diff --git a/package.json b/package.json index ce2b03d..50c5886 100644 --- a/package.json +++ b/package.json @@ -50,16 +50,14 @@ "base64js": "1.0.1", "cosmjs-types": "0.9.0", "long": "5.2.0", - "osmojs": "16.5.1", "protobufjs": "7.2.5", "stridejs": "0.6.2" }, "peerDependencies": { "@cosmjs/proto-signing": "0.31.x", - "osmojs": "16.5.x", + "long": "5.2.x", "protobufjs": "7.2.x", - "stridejs": "0.6.2", - "long": "5.2.x" + "stridejs": "0.6.2" }, "resolutions": { "long": "5.2.0" diff --git a/src/codec.ts b/src/codec.ts index 01b98cb..9db513f 100644 --- a/src/codec.ts +++ b/src/codec.ts @@ -2,7 +2,7 @@ import { GeneratedType } from '@cosmjs/proto-signing' import { Writer, Reader } from 'protobufjs' import { Registry } from './registry' import { convertToProtoFactory } from './util' -import { Any } from 'osmojs/dist/codegen/google/protobuf/any' +import { Any } from 'cosmjs-types/google/protobuf/any' export type AnyWithUnpacked = | Any diff --git a/src/decoder.spec.ts b/src/decoder.spec.ts index 855efd1..28ff95c 100644 --- a/src/decoder.spec.ts +++ b/src/decoder.spec.ts @@ -1,6 +1,6 @@ import { DirectSignDocDecoder } from './decoder' import Long from 'long' -import { cosmos, cosmwasm } from 'osmojs' +import { cosmos, cosmwasm } from './proto/osmojs' import { stride } from 'stridejs' import { assert, describe, expect, it } from 'vitest' diff --git a/src/msg-converter.ts b/src/msg-converter.ts index 9c7afb9..75fae15 100644 --- a/src/msg-converter.ts +++ b/src/msg-converter.ts @@ -3,7 +3,7 @@ import { osmosisAminoConverters, ibcAminoConverters, cosmwasmAminoConverters -} from 'osmojs' +} from './proto/osmojs' import { strideAminoConverters } from 'stridejs' import type { AminoConverters } from './supported-modules' diff --git a/src/proto/binary.ts b/src/proto/binary.ts new file mode 100644 index 0000000..0df30b7 --- /dev/null +++ b/src/proto/binary.ts @@ -0,0 +1,536 @@ +/* eslint-disable @typescript-eslint/no-extra-semi */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from './utf8' +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode +} from './varint' + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5 +} + +// 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 implements IBinaryReader { + buf: Uint8Array + pos: number + type: number + len: number + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError('premature EOF') + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0) + this.pos = 0 + this.type = 0 + this.len = this.buf.length + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7 + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error( + 'illegal tag: field no ' + fieldNo + ' wire type ' + wireType + ) + return [fieldNo, wireType, tag] + } + + skip(length?: number) { + if (typeof length === 'number') { + if (this.pos + length > this.len) throw indexOutOfRange(this, length) + this.pos += length + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this) + } while (this.buf[this.pos++] & 128) + } + return this + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip() + break + case WireType.Fixed64: + this.skip(8) + break + case WireType.Bytes: + this.skip(this.uint32()) + break + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType) + } + break + case WireType.Fixed32: + this.skip(4) + break + + /* istanbul ignore next */ + default: + throw Error('invalid wire type ' + wireType + ' at offset ' + this.pos) + } + return this + } + + uint32(): number { + return varint32read.bind(this)() + } + + int32(): number { + return this.uint32() | 0 + } + + sint32(): number { + const num = this.uint32() + return num % 2 === 1 ? (num + 1) / -2 : num / 2 // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos) + this.pos += 4 + return val + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos) + this.pos += 4 + return val + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)() + return BigInt(int64ToString(lo, hi)) + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)() + return BigInt(uInt64ToString(lo, hi)) + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)() + // zig zag + ;[lo, hi] = zzDecode(lo, hi) + return BigInt(int64ToString(lo, hi)) + } + + fixed64(): bigint { + const lo = this.sfixed32() + const hi = this.sfixed32() + return BigInt(uInt64ToString(lo, hi)) + } + sfixed64(): bigint { + const lo = this.sfixed32() + const hi = this.sfixed32() + return BigInt(int64ToString(lo, hi)) + } + + float(): number { + throw new Error('float not supported') + } + + double(): number { + throw new Error('double not supported') + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)() + return lo !== 0 || hi !== 0 + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos + this.pos += len + this.assertBounds() + return this.buf.subarray(start, start + len) + } + + string(): string { + const bytes = this.bytes() + return utf8Read(bytes, 0, bytes.length) + } +} + +// 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 +} + +interface IOp { + len: number + next?: IOp + proceed(buf: Uint8Array | number[], pos: number): void +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null + len: number + val: T + next?: IOp + + constructor( + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, + len: number, + 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: IOp + tail: IOp + len: number + next: State | null + + constructor(writer: BinaryWriter) { + this.head = writer.head + this.tail = writer.tail + this.len = writer.len + this.next = writer.states + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0 + head: IOp + tail: IOp + states: State | null + + constructor() { + this.head = new Op(null, 0, 0) + this.tail = this.head + this.states = null + } + + static create() { + return new BinaryWriter() + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== 'undefined') { + return pool( + (size) => new Uint8Array(size), + Uint8Array.prototype.subarray + )(size) + } else { + return new Array(size) + } + } + + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, + len: number, + val: T + ) { + this.tail = this.tail.next = new Op(fn, len, val) + this.len += len + return this + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0 + const buf = BinaryWriter.alloc(this.len) + while (head) { + head.proceed(buf, pos) + pos += head.len + head = head.next + } + return buf as Uint8Array + } + + fork(): BinaryWriter { + this.states = new State(this) + this.head = this.tail = new Op(null, 0, 0) + this.len = 0 + return this + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head + this.tail = this.states.tail + this.len = this.states.len + this.states = this.states.next + } else { + this.head = this.tail = new Op(null, 0, 0) + this.len = 0 + } + return this + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len + this.reset().uint32(len) + if (len) { + this.tail.next = head.next // skip noop + this.tail = tail + this.len += len + } + return this + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0) + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, + value + )).len + return this + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value) + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0) + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()) + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }) + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64 + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()) + // zig zag + ;[lo, hi] = zzEncode(lo, hi) + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }) + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()) + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi) + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64 + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0) + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0) + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32 + + float(value: number): BinaryWriter { + throw new Error('float not supported' + value) + } + + double(value: number): BinaryWriter { + throw new Error('double not supported' + value) + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0 + if (!len) return this._push(writeByte, 1, 0) + return this.uint32(len)._push(writeBytes, len, value) + } + + string(value: string): BinaryWriter { + const len = utf8Length(value) + return len + ? this.uint32(len)._push(utf8Write, len, value) + : this._push(writeByte, 1, 0) + } +} + +function writeBytes( + val: Uint8Array | number[], + buf: Uint8Array | number[], + pos: number +) { + if (typeof Uint8Array !== 'undefined') { + ;(buf as Uint8Array).set(val, pos) + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i] + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number +): (size: number) => Uint8Array { + const SIZE = size || 8192 + const MAX = SIZE >>> 1 + let slab: Uint8Array | null = null + let offset = SIZE + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size) + if (offset + size > SIZE) { + slab = alloc(SIZE) + offset = 0 + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)) + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1 + return buf + } +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError( + 'index out of range: ' + + reader.pos + + ' + ' + + (writeLength || 1) + + ' > ' + + reader.len + ) +} diff --git a/src/proto/helpers.ts b/src/proto/helpers.ts new file mode 100644 index 0000000..0a4d58e --- /dev/null +++ b/src/proto/helpers.ts @@ -0,0 +1,257 @@ +/* eslint-disable @typescript-eslint/ban-types */ +/* eslint-disable no-var */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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. + */ + +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined +var globalThis: any = (() => { + if (typeof globalThis !== 'undefined') return globalThis + if (typeof self !== 'undefined') return self + if (typeof window !== 'undefined') return window + if (typeof global !== 'undefined') return global + throw 'Unable to locate global object' +})() + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, 'base64').toString('binary')) + +export function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64) + const arr = new Uint8Array(bin.length) + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i) + } + return arr +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, 'binary').toString('base64')) + +export function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = [] + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)) + }) + return btoa(bin.join('')) +} + +export interface AminoHeight { + readonly revision_number?: string + readonly revision_height?: string +} + +export function omitDefault( + input: T +): T | undefined { + if (typeof input === 'string') { + return input === '' ? undefined : input + } + + if (typeof input === 'number') { + return input === 0 ? undefined : input + } + + if (typeof input === 'boolean') { + return input === false ? undefined : input + } + + if (typeof input === 'bigint') { + return input === BigInt(0) ? undefined : input + } + + throw new Error(`Got unsupported type ${typeof input}`) +} + +interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: bigint + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + + nanos: number +} + +export function toDuration(duration: string): Duration { + return { + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), + nanos: parseInt(duration) % 1000000000 + } +} + +export function fromDuration(duration: Duration): string { + return ( + parseInt(duration.seconds.toString()) * 1000000000 + + duration.nanos + ).toString() +} + +export function isSet(value: any): boolean { + return value !== null && value !== undefined +} + +export function isObject(value: any): boolean { + return typeof value === 'object' && value !== null +} + +export interface PageRequest { + key: Uint8Array + offset: bigint + limit: bigint + countTotal: boolean + reverse: boolean +} + +export interface PageRequestParams { + 'pagination.key'?: string + 'pagination.offset'?: string + 'pagination.limit'?: string + 'pagination.count_total'?: boolean + 'pagination.reverse'?: boolean +} + +export interface Params { + params: PageRequestParams +} + +export const setPaginationParams = ( + options: Params, + pagination?: PageRequest +) => { + if (!pagination) { + return options + } + + if (typeof pagination?.countTotal !== 'undefined') { + options.params['pagination.count_total'] = pagination.countTotal + } + if (typeof pagination?.key !== 'undefined') { + // String to Uint8Array + // let uint8arr = new Uint8Array(Buffer.from(data,'base64')); + + // Uint8Array to String + options.params['pagination.key'] = Buffer.from(pagination.key).toString( + 'base64' + ) + } + if (typeof pagination?.limit !== 'undefined') { + options.params['pagination.limit'] = pagination.limit.toString() + } + if (typeof pagination?.offset !== 'undefined') { + options.params['pagination.offset'] = pagination.offset.toString() + } + if (typeof pagination?.reverse !== 'undefined') { + options.params['pagination.reverse'] = pagination.reverse + } + + return options +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | bigint + | boolean + | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +type KeysOfUnion = T extends T ? keyof T : never +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude>, + never + > + +export interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise +} + +interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: bigint + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + + nanos: number +} + +export function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1000) * 1000000 + return { + seconds, + nanos + } +} + +export function fromTimestamp(t: Timestamp): Date { + let millis = Number(t.seconds) * 1000 + millis += t.nanos / 1000000 + return new Date(millis) +} + +const timestampFromJSON = (object: any): Timestamp => { + return { + seconds: isSet(object.seconds) + ? BigInt(object.seconds.toString()) + : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + } +} + +export function fromJsonTimestamp(o: any): Timestamp { + if (o instanceof Date) { + return toTimestamp(o) + } else if (typeof o === 'string') { + return toTimestamp(new Date(o)) + } else { + return timestampFromJSON(o) + } +} + +function numberToLong(number: number) { + return BigInt(Math.trunc(number)) +} diff --git a/src/proto/osmojs/cosmos/auth/v1beta1/auth.ts b/src/proto/osmojs/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 0000000..4c0db10 --- /dev/null +++ b/src/proto/osmojs/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,784 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +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?: '/cosmos.auth.v1beta1.BaseAccount' + address: string + pubKey?: Any + accountNumber: bigint + sequence: bigint +} +export interface BaseAccountProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.BaseAccount' + value: Uint8Array +} +/** + * 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 BaseAccountAmino { + address?: string + pub_key?: AnyAmino + account_number?: string + sequence?: string +} +export interface BaseAccountAminoMsg { + type: 'cosmos-sdk/BaseAccount' + value: BaseAccountAmino +} +/** + * 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 BaseAccountSDKType { + $typeUrl?: '/cosmos.auth.v1beta1.BaseAccount' + address: string + pub_key?: AnySDKType + account_number: bigint + sequence: bigint +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + $typeUrl?: '/cosmos.auth.v1beta1.ModuleAccount' + baseAccount?: BaseAccount + name: string + permissions: string[] +} +export interface ModuleAccountProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.ModuleAccount' + value: Uint8Array +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountAmino { + base_account?: BaseAccountAmino + name?: string + permissions?: string[] +} +export interface ModuleAccountAminoMsg { + type: 'cosmos-sdk/ModuleAccount' + value: ModuleAccountAmino +} +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccountSDKType { + $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 + txSigLimit: bigint + txSizeCostPerByte: bigint + sigVerifyCostEd25519: bigint + sigVerifyCostSecp256k1: bigint +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.auth.v1beta1.Params' + value: Uint8Array +} +/** 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 +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/x/auth/Params' + value: ParamsAmino +} +/** Params defines the parameters for the auth module. */ +export interface ParamsSDKType { + max_memo_characters: bigint + tx_sig_limit: bigint + tx_size_cost_per_byte: bigint + sig_verify_cost_ed25519: bigint + sig_verify_cost_secp256k1: bigint +} +function createBaseBaseAccount(): BaseAccount { + return { + $typeUrl: '/cosmos.auth.v1beta1.BaseAccount', + address: '', + pubKey: undefined, + accountNumber: BigInt(0), + sequence: BigInt(0) + } +} +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) + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim() + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(24).uint64(message.accountNumber) + } + if (message.sequence !== BigInt(0)) { + writer.uint32(32).uint64(message.sequence) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBaseAccount() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.string() + break + case 2: + message.pubKey = Any.decode(reader, reader.uint32()) + break + case 3: + message.accountNumber = reader.uint64() + break + case 4: + message.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BaseAccount { + const message = createBaseBaseAccount() + message.address = object.address ?? '' + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? Any.fromPartial(object.pubKey) + : undefined + message.accountNumber = + object.accountNumber !== undefined && object.accountNumber !== null + ? BigInt(object.accountNumber.toString()) + : BigInt(0) + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + return message + }, + fromAmino(object: BaseAccountAmino): BaseAccount { + 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 = {} + obj.address = message.address === '' ? undefined : message.address + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined + obj.account_number = + message.accountNumber !== BigInt(0) + ? message.accountNumber.toString() + : undefined + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { + return BaseAccount.fromAmino(object.value) + }, + toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { + return { + type: 'cosmos-sdk/BaseAccount', + value: BaseAccount.toAmino(message) + } + }, + fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { + return BaseAccount.decode(message.value) + }, + toProto(message: BaseAccount): Uint8Array { + return BaseAccount.encode(message).finish() + }, + toProtoMsg(message: BaseAccount): BaseAccountProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.BaseAccount', + value: BaseAccount.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount) +GlobalDecoderRegistry.registerAminoProtoMapping( + BaseAccount.aminoType, + BaseAccount.typeUrl +) +function createBaseModuleAccount(): ModuleAccount { + return { + $typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', + 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() + } + if (message.name !== '') { + writer.uint32(18).string(message.name) + } + for (const v of message.permissions) { + writer.uint32(26).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModuleAccount() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()) + break + case 2: + message.name = reader.string() + break + case 3: + message.permissions.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModuleAccount { + const message = createBaseModuleAccount() + message.baseAccount = + object.baseAccount !== undefined && object.baseAccount !== null + ? BaseAccount.fromPartial(object.baseAccount) + : undefined + message.name = object.name ?? '' + message.permissions = object.permissions?.map((e) => e) || [] + return message + }, + fromAmino(object: ModuleAccountAmino): ModuleAccount { + 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 = {} + obj.base_account = message.baseAccount + ? BaseAccount.toAmino(message.baseAccount) + : undefined + obj.name = message.name === '' ? undefined : message.name + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e) + } else { + obj.permissions = message.permissions + } + return obj + }, + fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { + return ModuleAccount.fromAmino(object.value) + }, + toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { + return { + type: 'cosmos-sdk/ModuleAccount', + value: ModuleAccount.toAmino(message) + } + }, + fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { + return ModuleAccount.decode(message.value) + }, + toProto(message: ModuleAccount): Uint8Array { + return ModuleAccount.encode(message).finish() + }, + toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg { + return { + typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', + value: ModuleAccount.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.moduleName + if (message.derivationKeys) { + obj.derivation_keys = message.derivationKeys.map((e) => + base64FromBytes(e) + ) + } else { + obj.derivation_keys = message.derivationKeys + } + 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), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0) + } +} +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) + } + if (message.txSigLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.txSigLimit) + } + if (message.txSizeCostPerByte !== BigInt(0)) { + writer.uint32(24).uint64(message.txSizeCostPerByte) + } + if (message.sigVerifyCostEd25519 !== BigInt(0)) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519) + } + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1) + } + 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.maxMemoCharacters = reader.uint64() + break + case 2: + message.txSigLimit = reader.uint64() + break + case 3: + message.txSizeCostPerByte = reader.uint64() + break + case 4: + message.sigVerifyCostEd25519 = reader.uint64() + break + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.maxMemoCharacters = + object.maxMemoCharacters !== undefined && + object.maxMemoCharacters !== null + ? BigInt(object.maxMemoCharacters.toString()) + : BigInt(0) + message.txSigLimit = + object.txSigLimit !== undefined && object.txSigLimit !== null + ? BigInt(object.txSigLimit.toString()) + : BigInt(0) + message.txSizeCostPerByte = + object.txSizeCostPerByte !== undefined && + object.txSizeCostPerByte !== null + ? BigInt(object.txSizeCostPerByte.toString()) + : BigInt(0) + message.sigVerifyCostEd25519 = + object.sigVerifyCostEd25519 !== undefined && + object.sigVerifyCostEd25519 !== null + ? BigInt(object.sigVerifyCostEd25519.toString()) + : BigInt(0) + message.sigVerifyCostSecp256k1 = + object.sigVerifyCostSecp256k1 !== undefined && + object.sigVerifyCostSecp256k1 !== null + ? BigInt(object.sigVerifyCostSecp256k1.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = {} + obj.max_memo_characters = + message.maxMemoCharacters !== BigInt(0) + ? message.maxMemoCharacters.toString() + : undefined + obj.tx_sig_limit = + message.txSigLimit !== BigInt(0) + ? message.txSigLimit.toString() + : undefined + obj.tx_size_cost_per_byte = + message.txSizeCostPerByte !== BigInt(0) + ? message.txSizeCostPerByte.toString() + : undefined + obj.sig_verify_cost_ed25519 = + message.sigVerifyCostEd25519 !== BigInt(0) + ? message.sigVerifyCostEd25519.toString() + : undefined + obj.sig_verify_cost_secp256k1 = + message.sigVerifyCostSecp256k1 !== BigInt(0) + ? message.sigVerifyCostSecp256k1.toString() + : undefined + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/auth/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: '/cosmos.auth.v1beta1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) diff --git a/src/proto/osmojs/cosmos/auth/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/auth/v1beta1/tx.amino.ts new file mode 100644 index 0000000..7145266 --- /dev/null +++ b/src/proto/osmojs/cosmos/auth/v1beta1/tx.amino.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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 + } +} diff --git a/src/proto/osmojs/cosmos/auth/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/auth/v1beta1/tx.registry.ts new file mode 100644 index 0000000..f64f8bc --- /dev/null +++ b/src/proto/osmojs/cosmos/auth/v1beta1/tx.registry.ts @@ -0,0 +1,38 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/auth/v1beta1/tx.ts b/src/proto/osmojs/cosmos/auth/v1beta1/tx.ts new file mode 100644 index 0000000..5254bfb --- /dev/null +++ b/src/proto/osmojs/cosmos/auth/v1beta1/tx.ts @@ -0,0 +1,288 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from './auth' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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) + const 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 === '' ? undefined : message.authority + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(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) + const 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() + } + } +} +GlobalDecoderRegistry.register( + MsgUpdateParamsResponse.typeUrl, + MsgUpdateParamsResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateParamsResponse.aminoType, + MsgUpdateParamsResponse.typeUrl +) diff --git a/src/proto/osmojs/cosmos/authz/v1beta1/authz.ts b/src/proto/osmojs/cosmos/authz/v1beta1/authz.ts new file mode 100644 index 0000000..3ef96da --- /dev/null +++ b/src/proto/osmojs/cosmos/authz/v1beta1/authz.ts @@ -0,0 +1,717 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +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 { + SendAuthorization, + SendAuthorizationProtoMsg, + SendAuthorizationSDKType +} from '../../bank/v1beta1/authz' +import { + StakeAuthorization, + StakeAuthorizationProtoMsg, + StakeAuthorizationSDKType +} from '../../staking/v1beta1/authz' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +import { toTimestamp, fromTimestamp } from '../../../../helpers' +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorization { + $typeUrl?: '/cosmos.authz.v1beta1.GenericAuthorization' + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg: string +} +export interface GenericAuthorizationProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization' + value: Uint8Array +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationAmino { + /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ + msg?: string +} +export interface GenericAuthorizationAminoMsg { + type: 'cosmos-sdk/GenericAuthorization' + value: GenericAuthorizationAmino +} +/** + * GenericAuthorization gives the grantee unrestricted permissions to execute + * the provided method on behalf of the granter's account. + */ +export interface GenericAuthorizationSDKType { + $typeUrl?: '/cosmos.authz.v1beta1.GenericAuthorization' + msg: string +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface Grant { + authorization?: + | GenericAuthorization + | TransferAuthorization + | StoreCodeAuthorization + | ContractExecutionAuthorization + | ContractMigrationAuthorization + | SendAuthorization + | StakeAuthorization + | 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 + | TransferAuthorizationProtoMsg + | StoreCodeAuthorizationProtoMsg + | ContractExecutionAuthorizationProtoMsg + | ContractMigrationAuthorizationProtoMsg + | SendAuthorizationProtoMsg + | StakeAuthorizationProtoMsg + | AnyProtoMsg + | undefined +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface GrantAmino { + authorization?: AnyAmino + /** + * 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' + value: GrantAmino +} +/** + * Grant gives permissions to execute + * the provide method with expiration time. + */ +export interface GrantSDKType { + authorization?: + | GenericAuthorizationSDKType + | TransferAuthorizationSDKType + | StoreCodeAuthorizationSDKType + | ContractExecutionAuthorizationSDKType + | ContractMigrationAuthorizationSDKType + | SendAuthorizationSDKType + | StakeAuthorizationSDKType + | AnySDKType + | undefined + expiration?: Date +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorization { + granter: string + grantee: string + authorization?: + | GenericAuthorization + | TransferAuthorization + | StoreCodeAuthorization + | ContractExecutionAuthorization + | ContractMigrationAuthorization + | SendAuthorization + | StakeAuthorization + | Any + | undefined + expiration?: Date +} +export interface GrantAuthorizationProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.GrantAuthorization' + value: Uint8Array +} +export type GrantAuthorizationEncoded = Omit< + GrantAuthorization, + 'authorization' +> & { + authorization?: + | GenericAuthorizationProtoMsg + | TransferAuthorizationProtoMsg + | StoreCodeAuthorizationProtoMsg + | ContractExecutionAuthorizationProtoMsg + | ContractMigrationAuthorizationProtoMsg + | SendAuthorizationProtoMsg + | StakeAuthorizationProtoMsg + | 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 + authorization?: AnyAmino + expiration?: string +} +export interface GrantAuthorizationAminoMsg { + type: 'cosmos-sdk/GrantAuthorization' + value: GrantAuthorizationAmino +} +/** + * GrantAuthorization extends a grant with both the addresses of the grantee and granter. + * It is used in genesis.proto and query.proto + */ +export interface GrantAuthorizationSDKType { + granter: string + grantee: string + authorization?: + | GenericAuthorizationSDKType + | TransferAuthorizationSDKType + | StoreCodeAuthorizationSDKType + | ContractExecutionAuthorizationSDKType + | ContractMigrationAuthorizationSDKType + | SendAuthorizationSDKType + | StakeAuthorizationSDKType + | 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 { + $typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization', + msg: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): GenericAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGenericAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.msg = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): GenericAuthorization { + const message = createBaseGenericAuthorization() + message.msg = object.msg ?? '' + return message + }, + fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { + const message = createBaseGenericAuthorization() + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg + } + return message + }, + toAmino(message: GenericAuthorization): GenericAuthorizationAmino { + const obj: any = {} + obj.msg = message.msg === '' ? undefined : message.msg + return obj + }, + fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization { + return GenericAuthorization.fromAmino(object.value) + }, + toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/GenericAuthorization', + value: GenericAuthorization.toAmino(message) + } + }, + fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization { + return GenericAuthorization.decode(message.value) + }, + toProto(message: GenericAuthorization): Uint8Array { + return GenericAuthorization.encode(message).finish() + }, + toProtoMsg(message: GenericAuthorization): GenericAuthorizationProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization', + value: GenericAuthorization.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + GenericAuthorization.typeUrl, + GenericAuthorization +) +GlobalDecoderRegistry.registerAminoProtoMapping( + GenericAuthorization.aminoType, + GenericAuthorization.typeUrl +) +function createBaseGrant(): Grant { + return { + authorization: undefined, + expiration: undefined + } +} +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( + GlobalDecoderRegistry.wrapAny(message.authorization), + writer.uint32(10).fork() + ).ldelim() + } + if (message.expiration !== undefined) { + Timestamp.encode( + toTimestamp(message.expiration), + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGrant() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.authorization = GlobalDecoderRegistry.unwrapAny(reader) + break + case 2: + message.expiration = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Grant { + const message = createBaseGrant() + message.authorization = + object.authorization !== undefined && object.authorization !== null + ? GlobalDecoderRegistry.fromPartial(object.authorization) + : undefined + message.expiration = object.expiration ?? undefined + return message + }, + fromAmino(object: GrantAmino): Grant { + 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 + ? GlobalDecoderRegistry.toAminoMsg(message.authorization) + : undefined + obj.expiration = message.expiration + ? Timestamp.toAmino(toTimestamp(message.expiration)) + : undefined + return obj + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value) + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: 'cosmos-sdk/Grant', + value: Grant.toAmino(message) + } + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value) + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish() + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.Grant', + value: Grant.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Grant.typeUrl, Grant) +GlobalDecoderRegistry.registerAminoProtoMapping(Grant.aminoType, Grant.typeUrl) +function createBaseGrantAuthorization(): GrantAuthorization { + return { + granter: '', + grantee: '', + authorization: undefined, + expiration: undefined + } +} +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) + } + if (message.grantee !== '') { + writer.uint32(18).string(message.grantee) + } + if (message.authorization !== undefined) { + 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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): GrantAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGrantAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.granter = reader.string() + break + case 2: + message.grantee = reader.string() + break + case 3: + message.authorization = GlobalDecoderRegistry.unwrapAny(reader) + break + case 4: + message.expiration = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): GrantAuthorization { + const message = createBaseGrantAuthorization() + message.granter = object.granter ?? '' + message.grantee = object.grantee ?? '' + message.authorization = + object.authorization !== undefined && object.authorization !== null + ? GlobalDecoderRegistry.fromPartial(object.authorization) + : undefined + message.expiration = object.expiration ?? undefined + return message + }, + fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { + 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 === '' ? undefined : message.granter + obj.grantee = message.grantee === '' ? undefined : message.grantee + 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 { + return GrantAuthorization.fromAmino(object.value) + }, + toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/GrantAuthorization', + value: GrantAuthorization.toAmino(message) + } + }, + fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { + return GrantAuthorization.decode(message.value) + }, + toProto(message: GrantAuthorization): Uint8Array { + return GrantAuthorization.encode(message).finish() + }, + toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.GrantAuthorization', + value: GrantAuthorization.encode(message).finish() + } + } +} +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 + }, + 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 = message.msgTypeUrls + } + 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() + } + } +} +GlobalDecoderRegistry.register(GrantQueueItem.typeUrl, GrantQueueItem) +GlobalDecoderRegistry.registerAminoProtoMapping( + GrantQueueItem.aminoType, + GrantQueueItem.typeUrl +) diff --git a/src/proto/osmojs/cosmos/authz/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/authz/v1beta1/tx.amino.ts new file mode 100644 index 0000000..47ea81b --- /dev/null +++ b/src/proto/osmojs/cosmos/authz/v1beta1/tx.amino.ts @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgGrant, MsgExec, MsgRevoke } from './tx' +export const AminoConverter = { + '/cosmos.authz.v1beta1.MsgGrant': { + aminoType: 'cosmos-sdk/MsgGrant', + toAmino: MsgGrant.toAmino, + fromAmino: MsgGrant.fromAmino + }, + '/cosmos.authz.v1beta1.MsgExec': { + aminoType: 'cosmos-sdk/MsgExec', + toAmino: MsgExec.toAmino, + fromAmino: MsgExec.fromAmino + }, + '/cosmos.authz.v1beta1.MsgRevoke': { + aminoType: 'cosmos-sdk/MsgRevoke', + toAmino: MsgRevoke.toAmino, + fromAmino: MsgRevoke.fromAmino + } +} diff --git a/src/proto/osmojs/cosmos/authz/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/authz/v1beta1/tx.registry.ts new file mode 100644 index 0000000..1114462 --- /dev/null +++ b/src/proto/osmojs/cosmos/authz/v1beta1/tx.registry.ts @@ -0,0 +1,76 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgGrant, MsgExec, MsgRevoke } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/cosmos.authz.v1beta1.MsgGrant', MsgGrant], + ['/cosmos.authz.v1beta1.MsgExec', MsgExec], + ['/cosmos.authz.v1beta1.MsgRevoke', MsgRevoke] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + grant(value: MsgGrant) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + value: MsgGrant.encode(value).finish() + } + }, + exec(value: MsgExec) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + value: MsgExec.encode(value).finish() + } + }, + revoke(value: MsgRevoke) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + value: MsgRevoke.encode(value).finish() + } + } + }, + withTypeUrl: { + grant(value: MsgGrant) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + value + } + }, + exec(value: MsgExec) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + value + } + }, + revoke(value: MsgRevoke) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + value + } + } + }, + fromPartial: { + grant(value: MsgGrant) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + value: MsgGrant.fromPartial(value) + } + }, + exec(value: MsgExec) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + value: MsgExec.fromPartial(value) + } + }, + revoke(value: MsgRevoke) { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + value: MsgRevoke.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/authz/v1beta1/tx.ts b/src/proto/osmojs/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 0000000..4c42293 --- /dev/null +++ b/src/proto/osmojs/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,839 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Grant, GrantAmino, GrantSDKType } from './authz' +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +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. + */ +export interface MsgGrant { + granter: string + grantee: string + grant: Grant +} +export interface MsgGrantProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant' + value: Uint8Array +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantAmino { + granter?: string + grantee?: string + grant: GrantAmino +} +export interface MsgGrantAminoMsg { + type: 'cosmos-sdk/MsgGrant' + value: MsgGrantAmino +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantSDKType { + granter: string + grantee: string + grant: GrantSDKType +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[] +} +export interface MsgExecResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse' + value: Uint8Array +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results?: string[] +} +export interface MsgExecResponseAminoMsg { + type: 'cosmos-sdk/MsgExecResponse' + value: MsgExecResponseAmino +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseSDKType { + results: Uint8Array[] +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExec { + grantee: string + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: Any[] | Any[] +} +export interface MsgExecProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgExec' + value: Uint8Array +} +export type MsgExecEncoded = Omit & { + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: AnyProtoMsg[] +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecAmino { + grantee?: string + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs?: AnyAmino[] +} +export interface MsgExecAminoMsg { + type: 'cosmos-sdk/MsgExec' + value: MsgExecAmino +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecSDKType { + grantee: string + msgs: AnySDKType[] +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse' + value: Uint8Array +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: 'cosmos-sdk/MsgGrantResponse' + value: MsgGrantResponseAmino +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseSDKType {} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevoke { + granter: string + grantee: string + msgTypeUrl: string +} +export interface MsgRevokeProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke' + value: Uint8Array +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeAmino { + granter?: string + grantee?: string + msg_type_url?: string +} +export interface MsgRevokeAminoMsg { + type: 'cosmos-sdk/MsgRevoke' + value: MsgRevokeAmino +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeSDKType { + granter: string + grantee: string + msg_type_url: string +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponse {} +export interface MsgRevokeResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse' + value: Uint8Array +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseAmino {} +export interface MsgRevokeResponseAminoMsg { + type: 'cosmos-sdk/MsgRevokeResponse' + value: MsgRevokeResponseAmino +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseSDKType {} +function createBaseMsgGrant(): MsgGrant { + return { + granter: '', + grantee: '', + grant: Grant.fromPartial({}) + } +} +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) + } + if (message.grantee !== '') { + writer.uint32(18).string(message.grantee) + } + if (message.grant !== undefined) { + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrant() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.granter = reader.string() + break + case 2: + message.grantee = reader.string() + break + case 3: + message.grant = Grant.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgGrant { + const message = createBaseMsgGrant() + message.granter = object.granter ?? '' + message.grantee = object.grantee ?? '' + message.grant = + object.grant !== undefined && object.grant !== null + ? Grant.fromPartial(object.grant) + : undefined + return message + }, + fromAmino(object: MsgGrantAmino): MsgGrant { + 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 === '' ? undefined : message.granter + obj.grantee = message.grantee === '' ? undefined : message.grantee + obj.grant = message.grant + ? Grant.toAmino(message.grant) + : Grant.toAmino(Grant.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { + return MsgGrant.fromAmino(object.value) + }, + toAminoMsg(message: MsgGrant): MsgGrantAminoMsg { + return { + type: 'cosmos-sdk/MsgGrant', + value: MsgGrant.toAmino(message) + } + }, + fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant { + return MsgGrant.decode(message.value) + }, + toProto(message: MsgGrant): Uint8Array { + return MsgGrant.encode(message).finish() + }, + toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + value: MsgGrant.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgGrant.typeUrl, MsgGrant) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgGrant.aminoType, + MsgGrant.typeUrl +) +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExecResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.results.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse() + message.results = object.results?.map((e) => e) || [] + return message + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + 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) => base64FromBytes(e)) + } else { + obj.results = message.results + } + return obj + }, + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgExecResponse', + value: MsgExecResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { + return MsgExecResponse.decode(message.value) + }, + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish() + }, + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse', + value: MsgExecResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExecResponse.aminoType, + MsgExecResponse.typeUrl +) +function createBaseMsgExec(): MsgExec { + return { + grantee: '', + msgs: [] + } +} +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( + GlobalDecoderRegistry.wrapAny(v!), + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExec() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.grantee = reader.string() + break + case 2: + message.msgs.push(GlobalDecoderRegistry.unwrapAny(reader)) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExec { + const message = createBaseMsgExec() + message.grantee = object.grantee ?? '' + message.msgs = + object.msgs?.map((e) => GlobalDecoderRegistry.fromPartial(e) as any) || [] + return message + }, + fromAmino(object: MsgExecAmino): MsgExec { + 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 === '' ? undefined : message.grantee + if (message.msgs) { + obj.msgs = message.msgs.map((e) => + e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined + ) + } else { + obj.msgs = message.msgs + } + return obj + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value) + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: 'cosmos-sdk/MsgExec', + value: MsgExec.toAmino(message) + } + }, + fromProtoMsg(message: MsgExecProtoMsg): MsgExec { + return MsgExec.decode(message.value) + }, + toProto(message: MsgExec): Uint8Array { + return MsgExec.encode(message).finish() + }, + toProtoMsg(message: MsgExec): MsgExecProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + value: MsgExec.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrantResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgGrantResponse { + const message = createBaseMsgGrantResponse() + return message + }, + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse() + return message + }, + toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgGrantResponse', + value: MsgGrantResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { + return MsgGrantResponse.decode(message.value) + }, + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish() + }, + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse', + value: MsgGrantResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgGrantResponse.typeUrl, MsgGrantResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgGrantResponse.aminoType, + MsgGrantResponse.typeUrl +) +function createBaseMsgRevoke(): MsgRevoke { + return { + granter: '', + grantee: '', + msgTypeUrl: '' + } +} +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) + } + if (message.grantee !== '') { + writer.uint32(18).string(message.grantee) + } + if (message.msgTypeUrl !== '') { + writer.uint32(26).string(message.msgTypeUrl) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevoke() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.granter = reader.string() + break + case 2: + message.grantee = reader.string() + break + case 3: + message.msgTypeUrl = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgRevoke { + const message = createBaseMsgRevoke() + message.granter = object.granter ?? '' + message.grantee = object.grantee ?? '' + message.msgTypeUrl = object.msgTypeUrl ?? '' + return message + }, + fromAmino(object: MsgRevokeAmino): MsgRevoke { + 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 = {} + obj.granter = message.granter === '' ? undefined : message.granter + obj.grantee = message.grantee === '' ? undefined : message.grantee + obj.msg_type_url = + message.msgTypeUrl === '' ? undefined : message.msgTypeUrl + return obj + }, + fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { + return MsgRevoke.fromAmino(object.value) + }, + toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg { + return { + type: 'cosmos-sdk/MsgRevoke', + value: MsgRevoke.toAmino(message) + } + }, + fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke { + return MsgRevoke.decode(message.value) + }, + toProto(message: MsgRevoke): Uint8Array { + return MsgRevoke.encode(message).finish() + }, + toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + value: MsgRevoke.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevokeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse() + return message + }, + fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse() + return message + }, + toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { + return MsgRevokeResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRevokeResponse', + value: MsgRevokeResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value) + }, + toProto(message: MsgRevokeResponse): Uint8Array { + return MsgRevokeResponse.encode(message).finish() + }, + toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse', + value: MsgRevokeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgRevokeResponse.typeUrl, MsgRevokeResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRevokeResponse.aminoType, + MsgRevokeResponse.typeUrl +) diff --git a/src/proto/osmojs/cosmos/bank/v1beta1/authz.ts b/src/proto/osmojs/cosmos/bank/v1beta1/authz.ts new file mode 100644 index 0000000..2e75a05 --- /dev/null +++ b/src/proto/osmojs/cosmos/bank/v1beta1/authz.ts @@ -0,0 +1,188 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorization { + $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' + value: Uint8Array +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +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' + value: SendAuthorizationAmino +} +/** + * SendAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account. + * + * Since: cosmos-sdk 0.43 + */ +export interface SendAuthorizationSDKType { + $typeUrl?: '/cosmos.bank.v1beta1.SendAuthorization' + spend_limit: CoinSDKType[] + allow_list: string[] +} +function createBaseSendAuthorization(): SendAuthorization { + return { + $typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSendAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + 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 + } + } + return message + }, + 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 { + 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 = {} + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.spend_limit = message.spendLimit + } + if (message.allowList) { + obj.allow_list = message.allowList.map((e) => e) + } else { + obj.allow_list = message.allowList + } + return obj + }, + fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { + return SendAuthorization.fromAmino(object.value) + }, + toAminoMsg(message: SendAuthorization): SendAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/SendAuthorization', + value: SendAuthorization.toAmino(message) + } + }, + fromProtoMsg(message: SendAuthorizationProtoMsg): SendAuthorization { + return SendAuthorization.decode(message.value) + }, + toProto(message: SendAuthorization): Uint8Array { + return SendAuthorization.encode(message).finish() + }, + toProtoMsg(message: SendAuthorization): SendAuthorizationProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', + value: SendAuthorization.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SendAuthorization.typeUrl, SendAuthorization) +GlobalDecoderRegistry.registerAminoProtoMapping( + SendAuthorization.aminoType, + SendAuthorization.typeUrl +) diff --git a/src/proto/osmojs/cosmos/bank/v1beta1/bank.ts b/src/proto/osmojs/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 0000000..f97e0aa --- /dev/null +++ b/src/proto/osmojs/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,1254 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Params' + value: Uint8Array +} +/** Params defines the parameters for the bank module. */ +export interface ParamsAmino { + /** + * 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' + value: ParamsAmino +} +/** Params defines the parameters for the bank module. */ +export interface ParamsSDKType { + /** @deprecated */ + send_enabled: SendEnabledSDKType[] + default_send_enabled: boolean +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string + enabled: boolean +} +export interface SendEnabledProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.SendEnabled' + value: Uint8Array +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledAmino { + denom?: string + enabled?: boolean +} +export interface SendEnabledAminoMsg { + type: 'cosmos-sdk/SendEnabled' + value: SendEnabledAmino +} +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabledSDKType { + denom: string + enabled: boolean +} +/** Input models transaction input. */ +export interface Input { + address: string + coins: Coin[] +} +export interface InputProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Input' + value: Uint8Array +} +/** Input models transaction input. */ +export interface InputAmino { + address?: string + coins: CoinAmino[] +} +export interface InputAminoMsg { + type: 'cosmos-sdk/Input' + value: InputAmino +} +/** Input models transaction input. */ +export interface InputSDKType { + address: string + coins: CoinSDKType[] +} +/** Output models transaction outputs. */ +export interface Output { + address: string + coins: Coin[] +} +export interface OutputProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Output' + value: Uint8Array +} +/** Output models transaction outputs. */ +export interface OutputAmino { + address?: string + coins: CoinAmino[] +} +export interface OutputAminoMsg { + type: 'cosmos-sdk/Output' + value: OutputAmino +} +/** Output models transaction outputs. */ +export interface OutputSDKType { + address: string + coins: CoinSDKType[] +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface Supply { + $typeUrl?: '/cosmos.bank.v1beta1.Supply' + total: Coin[] +} +export interface SupplyProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.Supply' + value: Uint8Array +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplyAmino { + total: CoinAmino[] +} +export interface SupplyAminoMsg { + type: 'cosmos-sdk/Supply' + value: SupplyAmino +} +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + */ +/** @deprecated */ +export interface SupplySDKType { + $typeUrl?: '/cosmos.bank.v1beta1.Supply' + total: CoinSDKType[] +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 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 + /** aliases is a list of string aliases for the given denom */ + aliases: string[] +} +export interface DenomUnitProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.DenomUnit' + value: Uint8Array +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitAmino { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom?: string + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 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 + /** aliases is a list of string aliases for the given denom */ + aliases?: string[] +} +export interface DenomUnitAminoMsg { + type: 'cosmos-sdk/DenomUnit' + value: DenomUnitAmino +} +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnitSDKType { + denom: string + exponent: number + aliases: string[] +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[] + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + 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 + /** + * 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' + value: Uint8Array +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataAmino { + description?: string + /** denom_units represents the list of DenomUnit's for a given coin */ + denom_units?: DenomUnitAmino[] + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base?: string + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display?: string + /** + * name defines the name of the token (eg: Cosmos Atom) + * + * Since: cosmos-sdk 0.43 + */ + 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 + /** + * 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' + value: MetadataAmino +} +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface MetadataSDKType { + description: string + denom_units: DenomUnitSDKType[] + base: string + display: string + name: string + symbol: string + uri: string + uri_hash: string +} +function createBaseParams(): Params { + return { + sendEnabled: [], + defaultSendEnabled: false + } +} +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() + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled) + } + 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.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())) + break + case 2: + message.defaultSendEnabled = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.sendEnabled = + object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || [] + message.defaultSendEnabled = object.defaultSendEnabled ?? false + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = {} + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map((e) => + e ? SendEnabled.toAmino(e) : undefined + ) + } else { + obj.send_enabled = message.sendEnabled + } + obj.default_send_enabled = + message.defaultSendEnabled === false + ? undefined + : message.defaultSendEnabled + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/bank/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: '/cosmos.bank.v1beta1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseSendEnabled(): SendEnabled { + return { + denom: '', + enabled: false + } +} +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) + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSendEnabled() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.enabled = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SendEnabled { + const message = createBaseSendEnabled() + message.denom = object.denom ?? '' + message.enabled = object.enabled ?? false + return message + }, + fromAmino(object: SendEnabledAmino): SendEnabled { + 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 = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.enabled = message.enabled === false ? undefined : message.enabled + return obj + }, + fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { + return SendEnabled.fromAmino(object.value) + }, + toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { + return { + type: 'cosmos-sdk/SendEnabled', + value: SendEnabled.toAmino(message) + } + }, + fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { + return SendEnabled.decode(message.value) + }, + toProto(message: SendEnabled): Uint8Array { + return SendEnabled.encode(message).finish() + }, + toProtoMsg(message: SendEnabled): SendEnabledProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.SendEnabled', + value: SendEnabled.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SendEnabled.typeUrl, SendEnabled) +GlobalDecoderRegistry.registerAminoProtoMapping( + SendEnabled.aminoType, + SendEnabled.typeUrl +) +function createBaseInput(): Input { + return { + address: '', + coins: [] + } +} +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) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInput() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.string() + break + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Input { + const message = createBaseInput() + message.address = object.address ?? '' + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: InputAmino): Input { + 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 = {} + obj.address = message.address === '' ? undefined : message.address + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + return obj + }, + fromAminoMsg(object: InputAminoMsg): Input { + return Input.fromAmino(object.value) + }, + toAminoMsg(message: Input): InputAminoMsg { + return { + type: 'cosmos-sdk/Input', + value: Input.toAmino(message) + } + }, + fromProtoMsg(message: InputProtoMsg): Input { + return Input.decode(message.value) + }, + toProto(message: Input): Uint8Array { + return Input.encode(message).finish() + }, + toProtoMsg(message: Input): InputProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Input', + value: Input.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Input.typeUrl, Input) +GlobalDecoderRegistry.registerAminoProtoMapping(Input.aminoType, Input.typeUrl) +function createBaseOutput(): Output { + return { + address: '', + coins: [] + } +} +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) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOutput() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.string() + break + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Output { + const message = createBaseOutput() + message.address = object.address ?? '' + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: OutputAmino): Output { + 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 = {} + obj.address = message.address === '' ? undefined : message.address + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + return obj + }, + fromAminoMsg(object: OutputAminoMsg): Output { + return Output.fromAmino(object.value) + }, + toAminoMsg(message: Output): OutputAminoMsg { + return { + type: 'cosmos-sdk/Output', + value: Output.toAmino(message) + } + }, + fromProtoMsg(message: OutputProtoMsg): Output { + return Output.decode(message.value) + }, + toProto(message: Output): Uint8Array { + return Output.encode(message).finish() + }, + toProtoMsg(message: Output): OutputProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Output', + value: Output.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Output.typeUrl, Output) +GlobalDecoderRegistry.registerAminoProtoMapping( + Output.aminoType, + Output.typeUrl +) +function createBaseSupply(): Supply { + return { + $typeUrl: '/cosmos.bank.v1beta1.Supply', + total: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSupply() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Supply { + const message = createBaseSupply() + message.total = object.total?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: SupplyAmino): Supply { + const message = createBaseSupply() + message.total = object.total?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino(message: Supply): SupplyAmino { + const obj: any = {} + if (message.total) { + obj.total = message.total.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.total = message.total + } + return obj + }, + fromAminoMsg(object: SupplyAminoMsg): Supply { + return Supply.fromAmino(object.value) + }, + toAminoMsg(message: Supply): SupplyAminoMsg { + return { + type: 'cosmos-sdk/Supply', + value: Supply.toAmino(message) + } + }, + fromProtoMsg(message: SupplyProtoMsg): Supply { + return Supply.decode(message.value) + }, + toProto(message: Supply): Uint8Array { + return Supply.encode(message).finish() + }, + toProtoMsg(message: Supply): SupplyProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Supply', + value: Supply.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Supply.typeUrl, Supply) +GlobalDecoderRegistry.registerAminoProtoMapping( + Supply.aminoType, + Supply.typeUrl +) +function createBaseDenomUnit(): DenomUnit { + return { + denom: '', + exponent: 0, + aliases: [] + } +} +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) + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent) + } + for (const v of message.aliases) { + writer.uint32(26).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDenomUnit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.exponent = reader.uint32() + break + case 3: + message.aliases.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DenomUnit { + const message = createBaseDenomUnit() + message.denom = object.denom ?? '' + message.exponent = object.exponent ?? 0 + message.aliases = object.aliases?.map((e) => e) || [] + return message + }, + fromAmino(object: DenomUnitAmino): DenomUnit { + 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 = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.exponent = message.exponent === 0 ? undefined : message.exponent + if (message.aliases) { + obj.aliases = message.aliases.map((e) => e) + } else { + obj.aliases = message.aliases + } + return obj + }, + fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { + return DenomUnit.fromAmino(object.value) + }, + toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { + return { + type: 'cosmos-sdk/DenomUnit', + value: DenomUnit.toAmino(message) + } + }, + fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { + return DenomUnit.decode(message.value) + }, + toProto(message: DenomUnit): Uint8Array { + return DenomUnit.encode(message).finish() + }, + toProtoMsg(message: DenomUnit): DenomUnitProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.DenomUnit', + value: DenomUnit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DenomUnit.typeUrl, DenomUnit) +GlobalDecoderRegistry.registerAminoProtoMapping( + DenomUnit.aminoType, + DenomUnit.typeUrl +) +function createBaseMetadata(): Metadata { + return { + description: '', + denomUnits: [], + base: '', + display: '', + name: '', + 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) + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.base !== '') { + writer.uint32(26).string(message.base) + } + if (message.display !== '') { + writer.uint32(34).string(message.display) + } + if (message.name !== '') { + writer.uint32(42).string(message.name) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetadata() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.description = reader.string() + break + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())) + break + case 3: + message.base = reader.string() + break + case 4: + message.display = reader.string() + break + case 5: + message.name = reader.string() + break + 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 + } + } + return message + }, + fromPartial(object: Partial): Metadata { + const message = createBaseMetadata() + message.description = object.description ?? '' + message.denomUnits = + object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || [] + message.base = object.base ?? '' + message.display = object.display ?? '' + message.name = object.name ?? '' + message.symbol = object.symbol ?? '' + message.uri = object.uri ?? '' + message.uriHash = object.uriHash ?? '' + return message + }, + fromAmino(object: MetadataAmino): Metadata { + 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 = {} + obj.description = + message.description === '' ? undefined : message.description + if (message.denomUnits) { + obj.denom_units = message.denomUnits.map((e) => + e ? DenomUnit.toAmino(e) : undefined + ) + } else { + obj.denom_units = message.denomUnits + } + obj.base = message.base === '' ? undefined : message.base + obj.display = message.display === '' ? undefined : message.display + obj.name = message.name === '' ? undefined : message.name + obj.symbol = message.symbol === '' ? undefined : message.symbol + obj.uri = message.uri === '' ? undefined : message.uri + obj.uri_hash = message.uriHash === '' ? undefined : message.uriHash + return obj + }, + fromAminoMsg(object: MetadataAminoMsg): Metadata { + return Metadata.fromAmino(object.value) + }, + toAminoMsg(message: Metadata): MetadataAminoMsg { + return { + type: 'cosmos-sdk/Metadata', + value: Metadata.toAmino(message) + } + }, + fromProtoMsg(message: MetadataProtoMsg): Metadata { + return Metadata.decode(message.value) + }, + toProto(message: Metadata): Uint8Array { + return Metadata.encode(message).finish() + }, + toProtoMsg(message: Metadata): MetadataProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.Metadata', + value: Metadata.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata) +GlobalDecoderRegistry.registerAminoProtoMapping( + Metadata.aminoType, + Metadata.typeUrl +) diff --git a/src/proto/osmojs/cosmos/bank/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/bank/v1beta1/tx.amino.ts new file mode 100644 index 0000000..a7e51ad --- /dev/null +++ b/src/proto/osmojs/cosmos/bank/v1beta1/tx.amino.ts @@ -0,0 +1,25 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from './tx' +export const AminoConverter = { + '/cosmos.bank.v1beta1.MsgSend': { + aminoType: 'cosmos-sdk/MsgSend', + toAmino: MsgSend.toAmino, + fromAmino: MsgSend.fromAmino + }, + '/cosmos.bank.v1beta1.MsgMultiSend': { + 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 + } +} diff --git a/src/proto/osmojs/cosmos/bank/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/bank/v1beta1/tx.registry.ts new file mode 100644 index 0000000..ca403e9 --- /dev/null +++ b/src/proto/osmojs/cosmos/bank/v1beta1/tx.registry.ts @@ -0,0 +1,95 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode(value).finish() + } + }, + multiSend(value: MsgMultiSend) { + return { + 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: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value + } + }, + multiSend(value: MsgMultiSend) { + return { + 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: { + send(value: MsgSend) { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.fromPartial(value) + } + }, + multiSend(value: MsgMultiSend) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/bank/v1beta1/tx.ts b/src/proto/osmojs/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 0000000..f12ccb9 --- /dev/null +++ b/src/proto/osmojs/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,1134 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { + Input, + InputAmino, + InputSDKType, + Output, + OutputAmino, + OutputSDKType, + Params, + ParamsAmino, + ParamsSDKType, + SendEnabled, + SendEnabledAmino, + SendEnabledSDKType +} from './bank' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string + toAddress: string + amount: Coin[] +} +export interface MsgSendProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSend' + value: Uint8Array +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendAmino { + from_address?: string + to_address?: string + amount: CoinAmino[] +} +export interface MsgSendAminoMsg { + type: 'cosmos-sdk/MsgSend' + value: MsgSendAmino +} +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSendSDKType { + from_address: string + to_address: string + amount: CoinSDKType[] +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgSendResponse' + value: Uint8Array +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: 'cosmos-sdk/MsgSendResponse' + value: MsgSendResponseAmino +} +/** MsgSendResponse defines the Msg/Send response type. */ +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[] +} +export interface MsgMultiSendProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend' + value: Uint8Array +} +/** 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[] +} +export interface MsgMultiSendAminoMsg { + type: 'cosmos-sdk/MsgMultiSend' + value: MsgMultiSendAmino +} +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSendSDKType { + inputs: InputSDKType[] + outputs: OutputSDKType[] +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} +export interface MsgMultiSendResponseProtoMsg { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSendResponse' + value: Uint8Array +} +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponseAmino {} +export interface MsgMultiSendResponseAminoMsg { + type: 'cosmos-sdk/MsgMultiSendResponse' + value: MsgMultiSendResponseAmino +} +/** 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: '', + toAddress: '', + amount: [] + } +} +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) + } + if (message.toAddress !== '') { + writer.uint32(18).string(message.toAddress) + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSend() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string() + break + case 2: + message.toAddress = reader.string() + break + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSend { + const message = createBaseMsgSend() + message.fromAddress = object.fromAddress ?? '' + message.toAddress = object.toAddress ?? '' + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgSendAmino): MsgSend { + 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 = {} + obj.from_address = + message.fromAddress === '' ? undefined : message.fromAddress + obj.to_address = message.toAddress === '' ? undefined : message.toAddress + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg(object: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value) + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: 'cosmos-sdk/MsgSend', + value: MsgSend.toAmino(message) + } + }, + fromProtoMsg(message: MsgSendProtoMsg): MsgSend { + return MsgSend.decode(message.value) + }, + toProto(message: MsgSend): Uint8Array { + return MsgSend.encode(message).finish() + }, + toProtoMsg(message: MsgSend): MsgSendProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSend', + value: MsgSend.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSendResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgSendResponse { + const message = createBaseMsgSendResponse() + return message + }, + fromAmino(_: MsgSendResponseAmino): MsgSendResponse { + const message = createBaseMsgSendResponse() + return message + }, + toAmino(_: MsgSendResponse): MsgSendResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { + return MsgSendResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSendResponse', + value: MsgSendResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { + return MsgSendResponse.decode(message.value) + }, + toProto(message: MsgSendResponse): Uint8Array { + return MsgSendResponse.encode(message).finish() + }, + toProtoMsg(message: MsgSendResponse): MsgSendResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgSendResponse', + value: MsgSendResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgSendResponse.typeUrl, MsgSendResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSendResponse.aminoType, + MsgSendResponse.typeUrl +) +function createBaseMsgMultiSend(): MsgMultiSend { + return { + inputs: [], + outputs: [] + } +} +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() + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiSend() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())) + break + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgMultiSend { + const message = createBaseMsgMultiSend() + message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || [] + message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgMultiSendAmino): MsgMultiSend { + 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 = {} + if (message.inputs) { + obj.inputs = message.inputs.map((e) => (e ? Input.toAmino(e) : undefined)) + } else { + obj.inputs = message.inputs + } + if (message.outputs) { + obj.outputs = message.outputs.map((e) => + e ? Output.toAmino(e) : undefined + ) + } else { + obj.outputs = message.outputs + } + return obj + }, + fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { + return MsgMultiSend.fromAmino(object.value) + }, + toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { + return { + type: 'cosmos-sdk/MsgMultiSend', + value: MsgMultiSend.toAmino(message) + } + }, + fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { + return MsgMultiSend.decode(message.value) + }, + toProto(message: MsgMultiSend): Uint8Array { + return MsgMultiSend.encode(message).finish() + }, + toProtoMsg(message: MsgMultiSend): MsgMultiSendProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', + value: MsgMultiSend.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgMultiSendResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMultiSendResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse() + return message + }, + fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { + const message = createBaseMsgMultiSendResponse() + return message + }, + toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgMultiSendResponse', + value: MsgMultiSendResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { + return MsgMultiSendResponse.decode(message.value) + }, + toProto(message: MsgMultiSendResponse): Uint8Array { + return MsgMultiSendResponse.encode(message).finish() + }, + toProtoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseProtoMsg { + return { + typeUrl: '/cosmos.bank.v1beta1.MsgMultiSendResponse', + value: MsgMultiSendResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.authority + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(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 + }, + 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 + }, + 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 === '' ? undefined : message.authority + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map((e) => + e ? SendEnabled.toAmino(e) : undefined + ) + } else { + obj.send_enabled = message.sendEnabled + } + if (message.useDefaultFor) { + obj.use_default_for = message.useDefaultFor.map((e) => e) + } else { + obj.use_default_for = message.useDefaultFor + } + 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 + }, + 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 +) diff --git a/src/proto/osmojs/cosmos/base/v1beta1/coin.ts b/src/proto/osmojs/cosmos/base/v1beta1/coin.ts new file mode 100644 index 0000000..7f2a606 --- /dev/null +++ b/src/proto/osmojs/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,519 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * 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 interface CoinProtoMsg { + typeUrl: '/cosmos.base.v1beta1.Coin' + value: Uint8Array +} +/** + * 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 CoinAmino { + denom?: string + amount: string +} +export interface CoinAminoMsg { + type: 'cosmos-sdk/Coin' + value: CoinAmino +} +/** + * 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 CoinSDKType { + denom: string + amount: string +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string + amount: string +} +export interface DecCoinProtoMsg { + typeUrl: '/cosmos.base.v1beta1.DecCoin' + value: Uint8Array +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinAmino { + denom?: string + amount?: string +} +export interface DecCoinAminoMsg { + type: 'cosmos-sdk/DecCoin' + value: DecCoinAmino +} +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoinSDKType { + denom: string + amount: string +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string +} +export interface IntProtoProtoMsg { + typeUrl: '/cosmos.base.v1beta1.IntProto' + value: Uint8Array +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoAmino { + int?: string +} +export interface IntProtoAminoMsg { + type: 'cosmos-sdk/IntProto' + value: IntProtoAmino +} +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProtoSDKType { + int: string +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string +} +export interface DecProtoProtoMsg { + typeUrl: '/cosmos.base.v1beta1.DecProto' + value: Uint8Array +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoAmino { + dec?: string +} +export interface DecProtoAminoMsg { + type: 'cosmos-sdk/DecProto' + value: DecProtoAmino +} +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProtoSDKType { + dec: string +} +function createBaseCoin(): Coin { + return { + denom: '', + amount: '' + } +} +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) + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCoin() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.amount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Coin { + const message = createBaseCoin() + message.denom = object.denom ?? '' + message.amount = object.amount ?? '' + return message + }, + fromAmino(object: CoinAmino): Coin { + 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 === '' ? undefined : message.denom + obj.amount = message.amount ?? '' + return obj + }, + fromAminoMsg(object: CoinAminoMsg): Coin { + return Coin.fromAmino(object.value) + }, + toAminoMsg(message: Coin): CoinAminoMsg { + return { + type: 'cosmos-sdk/Coin', + value: Coin.toAmino(message) + } + }, + fromProtoMsg(message: CoinProtoMsg): Coin { + return Coin.decode(message.value) + }, + toProto(message: Coin): Uint8Array { + return Coin.encode(message).finish() + }, + toProtoMsg(message: Coin): CoinProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.Coin', + value: Coin.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Coin.typeUrl, Coin) +GlobalDecoderRegistry.registerAminoProtoMapping(Coin.aminoType, Coin.typeUrl) +function createBaseDecCoin(): DecCoin { + return { + denom: '', + amount: '' + } +} +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) + } + if (message.amount !== '') { + writer.uint32(18).string(message.amount) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDecCoin() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.amount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DecCoin { + const message = createBaseDecCoin() + message.denom = object.denom ?? '' + message.amount = object.amount ?? '' + return message + }, + fromAmino(object: DecCoinAmino): DecCoin { + 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 = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.amount = message.amount === '' ? undefined : message.amount + return obj + }, + fromAminoMsg(object: DecCoinAminoMsg): DecCoin { + return DecCoin.fromAmino(object.value) + }, + toAminoMsg(message: DecCoin): DecCoinAminoMsg { + return { + type: 'cosmos-sdk/DecCoin', + value: DecCoin.toAmino(message) + } + }, + fromProtoMsg(message: DecCoinProtoMsg): DecCoin { + return DecCoin.decode(message.value) + }, + toProto(message: DecCoin): Uint8Array { + return DecCoin.encode(message).finish() + }, + toProtoMsg(message: DecCoin): DecCoinProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.DecCoin', + value: DecCoin.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DecCoin.typeUrl, DecCoin) +GlobalDecoderRegistry.registerAminoProtoMapping( + DecCoin.aminoType, + DecCoin.typeUrl +) +function createBaseIntProto(): IntProto { + return { + int: '' + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIntProto() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.int = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): IntProto { + const message = createBaseIntProto() + message.int = object.int ?? '' + return message + }, + fromAmino(object: IntProtoAmino): IntProto { + const message = createBaseIntProto() + if (object.int !== undefined && object.int !== null) { + message.int = object.int + } + return message + }, + toAmino(message: IntProto): IntProtoAmino { + const obj: any = {} + obj.int = message.int === '' ? undefined : message.int + return obj + }, + fromAminoMsg(object: IntProtoAminoMsg): IntProto { + return IntProto.fromAmino(object.value) + }, + toAminoMsg(message: IntProto): IntProtoAminoMsg { + return { + type: 'cosmos-sdk/IntProto', + value: IntProto.toAmino(message) + } + }, + fromProtoMsg(message: IntProtoProtoMsg): IntProto { + return IntProto.decode(message.value) + }, + toProto(message: IntProto): Uint8Array { + return IntProto.encode(message).finish() + }, + toProtoMsg(message: IntProto): IntProtoProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.IntProto', + value: IntProto.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(IntProto.typeUrl, IntProto) +GlobalDecoderRegistry.registerAminoProtoMapping( + IntProto.aminoType, + IntProto.typeUrl +) +function createBaseDecProto(): DecProto { + return { + dec: '' + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDecProto() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.dec = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DecProto { + const message = createBaseDecProto() + message.dec = object.dec ?? '' + return message + }, + fromAmino(object: DecProtoAmino): DecProto { + const message = createBaseDecProto() + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec + } + return message + }, + toAmino(message: DecProto): DecProtoAmino { + const obj: any = {} + obj.dec = message.dec === '' ? undefined : message.dec + return obj + }, + fromAminoMsg(object: DecProtoAminoMsg): DecProto { + return DecProto.fromAmino(object.value) + }, + toAminoMsg(message: DecProto): DecProtoAminoMsg { + return { + type: 'cosmos-sdk/DecProto', + value: DecProto.toAmino(message) + } + }, + fromProtoMsg(message: DecProtoProtoMsg): DecProto { + return DecProto.decode(message.value) + }, + toProto(message: DecProto): Uint8Array { + return DecProto.encode(message).finish() + }, + toProtoMsg(message: DecProto): DecProtoProtoMsg { + return { + typeUrl: '/cosmos.base.v1beta1.DecProto', + value: DecProto.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DecProto.typeUrl, DecProto) +GlobalDecoderRegistry.registerAminoProtoMapping( + DecProto.aminoType, + DecProto.typeUrl +) diff --git a/src/proto/osmojs/cosmos/bundle.ts b/src/proto/osmojs/cosmos/bundle.ts new file mode 100644 index 0000000..c7cb623 --- /dev/null +++ b/src/proto/osmojs/cosmos/bundle.ts @@ -0,0 +1,455 @@ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import * as _0 from './ics23/v1/proofs' +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 _240 from './auth/v1beta1/tx.amino' +import * as _241 from './authz/v1beta1/tx.amino' +import * as _242 from './bank/v1beta1/tx.amino' +import * as _243 from './consensus/v1/tx.amino' +import * as _244 from './distribution/v1beta1/tx.amino' +import * as _245 from './gov/v1beta1/tx.amino' +import * as _246 from './staking/v1beta1/tx.amino' +import * as _247 from './upgrade/v1beta1/tx.amino' +import * as _248 from './auth/v1beta1/tx.registry' +import * as _249 from './authz/v1beta1/tx.registry' +import * as _250 from './bank/v1beta1/tx.registry' +import * as _251 from './consensus/v1/tx.registry' +import * as _252 from './distribution/v1beta1/tx.registry' +import * as _253 from './gov/v1beta1/tx.registry' +import * as _254 from './staking/v1beta1/tx.registry' +import * as _255 from './upgrade/v1beta1/tx.registry' +import * as _256 from './auth/v1beta1/query.lcd' +import * as _257 from './authz/v1beta1/query.lcd' +import * as _258 from './bank/v1beta1/query.lcd' +import * as _259 from './base/node/v1beta1/query.lcd' +import * as _260 from './consensus/v1/query.lcd' +import * as _261 from './distribution/v1beta1/query.lcd' +import * as _262 from './gov/v1beta1/query.lcd' +import * as _263 from './staking/v1beta1/query.lcd' +import * as _264 from './tx/v1beta1/service.lcd' +import * as _265 from './upgrade/v1beta1/query.lcd' +import * as _266 from './auth/v1beta1/query.rpc.Query' +import * as _267 from './authz/v1beta1/query.rpc.Query' +import * as _268 from './bank/v1beta1/query.rpc.Query' +import * as _269 from './base/node/v1beta1/query.rpc.Service' +import * as _270 from './consensus/v1/query.rpc.Query' +import * as _271 from './distribution/v1beta1/query.rpc.Query' +import * as _272 from './gov/v1beta1/query.rpc.Query' +import * as _273 from './orm/query/v1alpha1/query.rpc.Query' +import * as _274 from './staking/v1beta1/query.rpc.Query' +import * as _275 from './tx/v1beta1/service.rpc.Service' +import * as _276 from './upgrade/v1beta1/query.rpc.Query' +import * as _277 from './auth/v1beta1/tx.rpc.msg' +import * as _278 from './authz/v1beta1/tx.rpc.msg' +import * as _279 from './bank/v1beta1/tx.rpc.msg' +import * as _280 from './consensus/v1/tx.rpc.msg' +import * as _281 from './distribution/v1beta1/tx.rpc.msg' +import * as _282 from './gov/v1beta1/tx.rpc.msg' +import * as _283 from './staking/v1beta1/tx.rpc.msg' +import * as _284 from './upgrade/v1beta1/tx.rpc.msg' +import * as _415 from './lcd' +import * as _416 from './rpc.query' +import * as _417 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 = { + ..._3, + ..._4, + ..._5, + ..._6, + ..._240, + ..._248, + ..._256, + ..._266, + ..._277 + } + } + export namespace authz { + export namespace module { + export const v1 = { + ..._7 + } + } + export const v1beta1 = { + ..._8, + ..._9, + ..._10, + ..._11, + ..._12, + ..._241, + ..._249, + ..._257, + ..._267, + ..._278 + } + } + export namespace bank { + export namespace module { + export const v1 = { + ..._13 + } + } + export const v1beta1 = { + ..._14, + ..._15, + ..._16, + ..._17, + ..._18, + ..._242, + ..._250, + ..._258, + ..._268, + ..._279 + } + } + export namespace base { + export namespace abci { + export const v1beta1 = { + ..._19 + } + } + export namespace node { + export const v1beta1 = { + ..._20, + ..._259, + ..._269 + } + } + export namespace query { + export const v1beta1 = { + ..._21 + } + } + export namespace reflection { + export const v2alpha1 = { + ..._22 + } + } + export const v1beta1 = { + ..._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, + ..._243, + ..._251, + ..._260, + ..._270, + ..._280 + } + } + export namespace crisis { + export namespace module { + export const v1 = { + ..._28 + } + } + } + export namespace crypto { + export const ed25519 = { + ..._29 + } + export namespace hd { + export const v1 = { + ..._30 + } + } + export namespace keyring { + export const v1 = { + ..._31 + } + } + export const multisig = { + ..._32 + } + export const secp256k1 = { + ..._33 + } + export const secp256r1 = { + ..._34 + } + } + export namespace distribution { + export namespace module { + export const v1 = { + ..._35 + } + } + export const v1beta1 = { + ..._36, + ..._37, + ..._38, + ..._39, + ..._244, + ..._252, + ..._261, + ..._271, + ..._281 + } + } + 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 = { + ..._44, + ..._45, + ..._46, + ..._47, + ..._245, + ..._253, + ..._262, + ..._272, + ..._282 + } + } + 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, + ..._273 + } + } + } + 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 = { + ..._58, + ..._59, + ..._60, + ..._61, + ..._62, + ..._246, + ..._254, + ..._263, + ..._274, + ..._283 + } + } + export namespace tx { + export namespace config { + export const v1 = { + ..._63 + } + } + export namespace signing { + export const v1beta1 = { + ..._64 + } + } + export const v1beta1 = { + ..._65, + ..._66, + ..._264, + ..._275 + } + } + export namespace upgrade { + export namespace module { + export const v1 = { + ..._67 + } + } + export const v1beta1 = { + ..._68, + ..._69, + ..._70, + ..._247, + ..._255, + ..._265, + ..._276, + ..._284 + } + } + export namespace vesting { + export namespace module { + export const v1 = { + ..._71 + } + } + } + export const ClientFactory = { + ..._415, + ..._416, + ..._417 + } +} diff --git a/src/proto/osmojs/cosmos/client.ts b/src/proto/osmojs/cosmos/client.ts new file mode 100644 index 0000000..34fb401 --- /dev/null +++ b/src/proto/osmojs/cosmos/client.ts @@ -0,0 +1,72 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter +} +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 +} => { + const registry = new Registry([...cosmosProtoRegistry]) + const aminoTypes = new AminoTypes({ + ...cosmosAminoConverters + }) + return { + registry, + aminoTypes + } +} +export const getSigningCosmosClient = async ({ + rpcEndpoint, + signer +}: { + rpcEndpoint: string | HttpEndpoint + signer: OfflineSigner +}) => { + const { registry, aminoTypes } = getSigningCosmosClientOptions() + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes + } + ) + return client +} diff --git a/src/proto/osmojs/cosmos/consensus/v1/tx.amino.ts b/src/proto/osmojs/cosmos/consensus/v1/tx.amino.ts new file mode 100644 index 0000000..7c4c751 --- /dev/null +++ b/src/proto/osmojs/cosmos/consensus/v1/tx.amino.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgUpdateParams } from './tx' +export const AminoConverter = { + '/cosmos.consensus.v1.MsgUpdateParams': { + aminoType: 'cosmos-sdk/MsgUpdateParams', + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +} diff --git a/src/proto/osmojs/cosmos/consensus/v1/tx.registry.ts b/src/proto/osmojs/cosmos/consensus/v1/tx.registry.ts new file mode 100644 index 0000000..a17f433 --- /dev/null +++ b/src/proto/osmojs/cosmos/consensus/v1/tx.registry.ts @@ -0,0 +1,38 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/consensus/v1/tx.ts b/src/proto/osmojs/cosmos/consensus/v1/tx.ts new file mode 100644 index 0000000..b6a0d03 --- /dev/null +++ b/src/proto/osmojs/cosmos/consensus/v1/tx.ts @@ -0,0 +1,326 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + BlockParams, + BlockParamsAmino, + BlockParamsSDKType, + EvidenceParams, + EvidenceParamsAmino, + EvidenceParamsSDKType, + ValidatorParams, + ValidatorParamsAmino, + ValidatorParamsSDKType +} from '../../../tendermint/types/params' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/cosmos/crypto/multisig/v1beta1/multisig.ts b/src/proto/osmojs/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 0000000..5c11316 --- /dev/null +++ b/src/proto/osmojs/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,307 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { bytesFromBase64, base64FromBytes } 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 + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[] +} +export interface MultiSignatureProtoMsg { + typeUrl: '/cosmos.crypto.multisig.v1beta1.MultiSignature' + value: Uint8Array +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureAmino { + signatures?: string[] +} +export interface MultiSignatureAminoMsg { + type: 'cosmos-sdk/MultiSignature' + value: MultiSignatureAmino +} +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignatureSDKType { + signatures: Uint8Array[] +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number + elems: Uint8Array +} +export interface CompactBitArrayProtoMsg { + typeUrl: '/cosmos.crypto.multisig.v1beta1.CompactBitArray' + value: Uint8Array +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArrayAmino { + extra_bits_stored?: number + elems?: string +} +export interface CompactBitArrayAminoMsg { + type: 'cosmos-sdk/CompactBitArray' + value: CompactBitArrayAmino +} +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArraySDKType { + extra_bits_stored: number + elems: Uint8Array +} +function createBaseMultiSignature(): MultiSignature { + return { + signatures: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMultiSignature() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MultiSignature { + const message = createBaseMultiSignature() + message.signatures = object.signatures?.map((e) => e) || [] + return message + }, + fromAmino(object: MultiSignatureAmino): MultiSignature { + 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) => base64FromBytes(e)) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg(object: MultiSignatureAminoMsg): MultiSignature { + return MultiSignature.fromAmino(object.value) + }, + toAminoMsg(message: MultiSignature): MultiSignatureAminoMsg { + return { + type: 'cosmos-sdk/MultiSignature', + value: MultiSignature.toAmino(message) + } + }, + fromProtoMsg(message: MultiSignatureProtoMsg): MultiSignature { + return MultiSignature.decode(message.value) + }, + toProto(message: MultiSignature): Uint8Array { + return MultiSignature.encode(message).finish() + }, + toProtoMsg(message: MultiSignature): MultiSignatureProtoMsg { + return { + typeUrl: '/cosmos.crypto.multisig.v1beta1.MultiSignature', + value: MultiSignature.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MultiSignature.typeUrl, MultiSignature) +GlobalDecoderRegistry.registerAminoProtoMapping( + MultiSignature.aminoType, + MultiSignature.typeUrl +) +function createBaseCompactBitArray(): CompactBitArray { + return { + extraBitsStored: 0, + elems: new Uint8Array() + } +} +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) + } + if (message.elems.length !== 0) { + writer.uint32(18).bytes(message.elems) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompactBitArray() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32() + break + case 2: + message.elems = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CompactBitArray { + const message = createBaseCompactBitArray() + message.extraBitsStored = object.extraBitsStored ?? 0 + message.elems = object.elems ?? new Uint8Array() + return message + }, + fromAmino(object: CompactBitArrayAmino): CompactBitArray { + 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 === 0 ? undefined : message.extraBitsStored + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined + return obj + }, + fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { + return CompactBitArray.fromAmino(object.value) + }, + toAminoMsg(message: CompactBitArray): CompactBitArrayAminoMsg { + return { + type: 'cosmos-sdk/CompactBitArray', + value: CompactBitArray.toAmino(message) + } + }, + fromProtoMsg(message: CompactBitArrayProtoMsg): CompactBitArray { + return CompactBitArray.decode(message.value) + }, + toProto(message: CompactBitArray): Uint8Array { + return CompactBitArray.encode(message).finish() + }, + toProtoMsg(message: CompactBitArray): CompactBitArrayProtoMsg { + return { + typeUrl: '/cosmos.crypto.multisig.v1beta1.CompactBitArray', + value: CompactBitArray.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CompactBitArray.typeUrl, CompactBitArray) +GlobalDecoderRegistry.registerAminoProtoMapping( + CompactBitArray.aminoType, + CompactBitArray.typeUrl +) diff --git a/src/proto/osmojs/cosmos/distribution/v1beta1/distribution.ts b/src/proto/osmojs/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 0000000..c53ac35 --- /dev/null +++ b/src/proto/osmojs/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,2218 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + DecCoin, + DecCoinAmino, + DecCoinSDKType, + Coin, + CoinAmino, + CoinSDKType +} from '../../base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { Decimal } from '@cosmjs/math' +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 +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.Params' + value: Uint8Array +} +/** Params defines the set of params for the distribution module. */ +export interface ParamsAmino { + 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' + value: ParamsAmino +} +/** 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 +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[] + referenceCount: number +} +export interface ValidatorHistoricalRewardsProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorHistoricalRewards' + value: Uint8Array +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsAmino { + cumulative_reward_ratio: DecCoinAmino[] + reference_count?: number +} +export interface ValidatorHistoricalRewardsAminoMsg { + type: 'cosmos-sdk/ValidatorHistoricalRewards' + value: ValidatorHistoricalRewardsAmino +} +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewardsSDKType { + cumulative_reward_ratio: DecCoinSDKType[] + reference_count: number +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[] + period: bigint +} +export interface ValidatorCurrentRewardsProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorCurrentRewards' + value: Uint8Array +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewardsAmino { + rewards: DecCoinAmino[] + period?: string +} +export interface ValidatorCurrentRewardsAminoMsg { + type: 'cosmos-sdk/ValidatorCurrentRewards' + value: ValidatorCurrentRewardsAmino +} +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewardsSDKType { + rewards: DecCoinSDKType[] + period: bigint +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[] +} +export interface ValidatorAccumulatedCommissionProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission' + value: Uint8Array +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionAmino { + commission: DecCoinAmino[] +} +export interface ValidatorAccumulatedCommissionAminoMsg { + type: 'cosmos-sdk/ValidatorAccumulatedCommission' + value: ValidatorAccumulatedCommissionAmino +} +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommissionSDKType { + commission: DecCoinSDKType[] +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[] +} +export interface ValidatorOutstandingRewardsProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorOutstandingRewards' + value: Uint8Array +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsAmino { + rewards: DecCoinAmino[] +} +export interface ValidatorOutstandingRewardsAminoMsg { + type: 'cosmos-sdk/ValidatorOutstandingRewards' + value: ValidatorOutstandingRewardsAmino +} +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewardsSDKType { + rewards: DecCoinSDKType[] +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: bigint + fraction: string +} +export interface ValidatorSlashEventProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorSlashEvent' + value: Uint8Array +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventAmino { + validator_period?: string + fraction?: string +} +export interface ValidatorSlashEventAminoMsg { + type: 'cosmos-sdk/ValidatorSlashEvent' + value: ValidatorSlashEventAmino +} +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEventSDKType { + validator_period: bigint + fraction: string +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[] +} +export interface ValidatorSlashEventsProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorSlashEvents' + value: Uint8Array +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsAmino { + validator_slash_events: ValidatorSlashEventAmino[] +} +export interface ValidatorSlashEventsAminoMsg { + type: 'cosmos-sdk/ValidatorSlashEvents' + value: ValidatorSlashEventsAmino +} +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEventsSDKType { + validator_slash_events: ValidatorSlashEventSDKType[] +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[] +} +export interface FeePoolProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.FeePool' + value: Uint8Array +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolAmino { + community_pool: DecCoinAmino[] +} +export interface FeePoolAminoMsg { + type: 'cosmos-sdk/FeePool' + value: FeePoolAmino +} +/** FeePool is the global fee pool for distribution. */ +export interface FeePoolSDKType { + community_pool: DecCoinSDKType[] +} +/** + * 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 + amount: Coin[] +} +export interface CommunityPoolSpendProposalProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal' + value: Uint8Array +} +/** + * 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 + amount: CoinAmino[] +} +export interface CommunityPoolSpendProposalAminoMsg { + type: 'cosmos-sdk/CommunityPoolSpendProposal' + value: CommunityPoolSpendProposalAmino +} +/** + * 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 + amount: CoinSDKType[] +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: bigint + stake: string + height: bigint +} +export interface DelegatorStartingInfoProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.DelegatorStartingInfo' + value: Uint8Array +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoAmino { + previous_period?: string + stake?: string + height: string +} +export interface DelegatorStartingInfoAminoMsg { + type: 'cosmos-sdk/DelegatorStartingInfo' + value: DelegatorStartingInfoAmino +} +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfoSDKType { + previous_period: bigint + stake: string + height: bigint +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string + reward: DecCoin[] +} +export interface DelegationDelegatorRewardProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.DelegationDelegatorReward' + value: Uint8Array +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardAmino { + validator_address?: string + reward: DecCoinAmino[] +} +export interface DelegationDelegatorRewardAminoMsg { + type: 'cosmos-sdk/DelegationDelegatorReward' + value: DelegationDelegatorRewardAmino +} +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorRewardSDKType { + validator_address: string + reward: DecCoinSDKType[] +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + $typeUrl?: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit' + title: string + description: string + recipient: string + amount: string + deposit: string +} +export interface CommunityPoolSpendProposalWithDepositProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit' + value: Uint8Array +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositAmino { + title?: string + description?: string + recipient?: string + amount?: string + deposit?: string +} +export interface CommunityPoolSpendProposalWithDepositAminoMsg { + type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit' + value: CommunityPoolSpendProposalWithDepositAmino +} +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDepositSDKType { + $typeUrl?: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit' + title: string + description: string + recipient: string + amount: string + deposit: string +} +function createBaseParams(): Params { + return { + communityTax: '', + baseProposerReward: '', + bonusProposerReward: '', + withdrawAddrEnabled: false + } +} +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) + } + if (message.baseProposerReward !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.baseProposerReward, 18).atomics) + } + if (message.bonusProposerReward !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.bonusProposerReward, 18).atomics) + } + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled) + } + 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.communityTax = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 2: + message.baseProposerReward = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 3: + message.bonusProposerReward = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 4: + message.withdrawAddrEnabled = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.communityTax = object.communityTax ?? '' + message.baseProposerReward = object.baseProposerReward ?? '' + message.bonusProposerReward = object.bonusProposerReward ?? '' + message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = {} + obj.community_tax = + message.communityTax === '' ? undefined : message.communityTax + obj.base_proposer_reward = + message.baseProposerReward === '' ? undefined : message.baseProposerReward + obj.bonus_proposer_reward = + message.bonusProposerReward === '' + ? undefined + : message.bonusProposerReward + obj.withdraw_addr_enabled = + message.withdrawAddrEnabled === false + ? undefined + : message.withdrawAddrEnabled + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/distribution/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: '/cosmos.distribution.v1beta1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { + return { + cumulativeRewardRatio: [], + referenceCount: 0 + } +} +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() + } + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorHistoricalRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorHistoricalRewards() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.cumulativeRewardRatio.push( + DecCoin.decode(reader, reader.uint32()) + ) + break + case 2: + message.referenceCount = reader.uint32() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ValidatorHistoricalRewards { + const message = createBaseValidatorHistoricalRewards() + message.cumulativeRewardRatio = + object.cumulativeRewardRatio?.map((e) => DecCoin.fromPartial(e)) || [] + message.referenceCount = object.referenceCount ?? 0 + return message + }, + fromAmino( + object: ValidatorHistoricalRewardsAmino + ): ValidatorHistoricalRewards { + 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 = {} + if (message.cumulativeRewardRatio) { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.cumulative_reward_ratio = message.cumulativeRewardRatio + } + obj.reference_count = + message.referenceCount === 0 ? undefined : message.referenceCount + return obj + }, + fromAminoMsg( + object: ValidatorHistoricalRewardsAminoMsg + ): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.fromAmino(object.value) + }, + toAminoMsg( + message: ValidatorHistoricalRewards + ): ValidatorHistoricalRewardsAminoMsg { + return { + type: 'cosmos-sdk/ValidatorHistoricalRewards', + value: ValidatorHistoricalRewards.toAmino(message) + } + }, + fromProtoMsg( + message: ValidatorHistoricalRewardsProtoMsg + ): ValidatorHistoricalRewards { + return ValidatorHistoricalRewards.decode(message.value) + }, + toProto(message: ValidatorHistoricalRewards): Uint8Array { + return ValidatorHistoricalRewards.encode(message).finish() + }, + toProtoMsg( + message: ValidatorHistoricalRewards + ): ValidatorHistoricalRewardsProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorHistoricalRewards', + value: ValidatorHistoricalRewards.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorHistoricalRewards.typeUrl, + ValidatorHistoricalRewards +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorHistoricalRewards.aminoType, + ValidatorHistoricalRewards.typeUrl +) +function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { + return { + rewards: [], + period: BigInt(0) + } +} +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() + } + if (message.period !== BigInt(0)) { + writer.uint32(16).uint64(message.period) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorCurrentRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorCurrentRewards() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())) + break + case 2: + message.period = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ValidatorCurrentRewards { + const message = createBaseValidatorCurrentRewards() + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || [] + message.period = + object.period !== undefined && object.period !== null + ? BigInt(object.period.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { + 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 = {} + if (message.rewards) { + obj.rewards = message.rewards.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.rewards = message.rewards + } + obj.period = + message.period !== BigInt(0) ? message.period.toString() : undefined + return obj + }, + fromAminoMsg( + object: ValidatorCurrentRewardsAminoMsg + ): ValidatorCurrentRewards { + return ValidatorCurrentRewards.fromAmino(object.value) + }, + toAminoMsg( + message: ValidatorCurrentRewards + ): ValidatorCurrentRewardsAminoMsg { + return { + type: 'cosmos-sdk/ValidatorCurrentRewards', + value: ValidatorCurrentRewards.toAmino(message) + } + }, + fromProtoMsg( + message: ValidatorCurrentRewardsProtoMsg + ): ValidatorCurrentRewards { + return ValidatorCurrentRewards.decode(message.value) + }, + toProto(message: ValidatorCurrentRewards): Uint8Array { + return ValidatorCurrentRewards.encode(message).finish() + }, + toProtoMsg( + message: ValidatorCurrentRewards + ): ValidatorCurrentRewardsProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorCurrentRewards', + value: ValidatorCurrentRewards.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorCurrentRewards.typeUrl, + ValidatorCurrentRewards +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorCurrentRewards.aminoType, + ValidatorCurrentRewards.typeUrl +) +function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { + return { + commission: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorAccumulatedCommission { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorAccumulatedCommission() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.commission.push(DecCoin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission() + message.commission = + object.commission?.map((e) => DecCoin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: ValidatorAccumulatedCommissionAmino + ): ValidatorAccumulatedCommission { + const message = createBaseValidatorAccumulatedCommission() + message.commission = + object.commission?.map((e) => DecCoin.fromAmino(e)) || [] + return message + }, + toAmino( + message: ValidatorAccumulatedCommission + ): ValidatorAccumulatedCommissionAmino { + const obj: any = {} + if (message.commission) { + obj.commission = message.commission.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.commission = message.commission + } + return obj + }, + fromAminoMsg( + object: ValidatorAccumulatedCommissionAminoMsg + ): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.fromAmino(object.value) + }, + toAminoMsg( + message: ValidatorAccumulatedCommission + ): ValidatorAccumulatedCommissionAminoMsg { + return { + type: 'cosmos-sdk/ValidatorAccumulatedCommission', + value: ValidatorAccumulatedCommission.toAmino(message) + } + }, + fromProtoMsg( + message: ValidatorAccumulatedCommissionProtoMsg + ): ValidatorAccumulatedCommission { + return ValidatorAccumulatedCommission.decode(message.value) + }, + toProto(message: ValidatorAccumulatedCommission): Uint8Array { + return ValidatorAccumulatedCommission.encode(message).finish() + }, + toProtoMsg( + message: ValidatorAccumulatedCommission + ): ValidatorAccumulatedCommissionProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission', + value: ValidatorAccumulatedCommission.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorAccumulatedCommission.typeUrl, + ValidatorAccumulatedCommission +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorAccumulatedCommission.aminoType, + ValidatorAccumulatedCommission.typeUrl +) +function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { + return { + rewards: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorOutstandingRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorOutstandingRewards() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards() + message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: ValidatorOutstandingRewardsAmino + ): ValidatorOutstandingRewards { + const message = createBaseValidatorOutstandingRewards() + message.rewards = object.rewards?.map((e) => DecCoin.fromAmino(e)) || [] + return message + }, + toAmino( + message: ValidatorOutstandingRewards + ): ValidatorOutstandingRewardsAmino { + const obj: any = {} + if (message.rewards) { + obj.rewards = message.rewards.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.rewards = message.rewards + } + return obj + }, + fromAminoMsg( + object: ValidatorOutstandingRewardsAminoMsg + ): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.fromAmino(object.value) + }, + toAminoMsg( + message: ValidatorOutstandingRewards + ): ValidatorOutstandingRewardsAminoMsg { + return { + type: 'cosmos-sdk/ValidatorOutstandingRewards', + value: ValidatorOutstandingRewards.toAmino(message) + } + }, + fromProtoMsg( + message: ValidatorOutstandingRewardsProtoMsg + ): ValidatorOutstandingRewards { + return ValidatorOutstandingRewards.decode(message.value) + }, + toProto(message: ValidatorOutstandingRewards): Uint8Array { + return ValidatorOutstandingRewards.encode(message).finish() + }, + toProtoMsg( + message: ValidatorOutstandingRewards + ): ValidatorOutstandingRewardsProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorOutstandingRewards', + value: ValidatorOutstandingRewards.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorOutstandingRewards.typeUrl, + ValidatorOutstandingRewards +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorOutstandingRewards.aminoType, + ValidatorOutstandingRewards.typeUrl +) +function createBaseValidatorSlashEvent(): ValidatorSlashEvent { + return { + validatorPeriod: BigInt(0), + fraction: '' + } +} +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) + } + if (message.fraction !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.fraction, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorSlashEvent { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSlashEvent() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64() + break + case 2: + message.fraction = Decimal.fromAtomics(reader.string(), 18).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorSlashEvent { + const message = createBaseValidatorSlashEvent() + message.validatorPeriod = + object.validatorPeriod !== undefined && object.validatorPeriod !== null + ? BigInt(object.validatorPeriod.toString()) + : BigInt(0) + message.fraction = object.fraction ?? '' + return message + }, + fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { + 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 = {} + obj.validator_period = + message.validatorPeriod !== BigInt(0) + ? message.validatorPeriod.toString() + : undefined + obj.fraction = message.fraction === '' ? undefined : message.fraction + return obj + }, + fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.fromAmino(object.value) + }, + toAminoMsg(message: ValidatorSlashEvent): ValidatorSlashEventAminoMsg { + return { + type: 'cosmos-sdk/ValidatorSlashEvent', + value: ValidatorSlashEvent.toAmino(message) + } + }, + fromProtoMsg(message: ValidatorSlashEventProtoMsg): ValidatorSlashEvent { + return ValidatorSlashEvent.decode(message.value) + }, + toProto(message: ValidatorSlashEvent): Uint8Array { + return ValidatorSlashEvent.encode(message).finish() + }, + toProtoMsg(message: ValidatorSlashEvent): ValidatorSlashEventProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorSlashEvent', + value: ValidatorSlashEvent.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValidatorSlashEvent.typeUrl, ValidatorSlashEvent) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorSlashEvent.aminoType, + ValidatorSlashEvent.typeUrl +) +function createBaseValidatorSlashEvents(): ValidatorSlashEvents { + return { + 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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorSlashEvents { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSlashEvents() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validatorSlashEvents.push( + ValidatorSlashEvent.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents() + message.validatorSlashEvents = + object.validatorSlashEvents?.map((e) => + ValidatorSlashEvent.fromPartial(e) + ) || [] + return message + }, + fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { + const message = createBaseValidatorSlashEvents() + message.validatorSlashEvents = + object.validator_slash_events?.map((e) => + ValidatorSlashEvent.fromAmino(e) + ) || [] + return message + }, + toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { + const obj: any = {} + if (message.validatorSlashEvents) { + obj.validator_slash_events = message.validatorSlashEvents.map((e) => + e ? ValidatorSlashEvent.toAmino(e) : undefined + ) + } else { + obj.validator_slash_events = message.validatorSlashEvents + } + return obj + }, + fromAminoMsg(object: ValidatorSlashEventsAminoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.fromAmino(object.value) + }, + toAminoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsAminoMsg { + return { + type: 'cosmos-sdk/ValidatorSlashEvents', + value: ValidatorSlashEvents.toAmino(message) + } + }, + fromProtoMsg(message: ValidatorSlashEventsProtoMsg): ValidatorSlashEvents { + return ValidatorSlashEvents.decode(message.value) + }, + toProto(message: ValidatorSlashEvents): Uint8Array { + return ValidatorSlashEvents.encode(message).finish() + }, + toProtoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.ValidatorSlashEvents', + value: ValidatorSlashEvents.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorSlashEvents.typeUrl, + ValidatorSlashEvents +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorSlashEvents.aminoType, + ValidatorSlashEvents.typeUrl +) +function createBaseFeePool(): FeePool { + return { + communityPool: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFeePool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.communityPool.push(DecCoin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): FeePool { + const message = createBaseFeePool() + message.communityPool = + object.communityPool?.map((e) => DecCoin.fromPartial(e)) || [] + return message + }, + fromAmino(object: FeePoolAmino): FeePool { + const message = createBaseFeePool() + message.communityPool = + object.community_pool?.map((e) => DecCoin.fromAmino(e)) || [] + return message + }, + toAmino(message: FeePool): FeePoolAmino { + const obj: any = {} + if (message.communityPool) { + obj.community_pool = message.communityPool.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.community_pool = message.communityPool + } + return obj + }, + fromAminoMsg(object: FeePoolAminoMsg): FeePool { + return FeePool.fromAmino(object.value) + }, + toAminoMsg(message: FeePool): FeePoolAminoMsg { + return { + type: 'cosmos-sdk/FeePool', + value: FeePool.toAmino(message) + } + }, + fromProtoMsg(message: FeePoolProtoMsg): FeePool { + return FeePool.decode(message.value) + }, + toProto(message: FeePool): Uint8Array { + return FeePool.encode(message).finish() + }, + toProtoMsg(message: FeePool): FeePoolProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.FeePool', + value: FeePool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(FeePool.typeUrl, FeePool) +GlobalDecoderRegistry.registerAminoProtoMapping( + FeePool.aminoType, + FeePool.typeUrl +) +function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { + return { + $typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', + title: '', + description: '', + recipient: '', + amount: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.recipient !== '') { + writer.uint32(26).string(message.recipient) + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CommunityPoolSpendProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommunityPoolSpendProposal() + 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.recipient = reader.string() + break + case 4: + message.amount.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): CommunityPoolSpendProposal { + const message = createBaseCommunityPoolSpendProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.recipient = object.recipient ?? '' + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: CommunityPoolSpendProposalAmino + ): CommunityPoolSpendProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.recipient = message.recipient === '' ? undefined : message.recipient + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg( + object: CommunityPoolSpendProposalAminoMsg + ): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.fromAmino(object.value) + }, + toAminoMsg( + message: CommunityPoolSpendProposal + ): CommunityPoolSpendProposalAminoMsg { + return { + type: 'cosmos-sdk/CommunityPoolSpendProposal', + value: CommunityPoolSpendProposal.toAmino(message) + } + }, + fromProtoMsg( + message: CommunityPoolSpendProposalProtoMsg + ): CommunityPoolSpendProposal { + return CommunityPoolSpendProposal.decode(message.value) + }, + toProto(message: CommunityPoolSpendProposal): Uint8Array { + return CommunityPoolSpendProposal.encode(message).finish() + }, + toProtoMsg( + message: CommunityPoolSpendProposal + ): CommunityPoolSpendProposalProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', + value: CommunityPoolSpendProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CommunityPoolSpendProposal.typeUrl, + CommunityPoolSpendProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CommunityPoolSpendProposal.aminoType, + CommunityPoolSpendProposal.typeUrl +) +function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { + return { + previousPeriod: BigInt(0), + stake: '', + height: BigInt(0) + } +} +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) + } + if (message.stake !== '') { + writer.uint32(18).string(Decimal.fromUserInput(message.stake, 18).atomics) + } + if (message.height !== BigInt(0)) { + writer.uint32(24).uint64(message.height) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DelegatorStartingInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegatorStartingInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64() + break + case 2: + message.stake = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 3: + message.height = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DelegatorStartingInfo { + const message = createBaseDelegatorStartingInfo() + message.previousPeriod = + object.previousPeriod !== undefined && object.previousPeriod !== null + ? BigInt(object.previousPeriod.toString()) + : BigInt(0) + message.stake = object.stake ?? '' + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + return message + }, + fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { + 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 !== BigInt(0) + ? message.previousPeriod.toString() + : undefined + obj.stake = message.stake === '' ? undefined : message.stake + obj.height = message.height ? message.height.toString() : '0' + return obj + }, + fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.fromAmino(object.value) + }, + toAminoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoAminoMsg { + return { + type: 'cosmos-sdk/DelegatorStartingInfo', + value: DelegatorStartingInfo.toAmino(message) + } + }, + fromProtoMsg(message: DelegatorStartingInfoProtoMsg): DelegatorStartingInfo { + return DelegatorStartingInfo.decode(message.value) + }, + toProto(message: DelegatorStartingInfo): Uint8Array { + return DelegatorStartingInfo.encode(message).finish() + }, + toProtoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.DelegatorStartingInfo', + value: DelegatorStartingInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + DelegatorStartingInfo.typeUrl, + DelegatorStartingInfo +) +GlobalDecoderRegistry.registerAminoProtoMapping( + DelegatorStartingInfo.aminoType, + DelegatorStartingInfo.typeUrl +) +function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { + return { + validatorAddress: '', + reward: [] + } +} +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) + } + for (const v of message.reward) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DelegationDelegatorReward { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegationDelegatorReward() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string() + break + case 2: + message.reward.push(DecCoin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): DelegationDelegatorReward { + const message = createBaseDelegationDelegatorReward() + message.validatorAddress = object.validatorAddress ?? '' + message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || [] + return message + }, + fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { + 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 = {} + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + if (message.reward) { + obj.reward = message.reward.map((e) => + e ? DecCoin.toAmino(e) : undefined + ) + } else { + obj.reward = message.reward + } + return obj + }, + fromAminoMsg( + object: DelegationDelegatorRewardAminoMsg + ): DelegationDelegatorReward { + return DelegationDelegatorReward.fromAmino(object.value) + }, + toAminoMsg( + message: DelegationDelegatorReward + ): DelegationDelegatorRewardAminoMsg { + return { + type: 'cosmos-sdk/DelegationDelegatorReward', + value: DelegationDelegatorReward.toAmino(message) + } + }, + fromProtoMsg( + message: DelegationDelegatorRewardProtoMsg + ): DelegationDelegatorReward { + return DelegationDelegatorReward.decode(message.value) + }, + toProto(message: DelegationDelegatorReward): Uint8Array { + return DelegationDelegatorReward.encode(message).finish() + }, + toProtoMsg( + message: DelegationDelegatorReward + ): DelegationDelegatorRewardProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.DelegationDelegatorReward', + value: DelegationDelegatorReward.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + DelegationDelegatorReward.typeUrl, + DelegationDelegatorReward +) +GlobalDecoderRegistry.registerAminoProtoMapping( + DelegationDelegatorReward.aminoType, + DelegationDelegatorReward.typeUrl +) +function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { + return { + $typeUrl: + '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', + title: '', + description: '', + recipient: '', + amount: '', + deposit: '' + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.recipient !== '') { + writer.uint32(26).string(message.recipient) + } + if (message.amount !== '') { + writer.uint32(34).string(message.amount) + } + if (message.deposit !== '') { + writer.uint32(42).string(message.deposit) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CommunityPoolSpendProposalWithDeposit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommunityPoolSpendProposalWithDeposit() + 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.recipient = reader.string() + break + case 4: + message.amount = reader.string() + break + case 5: + message.deposit = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): CommunityPoolSpendProposalWithDeposit { + const message = createBaseCommunityPoolSpendProposalWithDeposit() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.recipient = object.recipient ?? '' + message.amount = object.amount ?? '' + message.deposit = object.deposit ?? '' + return message + }, + fromAmino( + object: CommunityPoolSpendProposalWithDepositAmino + ): CommunityPoolSpendProposalWithDeposit { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.recipient = message.recipient === '' ? undefined : message.recipient + obj.amount = message.amount === '' ? undefined : message.amount + obj.deposit = message.deposit === '' ? undefined : message.deposit + return obj + }, + fromAminoMsg( + object: CommunityPoolSpendProposalWithDepositAminoMsg + ): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.fromAmino(object.value) + }, + toAminoMsg( + message: CommunityPoolSpendProposalWithDeposit + ): CommunityPoolSpendProposalWithDepositAminoMsg { + return { + type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit', + value: CommunityPoolSpendProposalWithDeposit.toAmino(message) + } + }, + fromProtoMsg( + message: CommunityPoolSpendProposalWithDepositProtoMsg + ): CommunityPoolSpendProposalWithDeposit { + return CommunityPoolSpendProposalWithDeposit.decode(message.value) + }, + toProto(message: CommunityPoolSpendProposalWithDeposit): Uint8Array { + return CommunityPoolSpendProposalWithDeposit.encode(message).finish() + }, + toProtoMsg( + message: CommunityPoolSpendProposalWithDeposit + ): CommunityPoolSpendProposalWithDepositProtoMsg { + return { + typeUrl: + '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', + value: CommunityPoolSpendProposalWithDeposit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CommunityPoolSpendProposalWithDeposit.typeUrl, + CommunityPoolSpendProposalWithDeposit +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CommunityPoolSpendProposalWithDeposit.aminoType, + CommunityPoolSpendProposalWithDeposit.typeUrl +) diff --git a/src/proto/osmojs/cosmos/distribution/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.amino.ts new file mode 100644 index 0000000..9643307 --- /dev/null +++ b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.amino.ts @@ -0,0 +1,42 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgSetWithdrawAddress, + MsgWithdrawDelegatorReward, + MsgWithdrawValidatorCommission, + MsgFundCommunityPool, + MsgUpdateParams, + MsgCommunityPoolSpend +} from './tx' +export const AminoConverter = { + '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress': { + aminoType: 'cosmos-sdk/MsgModifyWithdrawAddress', + toAmino: MsgSetWithdrawAddress.toAmino, + fromAmino: MsgSetWithdrawAddress.fromAmino + }, + '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward': { + aminoType: 'cosmos-sdk/MsgWithdrawDelegationReward', + toAmino: MsgWithdrawDelegatorReward.toAmino, + fromAmino: MsgWithdrawDelegatorReward.fromAmino + }, + '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission': { + aminoType: 'cosmos-sdk/MsgWithdrawValidatorCommission', + toAmino: MsgWithdrawValidatorCommission.toAmino, + fromAmino: MsgWithdrawValidatorCommission.fromAmino + }, + '/cosmos.distribution.v1beta1.MsgFundCommunityPool': { + 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 + } +} diff --git a/src/proto/osmojs/cosmos/distribution/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.registry.ts new file mode 100644 index 0000000..0796a2e --- /dev/null +++ b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.registry.ts @@ -0,0 +1,146 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', + value: MsgSetWithdrawAddress.encode(value).finish() + } + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', + value: MsgWithdrawDelegatorReward.encode(value).finish() + } + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', + value: MsgWithdrawValidatorCommission.encode(value).finish() + } + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + 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: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', + value + } + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', + value + } + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', + value + } + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + 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: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', + value: MsgSetWithdrawAddress.fromPartial(value) + } + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', + value: MsgWithdrawDelegatorReward.fromPartial(value) + } + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', + value: MsgWithdrawValidatorCommission.fromPartial(value) + } + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/distribution/v1beta1/tx.ts b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 0000000..bf8f12a --- /dev/null +++ b/src/proto/osmojs/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,1786 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { Params, ParamsAmino, ParamsSDKType } from './distribution' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string + withdrawAddress: string +} +export interface MsgSetWithdrawAddressProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress' + value: Uint8Array +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressAmino { + delegator_address?: string + withdraw_address?: string +} +export interface MsgSetWithdrawAddressAminoMsg { + type: 'cosmos-sdk/MsgModifyWithdrawAddress' + value: MsgSetWithdrawAddressAmino +} +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddressSDKType { + delegator_address: string + withdraw_address: string +} +/** + * 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. + */ +export interface MsgSetWithdrawAddressResponseAmino {} +export interface MsgSetWithdrawAddressResponseAminoMsg { + type: 'cosmos-sdk/MsgSetWithdrawAddressResponse' + value: MsgSetWithdrawAddressResponseAmino +} +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ +export interface MsgSetWithdrawAddressResponseSDKType {} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string + validatorAddress: string +} +export interface MsgWithdrawDelegatorRewardProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward' + value: Uint8Array +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardAmino { + delegator_address?: string + validator_address?: string +} +export interface MsgWithdrawDelegatorRewardAminoMsg { + type: 'cosmos-sdk/MsgWithdrawDelegationReward' + value: MsgWithdrawDelegatorRewardAmino +} +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorRewardSDKType { + delegator_address: string + validator_address: string +} +/** + * 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 { + /** 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 { + amount: CoinSDKType[] +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string +} +export interface MsgWithdrawValidatorCommissionProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission' + value: Uint8Array +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionAmino { + validator_address?: string +} +export interface MsgWithdrawValidatorCommissionAminoMsg { + type: 'cosmos-sdk/MsgWithdrawValidatorCommission' + value: MsgWithdrawValidatorCommissionAmino +} +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommissionSDKType { + validator_address: string +} +/** + * 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 { + /** 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 { + amount: CoinSDKType[] +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[] + depositor: string +} +export interface MsgFundCommunityPoolProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool' + value: Uint8Array +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolAmino { + amount: CoinAmino[] + depositor?: string +} +export interface MsgFundCommunityPoolAminoMsg { + type: 'cosmos-sdk/MsgFundCommunityPool' + value: MsgFundCommunityPoolAmino +} +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPoolSDKType { + amount: CoinSDKType[] + depositor: string +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} +export interface MsgFundCommunityPoolResponseProtoMsg { + typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse' + value: Uint8Array +} +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponseAmino {} +export interface MsgFundCommunityPoolResponseAminoMsg { + type: 'cosmos-sdk/MsgFundCommunityPoolResponse' + value: MsgFundCommunityPoolResponseAmino +} +/** 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: '', + withdrawAddress: '' + } +} +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) + } + if (message.withdrawAddress !== '') { + writer.uint32(18).string(message.withdrawAddress) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetWithdrawAddress { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetWithdrawAddress() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string() + break + case 2: + message.withdrawAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetWithdrawAddress { + const message = createBaseMsgSetWithdrawAddress() + message.delegatorAddress = object.delegatorAddress ?? '' + message.withdrawAddress = object.withdrawAddress ?? '' + return message + }, + fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.withdraw_address = + message.withdrawAddress === '' ? undefined : message.withdrawAddress + return obj + }, + fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoMsg { + return { + type: 'cosmos-sdk/MsgModifyWithdrawAddress', + value: MsgSetWithdrawAddress.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetWithdrawAddressProtoMsg): MsgSetWithdrawAddress { + return MsgSetWithdrawAddress.decode(message.value) + }, + toProto(message: MsgSetWithdrawAddress): Uint8Array { + return MsgSetWithdrawAddress.encode(message).finish() + }, + toProtoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', + value: MsgSetWithdrawAddress.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetWithdrawAddressResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetWithdrawAddressResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse() + return message + }, + fromAmino( + _: MsgSetWithdrawAddressResponseAmino + ): MsgSetWithdrawAddressResponse { + const message = createBaseMsgSetWithdrawAddressResponse() + return message + }, + toAmino( + _: MsgSetWithdrawAddressResponse + ): MsgSetWithdrawAddressResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetWithdrawAddressResponseAminoMsg + ): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetWithdrawAddressResponse + ): MsgSetWithdrawAddressResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSetWithdrawAddressResponse', + value: MsgSetWithdrawAddressResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetWithdrawAddressResponseProtoMsg + ): MsgSetWithdrawAddressResponse { + return MsgSetWithdrawAddressResponse.decode(message.value) + }, + toProto(message: MsgSetWithdrawAddressResponse): Uint8Array { + return MsgSetWithdrawAddressResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetWithdrawAddressResponse + ): MsgSetWithdrawAddressResponseProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse', + value: MsgSetWithdrawAddressResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetWithdrawAddressResponse.typeUrl, + MsgSetWithdrawAddressResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetWithdrawAddressResponse.aminoType, + MsgSetWithdrawAddressResponse.typeUrl +) +function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { + return { + delegatorAddress: '', + validatorAddress: '' + } +} +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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawDelegatorReward { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegatorReward() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgWithdrawDelegatorReward { + const message = createBaseMsgWithdrawDelegatorReward() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + return message + }, + fromAmino( + object: MsgWithdrawDelegatorRewardAmino + ): MsgWithdrawDelegatorReward { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + return obj + }, + fromAminoMsg( + object: MsgWithdrawDelegatorRewardAminoMsg + ): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawDelegatorReward + ): MsgWithdrawDelegatorRewardAminoMsg { + return { + type: 'cosmos-sdk/MsgWithdrawDelegationReward', + value: MsgWithdrawDelegatorReward.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawDelegatorRewardProtoMsg + ): MsgWithdrawDelegatorReward { + return MsgWithdrawDelegatorReward.decode(message.value) + }, + toProto(message: MsgWithdrawDelegatorReward): Uint8Array { + return MsgWithdrawDelegatorReward.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawDelegatorReward + ): MsgWithdrawDelegatorRewardProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', + value: MsgWithdrawDelegatorReward.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawDelegatorReward.typeUrl, + MsgWithdrawDelegatorReward +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawDelegatorReward.aminoType, + MsgWithdrawDelegatorReward.typeUrl +) +function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { + return { + amount: [] + } +} +export const MsgWithdrawDelegatorRewardResponse = { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse', + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegatorRewardResponse() + 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 + ): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgWithdrawDelegatorRewardResponseAmino + ): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse() + message.amount = object.amount?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino( + message: MsgWithdrawDelegatorRewardResponse + ): MsgWithdrawDelegatorRewardResponseAmino { + const obj: any = {} + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg( + object: MsgWithdrawDelegatorRewardResponseAminoMsg + ): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawDelegatorRewardResponse + ): MsgWithdrawDelegatorRewardResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgWithdrawDelegatorRewardResponse', + value: MsgWithdrawDelegatorRewardResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawDelegatorRewardResponseProtoMsg + ): MsgWithdrawDelegatorRewardResponse { + return MsgWithdrawDelegatorRewardResponse.decode(message.value) + }, + toProto(message: MsgWithdrawDelegatorRewardResponse): Uint8Array { + return MsgWithdrawDelegatorRewardResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawDelegatorRewardResponse + ): MsgWithdrawDelegatorRewardResponseProtoMsg { + return { + typeUrl: + '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse', + value: MsgWithdrawDelegatorRewardResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawDelegatorRewardResponse.typeUrl, + MsgWithdrawDelegatorRewardResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawDelegatorRewardResponse.aminoType, + MsgWithdrawDelegatorRewardResponse.typeUrl +) +function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { + return { + validatorAddress: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawValidatorCommission { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawValidatorCommission() + 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 + ): MsgWithdrawValidatorCommission { + const message = createBaseMsgWithdrawValidatorCommission() + message.validatorAddress = object.validatorAddress ?? '' + return message + }, + fromAmino( + object: MsgWithdrawValidatorCommissionAmino + ): MsgWithdrawValidatorCommission { + 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 = {} + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + return obj + }, + fromAminoMsg( + object: MsgWithdrawValidatorCommissionAminoMsg + ): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawValidatorCommission + ): MsgWithdrawValidatorCommissionAminoMsg { + return { + type: 'cosmos-sdk/MsgWithdrawValidatorCommission', + value: MsgWithdrawValidatorCommission.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawValidatorCommissionProtoMsg + ): MsgWithdrawValidatorCommission { + return MsgWithdrawValidatorCommission.decode(message.value) + }, + toProto(message: MsgWithdrawValidatorCommission): Uint8Array { + return MsgWithdrawValidatorCommission.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawValidatorCommission + ): MsgWithdrawValidatorCommissionProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', + value: MsgWithdrawValidatorCommission.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawValidatorCommission.typeUrl, + MsgWithdrawValidatorCommission +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawValidatorCommission.aminoType, + MsgWithdrawValidatorCommission.typeUrl +) +function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { + return { + amount: [] + } +} +export const MsgWithdrawValidatorCommissionResponse = { + typeUrl: + '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse', + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawValidatorCommissionResponse() + 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 + ): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgWithdrawValidatorCommissionResponseAmino + ): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse() + message.amount = object.amount?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino( + message: MsgWithdrawValidatorCommissionResponse + ): MsgWithdrawValidatorCommissionResponseAmino { + const obj: any = {} + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg( + object: MsgWithdrawValidatorCommissionResponseAminoMsg + ): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawValidatorCommissionResponse + ): MsgWithdrawValidatorCommissionResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgWithdrawValidatorCommissionResponse', + value: MsgWithdrawValidatorCommissionResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawValidatorCommissionResponseProtoMsg + ): MsgWithdrawValidatorCommissionResponse { + return MsgWithdrawValidatorCommissionResponse.decode(message.value) + }, + toProto(message: MsgWithdrawValidatorCommissionResponse): Uint8Array { + return MsgWithdrawValidatorCommissionResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawValidatorCommissionResponse + ): MsgWithdrawValidatorCommissionResponseProtoMsg { + return { + typeUrl: + '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse', + value: MsgWithdrawValidatorCommissionResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawValidatorCommissionResponse.typeUrl, + MsgWithdrawValidatorCommissionResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawValidatorCommissionResponse.aminoType, + MsgWithdrawValidatorCommissionResponse.typeUrl +) +function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { + return { + amount: [], + depositor: '' + } +} +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() + } + if (message.depositor !== '') { + writer.uint32(18).string(message.depositor) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFundCommunityPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFundCommunityPool() + 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.depositor = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgFundCommunityPool { + const message = createBaseMsgFundCommunityPool() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + message.depositor = object.depositor ?? '' + return message + }, + fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { + 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 = {} + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + obj.depositor = message.depositor === '' ? undefined : message.depositor + return obj + }, + fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.fromAmino(object.value) + }, + toAminoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolAminoMsg { + return { + type: 'cosmos-sdk/MsgFundCommunityPool', + value: MsgFundCommunityPool.toAmino(message) + } + }, + fromProtoMsg(message: MsgFundCommunityPoolProtoMsg): MsgFundCommunityPool { + return MsgFundCommunityPool.decode(message.value) + }, + toProto(message: MsgFundCommunityPool): Uint8Array { + return MsgFundCommunityPool.encode(message).finish() + }, + toProtoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', + value: MsgFundCommunityPool.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFundCommunityPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFundCommunityPoolResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse() + return message + }, + fromAmino( + _: MsgFundCommunityPoolResponseAmino + ): MsgFundCommunityPoolResponse { + const message = createBaseMsgFundCommunityPoolResponse() + return message + }, + toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgFundCommunityPoolResponseAminoMsg + ): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgFundCommunityPoolResponse + ): MsgFundCommunityPoolResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgFundCommunityPoolResponse', + value: MsgFundCommunityPoolResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgFundCommunityPoolResponseProtoMsg + ): MsgFundCommunityPoolResponse { + return MsgFundCommunityPoolResponse.decode(message.value) + }, + toProto(message: MsgFundCommunityPoolResponse): Uint8Array { + return MsgFundCommunityPoolResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgFundCommunityPoolResponse + ): MsgFundCommunityPoolResponseProtoMsg { + return { + typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse', + value: MsgFundCommunityPoolResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.authority + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(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 + }, + 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 + }, + 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 === '' ? undefined : message.authority + obj.recipient = message.recipient === '' ? undefined : message.recipient + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.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 + }, + 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 +) diff --git a/src/proto/osmojs/cosmos/gov/v1beta1/gov.ts b/src/proto/osmojs/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 0000000..539cd2e --- /dev/null +++ b/src/proto/osmojs/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,2115 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +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 { + CreateGroupsProposal, + CreateGroupsProposalProtoMsg, + CreateGroupsProposalSDKType +} from '../../../osmosis/incentives/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 { + CommunityPoolSpendProposal, + CommunityPoolSpendProposalProtoMsg, + CommunityPoolSpendProposalSDKType, + CommunityPoolSpendProposalWithDeposit, + CommunityPoolSpendProposalWithDepositProtoMsg, + CommunityPoolSpendProposalWithDepositSDKType +} from '../../distribution/v1beta1/distribution' +import { + SoftwareUpgradeProposal, + SoftwareUpgradeProposalProtoMsg, + SoftwareUpgradeProposalSDKType, + CancelSoftwareUpgradeProposal, + CancelSoftwareUpgradeProposalProtoMsg, + CancelSoftwareUpgradeProposalSDKType +} from '../../upgrade/v1beta1/upgrade' +import { + isSet, + toTimestamp, + fromTimestamp, + bytesFromBase64, + base64FromBytes +} from '../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { Decimal } from '@cosmjs/math' +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. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1 +} +export const VoteOptionSDKType = VoteOption +export const VoteOptionAmino = VoteOption +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case 'VOTE_OPTION_UNSPECIFIED': + return VoteOption.VOTE_OPTION_UNSPECIFIED + case 1: + case 'VOTE_OPTION_YES': + return VoteOption.VOTE_OPTION_YES + case 2: + case 'VOTE_OPTION_ABSTAIN': + return VoteOption.VOTE_OPTION_ABSTAIN + case 3: + case 'VOTE_OPTION_NO': + return VoteOption.VOTE_OPTION_NO + case 4: + case 'VOTE_OPTION_NO_WITH_VETO': + return VoteOption.VOTE_OPTION_NO_WITH_VETO + case -1: + case 'UNRECOGNIZED': + default: + return VoteOption.UNRECOGNIZED + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return 'VOTE_OPTION_UNSPECIFIED' + case VoteOption.VOTE_OPTION_YES: + return 'VOTE_OPTION_YES' + case VoteOption.VOTE_OPTION_ABSTAIN: + return 'VOTE_OPTION_ABSTAIN' + case VoteOption.VOTE_OPTION_NO: + return 'VOTE_OPTION_NO' + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return 'VOTE_OPTION_NO_WITH_VETO' + case VoteOption.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** 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 + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1 +} +export const ProposalStatusSDKType = ProposalStatus +export const ProposalStatusAmino = ProposalStatus +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case 'PROPOSAL_STATUS_UNSPECIFIED': + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED + case 1: + case 'PROPOSAL_STATUS_DEPOSIT_PERIOD': + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD + case 2: + case 'PROPOSAL_STATUS_VOTING_PERIOD': + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD + case 3: + case 'PROPOSAL_STATUS_PASSED': + return ProposalStatus.PROPOSAL_STATUS_PASSED + case 4: + case 'PROPOSAL_STATUS_REJECTED': + return ProposalStatus.PROPOSAL_STATUS_REJECTED + case 5: + case 'PROPOSAL_STATUS_FAILED': + return ProposalStatus.PROPOSAL_STATUS_FAILED + case -1: + case 'UNRECOGNIZED': + default: + return ProposalStatus.UNRECOGNIZED + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return 'PROPOSAL_STATUS_UNSPECIFIED' + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return 'PROPOSAL_STATUS_DEPOSIT_PERIOD' + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return 'PROPOSAL_STATUS_VOTING_PERIOD' + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return 'PROPOSAL_STATUS_PASSED' + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return 'PROPOSAL_STATUS_REJECTED' + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return 'PROPOSAL_STATUS_FAILED' + case ProposalStatus.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * 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 { + typeUrl: '/cosmos.gov.v1beta1.WeightedVoteOption' + value: Uint8Array +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOptionAmino { + /** 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' + value: WeightedVoteOptionAmino +} +/** + * WeightedVoteOption defines a unit of vote for vote split. + * + * Since: cosmos-sdk 0.43 + */ +export interface WeightedVoteOptionSDKType { + option: VoteOption + weight: string +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposal { + $typeUrl?: '/cosmos.gov.v1beta1.TextProposal' + /** title of the proposal. */ + title: string + /** description associated with the proposal. */ + description: string +} +export interface TextProposalProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.TextProposal' + value: Uint8Array +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposalAmino { + /** title of the proposal. */ + title?: string + /** description associated with the proposal. */ + description?: string +} +export interface TextProposalAminoMsg { + type: 'cosmos-sdk/TextProposal' + value: TextProposalAmino +} +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposalSDKType { + $typeUrl?: '/cosmos.gov.v1beta1.TextProposal' + title: string + description: string +} +/** + * Deposit defines an amount deposited by an account address to an active + * 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 { + typeUrl: '/cosmos.gov.v1beta1.Deposit' + value: Uint8Array +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositAmino { + /** 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 { + type: 'cosmos-sdk/Deposit' + value: DepositAmino +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: bigint + depositor: string + amount: CoinSDKType[] +} +/** 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 is the proposal's content. */ + content?: + | TextProposal + | ClientUpdateProposal + | UpgradeProposal + | StoreCodeProposal + | InstantiateContractProposal + | InstantiateContract2Proposal + | MigrateContractProposal + | SudoContractProposal + | ExecuteContractProposal + | UpdateAdminProposal + | ClearAdminProposal + | PinCodesProposal + | UnpinCodesProposal + | UpdateInstantiateConfigProposal + | StoreAndInstantiateContractProposal + | ReplaceMigrationRecordsProposal + | UpdateMigrationRecordsProposal + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal + | SetScalingFactorControllerProposal + | CreateGroupsProposal + | ReplacePoolIncentivesProposal + | UpdatePoolIncentivesProposal + | SetProtoRevEnabledProposal + | SetProtoRevAdminAccountProposal + | SetSuperfluidAssetsProposal + | RemoveSuperfluidAssetsProposal + | UpdateUnpoolWhiteListProposal + | UpdateFeeTokenProposal + | CommunityPoolSpendProposal + | CommunityPoolSpendProposalWithDeposit + | SoftwareUpgradeProposal + | CancelSoftwareUpgradeProposal + | 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 +} +export interface ProposalProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.Proposal' + value: Uint8Array +} +export type ProposalEncoded = Omit & { + /** content is the proposal's content. */ content?: + | TextProposalProtoMsg + | ClientUpdateProposalProtoMsg + | UpgradeProposalProtoMsg + | StoreCodeProposalProtoMsg + | InstantiateContractProposalProtoMsg + | InstantiateContract2ProposalProtoMsg + | MigrateContractProposalProtoMsg + | SudoContractProposalProtoMsg + | ExecuteContractProposalProtoMsg + | UpdateAdminProposalProtoMsg + | ClearAdminProposalProtoMsg + | PinCodesProposalProtoMsg + | UnpinCodesProposalProtoMsg + | UpdateInstantiateConfigProposalProtoMsg + | StoreAndInstantiateContractProposalProtoMsg + | ReplaceMigrationRecordsProposalProtoMsg + | UpdateMigrationRecordsProposalProtoMsg + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg + | SetScalingFactorControllerProposalProtoMsg + | CreateGroupsProposalProtoMsg + | ReplacePoolIncentivesProposalProtoMsg + | UpdatePoolIncentivesProposalProtoMsg + | SetProtoRevEnabledProposalProtoMsg + | SetProtoRevAdminAccountProposalProtoMsg + | SetSuperfluidAssetsProposalProtoMsg + | RemoveSuperfluidAssetsProposalProtoMsg + | UpdateUnpoolWhiteListProposalProtoMsg + | UpdateFeeTokenProposalProtoMsg + | CommunityPoolSpendProposalProtoMsg + | CommunityPoolSpendProposalWithDepositProtoMsg + | SoftwareUpgradeProposalProtoMsg + | CancelSoftwareUpgradeProposalProtoMsg + | AnyProtoMsg + | undefined +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string + /** content is the proposal's content. */ + content?: AnyAmino + /** 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 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' + value: ProposalAmino +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + proposal_id: bigint + content?: + | TextProposalSDKType + | ClientUpdateProposalSDKType + | UpgradeProposalSDKType + | StoreCodeProposalSDKType + | InstantiateContractProposalSDKType + | InstantiateContract2ProposalSDKType + | MigrateContractProposalSDKType + | SudoContractProposalSDKType + | ExecuteContractProposalSDKType + | UpdateAdminProposalSDKType + | ClearAdminProposalSDKType + | PinCodesProposalSDKType + | UnpinCodesProposalSDKType + | UpdateInstantiateConfigProposalSDKType + | StoreAndInstantiateContractProposalSDKType + | ReplaceMigrationRecordsProposalSDKType + | UpdateMigrationRecordsProposalSDKType + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType + | SetScalingFactorControllerProposalSDKType + | CreateGroupsProposalSDKType + | ReplacePoolIncentivesProposalSDKType + | UpdatePoolIncentivesProposalSDKType + | SetProtoRevEnabledProposalSDKType + | SetProtoRevAdminAccountProposalSDKType + | SetSuperfluidAssetsProposalSDKType + | RemoveSuperfluidAssetsProposalSDKType + | UpdateUnpoolWhiteListProposalSDKType + | UpdateFeeTokenProposalSDKType + | CommunityPoolSpendProposalSDKType + | CommunityPoolSpendProposalWithDepositSDKType + | SoftwareUpgradeProposalSDKType + | CancelSoftwareUpgradeProposalSDKType + | AnySDKType + | undefined + status: ProposalStatus + final_tally_result: TallyResultSDKType + submit_time: Date + deposit_end_time: Date + total_deposit: CoinSDKType[] + voting_start_time: Date + voting_end_time: Date +} +/** 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 { + typeUrl: '/cosmos.gov.v1beta1.TallyResult' + value: Uint8Array +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultAmino { + /** 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' + value: TallyResultAmino +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes: string + abstain: string + no: string + no_with_veto: string +} +/** + * Vote defines a vote on a governance proposal. + * 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 + * 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 + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOption[] +} +export interface VoteProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.Vote' + value: Uint8Array +} +/** + * Vote defines a vote on a governance proposal. + * 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 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 + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOptionAmino[] +} +export interface VoteAminoMsg { + type: 'cosmos-sdk/Vote' + value: VoteAmino +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: bigint + voter: string + /** @deprecated */ + option: VoteOption + options: WeightedVoteOptionSDKType[] +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[] + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod: Duration +} +export interface DepositParamsProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.DepositParams' + value: Uint8Array +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsAmino { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: CoinAmino[] + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: DurationAmino +} +export interface DepositParamsAminoMsg { + type: 'cosmos-sdk/DepositParams' + value: DepositParamsAmino +} +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[] + max_deposit_period: DurationSDKType +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Duration of the voting period. */ + votingPeriod: Duration +} +export interface VotingParamsProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.VotingParams' + value: Uint8Array +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsAmino { + /** Duration of the voting period. */ + voting_period?: DurationAmino +} +export interface VotingParamsAminoMsg { + type: 'cosmos-sdk/VotingParams' + value: VotingParamsAmino +} +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParamsSDKType { + 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. + */ + 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. + */ + vetoThreshold: Uint8Array +} +export interface TallyParamsProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.TallyParams' + value: Uint8Array +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsAmino { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string +} +export interface TallyParamsAminoMsg { + type: 'cosmos-sdk/TallyParams' + value: TallyParamsAmino +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParamsSDKType { + quorum: Uint8Array + threshold: Uint8Array + veto_threshold: Uint8Array +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: '' + } +} +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) + } + if (message.weight !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.weight, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): WeightedVoteOption { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseWeightedVoteOption() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.option = reader.int32() as any + break + case 2: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): WeightedVoteOption { + const message = createBaseWeightedVoteOption() + message.option = object.option ?? 0 + message.weight = object.weight ?? '' + return message + }, + fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { + const message = createBaseWeightedVoteOption() + if (object.option !== undefined && object.option !== null) { + message.option = 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 === 0 ? undefined : message.option + obj.weight = message.weight === '' ? undefined : message.weight + return obj + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value) + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: 'cosmos-sdk/WeightedVoteOption', + value: WeightedVoteOption.toAmino(message) + } + }, + fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { + return WeightedVoteOption.decode(message.value) + }, + toProto(message: WeightedVoteOption): Uint8Array { + return WeightedVoteOption.encode(message).finish() + }, + toProtoMsg(message: WeightedVoteOption): WeightedVoteOptionProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.WeightedVoteOption', + value: WeightedVoteOption.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption) +GlobalDecoderRegistry.registerAminoProtoMapping( + WeightedVoteOption.aminoType, + WeightedVoteOption.typeUrl +) +function createBaseTextProposal(): TextProposal { + return { + $typeUrl: '/cosmos.gov.v1beta1.TextProposal', + title: '', + description: '' + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTextProposal() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TextProposal { + const message = createBaseTextProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + return message + }, + fromAmino(object: TextProposalAmino): TextProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + return obj + }, + fromAminoMsg(object: TextProposalAminoMsg): TextProposal { + return TextProposal.fromAmino(object.value) + }, + toAminoMsg(message: TextProposal): TextProposalAminoMsg { + return { + type: 'cosmos-sdk/TextProposal', + value: TextProposal.toAmino(message) + } + }, + fromProtoMsg(message: TextProposalProtoMsg): TextProposal { + return TextProposal.decode(message.value) + }, + toProto(message: TextProposal): Uint8Array { + return TextProposal.encode(message).finish() + }, + toProtoMsg(message: TextProposal): TextProposalProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.TextProposal', + value: TextProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TextProposal.typeUrl, TextProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + TextProposal.aminoType, + TextProposal.typeUrl +) +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: '', + amount: [] + } +} +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) + } + if (message.depositor !== '') { + writer.uint32(18).string(message.depositor) + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDeposit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.depositor = 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): Deposit { + const message = createBaseDeposit() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.depositor = object.depositor ?? '' + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: DepositAmino): Deposit { + 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 = {} + obj.proposal_id = + message.proposalId !== BigInt(0) + ? message.proposalId.toString() + : undefined + obj.depositor = message.depositor === '' ? undefined : message.depositor + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value) + }, + toAminoMsg(message: Deposit): DepositAminoMsg { + return { + type: 'cosmos-sdk/Deposit', + value: Deposit.toAmino(message) + } + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value) + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish() + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.Deposit', + value: Deposit.encode(message).finish() + } + } +} +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: new Date(), + depositEndTime: new Date(), + totalDeposit: [], + 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( + GlobalDecoderRegistry.wrapAny(message.content), + writer.uint32(18).fork() + ).ldelim() + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status) + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode( + message.finalTallyResult, + writer.uint32(34).fork() + ).ldelim() + } + if (message.submitTime !== undefined) { + Timestamp.encode( + toTimestamp(message.submitTime), + writer.uint32(42).fork() + ).ldelim() + } + if (message.depositEndTime !== undefined) { + Timestamp.encode( + toTimestamp(message.depositEndTime), + writer.uint32(50).fork() + ).ldelim() + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim() + } + if (message.votingStartTime !== undefined) { + Timestamp.encode( + toTimestamp(message.votingStartTime), + writer.uint32(66).fork() + ).ldelim() + } + if (message.votingEndTime !== undefined) { + Timestamp.encode( + toTimestamp(message.votingEndTime), + writer.uint32(74).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.content = GlobalDecoderRegistry.unwrapAny(reader) + break + case 3: + message.status = reader.int32() as any + break + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()) + break + case 5: + message.submitTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 6: + message.depositEndTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())) + break + case 8: + message.votingStartTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 9: + message.votingEndTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 + ? 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 + message.depositEndTime = object.depositEndTime ?? undefined + message.totalDeposit = + object.totalDeposit?.map((e) => Coin.fromPartial(e)) || [] + message.votingStartTime = object.votingStartTime ?? undefined + message.votingEndTime = object.votingEndTime ?? undefined + return message + }, + fromAmino(object: ProposalAmino): Proposal { + 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 = 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 !== BigInt(0) + ? message.proposalId.toString() + : undefined + obj.content = message.content + ? GlobalDecoderRegistry.toAminoMsg(message.content) + : undefined + obj.status = message.status === 0 ? undefined : message.status + obj.final_tally_result = message.finalTallyResult + ? TallyResult.toAmino(message.finalTallyResult) + : TallyResult.toAmino(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 = message.totalDeposit + } + 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 { + return Proposal.fromAmino(object.value) + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: 'cosmos-sdk/Proposal', + value: Proposal.toAmino(message) + } + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value) + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish() + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.Proposal', + value: Proposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + Proposal.aminoType, + Proposal.typeUrl +) +function createBaseTallyResult(): TallyResult { + return { + yes: '', + abstain: '', + no: '', + noWithVeto: '' + } +} +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) + } + if (message.abstain !== '') { + writer.uint32(18).string(message.abstain) + } + if (message.no !== '') { + writer.uint32(26).string(message.no) + } + if (message.noWithVeto !== '') { + writer.uint32(34).string(message.noWithVeto) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTallyResult() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.yes = reader.string() + break + case 2: + message.abstain = reader.string() + break + case 3: + message.no = reader.string() + break + case 4: + message.noWithVeto = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult() + message.yes = object.yes ?? '' + message.abstain = object.abstain ?? '' + message.no = object.no ?? '' + message.noWithVeto = object.noWithVeto ?? '' + return message + }, + fromAmino(object: TallyResultAmino): TallyResult { + 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 = {} + obj.yes = message.yes === '' ? undefined : message.yes + obj.abstain = message.abstain === '' ? undefined : message.abstain + obj.no = message.no === '' ? undefined : message.no + obj.no_with_veto = + message.noWithVeto === '' ? undefined : message.noWithVeto + return obj + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value) + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: 'cosmos-sdk/TallyResult', + value: TallyResult.toAmino(message) + } + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value) + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish() + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.TallyResult', + value: TallyResult.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult) +GlobalDecoderRegistry.registerAminoProtoMapping( + TallyResult.aminoType, + TallyResult.typeUrl +) +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: '', + option: 0, + options: [] + } +} +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) + } + if (message.voter !== '') { + writer.uint32(18).string(message.voter) + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option) + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVote() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.voter = reader.string() + break + case 3: + message.option = reader.int32() as any + break + case 4: + message.options.push( + WeightedVoteOption.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.voter = object.voter ?? '' + message.option = object.option ?? 0 + message.options = + object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] + return message + }, + fromAmino(object: VoteAmino): Vote { + 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 = 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() : '0' + obj.voter = message.voter === '' ? undefined : message.voter + obj.option = message.option === 0 ? undefined : message.option + if (message.options) { + obj.options = message.options.map((e) => + e ? WeightedVoteOption.toAmino(e) : undefined + ) + } else { + obj.options = message.options + } + return obj + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value) + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: 'cosmos-sdk/Vote', + value: Vote.toAmino(message) + } + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value) + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish() + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.Vote', + value: Vote.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Vote.typeUrl, Vote) +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl) +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + 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() + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode( + message.maxDepositPeriod, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDepositParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 + return message + }, + fromAmino(object: DepositParamsAmino): DepositParams { + 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 = {} + if (message.minDeposit) { + obj.min_deposit = message.minDeposit.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.min_deposit = message.minDeposit + } + obj.max_deposit_period = message.maxDepositPeriod + ? Duration.toAmino(message.maxDepositPeriod) + : undefined + return obj + }, + fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { + return DepositParams.fromAmino(object.value) + }, + toAminoMsg(message: DepositParams): DepositParamsAminoMsg { + return { + type: 'cosmos-sdk/DepositParams', + value: DepositParams.toAmino(message) + } + }, + fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { + return DepositParams.decode(message.value) + }, + toProto(message: DepositParams): Uint8Array { + return DepositParams.encode(message).finish() + }, + toProtoMsg(message: DepositParams): DepositParamsProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.DepositParams', + value: DepositParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams) +GlobalDecoderRegistry.registerAminoProtoMapping( + DepositParams.aminoType, + DepositParams.typeUrl +) +function createBaseVotingParams(): VotingParams { + return { + 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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVotingParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): VotingParams { + const message = createBaseVotingParams() + message.votingPeriod = + object.votingPeriod !== undefined && object.votingPeriod !== null + ? Duration.fromPartial(object.votingPeriod) + : undefined + return message + }, + fromAmino(object: VotingParamsAmino): VotingParams { + 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 + return obj + }, + fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { + return VotingParams.fromAmino(object.value) + }, + toAminoMsg(message: VotingParams): VotingParamsAminoMsg { + return { + type: 'cosmos-sdk/VotingParams', + value: VotingParams.toAmino(message) + } + }, + fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { + return VotingParams.decode(message.value) + }, + toProto(message: VotingParams): Uint8Array { + return VotingParams.encode(message).finish() + }, + toProtoMsg(message: VotingParams): VotingParamsProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.VotingParams', + value: VotingParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams) +GlobalDecoderRegistry.registerAminoProtoMapping( + VotingParams.aminoType, + VotingParams.typeUrl +) +function createBaseTallyParams(): TallyParams { + return { + quorum: new Uint8Array(), + threshold: 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) + } + if (message.threshold.length !== 0) { + writer.uint32(18).bytes(message.threshold) + } + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(message.vetoThreshold) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTallyParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes() + break + case 2: + message.threshold = reader.bytes() + break + case 3: + message.vetoThreshold = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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() + return message + }, + fromAmino(object: TallyParamsAmino): TallyParams { + 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 ? 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 { + return TallyParams.fromAmino(object.value) + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: 'cosmos-sdk/TallyParams', + value: TallyParams.toAmino(message) + } + }, + fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { + return TallyParams.decode(message.value) + }, + toProto(message: TallyParams): Uint8Array { + return TallyParams.encode(message).finish() + }, + toProtoMsg(message: TallyParams): TallyParamsProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.TallyParams', + value: TallyParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams) +GlobalDecoderRegistry.registerAminoProtoMapping( + TallyParams.aminoType, + TallyParams.typeUrl +) diff --git a/src/proto/osmojs/cosmos/gov/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/gov/v1beta1/tx.amino.ts new file mode 100644 index 0000000..bbbe8cd --- /dev/null +++ b/src/proto/osmojs/cosmos/gov/v1beta1/tx.amino.ts @@ -0,0 +1,25 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from './tx' +export const AminoConverter = { + '/cosmos.gov.v1beta1.MsgSubmitProposal': { + aminoType: 'cosmos-sdk/MsgSubmitProposal', + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + '/cosmos.gov.v1beta1.MsgVote': { + aminoType: 'cosmos-sdk/MsgVote', + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + '/cosmos.gov.v1beta1.MsgVoteWeighted': { + aminoType: 'cosmos-sdk/MsgVoteWeighted', + toAmino: MsgVoteWeighted.toAmino, + fromAmino: MsgVoteWeighted.fromAmino + }, + '/cosmos.gov.v1beta1.MsgDeposit': { + aminoType: 'cosmos-sdk/MsgDeposit', + toAmino: MsgDeposit.toAmino, + fromAmino: MsgDeposit.fromAmino + } +} diff --git a/src/proto/osmojs/cosmos/gov/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/gov/v1beta1/tx.registry.ts new file mode 100644 index 0000000..7683f14 --- /dev/null +++ b/src/proto/osmojs/cosmos/gov/v1beta1/tx.registry.ts @@ -0,0 +1,95 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/cosmos.gov.v1beta1.MsgSubmitProposal', MsgSubmitProposal], + ['/cosmos.gov.v1beta1.MsgVote', MsgVote], + ['/cosmos.gov.v1beta1.MsgVoteWeighted', MsgVoteWeighted], + ['/cosmos.gov.v1beta1.MsgDeposit', MsgDeposit] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', + value: MsgSubmitProposal.encode(value).finish() + } + }, + vote(value: MsgVote) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVote', + value: MsgVote.encode(value).finish() + } + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', + value: MsgVoteWeighted.encode(value).finish() + } + }, + deposit(value: MsgDeposit) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', + value: MsgDeposit.encode(value).finish() + } + } + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', + value + } + }, + vote(value: MsgVote) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVote', + value + } + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', + value + } + }, + deposit(value: MsgDeposit) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', + value + } + } + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', + value: MsgSubmitProposal.fromPartial(value) + } + }, + vote(value: MsgVote) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVote', + value: MsgVote.fromPartial(value) + } + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', + value: MsgVoteWeighted.fromPartial(value) + } + }, + deposit(value: MsgDeposit) { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', + value: MsgDeposit.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/gov/v1beta1/tx.ts b/src/proto/osmojs/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 0000000..480ed23 --- /dev/null +++ b/src/proto/osmojs/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,1389 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { + VoteOption, + WeightedVoteOption, + WeightedVoteOptionAmino, + WeightedVoteOptionSDKType, + TextProposal, + TextProposalProtoMsg, + TextProposalSDKType +} from './gov' +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 { + CreateGroupsProposal, + CreateGroupsProposalProtoMsg, + CreateGroupsProposalSDKType +} from '../../../osmosis/incentives/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 { + CommunityPoolSpendProposal, + CommunityPoolSpendProposalProtoMsg, + CommunityPoolSpendProposalSDKType, + CommunityPoolSpendProposalWithDeposit, + CommunityPoolSpendProposalWithDepositProtoMsg, + CommunityPoolSpendProposalWithDepositSDKType +} from '../../distribution/v1beta1/distribution' +import { + SoftwareUpgradeProposal, + SoftwareUpgradeProposalProtoMsg, + SoftwareUpgradeProposalSDKType, + CancelSoftwareUpgradeProposal, + CancelSoftwareUpgradeProposalProtoMsg, + CancelSoftwareUpgradeProposalSDKType +} from '../../upgrade/v1beta1/upgrade' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +import { isSet } from '../../../../helpers' +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** content is the proposal's content. */ + content?: + | ClientUpdateProposal + | UpgradeProposal + | StoreCodeProposal + | InstantiateContractProposal + | InstantiateContract2Proposal + | MigrateContractProposal + | SudoContractProposal + | ExecuteContractProposal + | UpdateAdminProposal + | ClearAdminProposal + | PinCodesProposal + | UnpinCodesProposal + | UpdateInstantiateConfigProposal + | StoreAndInstantiateContractProposal + | ReplaceMigrationRecordsProposal + | UpdateMigrationRecordsProposal + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal + | SetScalingFactorControllerProposal + | CreateGroupsProposal + | ReplacePoolIncentivesProposal + | UpdatePoolIncentivesProposal + | SetProtoRevEnabledProposal + | SetProtoRevAdminAccountProposal + | SetSuperfluidAssetsProposal + | RemoveSuperfluidAssetsProposal + | UpdateUnpoolWhiteListProposal + | UpdateFeeTokenProposal + | CommunityPoolSpendProposal + | CommunityPoolSpendProposalWithDeposit + | TextProposal + | SoftwareUpgradeProposal + | CancelSoftwareUpgradeProposal + | 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 +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal' + value: Uint8Array +} +export type MsgSubmitProposalEncoded = Omit & { + /** content is the proposal's content. */ content?: + | ClientUpdateProposalProtoMsg + | UpgradeProposalProtoMsg + | StoreCodeProposalProtoMsg + | InstantiateContractProposalProtoMsg + | InstantiateContract2ProposalProtoMsg + | MigrateContractProposalProtoMsg + | SudoContractProposalProtoMsg + | ExecuteContractProposalProtoMsg + | UpdateAdminProposalProtoMsg + | ClearAdminProposalProtoMsg + | PinCodesProposalProtoMsg + | UnpinCodesProposalProtoMsg + | UpdateInstantiateConfigProposalProtoMsg + | StoreAndInstantiateContractProposalProtoMsg + | ReplaceMigrationRecordsProposalProtoMsg + | UpdateMigrationRecordsProposalProtoMsg + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg + | SetScalingFactorControllerProposalProtoMsg + | CreateGroupsProposalProtoMsg + | ReplacePoolIncentivesProposalProtoMsg + | UpdatePoolIncentivesProposalProtoMsg + | SetProtoRevEnabledProposalProtoMsg + | SetProtoRevAdminAccountProposalProtoMsg + | SetSuperfluidAssetsProposalProtoMsg + | RemoveSuperfluidAssetsProposalProtoMsg + | UpdateUnpoolWhiteListProposalProtoMsg + | UpdateFeeTokenProposalProtoMsg + | CommunityPoolSpendProposalProtoMsg + | CommunityPoolSpendProposalWithDepositProtoMsg + | TextProposalProtoMsg + | SoftwareUpgradeProposalProtoMsg + | CancelSoftwareUpgradeProposalProtoMsg + | 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 is the account address of the proposer. */ + proposer?: string +} +export interface MsgSubmitProposalAminoMsg { + type: 'cosmos-sdk/MsgSubmitProposal' + value: MsgSubmitProposalAmino +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + content?: + | ClientUpdateProposalSDKType + | UpgradeProposalSDKType + | StoreCodeProposalSDKType + | InstantiateContractProposalSDKType + | InstantiateContract2ProposalSDKType + | MigrateContractProposalSDKType + | SudoContractProposalSDKType + | ExecuteContractProposalSDKType + | UpdateAdminProposalSDKType + | ClearAdminProposalSDKType + | PinCodesProposalSDKType + | UnpinCodesProposalSDKType + | UpdateInstantiateConfigProposalSDKType + | StoreAndInstantiateContractProposalSDKType + | ReplaceMigrationRecordsProposalSDKType + | UpdateMigrationRecordsProposalSDKType + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType + | SetScalingFactorControllerProposalSDKType + | CreateGroupsProposalSDKType + | ReplacePoolIncentivesProposalSDKType + | UpdatePoolIncentivesProposalSDKType + | SetProtoRevEnabledProposalSDKType + | SetProtoRevAdminAccountProposalSDKType + | SetSuperfluidAssetsProposalSDKType + | RemoveSuperfluidAssetsProposalSDKType + | UpdateUnpoolWhiteListProposalSDKType + | UpdateFeeTokenProposalSDKType + | CommunityPoolSpendProposalSDKType + | CommunityPoolSpendProposalWithDepositSDKType + | TextProposalSDKType + | SoftwareUpgradeProposalSDKType + | CancelSoftwareUpgradeProposalSDKType + | AnySDKType + | undefined + initial_deposit: CoinSDKType[] + proposer: string +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposalResponse' + value: Uint8Array +} +/** 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 { + type: 'cosmos-sdk/MsgSubmitProposalResponse' + value: MsgSubmitProposalResponseAmino +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint +} +/** 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 { + typeUrl: '/cosmos.gov.v1beta1.MsgVote' + value: Uint8Array +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteAmino { + /** 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' + value: MsgVoteAmino +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: bigint + voter: string + option: VoteOption +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteResponse' + value: Uint8Array +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: 'cosmos-sdk/MsgVoteResponse' + value: MsgVoteResponseAmino +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * 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 { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted' + value: Uint8Array +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: 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/MsgVoteWeighted' + value: MsgVoteWeightedAmino +} +/** + * MsgVoteWeighted defines a message to cast a vote. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedSDKType { + proposal_id: bigint + voter: string + options: WeightedVoteOptionSDKType[] +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeightedResponse' + value: Uint8Array +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: 'cosmos-sdk/MsgVoteWeightedResponse' + value: MsgVoteWeightedResponseAmino +} +/** + * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + * + * Since: cosmos-sdk 0.43 + */ +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 { + typeUrl: '/cosmos.gov.v1beta1.MsgDeposit' + value: Uint8Array +} +/** 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 defines the deposit addresses from the proposals. */ + depositor?: string + /** amount to be deposited by depositor. */ + amount: CoinAmino[] +} +export interface MsgDepositAminoMsg { + type: 'cosmos-sdk/MsgDeposit' + value: MsgDepositAmino +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: bigint + depositor: string + amount: CoinSDKType[] +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: '/cosmos.gov.v1beta1.MsgDepositResponse' + value: Uint8Array +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: 'cosmos-sdk/MsgDepositResponse' + value: MsgDepositResponseAmino +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + content: undefined, + initialDeposit: [], + 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( + GlobalDecoderRegistry.wrapAny(message.content), + writer.uint32(10).fork() + ).ldelim() + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.proposer !== '') { + writer.uint32(26).string(message.proposer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.content = GlobalDecoderRegistry.unwrapAny(reader) + break + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())) + break + case 3: + message.proposer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal() + 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 ?? '' + return message + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + 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 + ? GlobalDecoderRegistry.toAminoMsg(message.content) + : undefined + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.initial_deposit = message.initialDeposit + } + obj.proposer = message.proposer === '' ? undefined : message.proposer + return obj + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value) + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: 'cosmos-sdk/MsgSubmitProposal', + value: MsgSubmitProposal.toAmino(message) + } + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value) + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish() + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', + value: MsgSubmitProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSubmitProposal.aminoType, + MsgSubmitProposal.typeUrl +) +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSubmitProposalResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposalResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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() : '0' + return obj + }, + fromAminoMsg( + object: MsgSubmitProposalResponseAminoMsg + ): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSubmitProposalResponse + ): MsgSubmitProposalResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSubmitProposalResponse', + value: MsgSubmitProposalResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSubmitProposalResponseProtoMsg + ): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value) + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSubmitProposalResponse + ): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposalResponse', + value: MsgSubmitProposalResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSubmitProposalResponse.typeUrl, + MsgSubmitProposalResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSubmitProposalResponse.aminoType, + MsgSubmitProposalResponse.typeUrl +) +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: '', + option: 0 + } +} +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) + } + if (message.voter !== '') { + writer.uint32(18).string(message.voter) + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVote() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.voter = reader.string() + break + case 3: + message.option = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.voter = object.voter ?? '' + message.option = object.option ?? 0 + return message + }, + fromAmino(object: MsgVoteAmino): MsgVote { + 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 = object.option + } + return message + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {} + obj.proposal_id = + message.proposalId !== BigInt(0) + ? message.proposalId.toString() + : undefined + obj.voter = message.voter === '' ? undefined : message.voter + obj.option = message.option === 0 ? undefined : message.option + return obj + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value) + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: 'cosmos-sdk/MsgVote', + value: MsgVote.toAmino(message) + } + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value) + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish() + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVote', + value: MsgVote.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse() + return message + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse() + return message + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgVoteResponse', + value: MsgVoteResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value) + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish() + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteResponse', + value: MsgVoteResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgVoteResponse.aminoType, + MsgVoteResponse.typeUrl +) +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: '', + options: [] + } +} +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) + } + if (message.voter !== '') { + writer.uint32(18).string(message.voter) + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeighted() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.voter = reader.string() + break + case 3: + message.options.push( + WeightedVoteOption.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.voter = object.voter ?? '' + message.options = + object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { + 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() : '0' + obj.voter = message.voter === '' ? undefined : message.voter + if (message.options) { + obj.options = message.options.map((e) => + e ? WeightedVoteOption.toAmino(e) : undefined + ) + } else { + obj.options = message.options + } + return obj + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value) + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: 'cosmos-sdk/MsgVoteWeighted', + value: MsgVoteWeighted.toAmino(message) + } + }, + fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value) + }, + toProto(message: MsgVoteWeighted): Uint8Array { + return MsgVoteWeighted.encode(message).finish() + }, + toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', + value: MsgVoteWeighted.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgVoteWeightedResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeightedResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse() + return message + }, + fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse() + return message + }, + toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgVoteWeightedResponseAminoMsg + ): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgVoteWeightedResponse + ): MsgVoteWeightedResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgVoteWeightedResponse', + value: MsgVoteWeightedResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgVoteWeightedResponseProtoMsg + ): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode(message.value) + }, + toProto(message: MsgVoteWeightedResponse): Uint8Array { + return MsgVoteWeightedResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgVoteWeightedResponse + ): MsgVoteWeightedResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeightedResponse', + value: MsgVoteWeightedResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgVoteWeightedResponse.typeUrl, + MsgVoteWeightedResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgVoteWeightedResponse.aminoType, + MsgVoteWeightedResponse.typeUrl +) +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: '', + amount: [] + } +} +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) + } + if (message.depositor !== '') { + writer.uint32(18).string(message.depositor) + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDeposit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.depositor = 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): MsgDeposit { + const message = createBaseMsgDeposit() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.depositor = object.depositor ?? '' + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + 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() : '0' + obj.depositor = message.depositor === '' ? undefined : message.depositor + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + return obj + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value) + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: 'cosmos-sdk/MsgDeposit', + value: MsgDeposit.toAmino(message) + } + }, + fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { + return MsgDeposit.decode(message.value) + }, + toProto(message: MsgDeposit): Uint8Array { + return MsgDeposit.encode(message).finish() + }, + toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', + value: MsgDeposit.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDepositResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDepositResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgDepositResponse { + const message = createBaseMsgDepositResponse() + return message + }, + fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { + const message = createBaseMsgDepositResponse() + return message + }, + toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { + return MsgDepositResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgDepositResponse', + value: MsgDepositResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value) + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish() + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1beta1.MsgDepositResponse', + value: MsgDepositResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDepositResponse.aminoType, + MsgDepositResponse.typeUrl +) diff --git a/src/proto/osmojs/cosmos/ics23/v1/proofs.ts b/src/proto/osmojs/cosmos/ics23/v1/proofs.ts new file mode 100644 index 0000000..b709f98 --- /dev/null +++ b/src/proto/osmojs/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,2731 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { bytesFromBase64, base64FromBytes, isSet } 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, + 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 +export const HashOpAmino = HashOp +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case 'NO_HASH': + return HashOp.NO_HASH + case 1: + case 'SHA256': + return HashOp.SHA256 + case 2: + case 'SHA512': + return HashOp.SHA512 + case 3: + case 'KECCAK256': + return HashOp.KECCAK256 + case 4: + case 'RIPEMD160': + return HashOp.RIPEMD160 + case 5: + case 'BITCOIN': + return HashOp.BITCOIN + 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: + return HashOp.UNRECOGNIZED + } +} +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return 'NO_HASH' + case HashOp.SHA256: + return 'SHA256' + case HashOp.SHA512: + return 'SHA512' + 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' + } +} +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1 +} +export const LengthOpSDKType = LengthOp +export const LengthOpAmino = LengthOp +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case 'NO_PREFIX': + return LengthOp.NO_PREFIX + case 1: + case 'VAR_PROTO': + return LengthOp.VAR_PROTO + case 2: + case 'VAR_RLP': + return LengthOp.VAR_RLP + case 3: + case 'FIXED32_BIG': + return LengthOp.FIXED32_BIG + case 4: + case 'FIXED32_LITTLE': + return LengthOp.FIXED32_LITTLE + case 5: + case 'FIXED64_BIG': + return LengthOp.FIXED64_BIG + case 6: + case 'FIXED64_LITTLE': + return LengthOp.FIXED64_LITTLE + case 7: + case 'REQUIRE_32_BYTES': + return LengthOp.REQUIRE_32_BYTES + case 8: + case 'REQUIRE_64_BYTES': + return LengthOp.REQUIRE_64_BYTES + case -1: + case 'UNRECOGNIZED': + default: + return LengthOp.UNRECOGNIZED + } +} +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return 'NO_PREFIX' + case LengthOp.VAR_PROTO: + return 'VAR_PROTO' + case LengthOp.VAR_RLP: + return 'VAR_RLP' + case LengthOp.FIXED32_BIG: + return 'FIXED32_BIG' + case LengthOp.FIXED32_LITTLE: + return 'FIXED32_LITTLE' + case LengthOp.FIXED64_BIG: + return 'FIXED64_BIG' + case LengthOp.FIXED64_LITTLE: + return 'FIXED64_LITTLE' + case LengthOp.REQUIRE_32_BYTES: + return 'REQUIRE_32_BYTES' + case LengthOp.REQUIRE_64_BYTES: + return 'REQUIRE_64_BYTES' + case LengthOp.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array + value: Uint8Array + leaf?: LeafOp + path: InnerOp[] +} +export interface ExistenceProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.ExistenceProof' + value: Uint8Array +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofAmino { + key?: string + value?: string + leaf?: LeafOpAmino + path?: InnerOpAmino[] +} +export interface ExistenceProofAminoMsg { + type: 'cosmos-sdk/ExistenceProof' + value: ExistenceProofAmino +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofSDKType { + key: Uint8Array + value: Uint8Array + leaf?: LeafOpSDKType + path: InnerOpSDKType[] +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array + left?: ExistenceProof + right?: ExistenceProof +} +export interface NonExistenceProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.NonExistenceProof' + value: Uint8Array +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string + left?: ExistenceProofAmino + right?: ExistenceProofAmino +} +export interface NonExistenceProofAminoMsg { + type: 'cosmos-sdk/NonExistenceProof' + value: NonExistenceProofAmino +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofSDKType { + key: Uint8Array + left?: ExistenceProofSDKType + right?: ExistenceProofSDKType +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof + nonexist?: NonExistenceProof + batch?: BatchProof + compressed?: CompressedBatchProof +} +export interface CommitmentProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.CommitmentProof' + value: Uint8Array +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofAmino { + exist?: ExistenceProofAmino + nonexist?: NonExistenceProofAmino + batch?: BatchProofAmino + compressed?: CompressedBatchProofAmino +} +export interface CommitmentProofAminoMsg { + type: 'cosmos-sdk/CommitmentProof' + value: CommitmentProofAmino +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofSDKType { + exist?: ExistenceProofSDKType + nonexist?: NonExistenceProofSDKType + batch?: BatchProofSDKType + compressed?: CompressedBatchProofSDKType +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp + prehashKey: HashOp + prehashValue: HashOp + length: LengthOp + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array +} +export interface LeafOpProtoMsg { + typeUrl: '/cosmos.ics23.v1.LeafOp' + value: Uint8Array +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpAmino { + 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?: string +} +export interface LeafOpAminoMsg { + type: 'cosmos-sdk/LeafOp' + value: LeafOpAmino +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpSDKType { + hash: HashOp + prehash_key: HashOp + prehash_value: HashOp + length: LengthOp + prefix: Uint8Array +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp + prefix: Uint8Array + suffix: Uint8Array +} +export interface InnerOpProtoMsg { + typeUrl: '/cosmos.ics23.v1.InnerOp' + value: Uint8Array +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpAmino { + hash?: HashOp + prefix?: string + suffix?: string +} +export interface InnerOpAminoMsg { + type: 'cosmos-sdk/InnerOp' + value: InnerOpAmino +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpSDKType { + hash: HashOp + prefix: Uint8Array + suffix: Uint8Array +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +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 + /** 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' + value: Uint8Array +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecAmino { + /** + * 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) + */ + 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 + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + 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' + value: ProofSpecAmino +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecSDKType { + 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 + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[] + childSize: number + minPrefixLength: number + maxPrefixLength: number + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp +} +export interface InnerSpecProtoMsg { + typeUrl: '/cosmos.ics23.v1.InnerSpec' + value: Uint8Array +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecAmino { + /** + * Child order is the ordering of the children node, must count from 0 + * 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 + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + empty_child?: string + /** hash is the algorithm that must be used for each InnerOp */ + hash?: HashOp +} +export interface InnerSpecAminoMsg { + type: 'cosmos-sdk/InnerSpec' + value: InnerSpecAmino +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecSDKType { + child_order: number[] + child_size: number + min_prefix_length: number + max_prefix_length: number + empty_child: Uint8Array + hash: HashOp +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[] +} +export interface BatchProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.BatchProof' + value: Uint8Array +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofAmino { + entries?: BatchEntryAmino[] +} +export interface BatchProofAminoMsg { + type: 'cosmos-sdk/BatchProof' + value: BatchProofAmino +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofSDKType { + entries: BatchEntrySDKType[] +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof + nonexist?: NonExistenceProof +} +export interface BatchEntryProtoMsg { + typeUrl: '/cosmos.ics23.v1.BatchEntry' + value: Uint8Array +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntryAmino { + exist?: ExistenceProofAmino + nonexist?: NonExistenceProofAmino +} +export interface BatchEntryAminoMsg { + type: 'cosmos-sdk/BatchEntry' + value: BatchEntryAmino +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntrySDKType { + exist?: ExistenceProofSDKType + nonexist?: NonExistenceProofSDKType +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[] + lookupInners: InnerOp[] +} +export interface CompressedBatchProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.CompressedBatchProof' + value: Uint8Array +} +export interface CompressedBatchProofAmino { + entries?: CompressedBatchEntryAmino[] + lookup_inners?: InnerOpAmino[] +} +export interface CompressedBatchProofAminoMsg { + type: 'cosmos-sdk/CompressedBatchProof' + value: CompressedBatchProofAmino +} +export interface CompressedBatchProofSDKType { + entries: CompressedBatchEntrySDKType[] + lookup_inners: InnerOpSDKType[] +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof + nonexist?: CompressedNonExistenceProof +} +export interface CompressedBatchEntryProtoMsg { + typeUrl: '/cosmos.ics23.v1.CompressedBatchEntry' + value: Uint8Array +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntryAmino { + exist?: CompressedExistenceProofAmino + nonexist?: CompressedNonExistenceProofAmino +} +export interface CompressedBatchEntryAminoMsg { + type: 'cosmos-sdk/CompressedBatchEntry' + value: CompressedBatchEntryAmino +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntrySDKType { + exist?: CompressedExistenceProofSDKType + nonexist?: CompressedNonExistenceProofSDKType +} +export interface CompressedExistenceProof { + key: Uint8Array + value: Uint8Array + leaf?: LeafOp + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[] +} +export interface CompressedExistenceProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.CompressedExistenceProof' + value: Uint8Array +} +export interface CompressedExistenceProofAmino { + key?: string + value?: string + leaf?: LeafOpAmino + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path?: number[] +} +export interface CompressedExistenceProofAminoMsg { + type: 'cosmos-sdk/CompressedExistenceProof' + value: CompressedExistenceProofAmino +} +export interface CompressedExistenceProofSDKType { + key: Uint8Array + value: Uint8Array + leaf?: LeafOpSDKType + path: number[] +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array + left?: CompressedExistenceProof + right?: CompressedExistenceProof +} +export interface CompressedNonExistenceProofProtoMsg { + typeUrl: '/cosmos.ics23.v1.CompressedNonExistenceProof' + value: Uint8Array +} +export interface CompressedNonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string + left?: CompressedExistenceProofAmino + right?: CompressedExistenceProofAmino +} +export interface CompressedNonExistenceProofAminoMsg { + type: 'cosmos-sdk/CompressedNonExistenceProof' + value: CompressedNonExistenceProofAmino +} +export interface CompressedNonExistenceProofSDKType { + key: Uint8Array + left?: CompressedExistenceProofSDKType + right?: CompressedExistenceProofSDKType +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + 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) + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value) + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim() + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExistenceProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExistenceProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.value = reader.bytes() + break + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()) + break + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ExistenceProof { + const message = createBaseExistenceProof() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.leaf = + object.leaf !== undefined && object.leaf !== null + ? LeafOp.fromPartial(object.leaf) + : undefined + message.path = object.path?.map((e) => InnerOp.fromPartial(e)) || [] + return message + }, + fromAmino(object: ExistenceProofAmino): ExistenceProof { + 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 ? 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)) + } else { + obj.path = message.path + } + return obj + }, + fromAminoMsg(object: ExistenceProofAminoMsg): ExistenceProof { + return ExistenceProof.fromAmino(object.value) + }, + toAminoMsg(message: ExistenceProof): ExistenceProofAminoMsg { + return { + type: 'cosmos-sdk/ExistenceProof', + value: ExistenceProof.toAmino(message) + } + }, + fromProtoMsg(message: ExistenceProofProtoMsg): ExistenceProof { + return ExistenceProof.decode(message.value) + }, + toProto(message: ExistenceProof): Uint8Array { + return ExistenceProof.encode(message).finish() + }, + toProtoMsg(message: ExistenceProof): ExistenceProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.ExistenceProof', + value: ExistenceProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ExistenceProof.typeUrl, ExistenceProof) +GlobalDecoderRegistry.registerAminoProtoMapping( + ExistenceProof.aminoType, + ExistenceProof.typeUrl +) +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + 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) + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim() + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): NonExistenceProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseNonExistenceProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()) + break + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): NonExistenceProof { + const message = createBaseNonExistenceProof() + message.key = object.key ?? new Uint8Array() + message.left = + object.left !== undefined && object.left !== null + ? ExistenceProof.fromPartial(object.left) + : undefined + message.right = + object.right !== undefined && object.right !== null + ? ExistenceProof.fromPartial(object.right) + : undefined + return message + }, + fromAmino(object: NonExistenceProofAmino): NonExistenceProof { + 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 ? base64FromBytes(message.key) : undefined + obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined + obj.right = message.right + ? ExistenceProof.toAmino(message.right) + : undefined + return obj + }, + fromAminoMsg(object: NonExistenceProofAminoMsg): NonExistenceProof { + return NonExistenceProof.fromAmino(object.value) + }, + toAminoMsg(message: NonExistenceProof): NonExistenceProofAminoMsg { + return { + type: 'cosmos-sdk/NonExistenceProof', + value: NonExistenceProof.toAmino(message) + } + }, + fromProtoMsg(message: NonExistenceProofProtoMsg): NonExistenceProof { + return NonExistenceProof.decode(message.value) + }, + toProto(message: NonExistenceProof): Uint8Array { + return NonExistenceProof.encode(message).finish() + }, + toProtoMsg(message: NonExistenceProof): NonExistenceProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.NonExistenceProof', + value: NonExistenceProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(NonExistenceProof.typeUrl, NonExistenceProof) +GlobalDecoderRegistry.registerAminoProtoMapping( + NonExistenceProof.aminoType, + NonExistenceProof.typeUrl +) +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + } +} +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() + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode( + message.nonexist, + writer.uint32(18).fork() + ).ldelim() + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim() + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode( + message.compressed, + writer.uint32(34).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitmentProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitmentProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()) + break + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()) + break + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()) + break + case 4: + message.compressed = CompressedBatchProof.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CommitmentProof { + const message = createBaseCommitmentProof() + message.exist = + object.exist !== undefined && object.exist !== null + ? ExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined + message.batch = + object.batch !== undefined && object.batch !== null + ? BatchProof.fromPartial(object.batch) + : undefined + message.compressed = + object.compressed !== undefined && object.compressed !== null + ? CompressedBatchProof.fromPartial(object.compressed) + : undefined + return message + }, + fromAmino(object: CommitmentProofAmino): CommitmentProof { + 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 = {} + obj.exist = message.exist + ? ExistenceProof.toAmino(message.exist) + : undefined + obj.nonexist = message.nonexist + ? NonExistenceProof.toAmino(message.nonexist) + : undefined + obj.batch = message.batch ? BatchProof.toAmino(message.batch) : undefined + obj.compressed = message.compressed + ? CompressedBatchProof.toAmino(message.compressed) + : undefined + return obj + }, + fromAminoMsg(object: CommitmentProofAminoMsg): CommitmentProof { + return CommitmentProof.fromAmino(object.value) + }, + toAminoMsg(message: CommitmentProof): CommitmentProofAminoMsg { + return { + type: 'cosmos-sdk/CommitmentProof', + value: CommitmentProof.toAmino(message) + } + }, + fromProtoMsg(message: CommitmentProofProtoMsg): CommitmentProof { + return CommitmentProof.decode(message.value) + }, + toProto(message: CommitmentProof): Uint8Array { + return CommitmentProof.encode(message).finish() + }, + toProtoMsg(message: CommitmentProof): CommitmentProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.CommitmentProof', + value: CommitmentProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CommitmentProof.typeUrl, CommitmentProof) +GlobalDecoderRegistry.registerAminoProtoMapping( + CommitmentProof.aminoType, + CommitmentProof.typeUrl +) +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + } +} +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) + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey) + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue) + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length) + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): LeafOp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLeafOp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any + break + case 2: + message.prehashKey = reader.int32() as any + break + case 3: + message.prehashValue = reader.int32() as any + break + case 4: + message.length = reader.int32() as any + break + case 5: + message.prefix = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): LeafOp { + const message = createBaseLeafOp() + message.hash = object.hash ?? 0 + message.prehashKey = object.prehashKey ?? 0 + message.prehashValue = object.prehashValue ?? 0 + message.length = object.length ?? 0 + message.prefix = object.prefix ?? new Uint8Array() + return message + }, + fromAmino(object: LeafOpAmino): LeafOp { + const message = createBaseLeafOp() + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = object.prehash_key + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = object.prehash_value + } + if (object.length !== undefined && object.length !== null) { + message.length = 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 === 0 ? undefined : message.hash + obj.prehash_key = message.prehashKey === 0 ? undefined : message.prehashKey + obj.prehash_value = + message.prehashValue === 0 ? undefined : message.prehashValue + obj.length = message.length === 0 ? undefined : message.length + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined + return obj + }, + fromAminoMsg(object: LeafOpAminoMsg): LeafOp { + return LeafOp.fromAmino(object.value) + }, + toAminoMsg(message: LeafOp): LeafOpAminoMsg { + return { + type: 'cosmos-sdk/LeafOp', + value: LeafOp.toAmino(message) + } + }, + fromProtoMsg(message: LeafOpProtoMsg): LeafOp { + return LeafOp.decode(message.value) + }, + toProto(message: LeafOp): Uint8Array { + return LeafOp.encode(message).finish() + }, + toProtoMsg(message: LeafOp): LeafOpProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.LeafOp', + value: LeafOp.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(LeafOp.typeUrl, LeafOp) +GlobalDecoderRegistry.registerAminoProtoMapping( + LeafOp.aminoType, + LeafOp.typeUrl +) +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + } +} +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) + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix) + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerOp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInnerOp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any + break + case 2: + message.prefix = reader.bytes() + break + case 3: + message.suffix = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): InnerOp { + const message = createBaseInnerOp() + message.hash = object.hash ?? 0 + message.prefix = object.prefix ?? new Uint8Array() + message.suffix = object.suffix ?? new Uint8Array() + return message + }, + fromAmino(object: InnerOpAmino): InnerOp { + const message = createBaseInnerOp() + if (object.hash !== undefined && object.hash !== null) { + message.hash = 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 === 0 ? undefined : message.hash + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined + return obj + }, + fromAminoMsg(object: InnerOpAminoMsg): InnerOp { + return InnerOp.fromAmino(object.value) + }, + toAminoMsg(message: InnerOp): InnerOpAminoMsg { + return { + type: 'cosmos-sdk/InnerOp', + value: InnerOp.toAmino(message) + } + }, + fromProtoMsg(message: InnerOpProtoMsg): InnerOp { + return InnerOp.decode(message.value) + }, + toProto(message: InnerOp): Uint8Array { + return InnerOp.encode(message).finish() + }, + toProtoMsg(message: InnerOp): InnerOpProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.InnerOp', + value: InnerOp.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(InnerOp.typeUrl, InnerOp) +GlobalDecoderRegistry.registerAminoProtoMapping( + InnerOp.aminoType, + InnerOp.typeUrl +) +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 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() + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim() + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofSpec() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()) + break + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()) + break + case 3: + message.maxDepth = reader.int32() + break + case 4: + message.minDepth = reader.int32() + break + case 5: + message.prehashKeyBeforeComparison = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + obj.leaf_spec = message.leafSpec + ? LeafOp.toAmino(message.leafSpec) + : undefined + obj.inner_spec = message.innerSpec + ? InnerSpec.toAmino(message.innerSpec) + : undefined + obj.max_depth = message.maxDepth === 0 ? undefined : message.maxDepth + obj.min_depth = message.minDepth === 0 ? undefined : message.minDepth + obj.prehash_key_before_comparison = + message.prehashKeyBeforeComparison === false + ? undefined + : message.prehashKeyBeforeComparison + return obj + }, + fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { + return ProofSpec.fromAmino(object.value) + }, + toAminoMsg(message: ProofSpec): ProofSpecAminoMsg { + return { + type: 'cosmos-sdk/ProofSpec', + value: ProofSpec.toAmino(message) + } + }, + fromProtoMsg(message: ProofSpecProtoMsg): ProofSpec { + return ProofSpec.decode(message.value) + }, + toProto(message: ProofSpec): Uint8Array { + return ProofSpec.encode(message).finish() + }, + toProtoMsg(message: ProofSpec): ProofSpecProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.ProofSpec', + value: ProofSpec.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ProofSpec.typeUrl, ProofSpec) +GlobalDecoderRegistry.registerAminoProtoMapping( + ProofSpec.aminoType, + ProofSpec.typeUrl +) +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + } +} +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) { + writer.int32(v) + } + writer.ldelim() + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize) + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength) + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength) + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild) + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerSpec { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInnerSpec() + 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.childOrder.push(reader.int32()) + } + } else { + message.childOrder.push(reader.int32()) + } + break + case 2: + message.childSize = reader.int32() + break + case 3: + message.minPrefixLength = reader.int32() + break + case 4: + message.maxPrefixLength = reader.int32() + break + case 5: + message.emptyChild = reader.bytes() + break + case 6: + message.hash = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): InnerSpec { + const message = createBaseInnerSpec() + message.childOrder = object.childOrder?.map((e) => e) || [] + message.childSize = object.childSize ?? 0 + message.minPrefixLength = object.minPrefixLength ?? 0 + message.maxPrefixLength = object.maxPrefixLength ?? 0 + message.emptyChild = object.emptyChild ?? new Uint8Array() + message.hash = object.hash ?? 0 + return message + }, + fromAmino(object: InnerSpecAmino): InnerSpec { + 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 = object.hash + } + return message + }, + toAmino(message: InnerSpec): InnerSpecAmino { + const obj: any = {} + if (message.childOrder) { + obj.child_order = message.childOrder.map((e) => e) + } else { + obj.child_order = message.childOrder + } + obj.child_size = message.childSize === 0 ? undefined : message.childSize + obj.min_prefix_length = + message.minPrefixLength === 0 ? undefined : message.minPrefixLength + obj.max_prefix_length = + message.maxPrefixLength === 0 ? undefined : message.maxPrefixLength + obj.empty_child = message.emptyChild + ? base64FromBytes(message.emptyChild) + : undefined + obj.hash = message.hash === 0 ? undefined : message.hash + return obj + }, + fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { + return InnerSpec.fromAmino(object.value) + }, + toAminoMsg(message: InnerSpec): InnerSpecAminoMsg { + return { + type: 'cosmos-sdk/InnerSpec', + value: InnerSpec.toAmino(message) + } + }, + fromProtoMsg(message: InnerSpecProtoMsg): InnerSpec { + return InnerSpec.decode(message.value) + }, + toProto(message: InnerSpec): Uint8Array { + return InnerSpec.encode(message).finish() + }, + toProtoMsg(message: InnerSpec): InnerSpecProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.InnerSpec', + value: InnerSpec.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(InnerSpec.typeUrl, InnerSpec) +GlobalDecoderRegistry.registerAminoProtoMapping( + InnerSpec.aminoType, + InnerSpec.typeUrl +) +function createBaseBatchProof(): BatchProof { + return { + entries: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBatchProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BatchProof { + const message = createBaseBatchProof() + message.entries = + object.entries?.map((e) => BatchEntry.fromPartial(e)) || [] + return message + }, + fromAmino(object: BatchProofAmino): BatchProof { + const message = createBaseBatchProof() + message.entries = object.entries?.map((e) => BatchEntry.fromAmino(e)) || [] + return message + }, + toAmino(message: BatchProof): BatchProofAmino { + const obj: any = {} + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? BatchEntry.toAmino(e) : undefined + ) + } else { + obj.entries = message.entries + } + return obj + }, + fromAminoMsg(object: BatchProofAminoMsg): BatchProof { + return BatchProof.fromAmino(object.value) + }, + toAminoMsg(message: BatchProof): BatchProofAminoMsg { + return { + type: 'cosmos-sdk/BatchProof', + value: BatchProof.toAmino(message) + } + }, + fromProtoMsg(message: BatchProofProtoMsg): BatchProof { + return BatchProof.decode(message.value) + }, + toProto(message: BatchProof): Uint8Array { + return BatchProof.encode(message).finish() + }, + toProtoMsg(message: BatchProof): BatchProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.BatchProof', + value: BatchProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BatchProof.typeUrl, BatchProof) +GlobalDecoderRegistry.registerAminoProtoMapping( + BatchProof.aminoType, + BatchProof.typeUrl +) +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + } +} +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() + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode( + message.nonexist, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBatchEntry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()) + break + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BatchEntry { + const message = createBaseBatchEntry() + message.exist = + object.exist !== undefined && object.exist !== null + ? ExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? NonExistenceProof.fromPartial(object.nonexist) + : undefined + return message + }, + fromAmino(object: BatchEntryAmino): BatchEntry { + 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 = {} + obj.exist = message.exist + ? ExistenceProof.toAmino(message.exist) + : undefined + obj.nonexist = message.nonexist + ? NonExistenceProof.toAmino(message.nonexist) + : undefined + return obj + }, + fromAminoMsg(object: BatchEntryAminoMsg): BatchEntry { + return BatchEntry.fromAmino(object.value) + }, + toAminoMsg(message: BatchEntry): BatchEntryAminoMsg { + return { + type: 'cosmos-sdk/BatchEntry', + value: BatchEntry.toAmino(message) + } + }, + fromProtoMsg(message: BatchEntryProtoMsg): BatchEntry { + return BatchEntry.decode(message.value) + }, + toProto(message: BatchEntry): Uint8Array { + return BatchEntry.encode(message).finish() + }, + toProtoMsg(message: BatchEntry): BatchEntryProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.BatchEntry', + value: BatchEntry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BatchEntry.typeUrl, BatchEntry) +GlobalDecoderRegistry.registerAminoProtoMapping( + BatchEntry.aminoType, + BatchEntry.typeUrl +) +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + } +} +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() + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CompressedBatchProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedBatchProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.entries.push( + CompressedBatchEntry.decode(reader, reader.uint32()) + ) + break + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CompressedBatchProof { + const message = createBaseCompressedBatchProof() + message.entries = + object.entries?.map((e) => CompressedBatchEntry.fromPartial(e)) || [] + message.lookupInners = + object.lookupInners?.map((e) => InnerOp.fromPartial(e)) || [] + return message + }, + fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { + 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 = {} + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? CompressedBatchEntry.toAmino(e) : undefined + ) + } else { + obj.entries = message.entries + } + if (message.lookupInners) { + obj.lookup_inners = message.lookupInners.map((e) => + e ? InnerOp.toAmino(e) : undefined + ) + } else { + obj.lookup_inners = message.lookupInners + } + return obj + }, + fromAminoMsg(object: CompressedBatchProofAminoMsg): CompressedBatchProof { + return CompressedBatchProof.fromAmino(object.value) + }, + toAminoMsg(message: CompressedBatchProof): CompressedBatchProofAminoMsg { + return { + type: 'cosmos-sdk/CompressedBatchProof', + value: CompressedBatchProof.toAmino(message) + } + }, + fromProtoMsg(message: CompressedBatchProofProtoMsg): CompressedBatchProof { + return CompressedBatchProof.decode(message.value) + }, + toProto(message: CompressedBatchProof): Uint8Array { + return CompressedBatchProof.encode(message).finish() + }, + toProtoMsg(message: CompressedBatchProof): CompressedBatchProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.CompressedBatchProof', + value: CompressedBatchProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CompressedBatchProof.typeUrl, + CompressedBatchProof +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CompressedBatchProof.aminoType, + CompressedBatchProof.typeUrl +) +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + } +} +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() + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode( + message.nonexist, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CompressedBatchEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedBatchEntry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode( + reader, + reader.uint32() + ) + break + case 2: + message.nonexist = CompressedNonExistenceProof.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry() + message.exist = + object.exist !== undefined && object.exist !== null + ? CompressedExistenceProof.fromPartial(object.exist) + : undefined + message.nonexist = + object.nonexist !== undefined && object.nonexist !== null + ? CompressedNonExistenceProof.fromPartial(object.nonexist) + : undefined + return message + }, + fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { + 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 = {} + obj.exist = message.exist + ? CompressedExistenceProof.toAmino(message.exist) + : undefined + obj.nonexist = message.nonexist + ? CompressedNonExistenceProof.toAmino(message.nonexist) + : undefined + return obj + }, + fromAminoMsg(object: CompressedBatchEntryAminoMsg): CompressedBatchEntry { + return CompressedBatchEntry.fromAmino(object.value) + }, + toAminoMsg(message: CompressedBatchEntry): CompressedBatchEntryAminoMsg { + return { + type: 'cosmos-sdk/CompressedBatchEntry', + value: CompressedBatchEntry.toAmino(message) + } + }, + fromProtoMsg(message: CompressedBatchEntryProtoMsg): CompressedBatchEntry { + return CompressedBatchEntry.decode(message.value) + }, + toProto(message: CompressedBatchEntry): Uint8Array { + return CompressedBatchEntry.encode(message).finish() + }, + toProtoMsg(message: CompressedBatchEntry): CompressedBatchEntryProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.CompressedBatchEntry', + value: CompressedBatchEntry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CompressedBatchEntry.typeUrl, + CompressedBatchEntry +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CompressedBatchEntry.aminoType, + CompressedBatchEntry.typeUrl +) +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + 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) + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value) + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim() + } + writer.uint32(34).fork() + for (const v of message.path) { + writer.int32(v) + } + writer.ldelim() + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CompressedExistenceProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedExistenceProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.value = reader.bytes() + break + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()) + break + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.path.push(reader.int32()) + } + } else { + message.path.push(reader.int32()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.leaf = + object.leaf !== undefined && object.leaf !== null + ? LeafOp.fromPartial(object.leaf) + : undefined + message.path = object.path?.map((e) => e) || [] + return message + }, + fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { + 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 ? 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) + } else { + obj.path = message.path + } + return obj + }, + fromAminoMsg( + object: CompressedExistenceProofAminoMsg + ): CompressedExistenceProof { + return CompressedExistenceProof.fromAmino(object.value) + }, + toAminoMsg( + message: CompressedExistenceProof + ): CompressedExistenceProofAminoMsg { + return { + type: 'cosmos-sdk/CompressedExistenceProof', + value: CompressedExistenceProof.toAmino(message) + } + }, + fromProtoMsg( + message: CompressedExistenceProofProtoMsg + ): CompressedExistenceProof { + return CompressedExistenceProof.decode(message.value) + }, + toProto(message: CompressedExistenceProof): Uint8Array { + return CompressedExistenceProof.encode(message).finish() + }, + toProtoMsg( + message: CompressedExistenceProof + ): CompressedExistenceProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.CompressedExistenceProof', + value: CompressedExistenceProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CompressedExistenceProof.typeUrl, + CompressedExistenceProof +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CompressedExistenceProof.aminoType, + CompressedExistenceProof.typeUrl +) +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + 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) + } + if (message.left !== undefined) { + CompressedExistenceProof.encode( + message.left, + writer.uint32(18).fork() + ).ldelim() + } + if (message.right !== undefined) { + CompressedExistenceProof.encode( + message.right, + writer.uint32(26).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CompressedNonExistenceProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCompressedNonExistenceProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.left = CompressedExistenceProof.decode( + reader, + reader.uint32() + ) + break + case 3: + message.right = CompressedExistenceProof.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof() + message.key = object.key ?? new Uint8Array() + message.left = + object.left !== undefined && object.left !== null + ? CompressedExistenceProof.fromPartial(object.left) + : undefined + message.right = + object.right !== undefined && object.right !== null + ? CompressedExistenceProof.fromPartial(object.right) + : undefined + return message + }, + fromAmino( + object: CompressedNonExistenceProofAmino + ): CompressedNonExistenceProof { + 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 ? base64FromBytes(message.key) : undefined + obj.left = message.left + ? CompressedExistenceProof.toAmino(message.left) + : undefined + obj.right = message.right + ? CompressedExistenceProof.toAmino(message.right) + : undefined + return obj + }, + fromAminoMsg( + object: CompressedNonExistenceProofAminoMsg + ): CompressedNonExistenceProof { + return CompressedNonExistenceProof.fromAmino(object.value) + }, + toAminoMsg( + message: CompressedNonExistenceProof + ): CompressedNonExistenceProofAminoMsg { + return { + type: 'cosmos-sdk/CompressedNonExistenceProof', + value: CompressedNonExistenceProof.toAmino(message) + } + }, + fromProtoMsg( + message: CompressedNonExistenceProofProtoMsg + ): CompressedNonExistenceProof { + return CompressedNonExistenceProof.decode(message.value) + }, + toProto(message: CompressedNonExistenceProof): Uint8Array { + return CompressedNonExistenceProof.encode(message).finish() + }, + toProtoMsg( + message: CompressedNonExistenceProof + ): CompressedNonExistenceProofProtoMsg { + return { + typeUrl: '/cosmos.ics23.v1.CompressedNonExistenceProof', + value: CompressedNonExistenceProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CompressedNonExistenceProof.typeUrl, + CompressedNonExistenceProof +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CompressedNonExistenceProof.aminoType, + CompressedNonExistenceProof.typeUrl +) diff --git a/src/proto/osmojs/cosmos/staking/v1beta1/authz.ts b/src/proto/osmojs/cosmos/staking/v1beta1/authz.ts new file mode 100644 index 0000000..70147d8 --- /dev/null +++ b/src/proto/osmojs/cosmos/staking/v1beta1/authz.ts @@ -0,0 +1,441 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { isSet } from '../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * AuthorizationType defines the type of staking module authorization type + * + * Since: cosmos-sdk 0.43 + */ +export enum AuthorizationType { + /** AUTHORIZATION_TYPE_UNSPECIFIED - AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type */ + AUTHORIZATION_TYPE_UNSPECIFIED = 0, + /** AUTHORIZATION_TYPE_DELEGATE - AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate */ + AUTHORIZATION_TYPE_DELEGATE = 1, + /** AUTHORIZATION_TYPE_UNDELEGATE - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate */ + AUTHORIZATION_TYPE_UNDELEGATE = 2, + /** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */ + AUTHORIZATION_TYPE_REDELEGATE = 3, + UNRECOGNIZED = -1 +} +export const AuthorizationTypeSDKType = AuthorizationType +export const AuthorizationTypeAmino = AuthorizationType +export function authorizationTypeFromJSON(object: any): AuthorizationType { + switch (object) { + case 0: + case 'AUTHORIZATION_TYPE_UNSPECIFIED': + return AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED + case 1: + case 'AUTHORIZATION_TYPE_DELEGATE': + return AuthorizationType.AUTHORIZATION_TYPE_DELEGATE + case 2: + case 'AUTHORIZATION_TYPE_UNDELEGATE': + return AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE + case 3: + case 'AUTHORIZATION_TYPE_REDELEGATE': + return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE + case -1: + case 'UNRECOGNIZED': + default: + return AuthorizationType.UNRECOGNIZED + } +} +export function authorizationTypeToJSON(object: AuthorizationType): string { + switch (object) { + case AuthorizationType.AUTHORIZATION_TYPE_UNSPECIFIED: + return 'AUTHORIZATION_TYPE_UNSPECIFIED' + case AuthorizationType.AUTHORIZATION_TYPE_DELEGATE: + return 'AUTHORIZATION_TYPE_DELEGATE' + case AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE: + return 'AUTHORIZATION_TYPE_UNDELEGATE' + case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: + return 'AUTHORIZATION_TYPE_REDELEGATE' + case AuthorizationType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorization { + $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 + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allowList?: StakeAuthorization_Validators + /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ + denyList?: StakeAuthorization_Validators + /** authorization_type defines one of AuthorizationType. */ + authorizationType: AuthorizationType +} +export interface StakeAuthorizationProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization' + value: Uint8Array +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationAmino { + /** + * 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. + */ + max_tokens?: CoinAmino + /** + * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + * account. + */ + allow_list?: StakeAuthorization_ValidatorsAmino + /** 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 +} +export interface StakeAuthorizationAminoMsg { + type: 'cosmos-sdk/StakeAuthorization' + value: StakeAuthorizationAmino +} +/** + * StakeAuthorization defines authorization for delegate/undelegate/redelegate. + * + * Since: cosmos-sdk 0.43 + */ +export interface StakeAuthorizationSDKType { + $typeUrl?: '/cosmos.staking.v1beta1.StakeAuthorization' + max_tokens?: CoinSDKType + allow_list?: StakeAuthorization_ValidatorsSDKType + deny_list?: StakeAuthorization_ValidatorsSDKType + authorization_type: AuthorizationType +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_Validators { + address: string[] +} +export interface StakeAuthorization_ValidatorsProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Validators' + value: Uint8Array +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsAmino { + address?: string[] +} +export interface StakeAuthorization_ValidatorsAminoMsg { + type: 'cosmos-sdk/Validators' + value: StakeAuthorization_ValidatorsAmino +} +/** Validators defines list of validator addresses. */ +export interface StakeAuthorization_ValidatorsSDKType { + address: string[] +} +function createBaseStakeAuthorization(): StakeAuthorization { + return { + $typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization', + maxTokens: undefined, + allowList: undefined, + denyList: undefined, + authorizationType: 0 + } +} +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() + } + if (message.allowList !== undefined) { + StakeAuthorization_Validators.encode( + message.allowList, + writer.uint32(18).fork() + ).ldelim() + } + if (message.denyList !== undefined) { + StakeAuthorization_Validators.encode( + message.denyList, + writer.uint32(26).fork() + ).ldelim() + } + if (message.authorizationType !== 0) { + writer.uint32(32).int32(message.authorizationType) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): StakeAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStakeAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.maxTokens = Coin.decode(reader, reader.uint32()) + break + case 2: + message.allowList = StakeAuthorization_Validators.decode( + reader, + reader.uint32() + ) + break + case 3: + message.denyList = StakeAuthorization_Validators.decode( + reader, + reader.uint32() + ) + break + case 4: + message.authorizationType = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): StakeAuthorization { + const message = createBaseStakeAuthorization() + message.maxTokens = + object.maxTokens !== undefined && object.maxTokens !== null + ? Coin.fromPartial(object.maxTokens) + : undefined + message.allowList = + object.allowList !== undefined && object.allowList !== null + ? StakeAuthorization_Validators.fromPartial(object.allowList) + : undefined + message.denyList = + object.denyList !== undefined && object.denyList !== null + ? StakeAuthorization_Validators.fromPartial(object.denyList) + : undefined + message.authorizationType = object.authorizationType ?? 0 + return message + }, + fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { + 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 = 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 === 0 ? undefined : message.authorizationType + return obj + }, + fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { + return StakeAuthorization.fromAmino(object.value) + }, + toAminoMsg(message: StakeAuthorization): StakeAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/StakeAuthorization', + value: StakeAuthorization.toAmino(message) + } + }, + fromProtoMsg(message: StakeAuthorizationProtoMsg): StakeAuthorization { + return StakeAuthorization.decode(message.value) + }, + toProto(message: StakeAuthorization): Uint8Array { + return StakeAuthorization.encode(message).finish() + }, + toProtoMsg(message: StakeAuthorization): StakeAuthorizationProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization', + value: StakeAuthorization.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(StakeAuthorization.typeUrl, StakeAuthorization) +GlobalDecoderRegistry.registerAminoProtoMapping( + StakeAuthorization.aminoType, + StakeAuthorization.typeUrl +) +function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validators { + return { + address: [] + } +} +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!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): StakeAuthorization_Validators { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStakeAuthorization_Validators() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): StakeAuthorization_Validators { + const message = createBaseStakeAuthorization_Validators() + message.address = object.address?.map((e) => e) || [] + return message + }, + fromAmino( + object: StakeAuthorization_ValidatorsAmino + ): StakeAuthorization_Validators { + const message = createBaseStakeAuthorization_Validators() + message.address = object.address?.map((e) => e) || [] + return message + }, + toAmino( + message: StakeAuthorization_Validators + ): StakeAuthorization_ValidatorsAmino { + const obj: any = {} + if (message.address) { + obj.address = message.address.map((e) => e) + } else { + obj.address = message.address + } + return obj + }, + fromAminoMsg( + object: StakeAuthorization_ValidatorsAminoMsg + ): StakeAuthorization_Validators { + return StakeAuthorization_Validators.fromAmino(object.value) + }, + toAminoMsg( + message: StakeAuthorization_Validators + ): StakeAuthorization_ValidatorsAminoMsg { + return { + type: 'cosmos-sdk/Validators', + value: StakeAuthorization_Validators.toAmino(message) + } + }, + fromProtoMsg( + message: StakeAuthorization_ValidatorsProtoMsg + ): StakeAuthorization_Validators { + return StakeAuthorization_Validators.decode(message.value) + }, + toProto(message: StakeAuthorization_Validators): Uint8Array { + return StakeAuthorization_Validators.encode(message).finish() + }, + toProtoMsg( + message: StakeAuthorization_Validators + ): StakeAuthorization_ValidatorsProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Validators', + value: StakeAuthorization_Validators.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + StakeAuthorization_Validators.typeUrl, + StakeAuthorization_Validators +) +GlobalDecoderRegistry.registerAminoProtoMapping( + StakeAuthorization_Validators.aminoType, + StakeAuthorization_Validators.typeUrl +) diff --git a/src/proto/osmojs/cosmos/staking/v1beta1/staking.ts b/src/proto/osmojs/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 0000000..2bb3db0 --- /dev/null +++ b/src/proto/osmojs/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,4236 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Header, + HeaderAmino, + HeaderSDKType +} from '../../../tendermint/types/types' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/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 { GlobalDecoderRegistry } from '../../../registry' +import { Decimal } from '@cosmjs/math' +import { toTimestamp, fromTimestamp, isSet } from '../../../../helpers' +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. */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1 +} +export const BondStatusSDKType = BondStatus +export const BondStatusAmino = BondStatus +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case 'BOND_STATUS_UNSPECIFIED': + return BondStatus.BOND_STATUS_UNSPECIFIED + case 1: + case 'BOND_STATUS_UNBONDED': + return BondStatus.BOND_STATUS_UNBONDED + case 2: + case 'BOND_STATUS_UNBONDING': + return BondStatus.BOND_STATUS_UNBONDING + case 3: + case 'BOND_STATUS_BONDED': + return BondStatus.BOND_STATUS_BONDED + case -1: + case 'UNRECOGNIZED': + default: + return BondStatus.UNRECOGNIZED + } +} +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return 'BOND_STATUS_UNSPECIFIED' + case BondStatus.BOND_STATUS_UNBONDED: + return 'BOND_STATUS_UNBONDED' + case BondStatus.BOND_STATUS_UNBONDING: + return 'BOND_STATUS_UNBONDING' + case BondStatus.BOND_STATUS_BONDED: + return 'BOND_STATUS_BONDED' + case BondStatus.UNRECOGNIZED: + default: + 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 + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header: Header + valset: Validator[] +} +export interface HistoricalInfoProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.HistoricalInfo' + value: Uint8Array +} +/** + * 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 + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoAmino { + header: HeaderAmino + valset: ValidatorAmino[] +} +export interface HistoricalInfoAminoMsg { + type: 'cosmos-sdk/HistoricalInfo' + value: HistoricalInfoAmino +} +/** + * 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 + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfoSDKType { + header: HeaderSDKType + valset: ValidatorSDKType[] +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + maxRate: string + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + maxChangeRate: string +} +export interface CommissionRatesProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.CommissionRates' + value: Uint8Array +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesAmino { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate?: string + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + max_rate?: string + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + max_change_rate?: string +} +export interface CommissionRatesAminoMsg { + type: 'cosmos-sdk/CommissionRates' + value: CommissionRatesAmino +} +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRatesSDKType { + rate: string + max_rate: string + max_change_rate: string +} +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commissionRates: CommissionRates + /** update_time is the last time the commission rate was changed. */ + updateTime: Date +} +export interface CommissionProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Commission' + value: Uint8Array +} +/** 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 + /** update_time is the last time the commission rate was changed. */ + update_time: string +} +export interface CommissionAminoMsg { + type: 'cosmos-sdk/Commission' + value: CommissionAmino +} +/** Commission defines commission parameters for a given validator. */ +export interface CommissionSDKType { + commission_rates: CommissionRatesSDKType + update_time: Date +} +/** Description defines a validator description. */ +export interface Description { + /** moniker defines a human-readable name for the validator. */ + moniker: string + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string + /** website defines an optional website link. */ + website: string + /** security_contact defines an optional email for security contact. */ + securityContact: string + /** details define other optional details. */ + details: string +} +export interface DescriptionProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Description' + value: Uint8Array +} +/** Description defines a validator description. */ +export interface DescriptionAmino { + /** moniker defines a human-readable name for the validator. */ + moniker?: string + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity?: string + /** website defines an optional website link. */ + website?: string + /** security_contact defines an optional email for security contact. */ + security_contact?: string + /** details define other optional details. */ + details?: string +} +export interface DescriptionAminoMsg { + type: 'cosmos-sdk/Description' + value: DescriptionAmino +} +/** Description defines a validator description. */ +export interface DescriptionSDKType { + moniker: string + identity: string + website: string + security_contact: string + details: string +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +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 + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegatorShares: string + /** description defines the description terms for the validator. */ + description: Description + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbondingHeight: bigint + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbondingTime: Date + /** commission defines the commission parameters. */ + commission: Commission + /** + * 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' + value: Uint8Array +} +export type ValidatorEncoded = Omit & { + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensusPubkey?: + | AnyProtoMsg + | undefined +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorAmino { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + 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 + /** status is the validator status (bonded/unbonding/unbonded). */ + status?: BondStatus + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens?: string + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegator_shares?: string + /** description defines the description terms for the validator. */ + description: DescriptionAmino + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbonding_height?: string + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbonding_time: string + /** commission defines the commission parameters. */ + 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' + value: ValidatorAmino +} +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface ValidatorSDKType { + operator_address: string + consensus_pubkey?: AnySDKType | undefined + jailed: boolean + status: BondStatus + tokens: string + delegator_shares: string + description: DescriptionSDKType + unbonding_height: bigint + 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 { + addresses: string[] +} +export interface ValAddressesProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.ValAddresses' + value: Uint8Array +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesAmino { + addresses?: string[] +} +export interface ValAddressesAminoMsg { + type: 'cosmos-sdk/ValAddresses' + value: ValAddressesAmino +} +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddressesSDKType { + addresses: string[] +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPair { + delegatorAddress: string + validatorAddress: string +} +export interface DVPairProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.DVPair' + value: Uint8Array +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPairAmino { + delegator_address?: string + validator_address?: string +} +export interface DVPairAminoMsg { + type: 'cosmos-sdk/DVPair' + value: DVPairAmino +} +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPairSDKType { + delegator_address: string + validator_address: string +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[] +} +export interface DVPairsProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.DVPairs' + value: Uint8Array +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsAmino { + pairs: DVPairAmino[] +} +export interface DVPairsAminoMsg { + type: 'cosmos-sdk/DVPairs' + value: DVPairsAmino +} +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairsSDKType { + pairs: DVPairSDKType[] +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string + validatorSrcAddress: string + validatorDstAddress: string +} +export interface DVVTripletProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.DVVTriplet' + value: Uint8Array +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletAmino { + delegator_address?: string + validator_src_address?: string + validator_dst_address?: string +} +export interface DVVTripletAminoMsg { + type: 'cosmos-sdk/DVVTriplet' + value: DVVTripletAmino +} +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTripletSDKType { + delegator_address: string + validator_src_address: string + validator_dst_address: string +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[] +} +export interface DVVTripletsProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.DVVTriplets' + value: Uint8Array +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsAmino { + triplets: DVVTripletAmino[] +} +export interface DVVTripletsAminoMsg { + type: 'cosmos-sdk/DVVTriplets' + value: DVVTripletsAmino +} +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTripletsSDKType { + triplets: DVVTripletSDKType[] +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface Delegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string + /** shares define the delegation shares received. */ + shares: string +} +export interface DelegationProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Delegation' + value: Uint8Array +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface DelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string + /** shares define the delegation shares received. */ + shares?: string +} +export interface DelegationAminoMsg { + type: 'cosmos-sdk/Delegation' + value: DelegationAmino +} +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface DelegationSDKType { + delegator_address: string + validator_address: string + shares: string +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntry[] +} +export interface UnbondingDelegationProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.UnbondingDelegation' + value: Uint8Array +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntryAmino[] +} +export interface UnbondingDelegationAminoMsg { + type: 'cosmos-sdk/UnbondingDelegation' + value: UnbondingDelegationAmino +} +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegationSDKType { + delegator_address: string + validator_address: string + entries: UnbondingDelegationEntrySDKType[] +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint + /** completion_time is the unix time for unbonding completion. */ + completionTime: Date + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + 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' + value: Uint8Array +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntryAmino { + /** creation_height is the height which the unbonding took place. */ + creation_height?: string + /** completion_time is the unix time for unbonding completion. */ + completion_time: string + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initial_balance?: string + /** balance defines the tokens to receive at completion. */ + 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' + value: UnbondingDelegationEntryAmino +} +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntrySDKType { + creation_height: bigint + 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 { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: bigint + /** completion_time defines the unix time for redelegation completion. */ + completionTime: Date + /** initial_balance defines the initial balance when redelegation started. */ + 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' + value: Uint8Array +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntryAmino { + /** creation_height defines the height which the redelegation took place. */ + creation_height?: string + /** completion_time defines the unix time for redelegation completion. */ + completion_time: string + /** initial_balance defines the initial balance when redelegation started. */ + initial_balance?: string + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + 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' + value: RedelegationEntryAmino +} +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntrySDKType { + creation_height: bigint + 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 + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string + /** validator_src_address is the validator redelegation source operator address. */ + validatorSrcAddress: string + /** validator_dst_address is the validator redelegation destination operator address. */ + validatorDstAddress: string + /** entries are the redelegation entries. */ + entries: RedelegationEntry[] +} +export interface RedelegationProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Redelegation' + value: Uint8Array +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationAmino { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string + /** validator_src_address is the validator redelegation source operator address. */ + validator_src_address?: string + /** validator_dst_address is the validator redelegation destination operator address. */ + validator_dst_address?: string + /** entries are the redelegation entries. */ + entries: RedelegationEntryAmino[] +} +export interface RedelegationAminoMsg { + type: 'cosmos-sdk/Redelegation' + value: RedelegationAmino +} +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface RedelegationSDKType { + delegator_address: string + validator_src_address: string + validator_dst_address: string + entries: RedelegationEntrySDKType[] +} +/** Params defines the parameters for the x/staking module. */ +export interface Params { + /** unbonding_time is the time duration of unbonding. */ + unbondingTime: Duration + /** max_validators is the maximum number of validators. */ + maxValidators: number + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + maxEntries: number + /** historical_entries is the number of historical entries to persist. */ + historicalEntries: number + /** bond_denom defines the bondable coin denomination. */ + bondDenom: string + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + minCommissionRate: string +} +export interface ParamsProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Params' + value: Uint8Array +} +/** Params defines the parameters for the x/staking module. */ +export interface ParamsAmino { + /** unbonding_time is the time duration of unbonding. */ + unbonding_time: DurationAmino + /** max_validators is the maximum number of validators. */ + max_validators?: number + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + max_entries?: number + /** historical_entries is the number of historical entries to persist. */ + historical_entries?: number + /** bond_denom defines the bondable coin denomination. */ + bond_denom?: string + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + min_commission_rate?: string +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/x/staking/Params' + value: ParamsAmino +} +/** Params defines the parameters for the x/staking module. */ +export interface ParamsSDKType { + unbonding_time: DurationSDKType + max_validators: number + max_entries: number + historical_entries: number + bond_denom: string + min_commission_rate: string +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation: Delegation + balance: Coin +} +export interface DelegationResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.DelegationResponse' + value: Uint8Array +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseAmino { + delegation: DelegationAmino + balance: CoinAmino +} +export interface DelegationResponseAminoMsg { + type: 'cosmos-sdk/DelegationResponse' + value: DelegationResponseAmino +} +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponseSDKType { + delegation: DelegationSDKType + balance: CoinSDKType +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry: RedelegationEntry + balance: string +} +export interface RedelegationEntryResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.RedelegationEntryResponse' + value: Uint8Array +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseAmino { + redelegation_entry: RedelegationEntryAmino + balance?: string +} +export interface RedelegationEntryResponseAminoMsg { + type: 'cosmos-sdk/RedelegationEntryResponse' + value: RedelegationEntryResponseAmino +} +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponseSDKType { + redelegation_entry: RedelegationEntrySDKType + balance: string +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation: Redelegation + entries: RedelegationEntryResponse[] +} +export interface RedelegationResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.RedelegationResponse' + value: Uint8Array +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseAmino { + redelegation: RedelegationAmino + entries: RedelegationEntryResponseAmino[] +} +export interface RedelegationResponseAminoMsg { + type: 'cosmos-sdk/RedelegationResponse' + value: RedelegationResponseAmino +} +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponseSDKType { + redelegation: RedelegationSDKType + entries: RedelegationEntryResponseSDKType[] +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string + bondedTokens: string +} +export interface PoolProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.Pool' + value: Uint8Array +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface PoolAmino { + not_bonded_tokens: string + bonded_tokens: string +} +export interface PoolAminoMsg { + type: 'cosmos-sdk/Pool' + value: PoolAmino +} +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +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({}), + valset: [] + } +} +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() + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHistoricalInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()) + break + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): HistoricalInfo { + const message = createBaseHistoricalInfo() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.valset = object.valset?.map((e) => Validator.fromPartial(e)) || [] + return message + }, + fromAmino(object: HistoricalInfoAmino): HistoricalInfo { + 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) + : Header.toAmino(Header.fromPartial({})) + if (message.valset) { + obj.valset = message.valset.map((e) => + e ? Validator.toAmino(e) : undefined + ) + } else { + obj.valset = message.valset + } + return obj + }, + fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo { + return HistoricalInfo.fromAmino(object.value) + }, + toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg { + return { + type: 'cosmos-sdk/HistoricalInfo', + value: HistoricalInfo.toAmino(message) + } + }, + fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo { + return HistoricalInfo.decode(message.value) + }, + toProto(message: HistoricalInfo): Uint8Array { + return HistoricalInfo.encode(message).finish() + }, + toProtoMsg(message: HistoricalInfo): HistoricalInfoProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.HistoricalInfo', + value: HistoricalInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(HistoricalInfo.typeUrl, HistoricalInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + HistoricalInfo.aminoType, + HistoricalInfo.typeUrl +) +function createBaseCommissionRates(): CommissionRates { + return { + rate: '', + maxRate: '', + maxChangeRate: '' + } +} +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) + } + if (message.maxRate !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.maxRate, 18).atomics) + } + if (message.maxChangeRate !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.maxChangeRate, 18).atomics) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommissionRates() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.rate = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 2: + message.maxRate = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 3: + message.maxChangeRate = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CommissionRates { + const message = createBaseCommissionRates() + message.rate = object.rate ?? '' + message.maxRate = object.maxRate ?? '' + message.maxChangeRate = object.maxChangeRate ?? '' + return message + }, + fromAmino(object: CommissionRatesAmino): CommissionRates { + 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 = {} + obj.rate = message.rate === '' ? undefined : message.rate + obj.max_rate = message.maxRate === '' ? undefined : message.maxRate + obj.max_change_rate = + message.maxChangeRate === '' ? undefined : message.maxChangeRate + return obj + }, + fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { + return CommissionRates.fromAmino(object.value) + }, + toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg { + return { + type: 'cosmos-sdk/CommissionRates', + value: CommissionRates.toAmino(message) + } + }, + fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates { + return CommissionRates.decode(message.value) + }, + toProto(message: CommissionRates): Uint8Array { + return CommissionRates.encode(message).finish() + }, + toProtoMsg(message: CommissionRates): CommissionRatesProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.CommissionRates', + value: CommissionRates.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CommissionRates.typeUrl, CommissionRates) +GlobalDecoderRegistry.registerAminoProtoMapping( + CommissionRates.aminoType, + CommissionRates.typeUrl +) +function createBaseCommission(): Commission { + return { + commissionRates: CommissionRates.fromPartial({}), + 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() + } + if (message.updateTime !== undefined) { + Timestamp.encode( + toTimestamp(message.updateTime), + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommission() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode( + reader, + reader.uint32() + ) + break + case 2: + message.updateTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Commission { + const message = createBaseCommission() + message.commissionRates = + object.commissionRates !== undefined && object.commissionRates !== null + ? CommissionRates.fromPartial(object.commissionRates) + : undefined + message.updateTime = object.updateTime ?? undefined + return message + }, + fromAmino(object: CommissionAmino): Commission { + 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) + : CommissionRates.toAmino(CommissionRates.fromPartial({})) + obj.update_time = message.updateTime + ? Timestamp.toAmino(toTimestamp(message.updateTime)) + : new Date() + return obj + }, + fromAminoMsg(object: CommissionAminoMsg): Commission { + return Commission.fromAmino(object.value) + }, + toAminoMsg(message: Commission): CommissionAminoMsg { + return { + type: 'cosmos-sdk/Commission', + value: Commission.toAmino(message) + } + }, + fromProtoMsg(message: CommissionProtoMsg): Commission { + return Commission.decode(message.value) + }, + toProto(message: Commission): Uint8Array { + return Commission.encode(message).finish() + }, + toProtoMsg(message: Commission): CommissionProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Commission', + value: Commission.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Commission.typeUrl, Commission) +GlobalDecoderRegistry.registerAminoProtoMapping( + Commission.aminoType, + Commission.typeUrl +) +function createBaseDescription(): Description { + return { + moniker: '', + identity: '', + website: '', + securityContact: '', + details: '' + } +} +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) + } + if (message.identity !== '') { + writer.uint32(18).string(message.identity) + } + if (message.website !== '') { + writer.uint32(26).string(message.website) + } + if (message.securityContact !== '') { + writer.uint32(34).string(message.securityContact) + } + if (message.details !== '') { + writer.uint32(42).string(message.details) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDescription() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.moniker = reader.string() + break + case 2: + message.identity = reader.string() + break + case 3: + message.website = reader.string() + break + case 4: + message.securityContact = reader.string() + break + case 5: + message.details = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Description { + const message = createBaseDescription() + message.moniker = object.moniker ?? '' + message.identity = object.identity ?? '' + message.website = object.website ?? '' + message.securityContact = object.securityContact ?? '' + message.details = object.details ?? '' + return message + }, + fromAmino(object: DescriptionAmino): Description { + 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 = {} + obj.moniker = message.moniker === '' ? undefined : message.moniker + obj.identity = message.identity === '' ? undefined : message.identity + obj.website = message.website === '' ? undefined : message.website + obj.security_contact = + message.securityContact === '' ? undefined : message.securityContact + obj.details = message.details === '' ? undefined : message.details + return obj + }, + fromAminoMsg(object: DescriptionAminoMsg): Description { + return Description.fromAmino(object.value) + }, + toAminoMsg(message: Description): DescriptionAminoMsg { + return { + type: 'cosmos-sdk/Description', + value: Description.toAmino(message) + } + }, + fromProtoMsg(message: DescriptionProtoMsg): Description { + return Description.decode(message.value) + }, + toProto(message: Description): Uint8Array { + return Description.encode(message).finish() + }, + toProtoMsg(message: Description): DescriptionProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Description', + value: Description.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Description.typeUrl, Description) +GlobalDecoderRegistry.registerAminoProtoMapping( + Description.aminoType, + Description.typeUrl +) +function createBaseValidator(): Validator { + return { + operatorAddress: '', + consensusPubkey: undefined, + jailed: false, + status: 0, + tokens: '', + delegatorShares: '', + description: Description.fromPartial({}), + unbondingHeight: BigInt(0), + unbondingTime: new Date(), + commission: Commission.fromPartial({}), + 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( + GlobalDecoderRegistry.wrapAny(message.consensusPubkey), + writer.uint32(18).fork() + ).ldelim() + } + if (message.jailed === true) { + writer.uint32(24).bool(message.jailed) + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status) + } + if (message.tokens !== '') { + writer.uint32(42).string(message.tokens) + } + if (message.delegatorShares !== '') { + writer + .uint32(50) + .string(Decimal.fromUserInput(message.delegatorShares, 18).atomics) + } + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim() + } + if (message.unbondingHeight !== BigInt(0)) { + writer.uint32(64).int64(message.unbondingHeight) + } + if (message.unbondingTime !== undefined) { + Timestamp.encode( + toTimestamp(message.unbondingTime), + writer.uint32(74).fork() + ).ldelim() + } + if (message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string() + break + case 2: + message.consensusPubkey = GlobalDecoderRegistry.unwrapAny(reader) + break + case 3: + message.jailed = reader.bool() + break + case 4: + message.status = reader.int32() as any + break + case 5: + message.tokens = reader.string() + break + case 6: + message.delegatorShares = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 7: + message.description = Description.decode(reader, reader.uint32()) + break + case 8: + message.unbondingHeight = reader.int64() + break + case 9: + message.unbondingTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 10: + message.commission = Commission.decode(reader, reader.uint32()) + break + 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 + } + } + return message + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator() + message.operatorAddress = object.operatorAddress ?? '' + 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 ?? '' + message.delegatorShares = object.delegatorShares ?? '' + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.unbondingHeight = + object.unbondingHeight !== undefined && object.unbondingHeight !== null + ? BigInt(object.unbondingHeight.toString()) + : BigInt(0) + 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 { + 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 = 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 === '' ? undefined : message.operatorAddress + obj.consensus_pubkey = message.consensusPubkey + ? decodePubkey(message.consensusPubkey) + : undefined + obj.jailed = message.jailed === false ? undefined : message.jailed + obj.status = message.status === 0 ? undefined : message.status + obj.tokens = message.tokens === '' ? undefined : message.tokens + obj.delegator_shares = + message.delegatorShares === '' ? undefined : message.delegatorShares + obj.description = message.description + ? Description.toAmino(message.description) + : Description.toAmino(Description.fromPartial({})) + obj.unbonding_height = + message.unbondingHeight !== BigInt(0) + ? message.unbondingHeight.toString() + : undefined + obj.unbonding_time = message.unbondingTime + ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) + : new Date() + obj.commission = message.commission + ? Commission.toAmino(message.commission) + : Commission.toAmino(Commission.fromPartial({})) + obj.min_self_delegation = + message.minSelfDelegation === '' ? undefined : message.minSelfDelegation + obj.unbonding_on_hold_ref_count = + message.unbondingOnHoldRefCount !== BigInt(0) + ? message.unbondingOnHoldRefCount.toString() + : undefined + if (message.unbondingIds) { + obj.unbonding_ids = message.unbondingIds.map((e) => e.toString()) + } else { + obj.unbonding_ids = message.unbondingIds + } + return obj + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value) + }, + toAminoMsg(message: Validator): ValidatorAminoMsg { + return { + type: 'cosmos-sdk/Validator', + value: Validator.toAmino(message) + } + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value) + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish() + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Validator', + value: Validator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Validator.typeUrl, Validator) +GlobalDecoderRegistry.registerAminoProtoMapping( + Validator.aminoType, + Validator.typeUrl +) +function createBaseValAddresses(): ValAddresses { + return { + addresses: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValAddresses() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValAddresses { + const message = createBaseValAddresses() + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + fromAmino(object: ValAddressesAmino): ValAddresses { + const message = createBaseValAddresses() + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + toAmino(message: ValAddresses): ValAddressesAmino { + const obj: any = {} + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e) + } else { + obj.addresses = message.addresses + } + return obj + }, + fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses { + return ValAddresses.fromAmino(object.value) + }, + toAminoMsg(message: ValAddresses): ValAddressesAminoMsg { + return { + type: 'cosmos-sdk/ValAddresses', + value: ValAddresses.toAmino(message) + } + }, + fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses { + return ValAddresses.decode(message.value) + }, + toProto(message: ValAddresses): Uint8Array { + return ValAddresses.encode(message).finish() + }, + toProtoMsg(message: ValAddresses): ValAddressesProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.ValAddresses', + value: ValAddresses.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValAddresses.typeUrl, ValAddresses) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValAddresses.aminoType, + ValAddresses.typeUrl +) +function createBaseDVPair(): DVPair { + return { + delegatorAddress: '', + validatorAddress: '' + } +} +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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVPair() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DVPair { + const message = createBaseDVPair() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + return message + }, + fromAmino(object: DVPairAmino): DVPair { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + return obj + }, + fromAminoMsg(object: DVPairAminoMsg): DVPair { + return DVPair.fromAmino(object.value) + }, + toAminoMsg(message: DVPair): DVPairAminoMsg { + return { + type: 'cosmos-sdk/DVPair', + value: DVPair.toAmino(message) + } + }, + fromProtoMsg(message: DVPairProtoMsg): DVPair { + return DVPair.decode(message.value) + }, + toProto(message: DVPair): Uint8Array { + return DVPair.encode(message).finish() + }, + toProtoMsg(message: DVPair): DVPairProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.DVPair', + value: DVPair.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DVPair.typeUrl, DVPair) +GlobalDecoderRegistry.registerAminoProtoMapping( + DVPair.aminoType, + DVPair.typeUrl +) +function createBaseDVPairs(): DVPairs { + return { + pairs: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVPairs() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DVPairs { + const message = createBaseDVPairs() + message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || [] + return message + }, + fromAmino(object: DVPairsAmino): DVPairs { + const message = createBaseDVPairs() + message.pairs = object.pairs?.map((e) => DVPair.fromAmino(e)) || [] + return message + }, + toAmino(message: DVPairs): DVPairsAmino { + const obj: any = {} + if (message.pairs) { + obj.pairs = message.pairs.map((e) => (e ? DVPair.toAmino(e) : undefined)) + } else { + obj.pairs = message.pairs + } + return obj + }, + fromAminoMsg(object: DVPairsAminoMsg): DVPairs { + return DVPairs.fromAmino(object.value) + }, + toAminoMsg(message: DVPairs): DVPairsAminoMsg { + return { + type: 'cosmos-sdk/DVPairs', + value: DVPairs.toAmino(message) + } + }, + fromProtoMsg(message: DVPairsProtoMsg): DVPairs { + return DVPairs.decode(message.value) + }, + toProto(message: DVPairs): Uint8Array { + return DVPairs.encode(message).finish() + }, + toProtoMsg(message: DVPairs): DVPairsProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.DVPairs', + value: DVPairs.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DVPairs.typeUrl, DVPairs) +GlobalDecoderRegistry.registerAminoProtoMapping( + DVPairs.aminoType, + DVPairs.typeUrl +) +function createBaseDVVTriplet(): DVVTriplet { + return { + delegatorAddress: '', + validatorSrcAddress: '', + validatorDstAddress: '' + } +} +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) + } + if (message.validatorSrcAddress !== '') { + writer.uint32(18).string(message.validatorSrcAddress) + } + if (message.validatorDstAddress !== '') { + writer.uint32(26).string(message.validatorDstAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVVTriplet() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string() + break + case 2: + message.validatorSrcAddress = reader.string() + break + case 3: + message.validatorDstAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DVVTriplet { + const message = createBaseDVVTriplet() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorSrcAddress = object.validatorSrcAddress ?? '' + message.validatorDstAddress = object.validatorDstAddress ?? '' + return message + }, + fromAmino(object: DVVTripletAmino): DVVTriplet { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_src_address = + message.validatorSrcAddress === '' + ? undefined + : message.validatorSrcAddress + obj.validator_dst_address = + message.validatorDstAddress === '' + ? undefined + : message.validatorDstAddress + return obj + }, + fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { + return DVVTriplet.fromAmino(object.value) + }, + toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg { + return { + type: 'cosmos-sdk/DVVTriplet', + value: DVVTriplet.toAmino(message) + } + }, + fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet { + return DVVTriplet.decode(message.value) + }, + toProto(message: DVVTriplet): Uint8Array { + return DVVTriplet.encode(message).finish() + }, + toProtoMsg(message: DVVTriplet): DVVTripletProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.DVVTriplet', + value: DVVTriplet.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DVVTriplet.typeUrl, DVVTriplet) +GlobalDecoderRegistry.registerAminoProtoMapping( + DVVTriplet.aminoType, + DVVTriplet.typeUrl +) +function createBaseDVVTriplets(): DVVTriplets { + return { + triplets: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDVVTriplets() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DVVTriplets { + const message = createBaseDVVTriplets() + message.triplets = + object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || [] + return message + }, + fromAmino(object: DVVTripletsAmino): DVVTriplets { + const message = createBaseDVVTriplets() + message.triplets = + object.triplets?.map((e) => DVVTriplet.fromAmino(e)) || [] + return message + }, + toAmino(message: DVVTriplets): DVVTripletsAmino { + const obj: any = {} + if (message.triplets) { + obj.triplets = message.triplets.map((e) => + e ? DVVTriplet.toAmino(e) : undefined + ) + } else { + obj.triplets = message.triplets + } + return obj + }, + fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets { + return DVVTriplets.fromAmino(object.value) + }, + toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg { + return { + type: 'cosmos-sdk/DVVTriplets', + value: DVVTriplets.toAmino(message) + } + }, + fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets { + return DVVTriplets.decode(message.value) + }, + toProto(message: DVVTriplets): Uint8Array { + return DVVTriplets.encode(message).finish() + }, + toProtoMsg(message: DVVTriplets): DVVTripletsProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.DVVTriplets', + value: DVVTriplets.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DVVTriplets.typeUrl, DVVTriplets) +GlobalDecoderRegistry.registerAminoProtoMapping( + DVVTriplets.aminoType, + DVVTriplets.typeUrl +) +function createBaseDelegation(): Delegation { + return { + delegatorAddress: '', + validatorAddress: '', + shares: '' + } +} +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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + if (message.shares !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.shares, 18).atomics) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegation() + 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.shares = Decimal.fromAtomics(reader.string(), 18).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Delegation { + const message = createBaseDelegation() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.shares = object.shares ?? '' + return message + }, + fromAmino(object: DelegationAmino): Delegation { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.shares = message.shares === '' ? undefined : message.shares + return obj + }, + fromAminoMsg(object: DelegationAminoMsg): Delegation { + return Delegation.fromAmino(object.value) + }, + toAminoMsg(message: Delegation): DelegationAminoMsg { + return { + type: 'cosmos-sdk/Delegation', + value: Delegation.toAmino(message) + } + }, + fromProtoMsg(message: DelegationProtoMsg): Delegation { + return Delegation.decode(message.value) + }, + toProto(message: Delegation): Uint8Array { + return Delegation.encode(message).finish() + }, + toProtoMsg(message: Delegation): DelegationProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Delegation', + value: Delegation.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Delegation.typeUrl, Delegation) +GlobalDecoderRegistry.registerAminoProtoMapping( + Delegation.aminoType, + Delegation.typeUrl +) +function createBaseUnbondingDelegation(): UnbondingDelegation { + return { + delegatorAddress: '', + validatorAddress: '', + entries: [] + } +} +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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UnbondingDelegation { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnbondingDelegation() + 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.entries.push( + UnbondingDelegationEntry.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): UnbondingDelegation { + const message = createBaseUnbondingDelegation() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.entries = + object.entries?.map((e) => UnbondingDelegationEntry.fromPartial(e)) || [] + return message + }, + fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? UnbondingDelegationEntry.toAmino(e) : undefined + ) + } else { + obj.entries = message.entries + } + return obj + }, + fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation { + return UnbondingDelegation.fromAmino(object.value) + }, + toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg { + return { + type: 'cosmos-sdk/UnbondingDelegation', + value: UnbondingDelegation.toAmino(message) + } + }, + fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation { + return UnbondingDelegation.decode(message.value) + }, + toProto(message: UnbondingDelegation): Uint8Array { + return UnbondingDelegation.encode(message).finish() + }, + toProtoMsg(message: UnbondingDelegation): UnbondingDelegationProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.UnbondingDelegation', + value: UnbondingDelegation.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(UnbondingDelegation.typeUrl, UnbondingDelegation) +GlobalDecoderRegistry.registerAminoProtoMapping( + UnbondingDelegation.aminoType, + UnbondingDelegation.typeUrl +) +function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: '', + 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) + } + if (message.completionTime !== undefined) { + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(18).fork() + ).ldelim() + } + if (message.initialBalance !== '') { + writer.uint32(26).string(message.initialBalance) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnbondingDelegationEntry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() + break + case 2: + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 3: + message.initialBalance = reader.string() + break + 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 + } + } + return message + }, + 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 { + 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 !== BigInt(0) + ? message.creationHeight.toString() + : undefined + obj.completion_time = message.completionTime + ? Timestamp.toAmino(toTimestamp(message.completionTime)) + : new Date() + obj.initial_balance = + message.initialBalance === '' ? undefined : message.initialBalance + obj.balance = message.balance === '' ? undefined : message.balance + obj.unbonding_id = + message.unbondingId !== BigInt(0) + ? message.unbondingId.toString() + : undefined + obj.unbonding_on_hold_ref_count = + message.unbondingOnHoldRefCount !== BigInt(0) + ? message.unbondingOnHoldRefCount.toString() + : undefined + return obj + }, + fromAminoMsg( + object: UnbondingDelegationEntryAminoMsg + ): UnbondingDelegationEntry { + return UnbondingDelegationEntry.fromAmino(object.value) + }, + toAminoMsg( + message: UnbondingDelegationEntry + ): UnbondingDelegationEntryAminoMsg { + return { + type: 'cosmos-sdk/UnbondingDelegationEntry', + value: UnbondingDelegationEntry.toAmino(message) + } + }, + fromProtoMsg( + message: UnbondingDelegationEntryProtoMsg + ): UnbondingDelegationEntry { + return UnbondingDelegationEntry.decode(message.value) + }, + toProto(message: UnbondingDelegationEntry): Uint8Array { + return UnbondingDelegationEntry.encode(message).finish() + }, + toProtoMsg( + message: UnbondingDelegationEntry + ): UnbondingDelegationEntryProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.UnbondingDelegationEntry', + value: UnbondingDelegationEntry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + UnbondingDelegationEntry.typeUrl, + UnbondingDelegationEntry +) +GlobalDecoderRegistry.registerAminoProtoMapping( + UnbondingDelegationEntry.aminoType, + UnbondingDelegationEntry.typeUrl +) +function createBaseRedelegationEntry(): RedelegationEntry { + return { + creationHeight: BigInt(0), + completionTime: new Date(), + initialBalance: '', + 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) + } + if (message.completionTime !== undefined) { + Timestamp.encode( + toTimestamp(message.completionTime), + writer.uint32(18).fork() + ).ldelim() + } + if (message.initialBalance !== '') { + writer.uint32(26).string(message.initialBalance) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationEntry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() + break + case 2: + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 3: + message.initialBalance = reader.string() + break + 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 + } + } + return message + }, + 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 { + 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 !== BigInt(0) + ? message.creationHeight.toString() + : undefined + obj.completion_time = message.completionTime + ? Timestamp.toAmino(toTimestamp(message.completionTime)) + : new Date() + obj.initial_balance = + message.initialBalance === '' ? undefined : message.initialBalance + obj.shares_dst = message.sharesDst === '' ? undefined : message.sharesDst + obj.unbonding_id = + message.unbondingId !== BigInt(0) + ? message.unbondingId.toString() + : undefined + obj.unbonding_on_hold_ref_count = + message.unbondingOnHoldRefCount !== BigInt(0) + ? message.unbondingOnHoldRefCount.toString() + : undefined + return obj + }, + fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { + return RedelegationEntry.fromAmino(object.value) + }, + toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg { + return { + type: 'cosmos-sdk/RedelegationEntry', + value: RedelegationEntry.toAmino(message) + } + }, + fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry { + return RedelegationEntry.decode(message.value) + }, + toProto(message: RedelegationEntry): Uint8Array { + return RedelegationEntry.encode(message).finish() + }, + toProtoMsg(message: RedelegationEntry): RedelegationEntryProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.RedelegationEntry', + value: RedelegationEntry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RedelegationEntry.typeUrl, RedelegationEntry) +GlobalDecoderRegistry.registerAminoProtoMapping( + RedelegationEntry.aminoType, + RedelegationEntry.typeUrl +) +function createBaseRedelegation(): Redelegation { + return { + delegatorAddress: '', + validatorSrcAddress: '', + validatorDstAddress: '', + entries: [] + } +} +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) + } + if (message.validatorSrcAddress !== '') { + writer.uint32(18).string(message.validatorSrcAddress) + } + if (message.validatorDstAddress !== '') { + writer.uint32(26).string(message.validatorDstAddress) + } + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegation() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string() + break + case 2: + message.validatorSrcAddress = reader.string() + break + case 3: + message.validatorDstAddress = reader.string() + break + case 4: + message.entries.push( + RedelegationEntry.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Redelegation { + const message = createBaseRedelegation() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorSrcAddress = object.validatorSrcAddress ?? '' + message.validatorDstAddress = object.validatorDstAddress ?? '' + message.entries = + object.entries?.map((e) => RedelegationEntry.fromPartial(e)) || [] + return message + }, + fromAmino(object: RedelegationAmino): Redelegation { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_src_address = + message.validatorSrcAddress === '' + ? undefined + : message.validatorSrcAddress + obj.validator_dst_address = + message.validatorDstAddress === '' + ? undefined + : message.validatorDstAddress + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? RedelegationEntry.toAmino(e) : undefined + ) + } else { + obj.entries = message.entries + } + return obj + }, + fromAminoMsg(object: RedelegationAminoMsg): Redelegation { + return Redelegation.fromAmino(object.value) + }, + toAminoMsg(message: Redelegation): RedelegationAminoMsg { + return { + type: 'cosmos-sdk/Redelegation', + value: Redelegation.toAmino(message) + } + }, + fromProtoMsg(message: RedelegationProtoMsg): Redelegation { + return Redelegation.decode(message.value) + }, + toProto(message: Redelegation): Uint8Array { + return Redelegation.encode(message).finish() + }, + toProtoMsg(message: Redelegation): RedelegationProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Redelegation', + value: Redelegation.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Redelegation.typeUrl, Redelegation) +GlobalDecoderRegistry.registerAminoProtoMapping( + Redelegation.aminoType, + Redelegation.typeUrl +) +function createBaseParams(): Params { + return { + unbondingTime: Duration.fromPartial({}), + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: '', + 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() + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators) + } + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries) + } + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries) + } + if (message.bondDenom !== '') { + writer.uint32(42).string(message.bondDenom) + } + if (message.minCommissionRate !== '') { + writer + .uint32(50) + .string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics) + } + 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.unbondingTime = Duration.decode(reader, reader.uint32()) + break + case 2: + message.maxValidators = reader.uint32() + break + case 3: + message.maxEntries = reader.uint32() + break + case 4: + message.historicalEntries = reader.uint32() + break + case 5: + message.bondDenom = reader.string() + break + case 6: + message.minCommissionRate = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.unbondingTime = + object.unbondingTime !== undefined && object.unbondingTime !== null + ? Duration.fromPartial(object.unbondingTime) + : undefined + message.maxValidators = object.maxValidators ?? 0 + message.maxEntries = object.maxEntries ?? 0 + message.historicalEntries = object.historicalEntries ?? 0 + message.bondDenom = object.bondDenom ?? '' + message.minCommissionRate = object.minCommissionRate ?? '' + return message + }, + fromAmino(object: ParamsAmino): Params { + 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) + : Duration.toAmino(Duration.fromPartial({})) + obj.max_validators = + message.maxValidators === 0 ? undefined : message.maxValidators + obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries + obj.historical_entries = + message.historicalEntries === 0 ? undefined : message.historicalEntries + obj.bond_denom = message.bondDenom === '' ? undefined : message.bondDenom + obj.min_commission_rate = + message.minCommissionRate === '' ? undefined : message.minCommissionRate + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'cosmos-sdk/x/staking/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: '/cosmos.staking.v1beta1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseDelegationResponse(): DelegationResponse { + return { + delegation: Delegation.fromPartial({}), + 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() + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): DelegationResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDelegationResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()) + break + case 2: + message.balance = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DelegationResponse { + const message = createBaseDelegationResponse() + message.delegation = + object.delegation !== undefined && object.delegation !== null + ? Delegation.fromPartial(object.delegation) + : undefined + message.balance = + object.balance !== undefined && object.balance !== null + ? Coin.fromPartial(object.balance) + : undefined + return message + }, + fromAmino(object: DelegationResponseAmino): DelegationResponse { + 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) + : Delegation.toAmino(Delegation.fromPartial({})) + obj.balance = message.balance + ? Coin.toAmino(message.balance) + : Coin.toAmino(Coin.fromPartial({})) + return obj + }, + fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { + return DelegationResponse.fromAmino(object.value) + }, + toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg { + return { + type: 'cosmos-sdk/DelegationResponse', + value: DelegationResponse.toAmino(message) + } + }, + fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse { + return DelegationResponse.decode(message.value) + }, + toProto(message: DelegationResponse): Uint8Array { + return DelegationResponse.encode(message).finish() + }, + toProtoMsg(message: DelegationResponse): DelegationResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.DelegationResponse', + value: DelegationResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DelegationResponse.typeUrl, DelegationResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + DelegationResponse.aminoType, + DelegationResponse.typeUrl +) +function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { + return { + redelegationEntry: RedelegationEntry.fromPartial({}), + balance: '' + } +} +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() + } + if (message.balance !== '') { + writer.uint32(34).string(message.balance) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RedelegationEntryResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationEntryResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode( + reader, + reader.uint32() + ) + break + case 4: + message.balance = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): RedelegationEntryResponse { + const message = createBaseRedelegationEntryResponse() + message.redelegationEntry = + object.redelegationEntry !== undefined && + object.redelegationEntry !== null + ? RedelegationEntry.fromPartial(object.redelegationEntry) + : undefined + message.balance = object.balance ?? '' + return message + }, + fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { + 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) + : RedelegationEntry.toAmino(RedelegationEntry.fromPartial({})) + obj.balance = message.balance === '' ? undefined : message.balance + return obj + }, + fromAminoMsg( + object: RedelegationEntryResponseAminoMsg + ): RedelegationEntryResponse { + return RedelegationEntryResponse.fromAmino(object.value) + }, + toAminoMsg( + message: RedelegationEntryResponse + ): RedelegationEntryResponseAminoMsg { + return { + type: 'cosmos-sdk/RedelegationEntryResponse', + value: RedelegationEntryResponse.toAmino(message) + } + }, + fromProtoMsg( + message: RedelegationEntryResponseProtoMsg + ): RedelegationEntryResponse { + return RedelegationEntryResponse.decode(message.value) + }, + toProto(message: RedelegationEntryResponse): Uint8Array { + return RedelegationEntryResponse.encode(message).finish() + }, + toProtoMsg( + message: RedelegationEntryResponse + ): RedelegationEntryResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.RedelegationEntryResponse', + value: RedelegationEntryResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RedelegationEntryResponse.typeUrl, + RedelegationEntryResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + RedelegationEntryResponse.aminoType, + RedelegationEntryResponse.typeUrl +) +function createBaseRedelegationResponse(): RedelegationResponse { + return { + redelegation: Redelegation.fromPartial({}), + entries: [] + } +} +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() + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RedelegationResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRedelegationResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()) + break + case 2: + message.entries.push( + RedelegationEntryResponse.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RedelegationResponse { + const message = createBaseRedelegationResponse() + message.redelegation = + object.redelegation !== undefined && object.redelegation !== null + ? Redelegation.fromPartial(object.redelegation) + : undefined + message.entries = + object.entries?.map((e) => RedelegationEntryResponse.fromPartial(e)) || [] + return message + }, + fromAmino(object: RedelegationResponseAmino): RedelegationResponse { + 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) + : Redelegation.toAmino(Redelegation.fromPartial({})) + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? RedelegationEntryResponse.toAmino(e) : undefined + ) + } else { + obj.entries = message.entries + } + return obj + }, + fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse { + return RedelegationResponse.fromAmino(object.value) + }, + toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg { + return { + type: 'cosmos-sdk/RedelegationResponse', + value: RedelegationResponse.toAmino(message) + } + }, + fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse { + return RedelegationResponse.decode(message.value) + }, + toProto(message: RedelegationResponse): Uint8Array { + return RedelegationResponse.encode(message).finish() + }, + toProtoMsg(message: RedelegationResponse): RedelegationResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.RedelegationResponse', + value: RedelegationResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RedelegationResponse.typeUrl, + RedelegationResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + RedelegationResponse.aminoType, + RedelegationResponse.typeUrl +) +function createBasePool(): Pool { + return { + notBondedTokens: '', + bondedTokens: '' + } +} +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) + } + if (message.bondedTokens !== '') { + writer.uint32(18).string(message.bondedTokens) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string() + break + case 2: + message.bondedTokens = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Pool { + const message = createBasePool() + message.notBondedTokens = object.notBondedTokens ?? '' + message.bondedTokens = object.bondedTokens ?? '' + return message + }, + fromAmino(object: PoolAmino): Pool { + 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 ?? '' + return obj + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value) + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: 'cosmos-sdk/Pool', + value: Pool.toAmino(message) + } + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value) + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish() + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.Pool', + value: Pool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Pool.typeUrl, Pool) +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl) +function createBaseValidatorUpdates(): ValidatorUpdates { + return { + updates: [] + } +} +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 + }, + 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 = message.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 +) diff --git a/src/proto/osmojs/cosmos/staking/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/staking/v1beta1/tx.amino.ts new file mode 100644 index 0000000..20b86cb --- /dev/null +++ b/src/proto/osmojs/cosmos/staking/v1beta1/tx.amino.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgCreateValidator, + MsgEditValidator, + MsgDelegate, + MsgBeginRedelegate, + MsgUndelegate, + MsgCancelUnbondingDelegation, + MsgUpdateParams +} from './tx' +export const AminoConverter = { + '/cosmos.staking.v1beta1.MsgCreateValidator': { + aminoType: 'cosmos-sdk/MsgCreateValidator', + toAmino: MsgCreateValidator.toAmino, + fromAmino: MsgCreateValidator.fromAmino + }, + '/cosmos.staking.v1beta1.MsgEditValidator': { + aminoType: 'cosmos-sdk/MsgEditValidator', + toAmino: MsgEditValidator.toAmino, + fromAmino: MsgEditValidator.fromAmino + }, + '/cosmos.staking.v1beta1.MsgDelegate': { + aminoType: 'cosmos-sdk/MsgDelegate', + toAmino: MsgDelegate.toAmino, + fromAmino: MsgDelegate.fromAmino + }, + '/cosmos.staking.v1beta1.MsgBeginRedelegate': { + aminoType: 'cosmos-sdk/MsgBeginRedelegate', + toAmino: MsgBeginRedelegate.toAmino, + fromAmino: MsgBeginRedelegate.fromAmino + }, + '/cosmos.staking.v1beta1.MsgUndelegate': { + 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 + } +} diff --git a/src/proto/osmojs/cosmos/staking/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/staking/v1beta1/tx.registry.ts new file mode 100644 index 0000000..5f52591 --- /dev/null +++ b/src/proto/osmojs/cosmos/staking/v1beta1/tx.registry.ts @@ -0,0 +1,163 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', + value: MsgCreateValidator.encode(value).finish() + } + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', + value: MsgEditValidator.encode(value).finish() + } + }, + delegate(value: MsgDelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', + value: MsgDelegate.encode(value).finish() + } + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', + value: MsgBeginRedelegate.encode(value).finish() + } + }, + undelegate(value: MsgUndelegate) { + return { + 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: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', + value + } + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', + value + } + }, + delegate(value: MsgDelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', + value + } + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', + value + } + }, + undelegate(value: MsgUndelegate) { + return { + 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: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', + value: MsgCreateValidator.fromPartial(value) + } + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', + value: MsgEditValidator.fromPartial(value) + } + }, + delegate(value: MsgDelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', + value: MsgDelegate.fromPartial(value) + } + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', + value: MsgBeginRedelegate.fromPartial(value) + } + }, + undelegate(value: MsgUndelegate) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/staking/v1beta1/tx.ts b/src/proto/osmojs/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 0000000..080875c --- /dev/null +++ b/src/proto/osmojs/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,2291 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Description, + DescriptionAmino, + DescriptionSDKType, + CommissionRates, + CommissionRatesAmino, + CommissionRatesSDKType, + Params, + ParamsAmino, + ParamsSDKType +} from './staking' +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + commission: CommissionRates + minSelfDelegation: string + delegatorAddress: string + validatorAddress: string + pubkey?: Any | undefined + value: Coin +} +export interface MsgCreateValidatorProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator' + value: Uint8Array +} +export type MsgCreateValidatorEncoded = Omit & { + pubkey?: AnyProtoMsg | undefined +} +/** 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 + pubkey?: AnyAmino + value: CoinAmino +} +export interface MsgCreateValidatorAminoMsg { + type: 'cosmos-sdk/MsgCreateValidator' + value: MsgCreateValidatorAmino +} +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidatorSDKType { + description: DescriptionSDKType + commission: CommissionRatesSDKType + min_self_delegation: string + delegator_address: string + validator_address: string + pubkey?: AnySDKType | undefined + value: CoinSDKType +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponse {} +export interface MsgCreateValidatorResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidatorResponse' + value: Uint8Array +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseAmino {} +export interface MsgCreateValidatorResponseAminoMsg { + type: 'cosmos-sdk/MsgCreateValidatorResponse' + value: MsgCreateValidatorResponseAmino +} +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponseSDKType {} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidator { + description: Description + validatorAddress: string + /** + * We pass a reference to the new commission rate and min self delegation as + * it's not mandatory to update. If not updated, the deserialized rate will be + * zero with no way to distinguish if an update was intended. + * REF: #2373 + */ + commissionRate: string + minSelfDelegation: string +} +export interface MsgEditValidatorProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator' + value: Uint8Array +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorAmino { + 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 +} +export interface MsgEditValidatorAminoMsg { + type: 'cosmos-sdk/MsgEditValidator' + value: MsgEditValidatorAmino +} +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidatorSDKType { + description: DescriptionSDKType + validator_address: string + commission_rate: string + min_self_delegation: string +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponse {} +export interface MsgEditValidatorResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidatorResponse' + value: Uint8Array +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseAmino {} +export interface MsgEditValidatorResponseAminoMsg { + type: 'cosmos-sdk/MsgEditValidatorResponse' + value: MsgEditValidatorResponseAmino +} +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponseSDKType {} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegate { + delegatorAddress: string + validatorAddress: string + amount: Coin +} +export interface MsgDelegateProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegate' + value: Uint8Array +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateAmino { + delegator_address?: string + validator_address?: string + amount: CoinAmino +} +export interface MsgDelegateAminoMsg { + type: 'cosmos-sdk/MsgDelegate' + value: MsgDelegateAmino +} +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegateSDKType { + delegator_address: string + validator_address: string + amount: CoinSDKType +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponse {} +export interface MsgDelegateResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegateResponse' + value: Uint8Array +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseAmino {} +export interface MsgDelegateResponseAminoMsg { + type: 'cosmos-sdk/MsgDelegateResponse' + value: MsgDelegateResponseAmino +} +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponseSDKType {} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string + validatorSrcAddress: string + validatorDstAddress: string + amount: Coin +} +export interface MsgBeginRedelegateProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate' + value: Uint8Array +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * 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 +} +export interface MsgBeginRedelegateAminoMsg { + type: 'cosmos-sdk/MsgBeginRedelegate' + value: MsgBeginRedelegateAmino +} +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegateSDKType { + delegator_address: string + validator_src_address: string + validator_dst_address: string + amount: CoinSDKType +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponse { + completionTime: Date +} +export interface MsgBeginRedelegateResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegateResponse' + value: Uint8Array +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseAmino { + completion_time: string +} +export interface MsgBeginRedelegateResponseAminoMsg { + type: 'cosmos-sdk/MsgBeginRedelegateResponse' + value: MsgBeginRedelegateResponseAmino +} +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponseSDKType { + completion_time: Date +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegate { + delegatorAddress: string + validatorAddress: string + amount: Coin +} +export interface MsgUndelegateProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate' + value: Uint8Array +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateAmino { + delegator_address?: string + validator_address?: string + amount: CoinAmino +} +export interface MsgUndelegateAminoMsg { + type: 'cosmos-sdk/MsgUndelegate' + value: MsgUndelegateAmino +} +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegateSDKType { + delegator_address: string + validator_address: string + amount: CoinSDKType +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponse { + completionTime: Date +} +export interface MsgUndelegateResponseProtoMsg { + typeUrl: '/cosmos.staking.v1beta1.MsgUndelegateResponse' + value: Uint8Array +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponseAmino { + completion_time: string +} +export interface MsgUndelegateResponseAminoMsg { + type: 'cosmos-sdk/MsgUndelegateResponse' + value: MsgUndelegateResponseAmino +} +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +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({}), + commission: CommissionRates.fromPartial({}), + minSelfDelegation: '', + delegatorAddress: '', + validatorAddress: '', + pubkey: 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() + } + if (message.commission !== undefined) { + CommissionRates.encode( + message.commission, + writer.uint32(18).fork() + ).ldelim() + } + if (message.minSelfDelegation !== '') { + writer.uint32(26).string(message.minSelfDelegation) + } + if (message.delegatorAddress !== '') { + writer.uint32(34).string(message.delegatorAddress) + } + if (message.validatorAddress !== '') { + writer.uint32(42).string(message.validatorAddress) + } + if (message.pubkey !== undefined) { + Any.encode( + GlobalDecoderRegistry.wrapAny(message.pubkey), + writer.uint32(50).fork() + ).ldelim() + } + if (message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateValidator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()) + break + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()) + break + case 3: + message.minSelfDelegation = reader.string() + break + case 4: + message.delegatorAddress = reader.string() + break + case 5: + message.validatorAddress = reader.string() + break + case 6: + message.pubkey = GlobalDecoderRegistry.unwrapAny(reader) + break + case 7: + message.value = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateValidator { + const message = createBaseMsgCreateValidator() + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.commission = + object.commission !== undefined && object.commission !== null + ? CommissionRates.fromPartial(object.commission) + : undefined + message.minSelfDelegation = object.minSelfDelegation ?? '' + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.pubkey = + object.pubkey !== undefined && object.pubkey !== null + ? GlobalDecoderRegistry.fromPartial(object.pubkey) + : undefined + message.value = + object.value !== undefined && object.value !== null + ? Coin.fromPartial(object.value) + : undefined + return message + }, + fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { + 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) + : Description.toAmino(Description.fromPartial({})) + obj.commission = message.commission + ? CommissionRates.toAmino(message.commission) + : CommissionRates.toAmino(CommissionRates.fromPartial({})) + obj.min_self_delegation = + message.minSelfDelegation === '' ? undefined : message.minSelfDelegation + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined + obj.value = message.value + ? Coin.toAmino(message.value) + : Coin.toAmino(Coin.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { + return MsgCreateValidator.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateValidator): MsgCreateValidatorAminoMsg { + return { + type: 'cosmos-sdk/MsgCreateValidator', + value: MsgCreateValidator.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreateValidatorProtoMsg): MsgCreateValidator { + return MsgCreateValidator.decode(message.value) + }, + toProto(message: MsgCreateValidator): Uint8Array { + return MsgCreateValidator.encode(message).finish() + }, + toProtoMsg(message: MsgCreateValidator): MsgCreateValidatorProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', + value: MsgCreateValidator.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateValidatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateValidatorResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse() + return message + }, + fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { + const message = createBaseMsgCreateValidatorResponse() + return message + }, + toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgCreateValidatorResponseAminoMsg + ): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateValidatorResponse + ): MsgCreateValidatorResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgCreateValidatorResponse', + value: MsgCreateValidatorResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateValidatorResponseProtoMsg + ): MsgCreateValidatorResponse { + return MsgCreateValidatorResponse.decode(message.value) + }, + toProto(message: MsgCreateValidatorResponse): Uint8Array { + return MsgCreateValidatorResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateValidatorResponse + ): MsgCreateValidatorResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidatorResponse', + value: MsgCreateValidatorResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateValidatorResponse.typeUrl, + MsgCreateValidatorResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateValidatorResponse.aminoType, + MsgCreateValidatorResponse.typeUrl +) +function createBaseMsgEditValidator(): MsgEditValidator { + return { + description: Description.fromPartial({}), + validatorAddress: '', + commissionRate: '', + minSelfDelegation: '' + } +} +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() + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + if (message.commissionRate !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.commissionRate, 18).atomics) + } + if (message.minSelfDelegation !== '') { + writer.uint32(34).string(message.minSelfDelegation) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgEditValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()) + break + case 2: + message.validatorAddress = reader.string() + break + case 3: + message.commissionRate = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 4: + message.minSelfDelegation = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgEditValidator { + const message = createBaseMsgEditValidator() + message.description = + object.description !== undefined && object.description !== null + ? Description.fromPartial(object.description) + : undefined + message.validatorAddress = object.validatorAddress ?? '' + message.commissionRate = object.commissionRate ?? '' + message.minSelfDelegation = object.minSelfDelegation ?? '' + return message + }, + fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { + 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) + : Description.toAmino(Description.fromPartial({})) + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.commission_rate = + message.commissionRate === '' ? undefined : message.commissionRate + obj.min_self_delegation = + message.minSelfDelegation === '' ? undefined : message.minSelfDelegation + return obj + }, + fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { + return MsgEditValidator.fromAmino(object.value) + }, + toAminoMsg(message: MsgEditValidator): MsgEditValidatorAminoMsg { + return { + type: 'cosmos-sdk/MsgEditValidator', + value: MsgEditValidator.toAmino(message) + } + }, + fromProtoMsg(message: MsgEditValidatorProtoMsg): MsgEditValidator { + return MsgEditValidator.decode(message.value) + }, + toProto(message: MsgEditValidator): Uint8Array { + return MsgEditValidator.encode(message).finish() + }, + toProtoMsg(message: MsgEditValidator): MsgEditValidatorProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', + value: MsgEditValidator.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgEditValidatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgEditValidatorResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse() + return message + }, + fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { + const message = createBaseMsgEditValidatorResponse() + return message + }, + toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgEditValidatorResponseAminoMsg + ): MsgEditValidatorResponse { + return MsgEditValidatorResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgEditValidatorResponse + ): MsgEditValidatorResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgEditValidatorResponse', + value: MsgEditValidatorResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgEditValidatorResponseProtoMsg + ): MsgEditValidatorResponse { + return MsgEditValidatorResponse.decode(message.value) + }, + toProto(message: MsgEditValidatorResponse): Uint8Array { + return MsgEditValidatorResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgEditValidatorResponse + ): MsgEditValidatorResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgEditValidatorResponse', + value: MsgEditValidatorResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgEditValidatorResponse.typeUrl, + MsgEditValidatorResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgEditValidatorResponse.aminoType, + MsgEditValidatorResponse.typeUrl +) +function createBaseMsgDelegate(): MsgDelegate { + return { + delegatorAddress: '', + validatorAddress: '', + 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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegate() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgDelegate { + const message = createBaseMsgDelegate() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message + }, + fromAmino(object: MsgDelegateAmino): MsgDelegate { + 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 === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.amount = message.amount + ? Coin.toAmino(message.amount) + : Coin.toAmino(Coin.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { + return MsgDelegate.fromAmino(object.value) + }, + toAminoMsg(message: MsgDelegate): MsgDelegateAminoMsg { + return { + type: 'cosmos-sdk/MsgDelegate', + value: MsgDelegate.toAmino(message) + } + }, + fromProtoMsg(message: MsgDelegateProtoMsg): MsgDelegate { + return MsgDelegate.decode(message.value) + }, + toProto(message: MsgDelegate): Uint8Array { + return MsgDelegate.encode(message).finish() + }, + toProtoMsg(message: MsgDelegate): MsgDelegateProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', + value: MsgDelegate.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse() + return message + }, + fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { + const message = createBaseMsgDelegateResponse() + return message + }, + toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgDelegateResponseAminoMsg): MsgDelegateResponse { + return MsgDelegateResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgDelegateResponse): MsgDelegateResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgDelegateResponse', + value: MsgDelegateResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgDelegateResponseProtoMsg): MsgDelegateResponse { + return MsgDelegateResponse.decode(message.value) + }, + toProto(message: MsgDelegateResponse): Uint8Array { + return MsgDelegateResponse.encode(message).finish() + }, + toProtoMsg(message: MsgDelegateResponse): MsgDelegateResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgDelegateResponse', + value: MsgDelegateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgDelegateResponse.typeUrl, MsgDelegateResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateResponse.aminoType, + MsgDelegateResponse.typeUrl +) +function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { + return { + delegatorAddress: '', + validatorSrcAddress: '', + validatorDstAddress: '', + 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) + } + if (message.validatorSrcAddress !== '') { + writer.uint32(18).string(message.validatorSrcAddress) + } + if (message.validatorDstAddress !== '') { + writer.uint32(26).string(message.validatorDstAddress) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginRedelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginRedelegate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string() + break + case 2: + message.validatorSrcAddress = reader.string() + break + case 3: + message.validatorDstAddress = reader.string() + break + case 4: + message.amount = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgBeginRedelegate { + const message = createBaseMsgBeginRedelegate() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorSrcAddress = object.validatorSrcAddress ?? '' + message.validatorDstAddress = object.validatorDstAddress ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message + }, + fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { + 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 === '' ? undefined : message.delegatorAddress + obj.validator_src_address = + message.validatorSrcAddress === '' + ? undefined + : message.validatorSrcAddress + obj.validator_dst_address = + message.validatorDstAddress === '' + ? undefined + : message.validatorDstAddress + obj.amount = message.amount + ? Coin.toAmino(message.amount) + : Coin.toAmino(Coin.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.fromAmino(object.value) + }, + toAminoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateAminoMsg { + return { + type: 'cosmos-sdk/MsgBeginRedelegate', + value: MsgBeginRedelegate.toAmino(message) + } + }, + fromProtoMsg(message: MsgBeginRedelegateProtoMsg): MsgBeginRedelegate { + return MsgBeginRedelegate.decode(message.value) + }, + toProto(message: MsgBeginRedelegate): Uint8Array { + return MsgBeginRedelegate.encode(message).finish() + }, + toProtoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', + value: MsgBeginRedelegate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgBeginRedelegate.typeUrl, MsgBeginRedelegate) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginRedelegate.aminoType, + MsgBeginRedelegate.typeUrl +) +function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { + return { + 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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginRedelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginRedelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgBeginRedelegateResponse { + const message = createBaseMsgBeginRedelegateResponse() + message.completionTime = object.completionTime ?? undefined + return message + }, + fromAmino( + object: MsgBeginRedelegateResponseAmino + ): MsgBeginRedelegateResponse { + 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 + ? Timestamp.toAmino(toTimestamp(message.completionTime)) + : new Date() + return obj + }, + fromAminoMsg( + object: MsgBeginRedelegateResponseAminoMsg + ): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgBeginRedelegateResponse + ): MsgBeginRedelegateResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgBeginRedelegateResponse', + value: MsgBeginRedelegateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgBeginRedelegateResponseProtoMsg + ): MsgBeginRedelegateResponse { + return MsgBeginRedelegateResponse.decode(message.value) + }, + toProto(message: MsgBeginRedelegateResponse): Uint8Array { + return MsgBeginRedelegateResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgBeginRedelegateResponse + ): MsgBeginRedelegateResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegateResponse', + value: MsgBeginRedelegateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgBeginRedelegateResponse.typeUrl, + MsgBeginRedelegateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginRedelegateResponse.aminoType, + MsgBeginRedelegateResponse.typeUrl +) +function createBaseMsgUndelegate(): MsgUndelegate { + return { + delegatorAddress: '', + validatorAddress: '', + 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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegate() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUndelegate { + const message = createBaseMsgUndelegate() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + return message + }, + fromAmino(object: MsgUndelegateAmino): MsgUndelegate { + 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 === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.amount = message.amount + ? Coin.toAmino(message.amount) + : Coin.toAmino(Coin.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { + return MsgUndelegate.fromAmino(object.value) + }, + toAminoMsg(message: MsgUndelegate): MsgUndelegateAminoMsg { + return { + type: 'cosmos-sdk/MsgUndelegate', + value: MsgUndelegate.toAmino(message) + } + }, + fromProtoMsg(message: MsgUndelegateProtoMsg): MsgUndelegate { + return MsgUndelegate.decode(message.value) + }, + toProto(message: MsgUndelegate): Uint8Array { + return MsgUndelegate.encode(message).finish() + }, + toProtoMsg(message: MsgUndelegate): MsgUndelegateProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', + value: MsgUndelegate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgUndelegate.typeUrl, MsgUndelegate) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUndelegate.aminoType, + MsgUndelegate.typeUrl +) +function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { + return { + 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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUndelegateResponse { + const message = createBaseMsgUndelegateResponse() + message.completionTime = object.completionTime ?? undefined + return message + }, + fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { + 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 + ? Timestamp.toAmino(toTimestamp(message.completionTime)) + : new Date() + return obj + }, + fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgUndelegateResponse', + value: MsgUndelegateResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { + return MsgUndelegateResponse.decode(message.value) + }, + toProto(message: MsgUndelegateResponse): Uint8Array { + return MsgUndelegateResponse.encode(message).finish() + }, + toProtoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseProtoMsg { + return { + typeUrl: '/cosmos.staking.v1beta1.MsgUndelegateResponse', + value: MsgUndelegateResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.amount = message.amount + ? Coin.toAmino(message.amount) + : Coin.toAmino(Coin.fromPartial({})) + obj.creation_height = + message.creationHeight !== BigInt(0) + ? 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() + } + } +} +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 + }, + 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() + } + } +} +GlobalDecoderRegistry.register( + MsgCancelUnbondingDelegationResponse.typeUrl, + MsgCancelUnbondingDelegationResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCancelUnbondingDelegationResponse.aminoType, + MsgCancelUnbondingDelegationResponse.typeUrl +) +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: '', + params: Params.fromPartial({}) + } +} +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 + }, + 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 === '' ? undefined : message.authority + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(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 + }, + 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 +) diff --git a/src/proto/osmojs/cosmos/tx/signing/v1beta1/signing.ts b/src/proto/osmojs/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 0000000..a295f95 --- /dev/null +++ b/src/proto/osmojs/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,970 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + CompactBitArray, + CompactBitArrayAmino, + CompactBitArraySDKType +} from '../../../crypto/multisig/v1beta1/multisig' +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +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. + */ + SIGN_MODE_UNSPECIFIED = 0, + /** + * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + * verified with raw bytes from Tx. + */ + SIGN_MODE_DIRECT = 1, + /** + * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + * human-readable textual representation on top of the binary representation + * from SIGN_MODE_DIRECT. 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. + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + /** + * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + * + * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + * but is not implemented on the SDK by default. To enable EIP-191, you need + * to pass a custom `TxConfig` that has an implementation of + * `SignModeHandler` for EIP-191. The SDK may decide to fully support + * EIP-191 in the future. + * + * Since: cosmos-sdk 0.45.2 + */ + SIGN_MODE_EIP_191 = 191, + UNRECOGNIZED = -1 +} +export const SignModeSDKType = SignMode +export const SignModeAmino = SignMode +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case 'SIGN_MODE_UNSPECIFIED': + return SignMode.SIGN_MODE_UNSPECIFIED + case 1: + case 'SIGN_MODE_DIRECT': + return SignMode.SIGN_MODE_DIRECT + case 2: + case 'SIGN_MODE_TEXTUAL': + return SignMode.SIGN_MODE_TEXTUAL + case 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 + case 191: + case 'SIGN_MODE_EIP_191': + return SignMode.SIGN_MODE_EIP_191 + case -1: + case 'UNRECOGNIZED': + default: + return SignMode.UNRECOGNIZED + } +} +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return 'SIGN_MODE_UNSPECIFIED' + case SignMode.SIGN_MODE_DIRECT: + return 'SIGN_MODE_DIRECT' + case SignMode.SIGN_MODE_TEXTUAL: + return 'SIGN_MODE_TEXTUAL' + case SignMode.SIGN_MODE_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: + return 'SIGN_MODE_EIP_191' + case SignMode.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[] +} +export interface SignatureDescriptorsProtoMsg { + typeUrl: '/cosmos.tx.signing.v1beta1.SignatureDescriptors' + value: Uint8Array +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsAmino { + /** signatures are the signature descriptors */ + signatures?: SignatureDescriptorAmino[] +} +export interface SignatureDescriptorsAminoMsg { + type: 'cosmos-sdk/SignatureDescriptors' + value: SignatureDescriptorsAmino +} +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptorsSDKType { + signatures: SignatureDescriptorSDKType[] +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any + data?: SignatureDescriptor_Data + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: bigint +} +export interface SignatureDescriptorProtoMsg { + typeUrl: '/cosmos.tx.signing.v1beta1.SignatureDescriptor' + value: Uint8Array +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorAmino { + /** public_key is the public key of the signer */ + public_key?: AnyAmino + data?: SignatureDescriptor_DataAmino + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence?: string +} +export interface SignatureDescriptorAminoMsg { + type: 'cosmos-sdk/SignatureDescriptor' + value: SignatureDescriptorAmino +} +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptorSDKType { + public_key?: AnySDKType + data?: SignatureDescriptor_DataSDKType + sequence: bigint +} +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi +} +export interface SignatureDescriptor_DataProtoMsg { + typeUrl: '/cosmos.tx.signing.v1beta1.Data' + value: Uint8Array +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataAmino { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_SingleAmino + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_MultiAmino +} +export interface SignatureDescriptor_DataAminoMsg { + type: 'cosmos-sdk/Data' + value: SignatureDescriptor_DataAmino +} +/** Data represents signature data */ +export interface SignatureDescriptor_DataSDKType { + single?: SignatureDescriptor_Data_SingleSDKType + multi?: SignatureDescriptor_Data_MultiSDKType +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode + /** signature is the raw signature bytes */ + signature: Uint8Array +} +export interface SignatureDescriptor_Data_SingleProtoMsg { + typeUrl: '/cosmos.tx.signing.v1beta1.Single' + value: Uint8Array +} +/** 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 + /** signature is the raw signature bytes */ + signature?: string +} +export interface SignatureDescriptor_Data_SingleAminoMsg { + type: 'cosmos-sdk/Single' + value: SignatureDescriptor_Data_SingleAmino +} +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_SingleSDKType { + mode: SignMode + signature: Uint8Array +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[] +} +export interface SignatureDescriptor_Data_MultiProtoMsg { + typeUrl: '/cosmos.tx.signing.v1beta1.Multi' + value: Uint8Array +} +/** Multi is the signature data for a multisig public key */ +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[] +} +export interface SignatureDescriptor_Data_MultiAminoMsg { + type: 'cosmos-sdk/Multi' + value: SignatureDescriptor_Data_MultiAmino +} +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_MultiSDKType { + bitarray?: CompactBitArraySDKType + signatures: SignatureDescriptor_DataSDKType[] +} +function createBaseSignatureDescriptors(): SignatureDescriptors { + return { + signatures: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SignatureDescriptors { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptors() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.signatures.push( + SignatureDescriptor.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SignatureDescriptors { + const message = createBaseSignatureDescriptors() + message.signatures = + object.signatures?.map((e) => SignatureDescriptor.fromPartial(e)) || [] + return message + }, + fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { + const message = createBaseSignatureDescriptors() + message.signatures = + object.signatures?.map((e) => SignatureDescriptor.fromAmino(e)) || [] + return message + }, + toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { + const obj: any = {} + if (message.signatures) { + obj.signatures = message.signatures.map((e) => + e ? SignatureDescriptor.toAmino(e) : undefined + ) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg(object: SignatureDescriptorsAminoMsg): SignatureDescriptors { + return SignatureDescriptors.fromAmino(object.value) + }, + toAminoMsg(message: SignatureDescriptors): SignatureDescriptorsAminoMsg { + return { + type: 'cosmos-sdk/SignatureDescriptors', + value: SignatureDescriptors.toAmino(message) + } + }, + fromProtoMsg(message: SignatureDescriptorsProtoMsg): SignatureDescriptors { + return SignatureDescriptors.decode(message.value) + }, + toProto(message: SignatureDescriptors): Uint8Array { + return SignatureDescriptors.encode(message).finish() + }, + toProtoMsg(message: SignatureDescriptors): SignatureDescriptorsProtoMsg { + return { + typeUrl: '/cosmos.tx.signing.v1beta1.SignatureDescriptors', + value: SignatureDescriptors.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SignatureDescriptors.typeUrl, + SignatureDescriptors +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SignatureDescriptors.aminoType, + SignatureDescriptors.typeUrl +) +function createBaseSignatureDescriptor(): SignatureDescriptor { + return { + publicKey: undefined, + 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() + } + if (message.data !== undefined) { + SignatureDescriptor_Data.encode( + message.data, + writer.uint32(18).fork() + ).ldelim() + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SignatureDescriptor { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()) + break + case 2: + message.data = SignatureDescriptor_Data.decode( + reader, + reader.uint32() + ) + break + case 3: + message.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SignatureDescriptor { + const message = createBaseSignatureDescriptor() + message.publicKey = + object.publicKey !== undefined && object.publicKey !== null + ? Any.fromPartial(object.publicKey) + : undefined + message.data = + object.data !== undefined && object.data !== null + ? SignatureDescriptor_Data.fromPartial(object.data) + : undefined + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + return message + }, + fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { + 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 = {} + obj.public_key = message.publicKey + ? Any.toAmino(message.publicKey) + : undefined + obj.data = message.data + ? SignatureDescriptor_Data.toAmino(message.data) + : undefined + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { + return SignatureDescriptor.fromAmino(object.value) + }, + toAminoMsg(message: SignatureDescriptor): SignatureDescriptorAminoMsg { + return { + type: 'cosmos-sdk/SignatureDescriptor', + value: SignatureDescriptor.toAmino(message) + } + }, + fromProtoMsg(message: SignatureDescriptorProtoMsg): SignatureDescriptor { + return SignatureDescriptor.decode(message.value) + }, + toProto(message: SignatureDescriptor): Uint8Array { + return SignatureDescriptor.encode(message).finish() + }, + toProtoMsg(message: SignatureDescriptor): SignatureDescriptorProtoMsg { + return { + typeUrl: '/cosmos.tx.signing.v1beta1.SignatureDescriptor', + value: SignatureDescriptor.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SignatureDescriptor.typeUrl, SignatureDescriptor) +GlobalDecoderRegistry.registerAminoProtoMapping( + SignatureDescriptor.aminoType, + SignatureDescriptor.typeUrl +) +function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { + return { + single: undefined, + multi: undefined + } +} +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() + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode( + message.multi, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SignatureDescriptor_Data { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode( + reader, + reader.uint32() + ) + break + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SignatureDescriptor_Data { + const message = createBaseSignatureDescriptor_Data() + message.single = + object.single !== undefined && object.single !== null + ? SignatureDescriptor_Data_Single.fromPartial(object.single) + : undefined + message.multi = + object.multi !== undefined && object.multi !== null + ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) + : undefined + return message + }, + fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { + 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 = {} + obj.single = message.single + ? SignatureDescriptor_Data_Single.toAmino(message.single) + : undefined + obj.multi = message.multi + ? SignatureDescriptor_Data_Multi.toAmino(message.multi) + : undefined + return obj + }, + fromAminoMsg( + object: SignatureDescriptor_DataAminoMsg + ): SignatureDescriptor_Data { + return SignatureDescriptor_Data.fromAmino(object.value) + }, + toAminoMsg( + message: SignatureDescriptor_Data + ): SignatureDescriptor_DataAminoMsg { + return { + type: 'cosmos-sdk/Data', + value: SignatureDescriptor_Data.toAmino(message) + } + }, + fromProtoMsg( + message: SignatureDescriptor_DataProtoMsg + ): SignatureDescriptor_Data { + return SignatureDescriptor_Data.decode(message.value) + }, + toProto(message: SignatureDescriptor_Data): Uint8Array { + return SignatureDescriptor_Data.encode(message).finish() + }, + toProtoMsg( + message: SignatureDescriptor_Data + ): SignatureDescriptor_DataProtoMsg { + return { + typeUrl: '/cosmos.tx.signing.v1beta1.Data', + value: SignatureDescriptor_Data.encode(message).finish() + } + } +} +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, + signature: new Uint8Array() + } +} +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) + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SignatureDescriptor_Data_Single { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data_Single() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any + break + case 2: + message.signature = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single() + message.mode = object.mode ?? 0 + message.signature = object.signature ?? new Uint8Array() + return message + }, + fromAmino( + object: SignatureDescriptor_Data_SingleAmino + ): SignatureDescriptor_Data_Single { + const message = createBaseSignatureDescriptor_Data_Single() + if (object.mode !== undefined && object.mode !== null) { + message.mode = 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 === 0 ? undefined : message.mode + obj.signature = message.signature + ? base64FromBytes(message.signature) + : undefined + return obj + }, + fromAminoMsg( + object: SignatureDescriptor_Data_SingleAminoMsg + ): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.fromAmino(object.value) + }, + toAminoMsg( + message: SignatureDescriptor_Data_Single + ): SignatureDescriptor_Data_SingleAminoMsg { + return { + type: 'cosmos-sdk/Single', + value: SignatureDescriptor_Data_Single.toAmino(message) + } + }, + fromProtoMsg( + message: SignatureDescriptor_Data_SingleProtoMsg + ): SignatureDescriptor_Data_Single { + return SignatureDescriptor_Data_Single.decode(message.value) + }, + toProto(message: SignatureDescriptor_Data_Single): Uint8Array { + return SignatureDescriptor_Data_Single.encode(message).finish() + }, + toProtoMsg( + message: SignatureDescriptor_Data_Single + ): SignatureDescriptor_Data_SingleProtoMsg { + return { + typeUrl: '/cosmos.tx.signing.v1beta1.Single', + value: SignatureDescriptor_Data_Single.encode(message).finish() + } + } +} +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: 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() + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SignatureDescriptor_Data_Multi { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignatureDescriptor_Data_Multi() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()) + break + case 2: + message.signatures.push( + SignatureDescriptor_Data.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SignatureDescriptor_Data_Multi { + const message = createBaseSignatureDescriptor_Data_Multi() + message.bitarray = + object.bitarray !== undefined && object.bitarray !== null + ? CompactBitArray.fromPartial(object.bitarray) + : undefined + message.signatures = + object.signatures?.map((e) => SignatureDescriptor_Data.fromPartial(e)) || + [] + return message + }, + fromAmino( + object: SignatureDescriptor_Data_MultiAmino + ): SignatureDescriptor_Data_Multi { + 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 = {} + obj.bitarray = message.bitarray + ? CompactBitArray.toAmino(message.bitarray) + : undefined + if (message.signatures) { + obj.signatures = message.signatures.map((e) => + e ? SignatureDescriptor_Data.toAmino(e) : undefined + ) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg( + object: SignatureDescriptor_Data_MultiAminoMsg + ): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.fromAmino(object.value) + }, + toAminoMsg( + message: SignatureDescriptor_Data_Multi + ): SignatureDescriptor_Data_MultiAminoMsg { + return { + type: 'cosmos-sdk/Multi', + value: SignatureDescriptor_Data_Multi.toAmino(message) + } + }, + fromProtoMsg( + message: SignatureDescriptor_Data_MultiProtoMsg + ): SignatureDescriptor_Data_Multi { + return SignatureDescriptor_Data_Multi.decode(message.value) + }, + toProto(message: SignatureDescriptor_Data_Multi): Uint8Array { + return SignatureDescriptor_Data_Multi.encode(message).finish() + }, + toProtoMsg( + message: SignatureDescriptor_Data_Multi + ): SignatureDescriptor_Data_MultiProtoMsg { + return { + typeUrl: '/cosmos.tx.signing.v1beta1.Multi', + value: SignatureDescriptor_Data_Multi.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SignatureDescriptor_Data_Multi.typeUrl, + SignatureDescriptor_Data_Multi +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SignatureDescriptor_Data_Multi.aminoType, + SignatureDescriptor_Data_Multi.typeUrl +) diff --git a/src/proto/osmojs/cosmos/tx/v1beta1/tx.ts b/src/proto/osmojs/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 0000000..cc1db8e --- /dev/null +++ b/src/proto/osmojs/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,2643 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { SignMode } 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 { bytesFromBase64, base64FromBytes, isSet } 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 + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[] +} +export interface TxProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.Tx' + value: Uint8Array +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxAmino { + /** body is the processable content of the transaction */ + body?: TxBodyAmino + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + auth_info?: AuthInfoAmino + /** + * 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?: string[] +} +export interface TxAminoMsg { + type: 'cosmos-sdk/Tx' + value: TxAmino +} +/** Tx is the standard type used for broadcasting transactions. */ +export interface TxSDKType { + body?: TxBodySDKType + auth_info?: AuthInfoSDKType + signatures: Uint8Array[] +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[] +} +export interface TxRawProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.TxRaw' + value: Uint8Array +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawAmino { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + body_bytes?: string + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + 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?: string[] +} +export interface TxRawAminoMsg { + type: 'cosmos-sdk/TxRaw' + value: TxRawAmino +} +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRawSDKType { + body_bytes: Uint8Array + auth_info_bytes: Uint8Array + signatures: Uint8Array[] +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string + /** account_number is the account number of the account in state */ + accountNumber: bigint +} +export interface SignDocProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.SignDoc' + value: Uint8Array +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + 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 + /** account_number is the account number of the account in state */ + account_number?: string +} +export interface SignDocAminoMsg { + type: 'cosmos-sdk/SignDoc' + value: SignDocAmino +} +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDocSDKType { + body_bytes: Uint8Array + auth_info_bytes: Uint8Array + 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 { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[] + /** + * memo is any arbitrary 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 + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: bigint + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[] + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[] +} +export interface TxBodyProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.TxBody' + value: Uint8Array +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodyAmino { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages?: 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 + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + 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 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[] +} +export interface TxBodyAminoMsg { + type: 'cosmos-sdk/TxBody' + value: TxBodyAmino +} +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBodySDKType { + messages: AnySDKType[] + memo: string + timeout_height: bigint + extension_options: AnySDKType[] + non_critical_extension_options: AnySDKType[] +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[] + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee + /** + * 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' + value: Uint8Array +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoAmino { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + 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 + * based on the cost of evaluating the body and doing signature verification + * 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' + value: AuthInfoAmino +} +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfoSDKType { + signer_infos: SignerInfoSDKType[] + fee?: FeeSDKType + tip?: TipSDKType +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: bigint +} +export interface SignerInfoProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.SignerInfo' + value: Uint8Array +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoAmino { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + public_key?: AnyAmino + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + mode_info?: ModeInfoAmino + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence?: string +} +export interface SignerInfoAminoMsg { + type: 'cosmos-sdk/SignerInfo' + value: SignerInfoAmino +} +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfoSDKType { + public_key?: AnySDKType + mode_info?: ModeInfoSDKType + sequence: bigint +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfo { + /** single represents a single signer */ + single?: ModeInfo_Single + /** multi represents a nested multisig signer */ + multi?: ModeInfo_Multi +} +export interface ModeInfoProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.ModeInfo' + value: Uint8Array +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoAmino { + /** single represents a single signer */ + single?: ModeInfo_SingleAmino + /** multi represents a nested multisig signer */ + multi?: ModeInfo_MultiAmino +} +export interface ModeInfoAminoMsg { + type: 'cosmos-sdk/ModeInfo' + value: ModeInfoAmino +} +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfoSDKType { + single?: ModeInfo_SingleSDKType + multi?: ModeInfo_MultiSDKType +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode +} +export interface ModeInfo_SingleProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.Single' + value: Uint8Array +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleAmino { + /** mode is the signing mode of the single signer */ + mode?: SignMode +} +export interface ModeInfo_SingleAminoMsg { + type: 'cosmos-sdk/Single' + value: ModeInfo_SingleAmino +} +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_SingleSDKType { + mode: SignMode +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[] +} +export interface ModeInfo_MultiProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.Multi' + value: Uint8Array +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiAmino { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArrayAmino + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + mode_infos?: ModeInfoAmino[] +} +export interface ModeInfo_MultiAminoMsg { + type: 'cosmos-sdk/Multi' + value: ModeInfo_MultiAmino +} +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_MultiSDKType { + bitarray?: CompactBitArraySDKType + mode_infos: ModeInfoSDKType[] +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** amount is the amount of coins to be paid as a fee */ + amount: Coin[] + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: bigint + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string +} +export interface FeeProtoMsg { + typeUrl: '/cosmos.tx.v1beta1.Fee' + value: Uint8Array +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeAmino { + /** amount is the amount of coins to be paid as a fee */ + 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 + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer?: string + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter?: string +} +export interface FeeAminoMsg { + type: 'cosmos-sdk/Fee' + value: FeeAmino +} +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface FeeSDKType { + amount: CoinSDKType[] + gas_limit: bigint + 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: 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() + } + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim() + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()) + break + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()) + break + case 3: + message.signatures.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Tx { + const message = createBaseTx() + message.body = + object.body !== undefined && object.body !== null + ? TxBody.fromPartial(object.body) + : undefined + message.authInfo = + object.authInfo !== undefined && object.authInfo !== null + ? AuthInfo.fromPartial(object.authInfo) + : undefined + message.signatures = object.signatures?.map((e) => e) || [] + return message + }, + fromAmino(object: TxAmino): Tx { + 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) => base64FromBytes(e)) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg(object: TxAminoMsg): Tx { + return Tx.fromAmino(object.value) + }, + toAminoMsg(message: Tx): TxAminoMsg { + return { + type: 'cosmos-sdk/Tx', + value: Tx.toAmino(message) + } + }, + fromProtoMsg(message: TxProtoMsg): Tx { + return Tx.decode(message.value) + }, + toProto(message: Tx): Uint8Array { + return Tx.encode(message).finish() + }, + toProtoMsg(message: Tx): TxProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.Tx', + value: Tx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Tx.typeUrl, Tx) +GlobalDecoderRegistry.registerAminoProtoMapping(Tx.aminoType, Tx.typeUrl) +function createBaseTxRaw(): TxRaw { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + signatures: [] + } +} +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) + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes) + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxRaw() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes() + break + case 2: + message.authInfoBytes = reader.bytes() + break + case 3: + message.signatures.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TxRaw { + const message = createBaseTxRaw() + message.bodyBytes = object.bodyBytes ?? new Uint8Array() + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array() + message.signatures = object.signatures?.map((e) => e) || [] + return message + }, + fromAmino(object: TxRawAmino): TxRaw { + 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 + ? base64FromBytes(message.bodyBytes) + : undefined + obj.auth_info_bytes = message.authInfoBytes + ? base64FromBytes(message.authInfoBytes) + : undefined + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e)) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg(object: TxRawAminoMsg): TxRaw { + return TxRaw.fromAmino(object.value) + }, + toAminoMsg(message: TxRaw): TxRawAminoMsg { + return { + type: 'cosmos-sdk/TxRaw', + value: TxRaw.toAmino(message) + } + }, + fromProtoMsg(message: TxRawProtoMsg): TxRaw { + return TxRaw.decode(message.value) + }, + toProto(message: TxRaw): Uint8Array { + return TxRaw.encode(message).finish() + }, + toProtoMsg(message: TxRaw): TxRawProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.TxRaw', + value: TxRaw.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TxRaw.typeUrl, TxRaw) +GlobalDecoderRegistry.registerAminoProtoMapping(TxRaw.aminoType, TxRaw.typeUrl) +function createBaseSignDoc(): SignDoc { + return { + bodyBytes: new Uint8Array(), + authInfoBytes: new Uint8Array(), + chainId: '', + accountNumber: BigInt(0) + } +} +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) + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes) + } + if (message.chainId !== '') { + writer.uint32(26).string(message.chainId) + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignDoc() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes() + break + case 2: + message.authInfoBytes = reader.bytes() + break + case 3: + message.chainId = reader.string() + break + case 4: + message.accountNumber = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SignDoc { + const message = createBaseSignDoc() + message.bodyBytes = object.bodyBytes ?? new Uint8Array() + message.authInfoBytes = object.authInfoBytes ?? new Uint8Array() + message.chainId = object.chainId ?? '' + message.accountNumber = + object.accountNumber !== undefined && object.accountNumber !== null + ? BigInt(object.accountNumber.toString()) + : BigInt(0) + return message + }, + fromAmino(object: SignDocAmino): SignDoc { + 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 + ? base64FromBytes(message.bodyBytes) + : undefined + obj.auth_info_bytes = message.authInfoBytes + ? base64FromBytes(message.authInfoBytes) + : undefined + obj.chain_id = message.chainId === '' ? undefined : message.chainId + obj.account_number = + message.accountNumber !== BigInt(0) + ? message.accountNumber.toString() + : undefined + return obj + }, + fromAminoMsg(object: SignDocAminoMsg): SignDoc { + return SignDoc.fromAmino(object.value) + }, + toAminoMsg(message: SignDoc): SignDocAminoMsg { + return { + type: 'cosmos-sdk/SignDoc', + value: SignDoc.toAmino(message) + } + }, + fromProtoMsg(message: SignDocProtoMsg): SignDoc { + return SignDoc.decode(message.value) + }, + toProto(message: SignDoc): Uint8Array { + return SignDoc.encode(message).finish() + }, + toProtoMsg(message: SignDoc): SignDocProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.SignDoc', + value: SignDoc.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.chainId + obj.account_number = + message.accountNumber !== BigInt(0) + ? message.accountNumber.toString() + : undefined + obj.sequence = + message.sequence !== BigInt(0) ? 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: [], + memo: '', + timeoutHeight: BigInt(0), + extensionOptions: [], + nonCriticalExtensionOptions: [] + } +} +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() + } + if (message.memo !== '') { + writer.uint32(18).string(message.memo) + } + if (message.timeoutHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.timeoutHeight) + } + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim() + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxBody() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())) + break + case 2: + message.memo = reader.string() + break + case 3: + message.timeoutHeight = reader.uint64() + break + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())) + break + case 2047: + message.nonCriticalExtensionOptions.push( + Any.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TxBody { + const message = createBaseTxBody() + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [] + message.memo = object.memo ?? '' + message.timeoutHeight = + object.timeoutHeight !== undefined && object.timeoutHeight !== null + ? BigInt(object.timeoutHeight.toString()) + : BigInt(0) + message.extensionOptions = + object.extensionOptions?.map((e) => Any.fromPartial(e)) || [] + message.nonCriticalExtensionOptions = + object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || [] + return message + }, + fromAmino(object: TxBodyAmino): TxBody { + 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 = {} + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? Any.toAmino(e) : undefined + ) + } else { + obj.messages = message.messages + } + obj.memo = message.memo === '' ? undefined : message.memo + obj.timeout_height = + message.timeoutHeight !== BigInt(0) + ? message.timeoutHeight.toString() + : undefined + if (message.extensionOptions) { + obj.extension_options = message.extensionOptions.map((e) => + e ? Any.toAmino(e) : undefined + ) + } else { + obj.extension_options = message.extensionOptions + } + if (message.nonCriticalExtensionOptions) { + obj.non_critical_extension_options = + message.nonCriticalExtensionOptions.map((e) => + e ? Any.toAmino(e) : undefined + ) + } else { + obj.non_critical_extension_options = message.nonCriticalExtensionOptions + } + return obj + }, + fromAminoMsg(object: TxBodyAminoMsg): TxBody { + return TxBody.fromAmino(object.value) + }, + toAminoMsg(message: TxBody): TxBodyAminoMsg { + return { + type: 'cosmos-sdk/TxBody', + value: TxBody.toAmino(message) + } + }, + fromProtoMsg(message: TxBodyProtoMsg): TxBody { + return TxBody.decode(message.value) + }, + toProto(message: TxBody): Uint8Array { + return TxBody.encode(message).finish() + }, + toProtoMsg(message: TxBody): TxBodyProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.TxBody', + value: TxBody.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TxBody.typeUrl, TxBody) +GlobalDecoderRegistry.registerAminoProtoMapping( + TxBody.aminoType, + TxBody.typeUrl +) +function createBaseAuthInfo(): AuthInfo { + return { + signerInfos: [], + 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() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAuthInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())) + break + case 2: + message.fee = Fee.decode(reader, reader.uint32()) + break + case 3: + message.tip = Tip.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + if (message.signerInfos) { + obj.signer_infos = message.signerInfos.map((e) => + e ? SignerInfo.toAmino(e) : undefined + ) + } else { + obj.signer_infos = message.signerInfos + } + obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined + return obj + }, + fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { + return AuthInfo.fromAmino(object.value) + }, + toAminoMsg(message: AuthInfo): AuthInfoAminoMsg { + return { + type: 'cosmos-sdk/AuthInfo', + value: AuthInfo.toAmino(message) + } + }, + fromProtoMsg(message: AuthInfoProtoMsg): AuthInfo { + return AuthInfo.decode(message.value) + }, + toProto(message: AuthInfo): Uint8Array { + return AuthInfo.encode(message).finish() + }, + toProtoMsg(message: AuthInfo): AuthInfoProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.AuthInfo', + value: AuthInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(AuthInfo.typeUrl, AuthInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + AuthInfo.aminoType, + AuthInfo.typeUrl +) +function createBaseSignerInfo(): SignerInfo { + return { + publicKey: undefined, + 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() + } + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim() + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignerInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()) + break + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()) + break + case 3: + message.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SignerInfo { + const message = createBaseSignerInfo() + message.publicKey = + object.publicKey !== undefined && object.publicKey !== null + ? Any.fromPartial(object.publicKey) + : undefined + message.modeInfo = + object.modeInfo !== undefined && object.modeInfo !== null + ? ModeInfo.fromPartial(object.modeInfo) + : undefined + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + return message + }, + fromAmino(object: SignerInfoAmino): SignerInfo { + 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 = {} + obj.public_key = message.publicKey + ? Any.toAmino(message.publicKey) + : undefined + obj.mode_info = message.modeInfo + ? ModeInfo.toAmino(message.modeInfo) + : undefined + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { + return SignerInfo.fromAmino(object.value) + }, + toAminoMsg(message: SignerInfo): SignerInfoAminoMsg { + return { + type: 'cosmos-sdk/SignerInfo', + value: SignerInfo.toAmino(message) + } + }, + fromProtoMsg(message: SignerInfoProtoMsg): SignerInfo { + return SignerInfo.decode(message.value) + }, + toProto(message: SignerInfo): Uint8Array { + return SignerInfo.encode(message).finish() + }, + toProtoMsg(message: SignerInfo): SignerInfoProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.SignerInfo', + value: SignerInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SignerInfo.typeUrl, SignerInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + SignerInfo.aminoType, + SignerInfo.typeUrl +) +function createBaseModeInfo(): ModeInfo { + return { + single: undefined, + multi: undefined + } +} +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() + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()) + break + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModeInfo { + const message = createBaseModeInfo() + message.single = + object.single !== undefined && object.single !== null + ? ModeInfo_Single.fromPartial(object.single) + : undefined + message.multi = + object.multi !== undefined && object.multi !== null + ? ModeInfo_Multi.fromPartial(object.multi) + : undefined + return message + }, + fromAmino(object: ModeInfoAmino): ModeInfo { + 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 = {} + obj.single = message.single + ? ModeInfo_Single.toAmino(message.single) + : undefined + obj.multi = message.multi + ? ModeInfo_Multi.toAmino(message.multi) + : undefined + return obj + }, + fromAminoMsg(object: ModeInfoAminoMsg): ModeInfo { + return ModeInfo.fromAmino(object.value) + }, + toAminoMsg(message: ModeInfo): ModeInfoAminoMsg { + return { + type: 'cosmos-sdk/ModeInfo', + value: ModeInfo.toAmino(message) + } + }, + fromProtoMsg(message: ModeInfoProtoMsg): ModeInfo { + return ModeInfo.decode(message.value) + }, + toProto(message: ModeInfo): Uint8Array { + return ModeInfo.encode(message).finish() + }, + toProtoMsg(message: ModeInfo): ModeInfoProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.ModeInfo', + value: ModeInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ModeInfo.typeUrl, ModeInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + ModeInfo.aminoType, + ModeInfo.typeUrl +) +function createBaseModeInfo_Single(): ModeInfo_Single { + return { + mode: 0 + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo_Single() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModeInfo_Single { + const message = createBaseModeInfo_Single() + message.mode = object.mode ?? 0 + return message + }, + fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { + const message = createBaseModeInfo_Single() + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode + } + return message + }, + toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { + const obj: any = {} + obj.mode = message.mode === 0 ? undefined : message.mode + return obj + }, + fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { + return ModeInfo_Single.fromAmino(object.value) + }, + toAminoMsg(message: ModeInfo_Single): ModeInfo_SingleAminoMsg { + return { + type: 'cosmos-sdk/Single', + value: ModeInfo_Single.toAmino(message) + } + }, + fromProtoMsg(message: ModeInfo_SingleProtoMsg): ModeInfo_Single { + return ModeInfo_Single.decode(message.value) + }, + toProto(message: ModeInfo_Single): Uint8Array { + return ModeInfo_Single.encode(message).finish() + }, + toProtoMsg(message: ModeInfo_Single): ModeInfo_SingleProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.Single', + value: ModeInfo_Single.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ModeInfo_Single.typeUrl, ModeInfo_Single) +GlobalDecoderRegistry.registerAminoProtoMapping( + ModeInfo_Single.aminoType, + ModeInfo_Single.typeUrl +) +function createBaseModeInfo_Multi(): ModeInfo_Multi { + return { + 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() + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModeInfo_Multi() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()) + break + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModeInfo_Multi { + const message = createBaseModeInfo_Multi() + message.bitarray = + object.bitarray !== undefined && object.bitarray !== null + ? CompactBitArray.fromPartial(object.bitarray) + : undefined + message.modeInfos = + object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || [] + return message + }, + fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { + 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 = {} + obj.bitarray = message.bitarray + ? CompactBitArray.toAmino(message.bitarray) + : undefined + if (message.modeInfos) { + obj.mode_infos = message.modeInfos.map((e) => + e ? ModeInfo.toAmino(e) : undefined + ) + } else { + obj.mode_infos = message.modeInfos + } + return obj + }, + fromAminoMsg(object: ModeInfo_MultiAminoMsg): ModeInfo_Multi { + return ModeInfo_Multi.fromAmino(object.value) + }, + toAminoMsg(message: ModeInfo_Multi): ModeInfo_MultiAminoMsg { + return { + type: 'cosmos-sdk/Multi', + value: ModeInfo_Multi.toAmino(message) + } + }, + fromProtoMsg(message: ModeInfo_MultiProtoMsg): ModeInfo_Multi { + return ModeInfo_Multi.decode(message.value) + }, + toProto(message: ModeInfo_Multi): Uint8Array { + return ModeInfo_Multi.encode(message).finish() + }, + toProtoMsg(message: ModeInfo_Multi): ModeInfo_MultiProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.Multi', + value: ModeInfo_Multi.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ModeInfo_Multi.typeUrl, ModeInfo_Multi) +GlobalDecoderRegistry.registerAminoProtoMapping( + ModeInfo_Multi.aminoType, + ModeInfo_Multi.typeUrl +) +function createBaseFee(): Fee { + return { + amount: [], + gasLimit: BigInt(0), + payer: '', + granter: '' + } +} +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() + } + if (message.gasLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.gasLimit) + } + if (message.payer !== '') { + writer.uint32(26).string(message.payer) + } + if (message.granter !== '') { + writer.uint32(34).string(message.granter) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFee() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.gasLimit = reader.uint64() + break + case 3: + message.payer = reader.string() + break + case 4: + message.granter = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Fee { + const message = createBaseFee() + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + message.gasLimit = + object.gasLimit !== undefined && object.gasLimit !== null + ? BigInt(object.gasLimit.toString()) + : BigInt(0) + message.payer = object.payer ?? '' + message.granter = object.granter ?? '' + return message + }, + fromAmino(object: FeeAmino): Fee { + 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 = {} + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.amount = message.amount + } + obj.gas_limit = + message.gasLimit !== BigInt(0) ? message.gasLimit.toString() : undefined + obj.payer = message.payer === '' ? undefined : message.payer + obj.granter = message.granter === '' ? undefined : message.granter + return obj + }, + fromAminoMsg(object: FeeAminoMsg): Fee { + return Fee.fromAmino(object.value) + }, + toAminoMsg(message: Fee): FeeAminoMsg { + return { + type: 'cosmos-sdk/Fee', + value: Fee.toAmino(message) + } + }, + fromProtoMsg(message: FeeProtoMsg): Fee { + return Fee.decode(message.value) + }, + toProto(message: Fee): Uint8Array { + return Fee.encode(message).finish() + }, + toProtoMsg(message: Fee): FeeProtoMsg { + return { + typeUrl: '/cosmos.tx.v1beta1.Fee', + value: Fee.encode(message).finish() + } + } +} +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 + }, + 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 = message.amount + } + obj.tipper = message.tipper === '' ? undefined : 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 + }, + 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 = 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 === '' ? undefined : message.address + obj.sign_doc = message.signDoc + ? SignDocDirectAux.toAmino(message.signDoc) + : undefined + obj.mode = message.mode === 0 ? undefined : 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 +) diff --git a/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.amino.ts b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 0000000..979333c --- /dev/null +++ b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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 + } +} diff --git a/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.registry.ts b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 0000000..fafd862 --- /dev/null +++ b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,57 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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) + } + } + } +} diff --git a/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.ts b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 0000000..95161b5 --- /dev/null +++ b/src/proto/osmojs/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,532 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Plan, PlanAmino, PlanSDKType } from './upgrade' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + }, + 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 === '' ? undefined : message.authority + obj.plan = message.plan + ? Plan.toAmino(message.plan) + : Plan.toAmino(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 + }, + 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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/cosmos/upgrade/v1beta1/upgrade.ts b/src/proto/osmojs/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000..0a24f90 --- /dev/null +++ b/src/proto/osmojs/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,810 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { toTimestamp, fromTimestamp } from '../../../../helpers' +import { GlobalDecoderRegistry } from '../../../registry' +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + 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. */ + height: bigint + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgradedClientState?: Any +} +export interface PlanProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.Plan' + value: Uint8Array +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + 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: 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 + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino +} +export interface PlanAminoMsg { + type: 'cosmos-sdk/Plan' + value: PlanAmino +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanSDKType { + name: string + /** @deprecated */ + time: Date + height: bigint + info: string + /** @deprecated */ + 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 { + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal' + value: Uint8Array +} +/** + * 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 of the proposal */ + title?: string + /** description of the proposal */ + description?: string + /** plan of the proposal */ + plan: PlanAmino +} +export interface SoftwareUpgradeProposalAminoMsg { + type: 'cosmos-sdk/SoftwareUpgradeProposal' + value: SoftwareUpgradeProposalAmino +} +/** + * 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 +} +/** + * 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 { + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal' + value: Uint8Array +} +/** + * 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 of the proposal */ + title?: string + /** description of the proposal */ + description?: string +} +export interface CancelSoftwareUpgradeProposalAminoMsg { + type: 'cosmos-sdk/CancelSoftwareUpgradeProposal' + value: CancelSoftwareUpgradeProposalAmino +} +/** + * 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 +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string + /** consensus version of the app module */ + version: bigint +} +export interface ModuleVersionProtoMsg { + typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion' + value: Uint8Array +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name?: string + /** consensus version of the app module */ + version?: string +} +export interface ModuleVersionAminoMsg { + type: 'cosmos-sdk/ModuleVersion' + value: ModuleVersionAmino +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionSDKType { + name: string + version: bigint +} +function createBasePlan(): Plan { + return { + name: '', + time: new Date(), + height: BigInt(0), + info: '', + upgradedClientState: undefined + } +} +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) + } + if (message.time !== undefined) { + Timestamp.encode( + toTimestamp(message.time), + writer.uint32(18).fork() + ).ldelim() + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height) + } + if (message.info !== '') { + writer.uint32(34).string(message.info) + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePlan() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.name = reader.string() + break + case 2: + message.time = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 3: + message.height = reader.int64() + break + case 4: + message.info = reader.string() + break + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Plan { + const message = createBasePlan() + message.name = object.name ?? '' + message.time = object.time ?? undefined + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.info = object.info ?? '' + message.upgradedClientState = + object.upgradedClientState !== undefined && + object.upgradedClientState !== null + ? Any.fromPartial(object.upgradedClientState) + : undefined + return message + }, + fromAmino(object: PlanAmino): Plan { + 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 === '' ? undefined : message.name + obj.time = message.time + ? Timestamp.toAmino(toTimestamp(message.time)) + : new Date() + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.info = message.info === '' ? undefined : message.info + obj.upgraded_client_state = message.upgradedClientState + ? Any.toAmino(message.upgradedClientState) + : undefined + return obj + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value) + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: 'cosmos-sdk/Plan', + value: Plan.toAmino(message) + } + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value) + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish() + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.Plan', + value: Plan.encode(message).finish() + } + } +} +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({}) + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SoftwareUpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSoftwareUpgradeProposal() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined + return message + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + 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 === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.plan = message.plan + ? Plan.toAmino(message.plan) + : Plan.toAmino(Plan.fromPartial({})) + return obj + }, + fromAminoMsg( + object: SoftwareUpgradeProposalAminoMsg + ): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value) + }, + toAminoMsg( + message: SoftwareUpgradeProposal + ): SoftwareUpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.toAmino(message) + } + }, + fromProtoMsg( + message: SoftwareUpgradeProposalProtoMsg + ): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value) + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish() + }, + toProtoMsg( + message: SoftwareUpgradeProposal + ): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.encode(message).finish() + } + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): CancelSoftwareUpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCancelSoftwareUpgradeProposal() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + return message + }, + fromAmino( + object: CancelSoftwareUpgradeProposalAmino + ): CancelSoftwareUpgradeProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + return obj + }, + fromAminoMsg( + object: CancelSoftwareUpgradeProposalAminoMsg + ): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value) + }, + toAminoMsg( + message: CancelSoftwareUpgradeProposal + ): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.toAmino(message) + } + }, + fromProtoMsg( + message: CancelSoftwareUpgradeProposalProtoMsg + ): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value) + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish() + }, + toProtoMsg( + message: CancelSoftwareUpgradeProposal + ): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + CancelSoftwareUpgradeProposal.typeUrl, + CancelSoftwareUpgradeProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + CancelSoftwareUpgradeProposal.aminoType, + CancelSoftwareUpgradeProposal.typeUrl +) +function createBaseModuleVersion(): ModuleVersion { + return { + name: '', + version: BigInt(0) + } +} +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) + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModuleVersion() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.name = reader.string() + break + case 2: + message.version = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModuleVersion { + const message = createBaseModuleVersion() + message.name = object.name ?? '' + message.version = + object.version !== undefined && object.version !== null + ? BigInt(object.version.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + 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 = {} + obj.name = message.name === '' ? undefined : message.name + obj.version = + message.version !== BigInt(0) ? message.version.toString() : undefined + return obj + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value) + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: 'cosmos-sdk/ModuleVersion', + value: ModuleVersion.toAmino(message) + } + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value) + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish() + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion', + value: ModuleVersion.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ModuleVersion.typeUrl, ModuleVersion) +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleVersion.aminoType, + ModuleVersion.typeUrl +) diff --git a/src/proto/osmojs/cosmwasm/bundle.ts b/src/proto/osmojs/cosmwasm/bundle.ts new file mode 100644 index 0000000..7fd769c --- /dev/null +++ b/src/proto/osmojs/cosmwasm/bundle.ts @@ -0,0 +1,41 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +/* eslint-disable @typescript-eslint/no-namespace */ +//@ts-nocheck +import * as _118 from './wasm/v1/authz' +import * as _119 from './wasm/v1/genesis' +import * as _120 from './wasm/v1/ibc' +import * as _121 from './wasm/v1/proposal_legacy' +import * as _122 from './wasm/v1/query' +import * as _123 from './wasm/v1/tx' +import * as _124 from './wasm/v1/types' +import * as _325 from './wasm/v1/tx.amino' +import * as _326 from './wasm/v1/tx.registry' +import * as _327 from './wasm/v1/query.lcd' +import * as _328 from './wasm/v1/query.rpc.Query' +import * as _329 from './wasm/v1/tx.rpc.msg' +import * as _421 from './lcd' +import * as _422 from './rpc.query' +import * as _423 from './rpc.tx' +export namespace cosmwasm { + export namespace wasm { + export const v1 = { + ..._118, + ..._119, + ..._120, + ..._121, + ..._122, + ..._123, + ..._124, + ..._325, + ..._326, + ..._327, + ..._328, + ..._329 + } + } + export const ClientFactory = { + ..._421, + ..._422, + ..._423 + } +} diff --git a/src/proto/osmojs/cosmwasm/client.ts b/src/proto/osmojs/cosmwasm/client.ts new file mode 100644 index 0000000..ac50acb --- /dev/null +++ b/src/proto/osmojs/cosmwasm/client.ts @@ -0,0 +1,56 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing' +import { + defaultRegistryTypes, + AminoTypes, + SigningStargateClient +} from '@cosmjs/stargate' +import { HttpEndpoint } from '@cosmjs/tendermint-rpc' +import * as cosmwasmWasmV1TxRegistry from './wasm/v1/tx.registry' +import * as cosmwasmWasmV1TxAmino from './wasm/v1/tx.amino' +export const cosmwasmAminoConverters = { + ...cosmwasmWasmV1TxAmino.AminoConverter +} +export const cosmwasmProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmwasmWasmV1TxRegistry.registry +] +export const getSigningCosmwasmClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +} = {}): { + registry: Registry + aminoTypes: AminoTypes +} => { + const registry = new Registry([...defaultTypes, ...cosmwasmProtoRegistry]) + const aminoTypes = new AminoTypes({ + ...cosmwasmAminoConverters + }) + return { + registry, + aminoTypes + } +} +export const getSigningCosmwasmClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint + signer: OfflineSigner + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +}) => { + const { registry, aminoTypes } = getSigningCosmwasmClientOptions({ + defaultTypes + }) + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes + } + ) + return client +} diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/authz.ts b/src/proto/osmojs/cosmwasm/wasm/v1/authz.ts new file mode 100644 index 0000000..7a02dfd --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/authz.ts @@ -0,0 +1,1773 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from './types' +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +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?: '/cosmwasm.wasm.v1.ContractExecutionAuthorization' + /** Grants for contract executions */ + grants: ContractGrant[] +} +export interface ContractExecutionAuthorizationProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ContractExecutionAuthorization' + value: Uint8Array +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationAmino { + /** Grants for contract executions */ + grants: ContractGrantAmino[] +} +export interface ContractExecutionAuthorizationAminoMsg { + type: 'wasm/ContractExecutionAuthorization' + value: ContractExecutionAuthorizationAmino +} +/** + * ContractExecutionAuthorization defines authorization for wasm execute. + * Since: wasmd 0.30 + */ +export interface ContractExecutionAuthorizationSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.ContractExecutionAuthorization' + grants: ContractGrantSDKType[] +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorization { + $typeUrl?: '/cosmwasm.wasm.v1.ContractMigrationAuthorization' + /** Grants for contract migrations */ + grants: ContractGrant[] +} +export interface ContractMigrationAuthorizationProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ContractMigrationAuthorization' + value: Uint8Array +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationAmino { + /** Grants for contract migrations */ + grants: ContractGrantAmino[] +} +export interface ContractMigrationAuthorizationAminoMsg { + type: 'wasm/ContractMigrationAuthorization' + value: ContractMigrationAuthorizationAmino +} +/** + * ContractMigrationAuthorization defines authorization for wasm contract + * migration. Since: wasmd 0.30 + */ +export interface ContractMigrationAuthorizationSDKType { + $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 + */ +export interface ContractGrant { + /** Contract is the bech32 address of the smart contract */ + contract: string + /** + * 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 + /** + * 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 +} +export interface ContractGrantProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ContractGrant' + value: Uint8Array +} +export type ContractGrantEncoded = Omit & { + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: + | MaxCallsLimitProtoMsg + | MaxFundsLimitProtoMsg + | CombinedLimitProtoMsg + | AnyProtoMsg + | 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?: + | AllowAllMessagesFilterProtoMsg + | AcceptedMessageKeysFilterProtoMsg + | AcceptedMessagesFilterProtoMsg + | AnyProtoMsg + | undefined +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantAmino { + /** Contract is the bech32 address of the smart contract */ + contract?: string + /** + * Limit defines execution limits that are enforced and updated when the grant + * is applied. When the limit lapsed the grant is removed. + */ + limit?: AnyAmino + /** + * 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?: AnyAmino +} +export interface ContractGrantAminoMsg { + type: 'wasm/ContractGrant' + value: ContractGrantAmino +} +/** + * ContractGrant a granted permission for a single contract + * Since: wasmd 0.30 + */ +export interface ContractGrantSDKType { + contract: string + 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?: '/cosmwasm.wasm.v1.MaxCallsLimit' + /** Remaining number that is decremented on each execution */ + remaining: bigint +} +export interface MaxCallsLimitProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MaxCallsLimit' + value: Uint8Array +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitAmino { + /** Remaining number that is decremented on each execution */ + remaining?: string +} +export interface MaxCallsLimitAminoMsg { + type: 'wasm/MaxCallsLimit' + value: MaxCallsLimitAmino +} +/** + * MaxCallsLimit limited number of calls to the contract. No funds transferable. + * Since: wasmd 0.30 + */ +export interface MaxCallsLimitSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.MaxCallsLimit' + remaining: bigint +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimit { + $typeUrl?: '/cosmwasm.wasm.v1.MaxFundsLimit' + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: Coin[] +} +export interface MaxFundsLimitProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MaxFundsLimit' + value: Uint8Array +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitAmino { + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: CoinAmino[] +} +export interface MaxFundsLimitAminoMsg { + type: 'wasm/MaxFundsLimit' + value: MaxFundsLimitAmino +} +/** + * MaxFundsLimit defines the maximal amounts that can be sent to the contract. + * Since: wasmd 0.30 + */ +export interface MaxFundsLimitSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.MaxFundsLimit' + amounts: CoinSDKType[] +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimit { + $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. */ + amounts: Coin[] +} +export interface CombinedLimitProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.CombinedLimit' + value: Uint8Array +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitAmino { + /** Remaining number that is decremented on each execution */ + calls_remaining?: string + /** Amounts is the maximal amount of tokens transferable to the contract. */ + amounts: CoinAmino[] +} +export interface CombinedLimitAminoMsg { + type: 'wasm/CombinedLimit' + value: CombinedLimitAmino +} +/** + * CombinedLimit defines the maximal amounts that can be sent to a contract and + * the maximal number of calls executable. Both need to remain >0 to be valid. + * Since: wasmd 0.30 + */ +export interface CombinedLimitSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.CombinedLimit' + calls_remaining: bigint + amounts: CoinSDKType[] +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilter { + $typeUrl?: '/cosmwasm.wasm.v1.AllowAllMessagesFilter' +} +export interface AllowAllMessagesFilterProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AllowAllMessagesFilter' + value: Uint8Array +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterAmino {} +export interface AllowAllMessagesFilterAminoMsg { + type: 'wasm/AllowAllMessagesFilter' + value: AllowAllMessagesFilterAmino +} +/** + * AllowAllMessagesFilter is a wildcard to allow any type of contract payload + * message. + * Since: wasmd 0.30 + */ +export interface AllowAllMessagesFilterSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.AllowAllMessagesFilter' +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilter { + $typeUrl?: '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter' + /** Messages is the list of unique keys */ + keys: string[] +} +export interface AcceptedMessageKeysFilterProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter' + value: Uint8Array +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterAmino { + /** Messages is the list of unique keys */ + keys?: string[] +} +export interface AcceptedMessageKeysFilterAminoMsg { + type: 'wasm/AcceptedMessageKeysFilter' + value: AcceptedMessageKeysFilterAmino +} +/** + * AcceptedMessageKeysFilter accept only the specific contract message keys in + * the json object to be executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessageKeysFilterSDKType { + $typeUrl?: '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter' + keys: string[] +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilter { + $typeUrl?: '/cosmwasm.wasm.v1.AcceptedMessagesFilter' + /** Messages is the list of raw contract messages */ + messages: Uint8Array[] +} +export interface AcceptedMessagesFilterProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AcceptedMessagesFilter' + value: Uint8Array +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterAmino { + /** Messages is the list of raw contract messages */ + messages?: any[] +} +export interface AcceptedMessagesFilterAminoMsg { + type: 'wasm/AcceptedMessagesFilter' + value: AcceptedMessagesFilterAmino +} +/** + * AcceptedMessagesFilter accept only the specific raw contract messages to be + * executed. + * Since: wasmd 0.30 + */ +export interface AcceptedMessagesFilterSDKType { + $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 + }, + 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 = message.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', + grants: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ContractExecutionAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractExecutionAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.grants.push(ContractGrant.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ContractExecutionAuthorization { + const message = createBaseContractExecutionAuthorization() + message.grants = + object.grants?.map((e) => ContractGrant.fromPartial(e)) || [] + return message + }, + fromAmino( + object: ContractExecutionAuthorizationAmino + ): ContractExecutionAuthorization { + const message = createBaseContractExecutionAuthorization() + message.grants = object.grants?.map((e) => ContractGrant.fromAmino(e)) || [] + return message + }, + toAmino( + message: ContractExecutionAuthorization + ): ContractExecutionAuthorizationAmino { + const obj: any = {} + if (message.grants) { + obj.grants = message.grants.map((e) => + e ? ContractGrant.toAmino(e) : undefined + ) + } else { + obj.grants = message.grants + } + return obj + }, + fromAminoMsg( + object: ContractExecutionAuthorizationAminoMsg + ): ContractExecutionAuthorization { + return ContractExecutionAuthorization.fromAmino(object.value) + }, + toAminoMsg( + message: ContractExecutionAuthorization + ): ContractExecutionAuthorizationAminoMsg { + return { + type: 'wasm/ContractExecutionAuthorization', + value: ContractExecutionAuthorization.toAmino(message) + } + }, + fromProtoMsg( + message: ContractExecutionAuthorizationProtoMsg + ): ContractExecutionAuthorization { + return ContractExecutionAuthorization.decode(message.value) + }, + toProto(message: ContractExecutionAuthorization): Uint8Array { + return ContractExecutionAuthorization.encode(message).finish() + }, + toProtoMsg( + message: ContractExecutionAuthorization + ): ContractExecutionAuthorizationProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ContractExecutionAuthorization', + value: ContractExecutionAuthorization.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ContractExecutionAuthorization.typeUrl, + ContractExecutionAuthorization +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ContractExecutionAuthorization.aminoType, + ContractExecutionAuthorization.typeUrl +) +function createBaseContractMigrationAuthorization(): ContractMigrationAuthorization { + return { + $typeUrl: '/cosmwasm.wasm.v1.ContractMigrationAuthorization', + grants: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ContractMigrationAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractMigrationAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.grants.push(ContractGrant.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ContractMigrationAuthorization { + const message = createBaseContractMigrationAuthorization() + message.grants = + object.grants?.map((e) => ContractGrant.fromPartial(e)) || [] + return message + }, + fromAmino( + object: ContractMigrationAuthorizationAmino + ): ContractMigrationAuthorization { + const message = createBaseContractMigrationAuthorization() + message.grants = object.grants?.map((e) => ContractGrant.fromAmino(e)) || [] + return message + }, + toAmino( + message: ContractMigrationAuthorization + ): ContractMigrationAuthorizationAmino { + const obj: any = {} + if (message.grants) { + obj.grants = message.grants.map((e) => + e ? ContractGrant.toAmino(e) : undefined + ) + } else { + obj.grants = message.grants + } + return obj + }, + fromAminoMsg( + object: ContractMigrationAuthorizationAminoMsg + ): ContractMigrationAuthorization { + return ContractMigrationAuthorization.fromAmino(object.value) + }, + toAminoMsg( + message: ContractMigrationAuthorization + ): ContractMigrationAuthorizationAminoMsg { + return { + type: 'wasm/ContractMigrationAuthorization', + value: ContractMigrationAuthorization.toAmino(message) + } + }, + fromProtoMsg( + message: ContractMigrationAuthorizationProtoMsg + ): ContractMigrationAuthorization { + return ContractMigrationAuthorization.decode(message.value) + }, + toProto(message: ContractMigrationAuthorization): Uint8Array { + return ContractMigrationAuthorization.encode(message).finish() + }, + toProtoMsg( + message: ContractMigrationAuthorization + ): ContractMigrationAuthorizationProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ContractMigrationAuthorization', + value: ContractMigrationAuthorization.encode(message).finish() + } + } +} +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 + }, + 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: '', + limit: undefined, + filter: undefined + } +} +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( + GlobalDecoderRegistry.wrapAny(message.limit), + writer.uint32(18).fork() + ).ldelim() + } + if (message.filter !== undefined) { + Any.encode( + GlobalDecoderRegistry.wrapAny(message.filter), + writer.uint32(26).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractGrant { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractGrant() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.contract = reader.string() + break + case 2: + message.limit = GlobalDecoderRegistry.unwrapAny(reader) + break + case 3: + message.filter = GlobalDecoderRegistry.unwrapAny(reader) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ContractGrant { + const message = createBaseContractGrant() + message.contract = object.contract ?? '' + 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 { + 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 === '' ? undefined : message.contract + obj.limit = message.limit + ? GlobalDecoderRegistry.toAminoMsg(message.limit) + : undefined + obj.filter = message.filter + ? GlobalDecoderRegistry.toAminoMsg(message.filter) + : undefined + return obj + }, + fromAminoMsg(object: ContractGrantAminoMsg): ContractGrant { + return ContractGrant.fromAmino(object.value) + }, + toAminoMsg(message: ContractGrant): ContractGrantAminoMsg { + return { + type: 'wasm/ContractGrant', + value: ContractGrant.toAmino(message) + } + }, + fromProtoMsg(message: ContractGrantProtoMsg): ContractGrant { + return ContractGrant.decode(message.value) + }, + toProto(message: ContractGrant): Uint8Array { + return ContractGrant.encode(message).finish() + }, + toProtoMsg(message: ContractGrant): ContractGrantProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ContractGrant', + value: ContractGrant.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ContractGrant.typeUrl, ContractGrant) +GlobalDecoderRegistry.registerAminoProtoMapping( + ContractGrant.aminoType, + ContractGrant.typeUrl +) +function createBaseMaxCallsLimit(): MaxCallsLimit { + return { + $typeUrl: '/cosmwasm.wasm.v1.MaxCallsLimit', + remaining: BigInt(0) + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MaxCallsLimit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMaxCallsLimit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.remaining = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + const message = createBaseMaxCallsLimit() + if (object.remaining !== undefined && object.remaining !== null) { + message.remaining = BigInt(object.remaining) + } + return message + }, + toAmino(message: MaxCallsLimit): MaxCallsLimitAmino { + const obj: any = {} + obj.remaining = + message.remaining !== BigInt(0) ? message.remaining.toString() : undefined + return obj + }, + fromAminoMsg(object: MaxCallsLimitAminoMsg): MaxCallsLimit { + return MaxCallsLimit.fromAmino(object.value) + }, + toAminoMsg(message: MaxCallsLimit): MaxCallsLimitAminoMsg { + return { + type: 'wasm/MaxCallsLimit', + value: MaxCallsLimit.toAmino(message) + } + }, + fromProtoMsg(message: MaxCallsLimitProtoMsg): MaxCallsLimit { + return MaxCallsLimit.decode(message.value) + }, + toProto(message: MaxCallsLimit): Uint8Array { + return MaxCallsLimit.encode(message).finish() + }, + toProtoMsg(message: MaxCallsLimit): MaxCallsLimitProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MaxCallsLimit', + value: MaxCallsLimit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MaxCallsLimit.typeUrl, MaxCallsLimit) +GlobalDecoderRegistry.registerAminoProtoMapping( + MaxCallsLimit.aminoType, + MaxCallsLimit.typeUrl +) +function createBaseMaxFundsLimit(): MaxFundsLimit { + return { + $typeUrl: '/cosmwasm.wasm.v1.MaxFundsLimit', + amounts: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MaxFundsLimit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMaxFundsLimit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.amounts.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MaxFundsLimit { + const message = createBaseMaxFundsLimit() + message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MaxFundsLimitAmino): MaxFundsLimit { + const message = createBaseMaxFundsLimit() + message.amounts = object.amounts?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino(message: MaxFundsLimit): MaxFundsLimitAmino { + const obj: any = {} + if (message.amounts) { + obj.amounts = message.amounts.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.amounts = message.amounts + } + return obj + }, + fromAminoMsg(object: MaxFundsLimitAminoMsg): MaxFundsLimit { + return MaxFundsLimit.fromAmino(object.value) + }, + toAminoMsg(message: MaxFundsLimit): MaxFundsLimitAminoMsg { + return { + type: 'wasm/MaxFundsLimit', + value: MaxFundsLimit.toAmino(message) + } + }, + fromProtoMsg(message: MaxFundsLimitProtoMsg): MaxFundsLimit { + return MaxFundsLimit.decode(message.value) + }, + toProto(message: MaxFundsLimit): Uint8Array { + return MaxFundsLimit.encode(message).finish() + }, + toProtoMsg(message: MaxFundsLimit): MaxFundsLimitProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MaxFundsLimit', + value: MaxFundsLimit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MaxFundsLimit.typeUrl, MaxFundsLimit) +GlobalDecoderRegistry.registerAminoProtoMapping( + MaxFundsLimit.aminoType, + MaxFundsLimit.typeUrl +) +function createBaseCombinedLimit(): CombinedLimit { + return { + $typeUrl: '/cosmwasm.wasm.v1.CombinedLimit', + callsRemaining: BigInt(0), + amounts: [] + } +} +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) + } + for (const v of message.amounts) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CombinedLimit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCombinedLimit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.callsRemaining = reader.uint64() + break + case 2: + message.amounts.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CombinedLimit { + const message = createBaseCombinedLimit() + message.callsRemaining = + object.callsRemaining !== undefined && object.callsRemaining !== null + ? BigInt(object.callsRemaining.toString()) + : BigInt(0) + message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: CombinedLimitAmino): CombinedLimit { + 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 = {} + obj.calls_remaining = + message.callsRemaining !== BigInt(0) + ? message.callsRemaining.toString() + : undefined + if (message.amounts) { + obj.amounts = message.amounts.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.amounts = message.amounts + } + return obj + }, + fromAminoMsg(object: CombinedLimitAminoMsg): CombinedLimit { + return CombinedLimit.fromAmino(object.value) + }, + toAminoMsg(message: CombinedLimit): CombinedLimitAminoMsg { + return { + type: 'wasm/CombinedLimit', + value: CombinedLimit.toAmino(message) + } + }, + fromProtoMsg(message: CombinedLimitProtoMsg): CombinedLimit { + return CombinedLimit.decode(message.value) + }, + toProto(message: CombinedLimit): Uint8Array { + return CombinedLimit.encode(message).finish() + }, + toProtoMsg(message: CombinedLimit): CombinedLimitProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.CombinedLimit', + value: CombinedLimit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CombinedLimit.typeUrl, CombinedLimit) +GlobalDecoderRegistry.registerAminoProtoMapping( + CombinedLimit.aminoType, + CombinedLimit.typeUrl +) +function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { + return { + $typeUrl: '/cosmwasm.wasm.v1.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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AllowAllMessagesFilter { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAllowAllMessagesFilter() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): AllowAllMessagesFilter { + const message = createBaseAllowAllMessagesFilter() + return message + }, + fromAmino(_: AllowAllMessagesFilterAmino): AllowAllMessagesFilter { + const message = createBaseAllowAllMessagesFilter() + return message + }, + toAmino(_: AllowAllMessagesFilter): AllowAllMessagesFilterAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: AllowAllMessagesFilterAminoMsg): AllowAllMessagesFilter { + return AllowAllMessagesFilter.fromAmino(object.value) + }, + toAminoMsg(message: AllowAllMessagesFilter): AllowAllMessagesFilterAminoMsg { + return { + type: 'wasm/AllowAllMessagesFilter', + value: AllowAllMessagesFilter.toAmino(message) + } + }, + fromProtoMsg( + message: AllowAllMessagesFilterProtoMsg + ): AllowAllMessagesFilter { + return AllowAllMessagesFilter.decode(message.value) + }, + toProto(message: AllowAllMessagesFilter): Uint8Array { + return AllowAllMessagesFilter.encode(message).finish() + }, + toProtoMsg(message: AllowAllMessagesFilter): AllowAllMessagesFilterProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AllowAllMessagesFilter', + value: AllowAllMessagesFilter.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + AllowAllMessagesFilter.typeUrl, + AllowAllMessagesFilter +) +GlobalDecoderRegistry.registerAminoProtoMapping( + AllowAllMessagesFilter.aminoType, + AllowAllMessagesFilter.typeUrl +) +function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { + return { + $typeUrl: '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter', + keys: [] + } +} +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!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AcceptedMessageKeysFilter { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAcceptedMessageKeysFilter() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.keys.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): AcceptedMessageKeysFilter { + const message = createBaseAcceptedMessageKeysFilter() + message.keys = object.keys?.map((e) => e) || [] + return message + }, + fromAmino(object: AcceptedMessageKeysFilterAmino): AcceptedMessageKeysFilter { + const message = createBaseAcceptedMessageKeysFilter() + message.keys = object.keys?.map((e) => e) || [] + return message + }, + toAmino(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterAmino { + const obj: any = {} + if (message.keys) { + obj.keys = message.keys.map((e) => e) + } else { + obj.keys = message.keys + } + return obj + }, + fromAminoMsg( + object: AcceptedMessageKeysFilterAminoMsg + ): AcceptedMessageKeysFilter { + return AcceptedMessageKeysFilter.fromAmino(object.value) + }, + toAminoMsg( + message: AcceptedMessageKeysFilter + ): AcceptedMessageKeysFilterAminoMsg { + return { + type: 'wasm/AcceptedMessageKeysFilter', + value: AcceptedMessageKeysFilter.toAmino(message) + } + }, + fromProtoMsg( + message: AcceptedMessageKeysFilterProtoMsg + ): AcceptedMessageKeysFilter { + return AcceptedMessageKeysFilter.decode(message.value) + }, + toProto(message: AcceptedMessageKeysFilter): Uint8Array { + return AcceptedMessageKeysFilter.encode(message).finish() + }, + toProtoMsg( + message: AcceptedMessageKeysFilter + ): AcceptedMessageKeysFilterProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AcceptedMessageKeysFilter', + value: AcceptedMessageKeysFilter.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + AcceptedMessageKeysFilter.typeUrl, + AcceptedMessageKeysFilter +) +GlobalDecoderRegistry.registerAminoProtoMapping( + AcceptedMessageKeysFilter.aminoType, + AcceptedMessageKeysFilter.typeUrl +) +function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { + return { + $typeUrl: '/cosmwasm.wasm.v1.AcceptedMessagesFilter', + messages: [] + } +} +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!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AcceptedMessagesFilter { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAcceptedMessagesFilter() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.messages.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): AcceptedMessagesFilter { + const message = createBaseAcceptedMessagesFilter() + message.messages = object.messages?.map((e) => e) || [] + return message + }, + fromAmino(object: AcceptedMessagesFilterAmino): AcceptedMessagesFilter { + 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) => JSON.parse(fromUtf8(e))) + } else { + obj.messages = message.messages + } + return obj + }, + fromAminoMsg(object: AcceptedMessagesFilterAminoMsg): AcceptedMessagesFilter { + return AcceptedMessagesFilter.fromAmino(object.value) + }, + toAminoMsg(message: AcceptedMessagesFilter): AcceptedMessagesFilterAminoMsg { + return { + type: 'wasm/AcceptedMessagesFilter', + value: AcceptedMessagesFilter.toAmino(message) + } + }, + fromProtoMsg( + message: AcceptedMessagesFilterProtoMsg + ): AcceptedMessagesFilter { + return AcceptedMessagesFilter.decode(message.value) + }, + toProto(message: AcceptedMessagesFilter): Uint8Array { + return AcceptedMessagesFilter.encode(message).finish() + }, + toProtoMsg(message: AcceptedMessagesFilter): AcceptedMessagesFilterProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AcceptedMessagesFilter', + value: AcceptedMessagesFilter.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + AcceptedMessagesFilter.typeUrl, + AcceptedMessagesFilter +) +GlobalDecoderRegistry.registerAminoProtoMapping( + AcceptedMessagesFilter.aminoType, + AcceptedMessagesFilter.typeUrl +) diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/proposal_legacy.ts b/src/proto/osmojs/cosmwasm/wasm/v1/proposal_legacy.ts new file mode 100644 index 0000000..30077cd --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/proposal_legacy.ts @@ -0,0 +1,3380 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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' +import { bytesFromBase64, base64FromBytes } from '../../../../helpers' +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?: '/cosmwasm.wasm.v1.StoreCodeProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig + /** UnpinCode code on upload, optional */ + unpinCode: boolean + /** 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 StoreCodeProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.StoreCodeProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: 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 */ + unpin_code?: boolean + /** 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 StoreCodeProposalAminoMsg { + type: 'wasm/StoreCodeProposal' + value: StoreCodeProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.StoreCodeProposal' + title: string + description: string + run_as: string + wasm_byte_code: Uint8Array + instantiate_permission?: AccessConfigSDKType + unpin_code: boolean + source: string + builder: string + code_hash: Uint8Array +} +/** + * 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?: '/cosmwasm.wasm.v1.InstantiateContractProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string + /** Admin is an optional address that can execute migrations */ + admin: string + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** 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 to the contract on instantiation */ + funds: Coin[] +} +export interface InstantiateContractProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.InstantiateContractProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string + /** Admin is an optional address that can execute migrations */ + admin?: string + /** CodeID is the reference to the stored WASM code */ + code_id?: 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 to the contract on instantiation */ + funds: CoinAmino[] +} +export interface InstantiateContractProposalAminoMsg { + type: 'wasm/InstantiateContractProposal' + value: InstantiateContractProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.InstantiateContractProposal' + title: string + description: string + run_as: string + admin: string + code_id: bigint + label: string + msg: Uint8Array + funds: CoinSDKType[] +} +/** + * 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?: '/cosmwasm.wasm.v1.InstantiateContract2Proposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string + /** Admin is an optional address that can execute migrations */ + admin: string + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** Label is optional metadata to be stored with a constract instance. */ + label: string + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[] + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean +} +export interface InstantiateContract2ProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.InstantiateContract2Proposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** RunAs is the address that is passed to the contract's enviroment as sender */ + run_as?: string + /** Admin is an optional address that can execute migrations */ + admin?: string + /** CodeID is the reference to the stored WASM code */ + code_id?: string + /** Label is optional metadata to be stored with a constract instance. */ + label?: string + /** Msg json encode message to be passed to the contract on instantiation */ + 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?: string + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean +} +export interface InstantiateContract2ProposalAminoMsg { + type: 'wasm/InstantiateContract2Proposal' + value: InstantiateContract2ProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.InstantiateContract2Proposal' + title: string + description: string + run_as: string + admin: string + code_id: bigint + label: string + msg: Uint8Array + funds: CoinSDKType[] + salt: Uint8Array + fix_msg: boolean +} +/** + * 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?: '/cosmwasm.wasm.v1.MigrateContractProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** Contract is the address of the smart contract */ + contract: string + /** CodeID references the new WASM code */ + codeId: bigint + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array +} +export interface MigrateContractProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MigrateContractProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** Contract is the address of the smart contract */ + contract?: string + /** CodeID references the new WASM code */ + code_id?: string + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any +} +export interface MigrateContractProposalAminoMsg { + type: 'wasm/MigrateContractProposal' + value: MigrateContractProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.MigrateContractProposal' + title: string + description: string + contract: string + code_id: bigint + msg: Uint8Array +} +/** + * 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?: '/cosmwasm.wasm.v1.SudoContractProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: 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 SudoContractProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.SudoContractProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: 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 SudoContractProposalAminoMsg { + type: 'wasm/SudoContractProposal' + value: SudoContractProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.SudoContractProposal' + title: string + description: string + contract: string + msg: Uint8Array +} +/** + * 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?: '/cosmwasm.wasm.v1.ExecuteContractProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string + /** Contract is the address of the smart contract */ + contract: string + /** Msg json encoded message to be passed to the contract as execute */ + msg: Uint8Array + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[] +} +export interface ExecuteContractProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ExecuteContractProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string + /** Contract is the address of the smart contract */ + contract?: string + /** Msg json encoded message to be passed to the contract as execute */ + msg?: any + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[] +} +export interface ExecuteContractProposalAminoMsg { + type: 'wasm/ExecuteContractProposal' + value: ExecuteContractProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.ExecuteContractProposal' + title: string + description: string + run_as: string + contract: string + msg: Uint8Array + funds: CoinSDKType[] +} +/** + * 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?: '/cosmwasm.wasm.v1.UpdateAdminProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** NewAdmin address to be set */ + newAdmin: string + /** Contract is the address of the smart contract */ + contract: string +} +export interface UpdateAdminProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.UpdateAdminProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** NewAdmin address to be set */ + new_admin?: string + /** Contract is the address of the smart contract */ + contract?: string +} +export interface UpdateAdminProposalAminoMsg { + type: 'wasm/UpdateAdminProposal' + value: UpdateAdminProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.UpdateAdminProposal' + title: string + description: string + new_admin: string + contract: string +} +/** + * 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?: '/cosmwasm.wasm.v1.ClearAdminProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** Contract is the address of the smart contract */ + contract: string +} +export interface ClearAdminProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ClearAdminProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** Contract is the address of the smart contract */ + contract?: string +} +export interface ClearAdminProposalAminoMsg { + type: 'wasm/ClearAdminProposal' + value: ClearAdminProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.ClearAdminProposal' + title: string + description: string + contract: string +} +/** + * 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?: '/cosmwasm.wasm.v1.PinCodesProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** CodeIDs references the new WASM codes */ + codeIds: bigint[] +} +export interface PinCodesProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.PinCodesProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** CodeIDs references the new WASM codes */ + code_ids?: string[] +} +export interface PinCodesProposalAminoMsg { + type: 'wasm/PinCodesProposal' + value: PinCodesProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.PinCodesProposal' + title: string + description: string + code_ids: bigint[] +} +/** + * 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?: '/cosmwasm.wasm.v1.UnpinCodesProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** CodeIDs references the WASM codes */ + codeIds: bigint[] +} +export interface UnpinCodesProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.UnpinCodesProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** CodeIDs references the WASM codes */ + code_ids?: string[] +} +export interface UnpinCodesProposalAminoMsg { + type: 'wasm/UnpinCodesProposal' + value: UnpinCodesProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.UnpinCodesProposal' + title: string + description: string + code_ids: bigint[] +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdate { + /** CodeID is the reference to the stored WASM code to be updated */ + codeId: bigint + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfig +} +export interface AccessConfigUpdateProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AccessConfigUpdate' + value: Uint8Array +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateAmino { + /** CodeID is the reference to the stored WASM code to be updated */ + code_id?: string + /** InstantiatePermission to apply to the set of code ids */ + instantiate_permission: AccessConfigAmino +} +export interface AccessConfigUpdateAminoMsg { + type: 'wasm/AccessConfigUpdate' + value: AccessConfigUpdateAmino +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateSDKType { + code_id: bigint + instantiate_permission: AccessConfigSDKType +} +/** + * 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?: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + accessConfigUpdates: AccessConfigUpdate[] +} +export interface UpdateInstantiateConfigProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + access_config_updates: AccessConfigUpdateAmino[] +} +export interface UpdateInstantiateConfigProposalAminoMsg { + type: 'wasm/UpdateInstantiateConfigProposal' + value: UpdateInstantiateConfigProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal' + title: string + description: string + access_config_updates: AccessConfigUpdateSDKType[] +} +/** + * 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?: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal' + /** Title is a short summary */ + title: string + /** Description is a human readable text */ + description: string + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig + /** UnpinCode code on upload, optional */ + 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 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 StoreAndInstantiateContractProposalProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal' + value: Uint8Array +} +/** + * 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 + /** Description is a human readable text */ + description?: string + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: 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 */ + 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 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 StoreAndInstantiateContractProposalAminoMsg { + type: 'wasm/StoreAndInstantiateContractProposal' + value: StoreAndInstantiateContractProposalAmino +} +/** + * 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?: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal' + title: string + description: string + run_as: 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 +} +function createBaseStoreCodeProposal(): StoreCodeProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.StoreCodeProposal', + title: '', + description: '', + runAs: '', + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + source: '', + builder: '', + codeHash: new Uint8Array() + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.runAs !== '') { + writer.uint32(26).string(message.runAs) + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode) + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode( + message.instantiatePermission, + writer.uint32(58).fork() + ).ldelim() + } + if (message.unpinCode === true) { + writer.uint32(64).bool(message.unpinCode) + } + if (message.source !== '') { + writer.uint32(74).string(message.source) + } + if (message.builder !== '') { + writer.uint32(82).string(message.builder) + } + if (message.codeHash.length !== 0) { + writer.uint32(90).bytes(message.codeHash) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStoreCodeProposal() + 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.runAs = reader.string() + break + case 4: + message.wasmByteCode = reader.bytes() + break + case 7: + message.instantiatePermission = AccessConfig.decode( + reader, + reader.uint32() + ) + break + case 8: + message.unpinCode = reader.bool() + break + case 9: + message.source = reader.string() + break + case 10: + message.builder = reader.string() + break + case 11: + message.codeHash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): StoreCodeProposal { + const message = createBaseStoreCodeProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.runAs = object.runAs ?? '' + 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.source = object.source ?? '' + message.builder = object.builder ?? '' + message.codeHash = object.codeHash ?? new Uint8Array() + return message + }, + fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.run_as = message.runAs === '' ? undefined : message.runAs + 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 === false ? undefined : message.unpinCode + obj.source = message.source === '' ? undefined : message.source + obj.builder = message.builder === '' ? undefined : message.builder + obj.code_hash = message.codeHash + ? base64FromBytes(message.codeHash) + : undefined + return obj + }, + fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { + return StoreCodeProposal.fromAmino(object.value) + }, + toAminoMsg(message: StoreCodeProposal): StoreCodeProposalAminoMsg { + return { + type: 'wasm/StoreCodeProposal', + value: StoreCodeProposal.toAmino(message) + } + }, + fromProtoMsg(message: StoreCodeProposalProtoMsg): StoreCodeProposal { + return StoreCodeProposal.decode(message.value) + }, + toProto(message: StoreCodeProposal): Uint8Array { + return StoreCodeProposal.encode(message).finish() + }, + toProtoMsg(message: StoreCodeProposal): StoreCodeProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.StoreCodeProposal', + value: StoreCodeProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(StoreCodeProposal.typeUrl, StoreCodeProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + StoreCodeProposal.aminoType, + StoreCodeProposal.typeUrl +) +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.InstantiateContractProposal', + title: '', + description: '', + runAs: '', + admin: '', + codeId: BigInt(0), + label: '', + msg: new Uint8Array(), + funds: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.runAs !== '') { + writer.uint32(26).string(message.runAs) + } + if (message.admin !== '') { + writer.uint32(34).string(message.admin) + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId) + } + if (message.label !== '') { + writer.uint32(50).string(message.label) + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg) + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): InstantiateContractProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInstantiateContractProposal() + 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.runAs = reader.string() + break + case 4: + message.admin = reader.string() + break + case 5: + message.codeId = reader.uint64() + break + case 6: + message.label = reader.string() + break + case 7: + message.msg = reader.bytes() + break + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.runAs = object.runAs ?? '' + 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: InstantiateContractProposalAmino + ): InstantiateContractProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.run_as = message.runAs === '' ? undefined : message.runAs + obj.admin = message.admin === '' ? undefined : message.admin + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.label = message.label === '' ? undefined : 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 = message.funds + } + return obj + }, + fromAminoMsg( + object: InstantiateContractProposalAminoMsg + ): InstantiateContractProposal { + return InstantiateContractProposal.fromAmino(object.value) + }, + toAminoMsg( + message: InstantiateContractProposal + ): InstantiateContractProposalAminoMsg { + return { + type: 'wasm/InstantiateContractProposal', + value: InstantiateContractProposal.toAmino(message) + } + }, + fromProtoMsg( + message: InstantiateContractProposalProtoMsg + ): InstantiateContractProposal { + return InstantiateContractProposal.decode(message.value) + }, + toProto(message: InstantiateContractProposal): Uint8Array { + return InstantiateContractProposal.encode(message).finish() + }, + toProtoMsg( + message: InstantiateContractProposal + ): InstantiateContractProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.InstantiateContractProposal', + value: InstantiateContractProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + InstantiateContractProposal.typeUrl, + InstantiateContractProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + InstantiateContractProposal.aminoType, + InstantiateContractProposal.typeUrl +) +function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.InstantiateContract2Proposal', + title: '', + description: '', + runAs: '', + admin: '', + codeId: BigInt(0), + label: '', + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.runAs !== '') { + writer.uint32(26).string(message.runAs) + } + if (message.admin !== '') { + writer.uint32(34).string(message.admin) + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId) + } + if (message.label !== '') { + writer.uint32(50).string(message.label) + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg) + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim() + } + if (message.salt.length !== 0) { + writer.uint32(74).bytes(message.salt) + } + if (message.fixMsg === true) { + writer.uint32(80).bool(message.fixMsg) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): InstantiateContract2Proposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInstantiateContract2Proposal() + 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.runAs = reader.string() + break + case 4: + message.admin = reader.string() + break + case 5: + message.codeId = reader.uint64() + break + case 6: + message.label = reader.string() + break + case 7: + message.msg = reader.bytes() + break + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())) + break + case 9: + message.salt = reader.bytes() + break + case 10: + message.fixMsg = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.runAs = object.runAs ?? '' + 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: InstantiateContract2ProposalAmino + ): InstantiateContract2Proposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.run_as = message.runAs === '' ? undefined : message.runAs + obj.admin = message.admin === '' ? undefined : message.admin + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.label = message.label === '' ? undefined : 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 = message.funds + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg + return obj + }, + fromAminoMsg( + object: InstantiateContract2ProposalAminoMsg + ): InstantiateContract2Proposal { + return InstantiateContract2Proposal.fromAmino(object.value) + }, + toAminoMsg( + message: InstantiateContract2Proposal + ): InstantiateContract2ProposalAminoMsg { + return { + type: 'wasm/InstantiateContract2Proposal', + value: InstantiateContract2Proposal.toAmino(message) + } + }, + fromProtoMsg( + message: InstantiateContract2ProposalProtoMsg + ): InstantiateContract2Proposal { + return InstantiateContract2Proposal.decode(message.value) + }, + toProto(message: InstantiateContract2Proposal): Uint8Array { + return InstantiateContract2Proposal.encode(message).finish() + }, + toProtoMsg( + message: InstantiateContract2Proposal + ): InstantiateContract2ProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.InstantiateContract2Proposal', + value: InstantiateContract2Proposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + InstantiateContract2Proposal.typeUrl, + InstantiateContract2Proposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + InstantiateContract2Proposal.aminoType, + InstantiateContract2Proposal.typeUrl +) +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.MigrateContractProposal', + title: '', + description: '', + contract: '', + codeId: BigInt(0), + msg: new Uint8Array() + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.contract !== '') { + writer.uint32(34).string(message.contract) + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId) + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MigrateContractProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMigrateContractProposal() + 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 4: + message.contract = reader.string() + break + case 5: + message.codeId = reader.uint64() + break + case 6: + message.msg = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MigrateContractProposal { + const message = createBaseMigrateContractProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + 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: MigrateContractProposalAmino): MigrateContractProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.contract = message.contract === '' ? undefined : message.contract + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined + return obj + }, + fromAminoMsg( + object: MigrateContractProposalAminoMsg + ): MigrateContractProposal { + return MigrateContractProposal.fromAmino(object.value) + }, + toAminoMsg( + message: MigrateContractProposal + ): MigrateContractProposalAminoMsg { + return { + type: 'wasm/MigrateContractProposal', + value: MigrateContractProposal.toAmino(message) + } + }, + fromProtoMsg( + message: MigrateContractProposalProtoMsg + ): MigrateContractProposal { + return MigrateContractProposal.decode(message.value) + }, + toProto(message: MigrateContractProposal): Uint8Array { + return MigrateContractProposal.encode(message).finish() + }, + toProtoMsg( + message: MigrateContractProposal + ): MigrateContractProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MigrateContractProposal', + value: MigrateContractProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MigrateContractProposal.typeUrl, + MigrateContractProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MigrateContractProposal.aminoType, + MigrateContractProposal.typeUrl +) +function createBaseSudoContractProposal(): SudoContractProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.SudoContractProposal', + title: '', + description: '', + contract: '', + msg: new Uint8Array() + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.contract !== '') { + writer.uint32(26).string(message.contract) + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SudoContractProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSudoContractProposal() + 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.contract = reader.string() + break + case 4: + message.msg = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SudoContractProposal { + const message = createBaseSudoContractProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.contract = object.contract ?? '' + message.msg = object.msg ?? new Uint8Array() + return message + }, + fromAmino(object: SudoContractProposalAmino): SudoContractProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.contract = message.contract === '' ? undefined : message.contract + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined + return obj + }, + fromAminoMsg(object: SudoContractProposalAminoMsg): SudoContractProposal { + return SudoContractProposal.fromAmino(object.value) + }, + toAminoMsg(message: SudoContractProposal): SudoContractProposalAminoMsg { + return { + type: 'wasm/SudoContractProposal', + value: SudoContractProposal.toAmino(message) + } + }, + fromProtoMsg(message: SudoContractProposalProtoMsg): SudoContractProposal { + return SudoContractProposal.decode(message.value) + }, + toProto(message: SudoContractProposal): Uint8Array { + return SudoContractProposal.encode(message).finish() + }, + toProtoMsg(message: SudoContractProposal): SudoContractProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.SudoContractProposal', + value: SudoContractProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SudoContractProposal.typeUrl, + SudoContractProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SudoContractProposal.aminoType, + SudoContractProposal.typeUrl +) +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.ExecuteContractProposal', + title: '', + description: '', + runAs: '', + contract: '', + msg: new Uint8Array(), + funds: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.runAs !== '') { + writer.uint32(26).string(message.runAs) + } + if (message.contract !== '') { + writer.uint32(34).string(message.contract) + } + 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 + ): ExecuteContractProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExecuteContractProposal() + 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.runAs = reader.string() + break + case 4: + message.contract = 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 + ): ExecuteContractProposal { + const message = createBaseExecuteContractProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.runAs = object.runAs ?? '' + message.contract = object.contract ?? '' + message.msg = object.msg ?? new Uint8Array() + message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.run_as = message.runAs === '' ? undefined : message.runAs + obj.contract = message.contract === '' ? undefined : 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 = message.funds + } + return obj + }, + fromAminoMsg( + object: ExecuteContractProposalAminoMsg + ): ExecuteContractProposal { + return ExecuteContractProposal.fromAmino(object.value) + }, + toAminoMsg( + message: ExecuteContractProposal + ): ExecuteContractProposalAminoMsg { + return { + type: 'wasm/ExecuteContractProposal', + value: ExecuteContractProposal.toAmino(message) + } + }, + fromProtoMsg( + message: ExecuteContractProposalProtoMsg + ): ExecuteContractProposal { + return ExecuteContractProposal.decode(message.value) + }, + toProto(message: ExecuteContractProposal): Uint8Array { + return ExecuteContractProposal.encode(message).finish() + }, + toProtoMsg( + message: ExecuteContractProposal + ): ExecuteContractProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ExecuteContractProposal', + value: ExecuteContractProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ExecuteContractProposal.typeUrl, + ExecuteContractProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ExecuteContractProposal.aminoType, + ExecuteContractProposal.typeUrl +) +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.UpdateAdminProposal', + title: '', + description: '', + newAdmin: '', + contract: '' + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.newAdmin !== '') { + writer.uint32(26).string(message.newAdmin) + } + if (message.contract !== '') { + writer.uint32(34).string(message.contract) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateAdminProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdateAdminProposal() + 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.newAdmin = reader.string() + break + case 4: + message.contract = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.newAdmin = object.newAdmin ?? '' + message.contract = object.contract ?? '' + return message + }, + fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin + obj.contract = message.contract === '' ? undefined : message.contract + return obj + }, + fromAminoMsg(object: UpdateAdminProposalAminoMsg): UpdateAdminProposal { + return UpdateAdminProposal.fromAmino(object.value) + }, + toAminoMsg(message: UpdateAdminProposal): UpdateAdminProposalAminoMsg { + return { + type: 'wasm/UpdateAdminProposal', + value: UpdateAdminProposal.toAmino(message) + } + }, + fromProtoMsg(message: UpdateAdminProposalProtoMsg): UpdateAdminProposal { + return UpdateAdminProposal.decode(message.value) + }, + toProto(message: UpdateAdminProposal): Uint8Array { + return UpdateAdminProposal.encode(message).finish() + }, + toProtoMsg(message: UpdateAdminProposal): UpdateAdminProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.UpdateAdminProposal', + value: UpdateAdminProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(UpdateAdminProposal.typeUrl, UpdateAdminProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateAdminProposal.aminoType, + UpdateAdminProposal.typeUrl +) +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.ClearAdminProposal', + title: '', + description: '', + contract: '' + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.contract !== '') { + writer.uint32(26).string(message.contract) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ClearAdminProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseClearAdminProposal() + 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.contract = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ClearAdminProposal { + const message = createBaseClearAdminProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.contract = object.contract ?? '' + return message + }, + fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.contract = message.contract === '' ? undefined : message.contract + return obj + }, + fromAminoMsg(object: ClearAdminProposalAminoMsg): ClearAdminProposal { + return ClearAdminProposal.fromAmino(object.value) + }, + toAminoMsg(message: ClearAdminProposal): ClearAdminProposalAminoMsg { + return { + type: 'wasm/ClearAdminProposal', + value: ClearAdminProposal.toAmino(message) + } + }, + fromProtoMsg(message: ClearAdminProposalProtoMsg): ClearAdminProposal { + return ClearAdminProposal.decode(message.value) + }, + toProto(message: ClearAdminProposal): Uint8Array { + return ClearAdminProposal.encode(message).finish() + }, + toProtoMsg(message: ClearAdminProposal): ClearAdminProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ClearAdminProposal', + value: ClearAdminProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ClearAdminProposal.typeUrl, ClearAdminProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + ClearAdminProposal.aminoType, + ClearAdminProposal.typeUrl +) +function createBasePinCodesProposal(): PinCodesProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.PinCodesProposal', + title: '', + description: '', + codeIds: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + writer.uint32(26).fork() + for (const v of message.codeIds) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PinCodesProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePinCodesProposal() + 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: + 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 + } + } + return message + }, + fromPartial(object: Partial): PinCodesProposal { + const message = createBasePinCodesProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino(object: PinCodesProposalAmino): PinCodesProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.codeIds) { + obj.code_ids = message.codeIds.map((e) => e.toString()) + } else { + obj.code_ids = message.codeIds + } + return obj + }, + fromAminoMsg(object: PinCodesProposalAminoMsg): PinCodesProposal { + return PinCodesProposal.fromAmino(object.value) + }, + toAminoMsg(message: PinCodesProposal): PinCodesProposalAminoMsg { + return { + type: 'wasm/PinCodesProposal', + value: PinCodesProposal.toAmino(message) + } + }, + fromProtoMsg(message: PinCodesProposalProtoMsg): PinCodesProposal { + return PinCodesProposal.decode(message.value) + }, + toProto(message: PinCodesProposal): Uint8Array { + return PinCodesProposal.encode(message).finish() + }, + toProtoMsg(message: PinCodesProposal): PinCodesProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.PinCodesProposal', + value: PinCodesProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PinCodesProposal.typeUrl, PinCodesProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + PinCodesProposal.aminoType, + PinCodesProposal.typeUrl +) +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.UnpinCodesProposal', + title: '', + description: '', + codeIds: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + writer.uint32(26).fork() + for (const v of message.codeIds) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UnpinCodesProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnpinCodesProposal() + 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: + 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 + } + } + return message + }, + fromPartial(object: Partial): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.codeIds) { + obj.code_ids = message.codeIds.map((e) => e.toString()) + } else { + obj.code_ids = message.codeIds + } + return obj + }, + fromAminoMsg(object: UnpinCodesProposalAminoMsg): UnpinCodesProposal { + return UnpinCodesProposal.fromAmino(object.value) + }, + toAminoMsg(message: UnpinCodesProposal): UnpinCodesProposalAminoMsg { + return { + type: 'wasm/UnpinCodesProposal', + value: UnpinCodesProposal.toAmino(message) + } + }, + fromProtoMsg(message: UnpinCodesProposalProtoMsg): UnpinCodesProposal { + return UnpinCodesProposal.decode(message.value) + }, + toProto(message: UnpinCodesProposal): Uint8Array { + return UnpinCodesProposal.encode(message).finish() + }, + toProtoMsg(message: UnpinCodesProposal): UnpinCodesProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.UnpinCodesProposal', + value: UnpinCodesProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(UnpinCodesProposal.typeUrl, UnpinCodesProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + UnpinCodesProposal.aminoType, + UnpinCodesProposal.typeUrl +) +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfig.fromPartial({}) + } +} +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) + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode( + message.instantiatePermission, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AccessConfigUpdate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAccessConfigUpdate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() + break + case 2: + message.instantiatePermission = AccessConfig.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate() + message.codeId = + object.codeId !== undefined && object.codeId !== null + ? BigInt(object.codeId.toString()) + : BigInt(0) + message.instantiatePermission = + object.instantiatePermission !== undefined && + object.instantiatePermission !== null + ? AccessConfig.fromPartial(object.instantiatePermission) + : undefined + return message + }, + fromAmino(object: AccessConfigUpdateAmino): AccessConfigUpdate { + 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 !== BigInt(0) ? message.codeId.toString() : undefined + obj.instantiate_permission = message.instantiatePermission + ? AccessConfig.toAmino(message.instantiatePermission) + : AccessConfig.toAmino(AccessConfig.fromPartial({})) + return obj + }, + fromAminoMsg(object: AccessConfigUpdateAminoMsg): AccessConfigUpdate { + return AccessConfigUpdate.fromAmino(object.value) + }, + toAminoMsg(message: AccessConfigUpdate): AccessConfigUpdateAminoMsg { + return { + type: 'wasm/AccessConfigUpdate', + value: AccessConfigUpdate.toAmino(message) + } + }, + fromProtoMsg(message: AccessConfigUpdateProtoMsg): AccessConfigUpdate { + return AccessConfigUpdate.decode(message.value) + }, + toProto(message: AccessConfigUpdate): Uint8Array { + return AccessConfigUpdate.encode(message).finish() + }, + toProtoMsg(message: AccessConfigUpdate): AccessConfigUpdateProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AccessConfigUpdate', + value: AccessConfigUpdate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(AccessConfigUpdate.typeUrl, AccessConfigUpdate) +GlobalDecoderRegistry.registerAminoProtoMapping( + AccessConfigUpdate.aminoType, + AccessConfigUpdate.typeUrl +) +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal', + title: '', + description: '', + accessConfigUpdates: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.accessConfigUpdates) { + AccessConfigUpdate.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateInstantiateConfigProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdateInstantiateConfigProposal() + 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.accessConfigUpdates.push( + AccessConfigUpdate.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.accessConfigUpdates = + object.accessConfigUpdates?.map((e) => + AccessConfigUpdate.fromPartial(e) + ) || [] + return message + }, + fromAmino( + object: UpdateInstantiateConfigProposalAmino + ): UpdateInstantiateConfigProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.accessConfigUpdates) { + obj.access_config_updates = message.accessConfigUpdates.map((e) => + e ? AccessConfigUpdate.toAmino(e) : undefined + ) + } else { + obj.access_config_updates = message.accessConfigUpdates + } + return obj + }, + fromAminoMsg( + object: UpdateInstantiateConfigProposalAminoMsg + ): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.fromAmino(object.value) + }, + toAminoMsg( + message: UpdateInstantiateConfigProposal + ): UpdateInstantiateConfigProposalAminoMsg { + return { + type: 'wasm/UpdateInstantiateConfigProposal', + value: UpdateInstantiateConfigProposal.toAmino(message) + } + }, + fromProtoMsg( + message: UpdateInstantiateConfigProposalProtoMsg + ): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.decode(message.value) + }, + toProto(message: UpdateInstantiateConfigProposal): Uint8Array { + return UpdateInstantiateConfigProposal.encode(message).finish() + }, + toProtoMsg( + message: UpdateInstantiateConfigProposal + ): UpdateInstantiateConfigProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal', + value: UpdateInstantiateConfigProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + UpdateInstantiateConfigProposal.typeUrl, + UpdateInstantiateConfigProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateInstantiateConfigProposal.aminoType, + UpdateInstantiateConfigProposal.typeUrl +) +function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { + return { + $typeUrl: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal', + title: '', + description: '', + runAs: '', + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: '', + label: '', + msg: new Uint8Array(), + funds: [], + source: '', + builder: '', + codeHash: new Uint8Array() + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.runAs !== '') { + writer.uint32(26).string(message.runAs) + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode) + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode( + message.instantiatePermission, + writer.uint32(42).fork() + ).ldelim() + } + if (message.unpinCode === true) { + writer.uint32(48).bool(message.unpinCode) + } + if (message.admin !== '') { + writer.uint32(58).string(message.admin) + } + if (message.label !== '') { + writer.uint32(66).string(message.label) + } + if (message.msg.length !== 0) { + writer.uint32(74).bytes(message.msg) + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(82).fork()).ldelim() + } + if (message.source !== '') { + writer.uint32(90).string(message.source) + } + if (message.builder !== '') { + writer.uint32(98).string(message.builder) + } + if (message.codeHash.length !== 0) { + writer.uint32(106).bytes(message.codeHash) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): StoreAndInstantiateContractProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStoreAndInstantiateContractProposal() + 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.runAs = reader.string() + break + case 4: + message.wasmByteCode = reader.bytes() + break + case 5: + message.instantiatePermission = AccessConfig.decode( + reader, + reader.uint32() + ) + break + case 6: + message.unpinCode = reader.bool() + break + case 7: + message.admin = reader.string() + break + case 8: + message.label = reader.string() + break + case 9: + message.msg = reader.bytes() + break + case 10: + message.funds.push(Coin.decode(reader, reader.uint32())) + break + case 11: + message.source = reader.string() + break + case 12: + message.builder = reader.string() + break + case 13: + message.codeHash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.runAs = object.runAs ?? '' + 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: StoreAndInstantiateContractProposalAmino + ): StoreAndInstantiateContractProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.run_as = message.runAs === '' ? undefined : message.runAs + 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 === false ? undefined : message.unpinCode + obj.admin = message.admin === '' ? undefined : message.admin + obj.label = message.label === '' ? undefined : 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 = message.funds + } + obj.source = message.source === '' ? undefined : message.source + obj.builder = message.builder === '' ? undefined : message.builder + obj.code_hash = message.codeHash + ? base64FromBytes(message.codeHash) + : undefined + return obj + }, + fromAminoMsg( + object: StoreAndInstantiateContractProposalAminoMsg + ): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.fromAmino(object.value) + }, + toAminoMsg( + message: StoreAndInstantiateContractProposal + ): StoreAndInstantiateContractProposalAminoMsg { + return { + type: 'wasm/StoreAndInstantiateContractProposal', + value: StoreAndInstantiateContractProposal.toAmino(message) + } + }, + fromProtoMsg( + message: StoreAndInstantiateContractProposalProtoMsg + ): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.decode(message.value) + }, + toProto(message: StoreAndInstantiateContractProposal): Uint8Array { + return StoreAndInstantiateContractProposal.encode(message).finish() + }, + toProtoMsg( + message: StoreAndInstantiateContractProposal + ): StoreAndInstantiateContractProposalProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal', + value: StoreAndInstantiateContractProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + StoreAndInstantiateContractProposal.typeUrl, + StoreAndInstantiateContractProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + StoreAndInstantiateContractProposal.aminoType, + StoreAndInstantiateContractProposal.typeUrl +) diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/tx.amino.ts b/src/proto/osmojs/cosmwasm/wasm/v1/tx.amino.ts new file mode 100644 index 0000000..dd8e3f0 --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/tx.amino.ts @@ -0,0 +1,108 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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', + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + '/cosmwasm.wasm.v1.MsgInstantiateContract': { + aminoType: 'wasm/MsgInstantiateContract', + toAmino: MsgInstantiateContract.toAmino, + fromAmino: MsgInstantiateContract.fromAmino + }, + '/cosmwasm.wasm.v1.MsgInstantiateContract2': { + aminoType: 'wasm/MsgInstantiateContract2', + toAmino: MsgInstantiateContract2.toAmino, + fromAmino: MsgInstantiateContract2.fromAmino + }, + '/cosmwasm.wasm.v1.MsgExecuteContract': { + aminoType: 'wasm/MsgExecuteContract', + toAmino: MsgExecuteContract.toAmino, + fromAmino: MsgExecuteContract.fromAmino + }, + '/cosmwasm.wasm.v1.MsgMigrateContract': { + aminoType: 'wasm/MsgMigrateContract', + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + }, + '/cosmwasm.wasm.v1.MsgUpdateAdmin': { + aminoType: 'wasm/MsgUpdateAdmin', + toAmino: MsgUpdateAdmin.toAmino, + fromAmino: MsgUpdateAdmin.fromAmino + }, + '/cosmwasm.wasm.v1.MsgClearAdmin': { + aminoType: 'wasm/MsgClearAdmin', + toAmino: MsgClearAdmin.toAmino, + fromAmino: MsgClearAdmin.fromAmino + }, + '/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig': { + 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 + } +} diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/tx.registry.ts b/src/proto/osmojs/cosmwasm/wasm/v1/tx.registry.ts new file mode 100644 index 0000000..8a535b3 --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/tx.registry.ts @@ -0,0 +1,369 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreCode', + value: MsgStoreCode.encode(value).finish() + } + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract', + value: MsgInstantiateContract.encode(value).finish() + } + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract2', + value: MsgInstantiateContract2.encode(value).finish() + } + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract', + value: MsgExecuteContract.encode(value).finish() + } + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgMigrateContract', + value: MsgMigrateContract.encode(value).finish() + } + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateAdmin', + value: MsgUpdateAdmin.encode(value).finish() + } + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgClearAdmin', + value: MsgClearAdmin.encode(value).finish() + } + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + 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: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreCode', + value + } + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract', + value + } + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract2', + value + } + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract', + value + } + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgMigrateContract', + value + } + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateAdmin', + value + } + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgClearAdmin', + value + } + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + 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: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreCode', + value: MsgStoreCode.fromPartial(value) + } + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract', + value: MsgInstantiateContract.fromPartial(value) + } + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract2', + value: MsgInstantiateContract2.fromPartial(value) + } + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract', + value: MsgExecuteContract.fromPartial(value) + } + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgMigrateContract', + value: MsgMigrateContract.fromPartial(value) + } + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateAdmin', + value: MsgUpdateAdmin.fromPartial(value) + } + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgClearAdmin', + value: MsgClearAdmin.fromPartial(value) + } + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/tx.ts b/src/proto/osmojs/cosmwasm/wasm/v1/tx.ts new file mode 100644 index 0000000..16b55f2 --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/tx.ts @@ -0,0 +1,5788 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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 { GlobalDecoderRegistry } from '../../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../../helpers' +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the actor that signed the messages */ + sender: string + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiatePermission?: AccessConfig +} +export interface MsgStoreCodeProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreCode' + value: Uint8Array +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeAmino { + /** Sender is the actor that signed the messages */ + sender?: string + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiate_permission?: AccessConfigAmino +} +export interface MsgStoreCodeAminoMsg { + type: 'wasm/MsgStoreCode' + value: MsgStoreCodeAmino +} +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCodeSDKType { + sender: string + wasm_byte_code: Uint8Array + instantiate_permission?: AccessConfigSDKType +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreCodeResponse' + value: Uint8Array +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string + /** Checksum is the sha256 hash of the stored code */ + checksum?: string +} +export interface MsgStoreCodeResponseAminoMsg { + type: 'wasm/MsgStoreCodeResponse' + value: MsgStoreCodeResponseAmino +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseSDKType { + code_id: bigint + checksum: Uint8Array +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContract { + /** Sender is the that actor that signed the messages */ + sender: string + /** Admin is an optional address that can execute migrations */ + admin: string + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** Label is optional metadata to be stored with a contract instance. */ + label: string + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[] +} +export interface MsgInstantiateContractProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract' + value: Uint8Array +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** Admin is an optional address that can execute migrations */ + admin?: string + /** CodeID is the reference to the stored WASM code */ + code_id?: string + /** Label is optional metadata to be stored with a contract instance. */ + label?: string + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[] +} +export interface MsgInstantiateContractAminoMsg { + type: 'wasm/MsgInstantiateContract' + value: MsgInstantiateContractAmino +} +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContractSDKType { + sender: string + admin: string + code_id: bigint + label: string + 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. + */ +export interface MsgInstantiateContract2 { + /** Sender is the that actor that signed the messages */ + sender: string + /** Admin is an optional address that can execute migrations */ + admin: string + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** Label is optional metadata to be stored with a contract instance. */ + label: string + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[] + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean +} +export interface MsgInstantiateContract2ProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract2' + value: Uint8Array +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2Amino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** Admin is an optional address that can execute migrations */ + admin?: string + /** CodeID is the reference to the stored WASM code */ + code_id?: string + /** Label is optional metadata to be stored with a contract instance. */ + label?: string + /** Msg json encoded message to be passed to the contract on instantiation */ + 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?: string + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean +} +export interface MsgInstantiateContract2AminoMsg { + type: 'wasm/MsgInstantiateContract2' + value: MsgInstantiateContract2Amino +} +/** + * MsgInstantiateContract2 create a new smart contract instance for the given + * code id with a predicable address. + */ +export interface MsgInstantiateContract2SDKType { + sender: string + admin: string + code_id: bigint + label: string + msg: Uint8Array + funds: CoinSDKType[] + salt: Uint8Array + fix_msg: boolean +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2Response { + /** Address is the bech32 address of the new contract instance. */ + address: string + /** Data contains bytes to returned from the contract */ + data: Uint8Array +} +export interface MsgInstantiateContract2ResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgInstantiateContract2Response' + value: Uint8Array +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string + /** Data contains bytes to returned from the contract */ + data?: string +} +export interface MsgInstantiateContract2ResponseAminoMsg { + type: 'wasm/MsgInstantiateContract2Response' + value: MsgInstantiateContract2ResponseAmino +} +/** MsgInstantiateContract2Response return instantiation result data */ +export interface MsgInstantiateContract2ResponseSDKType { + address: string + data: Uint8Array +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContract { + /** Sender is the that actor that signed the messages */ + sender: string + /** Contract is the address of the smart contract */ + contract: string + /** Msg json encoded message to be passed to the contract */ + msg: Uint8Array + /** Funds coins that are transferred to the contract on execution */ + funds: Coin[] +} +export interface MsgExecuteContractProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract' + value: Uint8Array +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** Contract is the address of the smart contract */ + contract?: string + /** Msg json encoded message to be passed to the contract */ + msg?: any + /** Funds coins that are transferred to the contract on execution */ + funds: CoinAmino[] +} +export interface MsgExecuteContractAminoMsg { + type: 'wasm/MsgExecuteContract' + value: MsgExecuteContractAmino +} +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContractSDKType { + sender: string + contract: string + msg: Uint8Array + funds: CoinSDKType[] +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array +} +export interface MsgExecuteContractResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContractResponse' + value: Uint8Array +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data?: string +} +export interface MsgExecuteContractResponseAminoMsg { + type: 'wasm/MsgExecuteContractResponse' + value: MsgExecuteContractResponseAmino +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseSDKType { + data: Uint8Array +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: string + /** Contract is the address of the smart contract */ + contract: string + /** CodeID references the new WASM code */ + codeId: bigint + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array +} +export interface MsgMigrateContractProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgMigrateContract' + value: Uint8Array +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** Contract is the address of the smart contract */ + contract?: string + /** CodeID references the new WASM code */ + code_id?: string + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any +} +export interface MsgMigrateContractAminoMsg { + type: 'wasm/MsgMigrateContract' + value: MsgMigrateContractAmino +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractSDKType { + sender: string + contract: string + code_id: bigint + msg: Uint8Array +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array +} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgMigrateContractResponse' + value: Uint8Array +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseAmino { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data?: string +} +export interface MsgMigrateContractResponseAminoMsg { + type: 'wasm/MsgMigrateContractResponse' + value: MsgMigrateContractResponseAmino +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseSDKType { + data: Uint8Array +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string + /** NewAdmin address to be set */ + newAdmin: string + /** Contract is the address of the smart contract */ + contract: string +} +export interface MsgUpdateAdminProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateAdmin' + value: Uint8Array +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminAmino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** NewAdmin address to be set */ + new_admin?: string + /** Contract is the address of the smart contract */ + contract?: string +} +export interface MsgUpdateAdminAminoMsg { + type: 'wasm/MsgUpdateAdmin' + value: MsgUpdateAdminAmino +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminSDKType { + sender: string + new_admin: string + contract: string +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateAdminResponse' + value: Uint8Array +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseAmino {} +export interface MsgUpdateAdminResponseAminoMsg { + type: 'wasm/MsgUpdateAdminResponse' + value: MsgUpdateAdminResponseAmino +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseSDKType {} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the actor that signed the messages */ + sender: string + /** Contract is the address of the smart contract */ + contract: string +} +export interface MsgClearAdminProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgClearAdmin' + value: Uint8Array +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminAmino { + /** Sender is the actor that signed the messages */ + sender?: string + /** Contract is the address of the smart contract */ + contract?: string +} +export interface MsgClearAdminAminoMsg { + type: 'wasm/MsgClearAdmin' + value: MsgClearAdminAmino +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminSDKType { + sender: string + contract: string +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgClearAdminResponse' + value: Uint8Array +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseAmino {} +export interface MsgClearAdminResponseAminoMsg { + type: 'wasm/MsgClearAdminResponse' + value: MsgClearAdminResponseAmino +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseSDKType {} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfig { + /** Sender is the that actor that signed the messages */ + sender: string + /** CodeID references the stored WASM code */ + codeId: bigint + /** NewInstantiatePermission is the new access control */ + newInstantiatePermission?: AccessConfig +} +export interface MsgUpdateInstantiateConfigProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig' + value: Uint8Array +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfigAmino { + /** Sender is the that actor that signed the messages */ + sender?: string + /** CodeID references the stored WASM code */ + code_id?: string + /** NewInstantiatePermission is the new access control */ + new_instantiate_permission?: AccessConfigAmino +} +export interface MsgUpdateInstantiateConfigAminoMsg { + type: 'wasm/MsgUpdateInstantiateConfig' + value: MsgUpdateInstantiateConfigAmino +} +/** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ +export interface MsgUpdateInstantiateConfigSDKType { + sender: string + code_id: bigint + new_instantiate_permission?: AccessConfigSDKType +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponse {} +export interface MsgUpdateInstantiateConfigResponseProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse' + value: Uint8Array +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponseAmino {} +export interface MsgUpdateInstantiateConfigResponseAminoMsg { + type: 'wasm/MsgUpdateInstantiateConfigResponse' + value: MsgUpdateInstantiateConfigResponseAmino +} +/** MsgUpdateInstantiateConfigResponse returns empty data */ +export interface MsgUpdateInstantiateConfigResponseSDKType {} +/** + * 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 interface MsgUpdateParamsProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateParams' + value: Uint8Array +} +/** + * 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 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 + }, + 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 === '' ? undefined : 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 + }, + 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 !== BigInt(0) ? 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 + }, + 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 === '' ? undefined : message.sender + obj.admin = message.admin === '' ? undefined : message.admin + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.label = message.label === '' ? undefined : 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 = message.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 + }, + 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 === '' ? undefined : 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 + }, + 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 === '' ? undefined : message.sender + obj.admin = message.admin === '' ? undefined : message.admin + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.label = message.label === '' ? undefined : 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 = message.funds + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined + obj.fix_msg = message.fixMsg === false ? undefined : 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 + }, + 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 === '' ? undefined : 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 + }, + 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 === '' ? undefined : message.sender + obj.contract = message.contract === '' ? undefined : 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 = message.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 + }, + 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 + }, + 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 === '' ? undefined : message.sender + obj.contract = message.contract === '' ? undefined : message.contract + obj.code_id = + message.codeId !== BigInt(0) ? 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 + }, + 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 + }, + 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 === '' ? undefined : message.sender + obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin + obj.contract = message.contract === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : message.sender + obj.contract = message.contract === '' ? undefined : 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 + }, + 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.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 + }, + 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 === '' ? undefined : message.sender + obj.code_id = + message.codeId !== BigInt(0) ? 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 + }, + 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 + }, + 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 === '' ? undefined : message.authority + obj.params = message.params + ? Params.toAmino(message.params) + : Params.toAmino(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 + } + } + 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() + } + } +} +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.contract !== '') { + writer.uint32(18).string(message.contract) + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg) + } + 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 === '' ? undefined : message.authority + obj.contract = message.contract === '' ? undefined : 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() + } + } +} +GlobalDecoderRegistry.register(MsgSudoContract.typeUrl, MsgSudoContract) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSudoContract.aminoType, + MsgSudoContract.typeUrl +) +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + } +} +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) + } + 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 + } + } + return message + }, + 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) + } + 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) + } + writer.uint32(18).fork() + for (const v of message.codeIds) { + writer.uint64(v) + } + 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 + } + } + return message + }, + 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 === '' ? undefined : message.authority + if (message.codeIds) { + obj.code_ids = message.codeIds.map((e) => e.toString()) + } else { + obj.code_ids = message.codeIds + } + 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 + ): 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() + } + } +} +GlobalDecoderRegistry.register(MsgPinCodesResponse.typeUrl, MsgPinCodesResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgPinCodesResponse.aminoType, + MsgPinCodesResponse.typeUrl +) +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { + authority: '', + codeIds: [] + } +} +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) + } + writer.uint32(18).fork() + for (const v of message.codeIds) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + 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 = createBaseMsgUnpinCodes() + 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 + } + } + return message + }, + fromPartial(object: Partial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes() + message.authority = object.authority ?? '' + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || [] + return message + }, + 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 === '' ? undefined : message.authority + if (message.codeIds) { + obj.code_ids = message.codeIds.map((e) => e.toString()) + } else { + obj.code_ids = message.codeIds + } + return obj + }, + fromAminoMsg(object: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value) + }, + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { + return { + type: 'wasm/MsgUnpinCodes', + value: MsgUnpinCodes.toAmino(message) + } + }, + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value) + }, + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish() + }, + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUnpinCodes', + value: MsgUnpinCodes.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgUnpinCodes.typeUrl, MsgUnpinCodes) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnpinCodes.aminoType, + MsgUnpinCodes.typeUrl +) +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {} +} +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 + ): MsgUnpinCodesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUnpinCodesResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse() + return message + }, + fromAmino(_: MsgUnpinCodesResponseAmino): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse() + return message + }, + toAmino(_: MsgUnpinCodesResponse): MsgUnpinCodesResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgUnpinCodesResponseAminoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseAminoMsg { + return { + type: 'wasm/MsgUnpinCodesResponse', + value: MsgUnpinCodesResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgUnpinCodesResponseProtoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.decode(message.value) + }, + toProto(message: MsgUnpinCodesResponse): Uint8Array { + return MsgUnpinCodesResponse.encode(message).finish() + }, + toProtoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUnpinCodesResponse', + value: MsgUnpinCodesResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUnpinCodesResponse.typeUrl, + MsgUnpinCodesResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnpinCodesResponse.aminoType, + MsgUnpinCodesResponse.typeUrl +) +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { + return { + authority: '', + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: '', + label: '', + msg: new Uint8Array(), + funds: [], + source: '', + builder: '', + codeHash: new Uint8Array() + } +} +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.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(66).bytes(message.msg) + } + for (const v of message.funds) { + 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 + ): MsgStoreAndInstantiateContract { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgStoreAndInstantiateContract() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.authority = reader.string() + break + case 3: + 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 + } + } + return message + }, + 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: 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: MsgStoreAndInstantiateContract + ): MsgStoreAndInstantiateContractAmino { + const obj: any = {} + obj.authority = message.authority === '' ? undefined : 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 === false ? undefined : message.unpinCode + obj.admin = message.admin === '' ? undefined : message.admin + obj.label = message.label === '' ? undefined : 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 = message.funds + } + obj.source = message.source === '' ? undefined : message.source + obj.builder = message.builder === '' ? undefined : message.builder + obj.code_hash = message.codeHash + ? base64FromBytes(message.codeHash) + : undefined + return obj + }, + fromAminoMsg( + object: MsgStoreAndInstantiateContractAminoMsg + ): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStoreAndInstantiateContract + ): MsgStoreAndInstantiateContractAminoMsg { + return { + type: 'wasm/MsgStoreAndInstantiateContract', + value: MsgStoreAndInstantiateContract.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStoreAndInstantiateContractProtoMsg + ): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value) + }, + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish() + }, + toProtoMsg( + message: MsgStoreAndInstantiateContract + ): MsgStoreAndInstantiateContractProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract', + value: MsgStoreAndInstantiateContract.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgStoreAndInstantiateContract.typeUrl, + MsgStoreAndInstantiateContract +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStoreAndInstantiateContract.aminoType, + MsgStoreAndInstantiateContract.typeUrl +) +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { + return { + address: '', + data: new Uint8Array() + } +} +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(18).bytes(message.data) + } + return writer + }, + 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 = 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: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse() + message.address = object.address ?? '' + message.data = object.data ?? new Uint8Array() + return message + }, + 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: MsgStoreAndInstantiateContractResponse + ): MsgStoreAndInstantiateContractResponseAmino { + const obj: any = {} + obj.address = message.address === '' ? undefined : message.address + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg( + object: MsgStoreAndInstantiateContractResponseAminoMsg + ): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStoreAndInstantiateContractResponse + ): MsgStoreAndInstantiateContractResponseAminoMsg { + return { + type: 'wasm/MsgStoreAndInstantiateContractResponse', + value: MsgStoreAndInstantiateContractResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStoreAndInstantiateContractResponseProtoMsg + ): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value) + }, + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgStoreAndInstantiateContractResponse + ): MsgStoreAndInstantiateContractResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse', + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgStoreAndInstantiateContractResponse.typeUrl, + MsgStoreAndInstantiateContractResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStoreAndInstantiateContractResponse.aminoType, + MsgStoreAndInstantiateContractResponse.typeUrl +) +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { + return { + authority: '', + addresses: [] + } +} +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) + } + for (const v of message.addresses) { + writer.uint32(18).string(v!) + } + return writer + }, + 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 = createBaseMsgAddCodeUploadParamsAddresses() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.authority = reader.string() + break + case 2: + message.addresses.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses() + message.authority = object.authority ?? '' + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + 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 === '' ? undefined : message.authority + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e) + } else { + obj.addresses = message.addresses + } + return obj + }, + fromAminoMsg( + object: MsgAddCodeUploadParamsAddressesAminoMsg + ): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value) + }, + toAminoMsg( + message: MsgAddCodeUploadParamsAddresses + ): MsgAddCodeUploadParamsAddressesAminoMsg { + return { + type: 'wasm/MsgAddCodeUploadParamsAddresses', + value: MsgAddCodeUploadParamsAddresses.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddCodeUploadParamsAddressesProtoMsg + ): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value) + }, + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish() + }, + toProtoMsg( + message: MsgAddCodeUploadParamsAddresses + ): MsgAddCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses', + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgAddCodeUploadParamsAddresses.typeUrl, + MsgAddCodeUploadParamsAddresses +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddCodeUploadParamsAddresses.aminoType, + MsgAddCodeUploadParamsAddresses.typeUrl +) +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {} +} +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 + ): MsgAddCodeUploadParamsAddressesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddCodeUploadParamsAddressesResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse() + return message + }, + fromAmino( + _: MsgAddCodeUploadParamsAddressesResponseAmino + ): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse() + return message + }, + toAmino( + _: MsgAddCodeUploadParamsAddressesResponse + ): MsgAddCodeUploadParamsAddressesResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgAddCodeUploadParamsAddressesResponseAminoMsg + ): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgAddCodeUploadParamsAddressesResponse + ): MsgAddCodeUploadParamsAddressesResponseAminoMsg { + return { + type: 'wasm/MsgAddCodeUploadParamsAddressesResponse', + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddCodeUploadParamsAddressesResponseProtoMsg + ): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value) + }, + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgAddCodeUploadParamsAddressesResponse + ): MsgAddCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse', + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgAddCodeUploadParamsAddressesResponse.typeUrl, + MsgAddCodeUploadParamsAddressesResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddCodeUploadParamsAddressesResponse.aminoType, + MsgAddCodeUploadParamsAddressesResponse.typeUrl +) +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { + return { + authority: '', + addresses: [] + } +} +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) + } + for (const v of message.addresses) { + writer.uint32(18).string(v!) + } + return writer + }, + 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 = createBaseMsgRemoveCodeUploadParamsAddresses() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.authority = reader.string() + break + case 2: + message.addresses.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses() + message.authority = object.authority ?? '' + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + 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 === '' ? undefined : message.authority + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e) + } else { + obj.addresses = message.addresses + } + return obj + }, + fromAminoMsg( + object: MsgRemoveCodeUploadParamsAddressesAminoMsg + ): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRemoveCodeUploadParamsAddresses + ): MsgRemoveCodeUploadParamsAddressesAminoMsg { + return { + type: 'wasm/MsgRemoveCodeUploadParamsAddresses', + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRemoveCodeUploadParamsAddressesProtoMsg + ): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value) + }, + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish() + }, + toProtoMsg( + message: MsgRemoveCodeUploadParamsAddresses + ): MsgRemoveCodeUploadParamsAddressesProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses', + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRemoveCodeUploadParamsAddresses.typeUrl, + MsgRemoveCodeUploadParamsAddresses +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveCodeUploadParamsAddresses.aminoType, + MsgRemoveCodeUploadParamsAddresses.typeUrl +) +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { + return {} +} +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 + ): MsgRemoveCodeUploadParamsAddressesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse() + return message + }, + fromAmino( + _: MsgRemoveCodeUploadParamsAddressesResponseAmino + ): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse() + return message + }, + toAmino( + _: MsgRemoveCodeUploadParamsAddressesResponse + ): MsgRemoveCodeUploadParamsAddressesResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg + ): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRemoveCodeUploadParamsAddressesResponse + ): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + return { + type: 'wasm/MsgRemoveCodeUploadParamsAddressesResponse', + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg + ): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value) + }, + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRemoveCodeUploadParamsAddressesResponse + ): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse', + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRemoveCodeUploadParamsAddressesResponse.typeUrl, + MsgRemoveCodeUploadParamsAddressesResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveCodeUploadParamsAddressesResponse.aminoType, + MsgRemoveCodeUploadParamsAddressesResponse.typeUrl +) +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { + return { + authority: '', + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: '', + msg: new Uint8Array() + } +} +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(34).string(message.contract) + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg) + } + return writer + }, + 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 = createBaseMsgStoreAndMigrateContract() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + 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 + } + } + return message + }, + 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: 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: MsgStoreAndMigrateContract + ): MsgStoreAndMigrateContractAmino { + const obj: any = {} + obj.authority = message.authority === '' ? undefined : 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 === '' ? undefined : message.contract + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined + return obj + }, + fromAminoMsg( + object: MsgStoreAndMigrateContractAminoMsg + ): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStoreAndMigrateContract + ): MsgStoreAndMigrateContractAminoMsg { + return { + type: 'wasm/MsgStoreAndMigrateContract', + value: MsgStoreAndMigrateContract.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStoreAndMigrateContractProtoMsg + ): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value) + }, + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish() + }, + toProtoMsg( + message: MsgStoreAndMigrateContract + ): MsgStoreAndMigrateContractProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreAndMigrateContract', + value: MsgStoreAndMigrateContract.encode(message).finish() + } + } +} +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 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 + ): MsgStoreAndMigrateContractResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + 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 + } + } + return message + }, + 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( + 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( + message: MsgStoreAndMigrateContractResponse + ): MsgStoreAndMigrateContractResponseAmino { + const obj: any = {} + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.checksum = message.checksum + ? base64FromBytes(message.checksum) + : undefined + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg( + object: MsgStoreAndMigrateContractResponseAminoMsg + ): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStoreAndMigrateContractResponse + ): MsgStoreAndMigrateContractResponseAminoMsg { + return { + type: 'wasm/MsgStoreAndMigrateContractResponse', + value: MsgStoreAndMigrateContractResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStoreAndMigrateContractResponseProtoMsg + ): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value) + }, + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgStoreAndMigrateContractResponse + ): MsgStoreAndMigrateContractResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse', + value: MsgStoreAndMigrateContractResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgStoreAndMigrateContractResponse.typeUrl, + MsgStoreAndMigrateContractResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStoreAndMigrateContractResponse.aminoType, + MsgStoreAndMigrateContractResponse.typeUrl +) +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { + return { + sender: '', + newLabel: '', + contract: '' + } +} +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.newLabel !== '') { + writer.uint32(18).string(message.newLabel) + } + if (message.contract !== '') { + writer.uint32(26).string(message.contract) + } + return writer + }, + 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 = createBaseMsgUpdateContractLabel() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.newLabel = reader.string() + break + case 3: + message.contract = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel() + message.sender = object.sender ?? '' + message.newLabel = object.newLabel ?? '' + message.contract = object.contract ?? '' + return message + }, + 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: MsgUpdateContractLabel): MsgUpdateContractLabelAmino { + const obj: any = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.new_label = message.newLabel === '' ? undefined : message.newLabel + obj.contract = message.contract === '' ? undefined : message.contract + return obj + }, + fromAminoMsg(object: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value) + }, + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { + return { + type: 'wasm/MsgUpdateContractLabel', + value: MsgUpdateContractLabel.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUpdateContractLabelProtoMsg + ): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value) + }, + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish() + }, + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateContractLabel', + value: MsgUpdateContractLabel.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUpdateContractLabel.typeUrl, + MsgUpdateContractLabel +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateContractLabel.aminoType, + MsgUpdateContractLabel.typeUrl +) +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { + return {} +} +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 + ): MsgUpdateContractLabelResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpdateContractLabelResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse() + return message + }, + fromAmino( + _: MsgUpdateContractLabelResponseAmino + ): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse() + return message + }, + toAmino( + _: MsgUpdateContractLabelResponse + ): MsgUpdateContractLabelResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgUpdateContractLabelResponseAminoMsg + ): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUpdateContractLabelResponse + ): MsgUpdateContractLabelResponseAminoMsg { + return { + type: 'wasm/MsgUpdateContractLabelResponse', + value: MsgUpdateContractLabelResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUpdateContractLabelResponseProtoMsg + ): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value) + }, + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUpdateContractLabelResponse + ): MsgUpdateContractLabelResponseProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse', + value: MsgUpdateContractLabelResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUpdateContractLabelResponse.typeUrl, + MsgUpdateContractLabelResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateContractLabelResponse.aminoType, + MsgUpdateContractLabelResponse.typeUrl +) diff --git a/src/proto/osmojs/cosmwasm/wasm/v1/types.ts b/src/proto/osmojs/cosmwasm/wasm/v1/types.ts new file mode 100644 index 0000000..e111167 --- /dev/null +++ b/src/proto/osmojs/cosmwasm/wasm/v1/types.ts @@ -0,0 +1,1490 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Any, + AnyProtoMsg, + AnyAmino, + AnySDKType +} from 'cosmjs-types/google/protobuf/any' +import { isSet, bytesFromBase64, base64FromBytes } from '../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +import { toUtf8, fromUtf8 } from '@cosmjs/encoding' +/** AccessType permission types */ +export enum AccessType { + /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ + ACCESS_TYPE_UNSPECIFIED = 0, + /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ + ACCESS_TYPE_NOBODY = 1, + /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ + ACCESS_TYPE_EVERYBODY = 3, + /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ + ACCESS_TYPE_ANY_OF_ADDRESSES = 4, + UNRECOGNIZED = -1 +} +export const AccessTypeSDKType = AccessType +export const AccessTypeAmino = AccessType +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case 'ACCESS_TYPE_UNSPECIFIED': + return AccessType.ACCESS_TYPE_UNSPECIFIED + case 1: + case 'ACCESS_TYPE_NOBODY': + return AccessType.ACCESS_TYPE_NOBODY + case 3: + case 'ACCESS_TYPE_EVERYBODY': + return AccessType.ACCESS_TYPE_EVERYBODY + case 4: + case 'ACCESS_TYPE_ANY_OF_ADDRESSES': + return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES + case -1: + case 'UNRECOGNIZED': + default: + return AccessType.UNRECOGNIZED + } +} +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: + return 'ACCESS_TYPE_UNSPECIFIED' + case AccessType.ACCESS_TYPE_NOBODY: + return 'ACCESS_TYPE_NOBODY' + case AccessType.ACCESS_TYPE_EVERYBODY: + return 'ACCESS_TYPE_EVERYBODY' + case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: + return 'ACCESS_TYPE_ANY_OF_ADDRESSES' + case AccessType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1 +} +export const ContractCodeHistoryOperationTypeSDKType = + ContractCodeHistoryOperationType +export const ContractCodeHistoryOperationTypeAmino = + ContractCodeHistoryOperationType +export function contractCodeHistoryOperationTypeFromJSON( + object: any +): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED': + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED + case 1: + case 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT': + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT + case 2: + case 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE': + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE + case 3: + case 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS': + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS + case -1: + case 'UNRECOGNIZED': + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED + } +} +export function contractCodeHistoryOperationTypeToJSON( + object: ContractCodeHistoryOperationType +): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED' + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT' + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE' + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS' + case ContractCodeHistoryOperationType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** AccessTypeParam */ +export interface AccessTypeParam { + value: AccessType +} +export interface AccessTypeParamProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AccessTypeParam' + value: Uint8Array +} +/** AccessTypeParam */ +export interface AccessTypeParamAmino { + value?: AccessType +} +export interface AccessTypeParamAminoMsg { + type: 'wasm/AccessTypeParam' + value: AccessTypeParamAmino +} +/** AccessTypeParam */ +export interface AccessTypeParamSDKType { + value: AccessType +} +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType + addresses: string[] +} +export interface AccessConfigProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AccessConfig' + value: Uint8Array +} +/** AccessConfig access control type. */ +export interface AccessConfigAmino { + permission?: AccessType + addresses?: string[] +} +export interface AccessConfigAminoMsg { + type: 'wasm/AccessConfig' + value: AccessConfigAmino +} +/** AccessConfig access control type. */ +export interface AccessConfigSDKType { + permission: AccessType + addresses: string[] +} +/** Params defines the set of wasm parameters. */ +export interface Params { + codeUploadAccess: AccessConfig + instantiateDefaultPermission: AccessType +} +export interface ParamsProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.Params' + value: Uint8Array +} +/** Params defines the set of wasm parameters. */ +export interface ParamsAmino { + code_upload_access: AccessConfigAmino + instantiate_default_permission?: AccessType +} +export interface ParamsAminoMsg { + type: 'wasm/Params' + value: ParamsAmino +} +/** Params defines the set of wasm parameters. */ +export interface ParamsSDKType { + code_upload_access: AccessConfigSDKType + instantiate_default_permission: AccessType +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + /** CodeHash is the unique identifier created by wasmvm */ + codeHash: Uint8Array + /** Creator address who initially stored the code */ + creator: string + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiateConfig: AccessConfig +} +export interface CodeInfoProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.CodeInfo' + value: Uint8Array +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoAmino { + /** CodeHash is the unique identifier created by wasmvm */ + code_hash?: string + /** Creator address who initially stored the code */ + creator?: string + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiate_config: AccessConfigAmino +} +export interface CodeInfoAminoMsg { + type: 'wasm/CodeInfo' + value: CodeInfoAmino +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoSDKType { + code_hash: Uint8Array + creator: string + instantiate_config: AccessConfigSDKType +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: bigint + /** Creator address who initially instantiated the contract */ + creator: string + /** Admin is an optional address that can execute migrations */ + admin: string + /** Label is optional metadata to be stored with a contract instance. */ + label: string + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPosition + ibcPortId: string + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: Any | undefined +} +export interface ContractInfoProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ContractInfo' + value: Uint8Array +} +export type ContractInfoEncoded = Omit & { + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyProtoMsg | undefined +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoAmino { + /** CodeID is the reference to the stored Wasm code */ + code_id?: string + /** Creator address who initially instantiated the contract */ + creator?: string + /** Admin is an optional address that can execute migrations */ + admin?: string + /** Label is optional metadata to be stored with a contract instance. */ + label?: string + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPositionAmino + ibc_port_id?: string + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: AnyAmino +} +export interface ContractInfoAminoMsg { + type: 'wasm/ContractInfo' + value: ContractInfoAmino +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoSDKType { + code_id: bigint + creator: string + admin: string + label: string + created?: AbsoluteTxPositionSDKType + ibc_port_id: string + extension?: AnySDKType | undefined +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType + /** CodeID is the reference to the stored WASM code */ + codeId: bigint + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition + msg: Uint8Array +} +export interface ContractCodeHistoryEntryProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.ContractCodeHistoryEntry' + value: Uint8Array +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntryAmino { + operation?: ContractCodeHistoryOperationType + /** CodeID is the reference to the stored WASM code */ + code_id?: string + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPositionAmino + msg?: any +} +export interface ContractCodeHistoryEntryAminoMsg { + type: 'wasm/ContractCodeHistoryEntry' + value: ContractCodeHistoryEntryAmino +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntrySDKType { + operation: ContractCodeHistoryOperationType + code_id: bigint + updated?: AbsoluteTxPositionSDKType + msg: Uint8Array +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: bigint + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: bigint +} +export interface AbsoluteTxPositionProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.AbsoluteTxPosition' + value: Uint8Array +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionAmino { + /** BlockHeight is the block the contract was created at */ + block_height?: string + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + tx_index?: string +} +export interface AbsoluteTxPositionAminoMsg { + type: 'wasm/AbsoluteTxPosition' + value: AbsoluteTxPositionAmino +} +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPositionSDKType { + block_height: bigint + tx_index: bigint +} +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + key: Uint8Array + /** base64-encode raw value */ + value: Uint8Array +} +export interface ModelProtoMsg { + typeUrl: '/cosmwasm.wasm.v1.Model' + value: Uint8Array +} +/** Model is a struct that holds a KV pair */ +export interface ModelAmino { + /** hex-encode key to read it better (this is often ascii) */ + key?: string + /** base64-encode raw value */ + value?: string +} +export interface ModelAminoMsg { + type: 'wasm/Model' + value: ModelAmino +} +/** Model is a struct that holds a KV pair */ +export interface ModelSDKType { + key: Uint8Array + value: Uint8Array +} +function createBaseAccessTypeParam(): AccessTypeParam { + return { + value: 0 + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessTypeParam { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAccessTypeParam() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.value = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): AccessTypeParam { + const message = createBaseAccessTypeParam() + message.value = object.value ?? 0 + return message + }, + fromAmino(object: AccessTypeParamAmino): AccessTypeParam { + const message = createBaseAccessTypeParam() + if (object.value !== undefined && object.value !== null) { + message.value = object.value + } + return message + }, + toAmino(message: AccessTypeParam): AccessTypeParamAmino { + const obj: any = {} + obj.value = message.value === 0 ? undefined : message.value + return obj + }, + fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { + return AccessTypeParam.fromAmino(object.value) + }, + toAminoMsg(message: AccessTypeParam): AccessTypeParamAminoMsg { + return { + type: 'wasm/AccessTypeParam', + value: AccessTypeParam.toAmino(message) + } + }, + fromProtoMsg(message: AccessTypeParamProtoMsg): AccessTypeParam { + return AccessTypeParam.decode(message.value) + }, + toProto(message: AccessTypeParam): Uint8Array { + return AccessTypeParam.encode(message).finish() + }, + toProtoMsg(message: AccessTypeParam): AccessTypeParamProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AccessTypeParam', + value: AccessTypeParam.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(AccessTypeParam.typeUrl, AccessTypeParam) +GlobalDecoderRegistry.registerAminoProtoMapping( + AccessTypeParam.aminoType, + AccessTypeParam.typeUrl +) +function createBaseAccessConfig(): AccessConfig { + return { + permission: 0, + 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) + } + for (const v of message.addresses) { + writer.uint32(26).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfig { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAccessConfig() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.permission = reader.int32() as any + break + case 3: + message.addresses.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): AccessConfig { + const message = createBaseAccessConfig() + message.permission = object.permission ?? 0 + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + fromAmino(object: AccessConfigAmino): AccessConfig { + const message = createBaseAccessConfig() + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission + } + message.addresses = object.addresses?.map((e) => e) || [] + return message + }, + toAmino(message: AccessConfig): AccessConfigAmino { + const obj: any = {} + obj.permission = message.permission === 0 ? undefined : message.permission + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e) + } else { + obj.addresses = message.addresses + } + return obj + }, + fromAminoMsg(object: AccessConfigAminoMsg): AccessConfig { + return AccessConfig.fromAmino(object.value) + }, + toAminoMsg(message: AccessConfig): AccessConfigAminoMsg { + return { + type: 'wasm/AccessConfig', + value: AccessConfig.toAmino(message) + } + }, + fromProtoMsg(message: AccessConfigProtoMsg): AccessConfig { + return AccessConfig.decode(message.value) + }, + toProto(message: AccessConfig): Uint8Array { + return AccessConfig.encode(message).finish() + }, + toProtoMsg(message: AccessConfig): AccessConfigProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AccessConfig', + value: AccessConfig.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(AccessConfig.typeUrl, AccessConfig) +GlobalDecoderRegistry.registerAminoProtoMapping( + AccessConfig.aminoType, + AccessConfig.typeUrl +) +function createBaseParams(): Params { + return { + codeUploadAccess: AccessConfig.fromPartial({}), + instantiateDefaultPermission: 0 + } +} +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() + } + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission) + } + 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.codeUploadAccess = AccessConfig.decode( + reader, + reader.uint32() + ) + break + case 2: + message.instantiateDefaultPermission = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.codeUploadAccess = + object.codeUploadAccess !== undefined && object.codeUploadAccess !== null + ? AccessConfig.fromPartial(object.codeUploadAccess) + : undefined + message.instantiateDefaultPermission = + object.instantiateDefaultPermission ?? 0 + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = + object.instantiate_default_permission + } + return message + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {} + obj.code_upload_access = message.codeUploadAccess + ? AccessConfig.toAmino(message.codeUploadAccess) + : AccessConfig.toAmino(AccessConfig.fromPartial({})) + obj.instantiate_default_permission = + message.instantiateDefaultPermission === 0 + ? undefined + : message.instantiateDefaultPermission + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'wasm/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: '/cosmwasm.wasm.v1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseCodeInfo(): CodeInfo { + return { + codeHash: new Uint8Array(), + creator: '', + instantiateConfig: AccessConfig.fromPartial({}) + } +} +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) + } + if (message.creator !== '') { + writer.uint32(18).string(message.creator) + } + if (message.instantiateConfig !== undefined) { + AccessConfig.encode( + message.instantiateConfig, + writer.uint32(42).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCodeInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes() + break + case 2: + message.creator = reader.string() + break + case 5: + message.instantiateConfig = AccessConfig.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CodeInfo { + const message = createBaseCodeInfo() + message.codeHash = object.codeHash ?? new Uint8Array() + message.creator = object.creator ?? '' + message.instantiateConfig = + object.instantiateConfig !== undefined && + object.instantiateConfig !== null + ? AccessConfig.fromPartial(object.instantiateConfig) + : undefined + return message + }, + fromAmino(object: CodeInfoAmino): CodeInfo { + 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 + ? base64FromBytes(message.codeHash) + : undefined + obj.creator = message.creator === '' ? undefined : message.creator + obj.instantiate_config = message.instantiateConfig + ? AccessConfig.toAmino(message.instantiateConfig) + : AccessConfig.toAmino(AccessConfig.fromPartial({})) + return obj + }, + fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { + return CodeInfo.fromAmino(object.value) + }, + toAminoMsg(message: CodeInfo): CodeInfoAminoMsg { + return { + type: 'wasm/CodeInfo', + value: CodeInfo.toAmino(message) + } + }, + fromProtoMsg(message: CodeInfoProtoMsg): CodeInfo { + return CodeInfo.decode(message.value) + }, + toProto(message: CodeInfo): Uint8Array { + return CodeInfo.encode(message).finish() + }, + toProtoMsg(message: CodeInfo): CodeInfoProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.CodeInfo', + value: CodeInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CodeInfo.typeUrl, CodeInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + CodeInfo.aminoType, + CodeInfo.typeUrl +) +function createBaseContractInfo(): ContractInfo { + return { + codeId: BigInt(0), + creator: '', + admin: '', + label: '', + 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) + } + if (message.creator !== '') { + writer.uint32(18).string(message.creator) + } + if (message.admin !== '') { + writer.uint32(26).string(message.admin) + } + if (message.label !== '') { + writer.uint32(34).string(message.label) + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode( + message.created, + writer.uint32(42).fork() + ).ldelim() + } + if (message.ibcPortId !== '') { + writer.uint32(50).string(message.ibcPortId) + } + if (message.extension !== undefined) { + Any.encode( + GlobalDecoderRegistry.wrapAny(message.extension), + writer.uint32(58).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() + break + case 2: + message.creator = reader.string() + break + case 3: + message.admin = reader.string() + break + case 4: + message.label = reader.string() + break + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32()) + break + case 6: + message.ibcPortId = reader.string() + break + case 7: + message.extension = GlobalDecoderRegistry.unwrapAny(reader) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ContractInfo { + const message = createBaseContractInfo() + message.codeId = + object.codeId !== undefined && object.codeId !== null + ? BigInt(object.codeId.toString()) + : BigInt(0) + message.creator = object.creator ?? '' + message.admin = object.admin ?? '' + 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 + ? GlobalDecoderRegistry.fromPartial(object.extension) + : undefined + return message + }, + fromAmino(object: ContractInfoAmino): ContractInfo { + 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 = {} + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.creator = message.creator === '' ? undefined : message.creator + obj.admin = message.admin === '' ? undefined : message.admin + obj.label = message.label === '' ? undefined : message.label + obj.created = message.created + ? AbsoluteTxPosition.toAmino(message.created) + : undefined + obj.ibc_port_id = message.ibcPortId === '' ? undefined : message.ibcPortId + obj.extension = message.extension + ? GlobalDecoderRegistry.toAminoMsg(message.extension) + : undefined + return obj + }, + fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { + return ContractInfo.fromAmino(object.value) + }, + toAminoMsg(message: ContractInfo): ContractInfoAminoMsg { + return { + type: 'wasm/ContractInfo', + value: ContractInfo.toAmino(message) + } + }, + fromProtoMsg(message: ContractInfoProtoMsg): ContractInfo { + return ContractInfo.decode(message.value) + }, + toProto(message: ContractInfo): Uint8Array { + return ContractInfo.encode(message).finish() + }, + toProtoMsg(message: ContractInfo): ContractInfoProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ContractInfo', + value: ContractInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ContractInfo.typeUrl, ContractInfo) +GlobalDecoderRegistry.registerAminoProtoMapping( + ContractInfo.aminoType, + ContractInfo.typeUrl +) +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { + operation: 0, + codeId: BigInt(0), + 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) + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId) + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode( + message.updated, + writer.uint32(26).fork() + ).ldelim() + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ContractCodeHistoryEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractCodeHistoryEntry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.operation = reader.int32() as any + break + case 2: + message.codeId = reader.uint64() + break + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()) + break + case 4: + message.msg = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry() + message.operation = object.operation ?? 0 + message.codeId = + object.codeId !== undefined && object.codeId !== null + ? BigInt(object.codeId.toString()) + : BigInt(0) + message.updated = + object.updated !== undefined && object.updated !== null + ? AbsoluteTxPosition.fromPartial(object.updated) + : undefined + message.msg = object.msg ?? new Uint8Array() + return message + }, + fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry() + if (object.operation !== undefined && object.operation !== null) { + message.operation = 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 === 0 ? undefined : message.operation + obj.code_id = + message.codeId !== BigInt(0) ? message.codeId.toString() : undefined + obj.updated = message.updated + ? AbsoluteTxPosition.toAmino(message.updated) + : undefined + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined + return obj + }, + fromAminoMsg( + object: ContractCodeHistoryEntryAminoMsg + ): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.fromAmino(object.value) + }, + toAminoMsg( + message: ContractCodeHistoryEntry + ): ContractCodeHistoryEntryAminoMsg { + return { + type: 'wasm/ContractCodeHistoryEntry', + value: ContractCodeHistoryEntry.toAmino(message) + } + }, + fromProtoMsg( + message: ContractCodeHistoryEntryProtoMsg + ): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.decode(message.value) + }, + toProto(message: ContractCodeHistoryEntry): Uint8Array { + return ContractCodeHistoryEntry.encode(message).finish() + }, + toProtoMsg( + message: ContractCodeHistoryEntry + ): ContractCodeHistoryEntryProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.ContractCodeHistoryEntry', + value: ContractCodeHistoryEntry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ContractCodeHistoryEntry.typeUrl, + ContractCodeHistoryEntry +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ContractCodeHistoryEntry.aminoType, + ContractCodeHistoryEntry.typeUrl +) +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { + blockHeight: BigInt(0), + txIndex: BigInt(0) + } +} +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) + } + if (message.txIndex !== BigInt(0)) { + writer.uint32(16).uint64(message.txIndex) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AbsoluteTxPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAbsoluteTxPosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64() + break + case 2: + message.txIndex = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition() + message.blockHeight = + object.blockHeight !== undefined && object.blockHeight !== null + ? BigInt(object.blockHeight.toString()) + : BigInt(0) + message.txIndex = + object.txIndex !== undefined && object.txIndex !== null + ? BigInt(object.txIndex.toString()) + : BigInt(0) + return message + }, + fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { + 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 = {} + obj.block_height = + message.blockHeight !== BigInt(0) + ? message.blockHeight.toString() + : undefined + obj.tx_index = + message.txIndex !== BigInt(0) ? message.txIndex.toString() : undefined + return obj + }, + fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.fromAmino(object.value) + }, + toAminoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionAminoMsg { + return { + type: 'wasm/AbsoluteTxPosition', + value: AbsoluteTxPosition.toAmino(message) + } + }, + fromProtoMsg(message: AbsoluteTxPositionProtoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.decode(message.value) + }, + toProto(message: AbsoluteTxPosition): Uint8Array { + return AbsoluteTxPosition.encode(message).finish() + }, + toProtoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.AbsoluteTxPosition', + value: AbsoluteTxPosition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(AbsoluteTxPosition.typeUrl, AbsoluteTxPosition) +GlobalDecoderRegistry.registerAminoProtoMapping( + AbsoluteTxPosition.aminoType, + AbsoluteTxPosition.typeUrl +) +function createBaseModel(): Model { + return { + key: new Uint8Array(), + value: new Uint8Array() + } +} +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) + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Model { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModel() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.value = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Model { + const message = createBaseModel() + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + return message + }, + fromAmino(object: ModelAmino): Model { + 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 ? base64FromBytes(message.key) : undefined + obj.value = message.value ? base64FromBytes(message.value) : undefined + return obj + }, + fromAminoMsg(object: ModelAminoMsg): Model { + return Model.fromAmino(object.value) + }, + toAminoMsg(message: Model): ModelAminoMsg { + return { + type: 'wasm/Model', + value: Model.toAmino(message) + } + }, + fromProtoMsg(message: ModelProtoMsg): Model { + return Model.decode(message.value) + }, + toProto(message: Model): Uint8Array { + return Model.encode(message).finish() + }, + toProtoMsg(message: Model): ModelProtoMsg { + return { + typeUrl: '/cosmwasm.wasm.v1.Model', + value: Model.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Model.typeUrl, Model) +GlobalDecoderRegistry.registerAminoProtoMapping(Model.aminoType, Model.typeUrl) diff --git a/src/proto/osmojs/ibc/applications/fee/v1/fee.ts b/src/proto/osmojs/ibc/applications/fee/v1/fee.ts new file mode 100644 index 0000000..511bfd0 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/fee/v1/fee.ts @@ -0,0 +1,659 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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' +/** Fee defines the ICS29 receive, acknowledgement and timeout fees */ +export interface Fee { + /** the packet receive fee */ + recvFee: Coin[] + /** the packet acknowledgement fee */ + ackFee: Coin[] + /** the packet timeout fee */ + timeoutFee: Coin[] +} +export interface FeeProtoMsg { + typeUrl: '/ibc.applications.fee.v1.Fee' + value: Uint8Array +} +/** Fee defines the ICS29 receive, acknowledgement and timeout fees */ +export interface FeeAmino { + /** the packet receive fee */ + recv_fee?: CoinAmino[] + /** the packet acknowledgement fee */ + ack_fee?: CoinAmino[] + /** the packet timeout fee */ + timeout_fee?: CoinAmino[] +} +export interface FeeAminoMsg { + type: 'cosmos-sdk/Fee' + value: FeeAmino +} +/** Fee defines the ICS29 receive, acknowledgement and timeout fees */ +export interface FeeSDKType { + recv_fee: CoinSDKType[] + ack_fee: CoinSDKType[] + timeout_fee: CoinSDKType[] +} +/** PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers */ +export interface PacketFee { + /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ + fee: Fee + /** the refund address for unspent fees */ + refundAddress: string + /** optional list of relayers permitted to receive fees */ + relayers: string[] +} +export interface PacketFeeProtoMsg { + typeUrl: '/ibc.applications.fee.v1.PacketFee' + value: Uint8Array +} +/** PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers */ +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 + /** optional list of relayers permitted to receive fees */ + relayers?: string[] +} +export interface PacketFeeAminoMsg { + type: 'cosmos-sdk/PacketFee' + value: PacketFeeAmino +} +/** PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers */ +export interface PacketFeeSDKType { + fee: FeeSDKType + refund_address: string + relayers: string[] +} +/** PacketFees contains a list of type PacketFee */ +export interface PacketFees { + /** list of packet fees */ + packetFees: PacketFee[] +} +export interface PacketFeesProtoMsg { + typeUrl: '/ibc.applications.fee.v1.PacketFees' + value: Uint8Array +} +/** PacketFees contains a list of type PacketFee */ +export interface PacketFeesAmino { + /** list of packet fees */ + packet_fees?: PacketFeeAmino[] +} +export interface PacketFeesAminoMsg { + type: 'cosmos-sdk/PacketFees' + value: PacketFeesAmino +} +/** PacketFees contains a list of type PacketFee */ +export interface PacketFeesSDKType { + packet_fees: PacketFeeSDKType[] +} +/** IdentifiedPacketFees contains a list of type PacketFee and associated PacketId */ +export interface IdentifiedPacketFees { + /** unique packet identifier comprised of the channel ID, port ID and sequence */ + packetId: PacketId + /** list of packet fees */ + packetFees: PacketFee[] +} +export interface IdentifiedPacketFeesProtoMsg { + typeUrl: '/ibc.applications.fee.v1.IdentifiedPacketFees' + value: Uint8Array +} +/** IdentifiedPacketFees contains a list of type PacketFee and associated PacketId */ +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[] +} +export interface IdentifiedPacketFeesAminoMsg { + type: 'cosmos-sdk/IdentifiedPacketFees' + value: IdentifiedPacketFeesAmino +} +/** IdentifiedPacketFees contains a list of type PacketFee and associated PacketId */ +export interface IdentifiedPacketFeesSDKType { + packet_id: PacketIdSDKType + packet_fees: PacketFeeSDKType[] +} +function createBaseFee(): Fee { + return { + recvFee: [], + ackFee: [], + timeoutFee: [] + } +} +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() + } + for (const v of message.ackFee) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + for (const v of message.timeoutFee) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFee() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.recvFee.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.ackFee.push(Coin.decode(reader, reader.uint32())) + break + case 3: + message.timeoutFee.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Fee { + const message = createBaseFee() + message.recvFee = object.recvFee?.map((e) => Coin.fromPartial(e)) || [] + message.ackFee = object.ackFee?.map((e) => Coin.fromPartial(e)) || [] + message.timeoutFee = + object.timeoutFee?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: FeeAmino): Fee { + 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 = {} + if (message.recvFee) { + obj.recv_fee = message.recvFee.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.recv_fee = message.recvFee + } + if (message.ackFee) { + obj.ack_fee = message.ackFee.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.ack_fee = message.ackFee + } + if (message.timeoutFee) { + obj.timeout_fee = message.timeoutFee.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.timeout_fee = message.timeoutFee + } + return obj + }, + fromAminoMsg(object: FeeAminoMsg): Fee { + return Fee.fromAmino(object.value) + }, + toAminoMsg(message: Fee): FeeAminoMsg { + return { + type: 'cosmos-sdk/Fee', + value: Fee.toAmino(message) + } + }, + fromProtoMsg(message: FeeProtoMsg): Fee { + return Fee.decode(message.value) + }, + toProto(message: Fee): Uint8Array { + return Fee.encode(message).finish() + }, + toProtoMsg(message: Fee): FeeProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.Fee', + value: Fee.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Fee.typeUrl, Fee) +GlobalDecoderRegistry.registerAminoProtoMapping(Fee.aminoType, Fee.typeUrl) +function createBasePacketFee(): PacketFee { + return { + fee: Fee.fromPartial({}), + refundAddress: '', + relayers: [] + } +} +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() + } + if (message.refundAddress !== '') { + writer.uint32(18).string(message.refundAddress) + } + for (const v of message.relayers) { + writer.uint32(26).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketFee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePacketFee() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.fee = Fee.decode(reader, reader.uint32()) + break + case 2: + message.refundAddress = reader.string() + break + case 3: + message.relayers.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PacketFee { + const message = createBasePacketFee() + message.fee = + object.fee !== undefined && object.fee !== null + ? Fee.fromPartial(object.fee) + : undefined + message.refundAddress = object.refundAddress ?? '' + message.relayers = object.relayers?.map((e) => e) || [] + return message + }, + fromAmino(object: PacketFeeAmino): PacketFee { + 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 = {} + obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined + obj.refund_address = + message.refundAddress === '' ? undefined : message.refundAddress + if (message.relayers) { + obj.relayers = message.relayers.map((e) => e) + } else { + obj.relayers = message.relayers + } + return obj + }, + fromAminoMsg(object: PacketFeeAminoMsg): PacketFee { + return PacketFee.fromAmino(object.value) + }, + toAminoMsg(message: PacketFee): PacketFeeAminoMsg { + return { + type: 'cosmos-sdk/PacketFee', + value: PacketFee.toAmino(message) + } + }, + fromProtoMsg(message: PacketFeeProtoMsg): PacketFee { + return PacketFee.decode(message.value) + }, + toProto(message: PacketFee): Uint8Array { + return PacketFee.encode(message).finish() + }, + toProtoMsg(message: PacketFee): PacketFeeProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.PacketFee', + value: PacketFee.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PacketFee.typeUrl, PacketFee) +GlobalDecoderRegistry.registerAminoProtoMapping( + PacketFee.aminoType, + PacketFee.typeUrl +) +function createBasePacketFees(): PacketFees { + return { + 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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketFees { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePacketFees() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packetFees.push(PacketFee.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PacketFees { + const message = createBasePacketFees() + message.packetFees = + object.packetFees?.map((e) => PacketFee.fromPartial(e)) || [] + return message + }, + fromAmino(object: PacketFeesAmino): PacketFees { + const message = createBasePacketFees() + message.packetFees = + object.packet_fees?.map((e) => PacketFee.fromAmino(e)) || [] + return message + }, + toAmino(message: PacketFees): PacketFeesAmino { + const obj: any = {} + if (message.packetFees) { + obj.packet_fees = message.packetFees.map((e) => + e ? PacketFee.toAmino(e) : undefined + ) + } else { + obj.packet_fees = message.packetFees + } + return obj + }, + fromAminoMsg(object: PacketFeesAminoMsg): PacketFees { + return PacketFees.fromAmino(object.value) + }, + toAminoMsg(message: PacketFees): PacketFeesAminoMsg { + return { + type: 'cosmos-sdk/PacketFees', + value: PacketFees.toAmino(message) + } + }, + fromProtoMsg(message: PacketFeesProtoMsg): PacketFees { + return PacketFees.decode(message.value) + }, + toProto(message: PacketFees): Uint8Array { + return PacketFees.encode(message).finish() + }, + toProtoMsg(message: PacketFees): PacketFeesProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.PacketFees', + value: PacketFees.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PacketFees.typeUrl, PacketFees) +GlobalDecoderRegistry.registerAminoProtoMapping( + PacketFees.aminoType, + PacketFees.typeUrl +) +function createBaseIdentifiedPacketFees(): IdentifiedPacketFees { + return { + packetId: PacketId.fromPartial({}), + packetFees: [] + } +} +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() + } + for (const v of message.packetFees) { + PacketFee.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): IdentifiedPacketFees { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIdentifiedPacketFees() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packetId = PacketId.decode(reader, reader.uint32()) + break + case 2: + message.packetFees.push(PacketFee.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): IdentifiedPacketFees { + const message = createBaseIdentifiedPacketFees() + message.packetId = + object.packetId !== undefined && object.packetId !== null + ? PacketId.fromPartial(object.packetId) + : undefined + message.packetFees = + object.packetFees?.map((e) => PacketFee.fromPartial(e)) || [] + return message + }, + fromAmino(object: IdentifiedPacketFeesAmino): IdentifiedPacketFees { + 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 = {} + obj.packet_id = message.packetId + ? PacketId.toAmino(message.packetId) + : undefined + if (message.packetFees) { + obj.packet_fees = message.packetFees.map((e) => + e ? PacketFee.toAmino(e) : undefined + ) + } else { + obj.packet_fees = message.packetFees + } + return obj + }, + fromAminoMsg(object: IdentifiedPacketFeesAminoMsg): IdentifiedPacketFees { + return IdentifiedPacketFees.fromAmino(object.value) + }, + toAminoMsg(message: IdentifiedPacketFees): IdentifiedPacketFeesAminoMsg { + return { + type: 'cosmos-sdk/IdentifiedPacketFees', + value: IdentifiedPacketFees.toAmino(message) + } + }, + fromProtoMsg(message: IdentifiedPacketFeesProtoMsg): IdentifiedPacketFees { + return IdentifiedPacketFees.decode(message.value) + }, + toProto(message: IdentifiedPacketFees): Uint8Array { + return IdentifiedPacketFees.encode(message).finish() + }, + toProtoMsg(message: IdentifiedPacketFees): IdentifiedPacketFeesProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.IdentifiedPacketFees', + value: IdentifiedPacketFees.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + IdentifiedPacketFees.typeUrl, + IdentifiedPacketFees +) +GlobalDecoderRegistry.registerAminoProtoMapping( + IdentifiedPacketFees.aminoType, + IdentifiedPacketFees.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/fee/v1/tx.amino.ts b/src/proto/osmojs/ibc/applications/fee/v1/tx.amino.ts new file mode 100644 index 0000000..fd890ce --- /dev/null +++ b/src/proto/osmojs/ibc/applications/fee/v1/tx.amino.ts @@ -0,0 +1,30 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgRegisterPayee, + MsgRegisterCounterpartyPayee, + MsgPayPacketFee, + MsgPayPacketFeeAsync +} from './tx' +export const AminoConverter = { + '/ibc.applications.fee.v1.MsgRegisterPayee': { + aminoType: 'cosmos-sdk/MsgRegisterPayee', + toAmino: MsgRegisterPayee.toAmino, + fromAmino: MsgRegisterPayee.fromAmino + }, + '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee': { + aminoType: 'cosmos-sdk/MsgRegisterCounterpartyPayee', + toAmino: MsgRegisterCounterpartyPayee.toAmino, + fromAmino: MsgRegisterCounterpartyPayee.fromAmino + }, + '/ibc.applications.fee.v1.MsgPayPacketFee': { + aminoType: 'cosmos-sdk/MsgPayPacketFee', + toAmino: MsgPayPacketFee.toAmino, + fromAmino: MsgPayPacketFee.fromAmino + }, + '/ibc.applications.fee.v1.MsgPayPacketFeeAsync': { + aminoType: 'cosmos-sdk/MsgPayPacketFeeAsync', + toAmino: MsgPayPacketFeeAsync.toAmino, + fromAmino: MsgPayPacketFeeAsync.fromAmino + } +} diff --git a/src/proto/osmojs/ibc/applications/fee/v1/tx.registry.ts b/src/proto/osmojs/ibc/applications/fee/v1/tx.registry.ts new file mode 100644 index 0000000..f1c60fe --- /dev/null +++ b/src/proto/osmojs/ibc/applications/fee/v1/tx.registry.ts @@ -0,0 +1,103 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { + MsgRegisterPayee, + MsgRegisterCounterpartyPayee, + MsgPayPacketFee, + MsgPayPacketFeeAsync +} from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/ibc.applications.fee.v1.MsgRegisterPayee', MsgRegisterPayee], + [ + '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee', + MsgRegisterCounterpartyPayee + ], + ['/ibc.applications.fee.v1.MsgPayPacketFee', MsgPayPacketFee], + ['/ibc.applications.fee.v1.MsgPayPacketFeeAsync', MsgPayPacketFeeAsync] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayee', + value: MsgRegisterPayee.encode(value).finish() + } + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee', + value: MsgRegisterCounterpartyPayee.encode(value).finish() + } + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFee', + value: MsgPayPacketFee.encode(value).finish() + } + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsync', + value: MsgPayPacketFeeAsync.encode(value).finish() + } + } + }, + withTypeUrl: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayee', + value + } + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee', + value + } + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFee', + value + } + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsync', + value + } + } + }, + fromPartial: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayee', + value: MsgRegisterPayee.fromPartial(value) + } + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee', + value: MsgRegisterCounterpartyPayee.fromPartial(value) + } + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFee', + value: MsgPayPacketFee.fromPartial(value) + } + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsync', + value: MsgPayPacketFeeAsync.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/ibc/applications/fee/v1/tx.ts b/src/proto/osmojs/ibc/applications/fee/v1/tx.ts new file mode 100644 index 0000000..d0719b1 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/fee/v1/tx.ts @@ -0,0 +1,1222 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Fee, + FeeAmino, + FeeSDKType, + PacketFee, + PacketFeeAmino, + PacketFeeSDKType +} from './fee' +import { + PacketId, + PacketIdAmino, + PacketIdSDKType +} from '../../../core/channel/v1/channel' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +/** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ +export interface MsgRegisterPayee { + /** unique port identifier */ + portId: string + /** unique channel identifier */ + channelId: string + /** the relayer address */ + relayer: string + /** the payee address */ + payee: string +} +export interface MsgRegisterPayeeProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayee' + value: Uint8Array +} +/** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ +export interface MsgRegisterPayeeAmino { + /** unique port identifier */ + port_id?: string + /** unique channel identifier */ + channel_id?: string + /** the relayer address */ + relayer?: string + /** the payee address */ + payee?: string +} +export interface MsgRegisterPayeeAminoMsg { + type: 'cosmos-sdk/MsgRegisterPayee' + value: MsgRegisterPayeeAmino +} +/** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ +export interface MsgRegisterPayeeSDKType { + port_id: string + channel_id: string + relayer: string + payee: string +} +/** MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc */ +export interface MsgRegisterPayeeResponse {} +export interface MsgRegisterPayeeResponseProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayeeResponse' + value: Uint8Array +} +/** MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc */ +export interface MsgRegisterPayeeResponseAmino {} +export interface MsgRegisterPayeeResponseAminoMsg { + type: 'cosmos-sdk/MsgRegisterPayeeResponse' + value: MsgRegisterPayeeResponseAmino +} +/** MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc */ +export interface MsgRegisterPayeeResponseSDKType {} +/** MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayee { + /** unique port identifier */ + portId: string + /** unique channel identifier */ + channelId: string + /** the relayer address */ + relayer: string + /** the counterparty payee address */ + counterpartyPayee: string +} +export interface MsgRegisterCounterpartyPayeeProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee' + value: Uint8Array +} +/** MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayeeAmino { + /** unique port identifier */ + port_id?: string + /** unique channel identifier */ + channel_id?: string + /** the relayer address */ + relayer?: string + /** the counterparty payee address */ + counterparty_payee?: string +} +export interface MsgRegisterCounterpartyPayeeAminoMsg { + type: 'cosmos-sdk/MsgRegisterCounterpartyPayee' + value: MsgRegisterCounterpartyPayeeAmino +} +/** MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayeeSDKType { + port_id: string + channel_id: string + relayer: string + counterparty_payee: string +} +/** MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayeeResponse {} +export interface MsgRegisterCounterpartyPayeeResponseProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse' + value: Uint8Array +} +/** MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayeeResponseAmino {} +export interface MsgRegisterCounterpartyPayeeResponseAminoMsg { + type: 'cosmos-sdk/MsgRegisterCounterpartyPayeeResponse' + value: MsgRegisterCounterpartyPayeeResponseAmino +} +/** MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc */ +export interface MsgRegisterCounterpartyPayeeResponseSDKType {} +/** + * MsgPayPacketFee defines the request type for the PayPacketFee rpc + * This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be + * paid for + */ +export interface MsgPayPacketFee { + /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ + fee: Fee + /** the source port unique identifier */ + sourcePortId: string + /** the source channel unique identifier */ + sourceChannelId: string + /** account address to refund fee if necessary */ + signer: string + /** optional list of relayers permitted to the receive packet fees */ + relayers: string[] +} +export interface MsgPayPacketFeeProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFee' + value: Uint8Array +} +/** + * MsgPayPacketFee defines the request type for the PayPacketFee rpc + * This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be + * paid for + */ +export interface MsgPayPacketFeeAmino { + /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ + fee: FeeAmino + /** the source port unique identifier */ + source_port_id?: string + /** the source channel unique identifier */ + source_channel_id?: string + /** account address to refund fee if necessary */ + signer?: string + /** optional list of relayers permitted to the receive packet fees */ + relayers?: string[] +} +export interface MsgPayPacketFeeAminoMsg { + type: 'cosmos-sdk/MsgPayPacketFee' + value: MsgPayPacketFeeAmino +} +/** + * MsgPayPacketFee defines the request type for the PayPacketFee rpc + * This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be + * paid for + */ +export interface MsgPayPacketFeeSDKType { + fee: FeeSDKType + source_port_id: string + source_channel_id: string + signer: string + relayers: string[] +} +/** MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc */ +export interface MsgPayPacketFeeResponse {} +export interface MsgPayPacketFeeResponseProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeResponse' + value: Uint8Array +} +/** MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc */ +export interface MsgPayPacketFeeResponseAmino {} +export interface MsgPayPacketFeeResponseAminoMsg { + type: 'cosmos-sdk/MsgPayPacketFeeResponse' + value: MsgPayPacketFeeResponseAmino +} +/** MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc */ +export interface MsgPayPacketFeeResponseSDKType {} +/** + * MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc + * This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) + */ +export interface MsgPayPacketFeeAsync { + /** unique packet identifier comprised of the channel ID, port ID and sequence */ + packetId: PacketId + /** the packet fee associated with a particular IBC packet */ + packetFee: PacketFee +} +export interface MsgPayPacketFeeAsyncProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsync' + value: Uint8Array +} +/** + * MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc + * This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) + */ +export interface MsgPayPacketFeeAsyncAmino { + /** unique packet identifier comprised of the channel ID, port ID and sequence */ + packet_id: PacketIdAmino + /** the packet fee associated with a particular IBC packet */ + packet_fee: PacketFeeAmino +} +export interface MsgPayPacketFeeAsyncAminoMsg { + type: 'cosmos-sdk/MsgPayPacketFeeAsync' + value: MsgPayPacketFeeAsyncAmino +} +/** + * MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc + * This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) + */ +export interface MsgPayPacketFeeAsyncSDKType { + packet_id: PacketIdSDKType + packet_fee: PacketFeeSDKType +} +/** MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc */ +export interface MsgPayPacketFeeAsyncResponse {} +export interface MsgPayPacketFeeAsyncResponseProtoMsg { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse' + value: Uint8Array +} +/** MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc */ +export interface MsgPayPacketFeeAsyncResponseAmino {} +export interface MsgPayPacketFeeAsyncResponseAminoMsg { + type: 'cosmos-sdk/MsgPayPacketFeeAsyncResponse' + value: MsgPayPacketFeeAsyncResponseAmino +} +/** MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc */ +export interface MsgPayPacketFeeAsyncResponseSDKType {} +function createBaseMsgRegisterPayee(): MsgRegisterPayee { + return { + portId: '', + channelId: '', + relayer: '', + payee: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.relayer !== '') { + writer.uint32(26).string(message.relayer) + } + if (message.payee !== '') { + writer.uint32(34).string(message.payee) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterPayee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterPayee() + 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.relayer = reader.string() + break + case 4: + message.payee = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgRegisterPayee { + const message = createBaseMsgRegisterPayee() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.relayer = object.relayer ?? '' + message.payee = object.payee ?? '' + return message + }, + fromAmino(object: MsgRegisterPayeeAmino): MsgRegisterPayee { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.relayer = message.relayer === '' ? undefined : message.relayer + obj.payee = message.payee === '' ? undefined : message.payee + return obj + }, + fromAminoMsg(object: MsgRegisterPayeeAminoMsg): MsgRegisterPayee { + return MsgRegisterPayee.fromAmino(object.value) + }, + toAminoMsg(message: MsgRegisterPayee): MsgRegisterPayeeAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterPayee', + value: MsgRegisterPayee.toAmino(message) + } + }, + fromProtoMsg(message: MsgRegisterPayeeProtoMsg): MsgRegisterPayee { + return MsgRegisterPayee.decode(message.value) + }, + toProto(message: MsgRegisterPayee): Uint8Array { + return MsgRegisterPayee.encode(message).finish() + }, + toProtoMsg(message: MsgRegisterPayee): MsgRegisterPayeeProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayee', + value: MsgRegisterPayee.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRegisterPayeeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterPayeeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgRegisterPayeeResponse { + const message = createBaseMsgRegisterPayeeResponse() + return message + }, + fromAmino(_: MsgRegisterPayeeResponseAmino): MsgRegisterPayeeResponse { + const message = createBaseMsgRegisterPayeeResponse() + return message + }, + toAmino(_: MsgRegisterPayeeResponse): MsgRegisterPayeeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgRegisterPayeeResponseAminoMsg + ): MsgRegisterPayeeResponse { + return MsgRegisterPayeeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRegisterPayeeResponse + ): MsgRegisterPayeeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterPayeeResponse', + value: MsgRegisterPayeeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRegisterPayeeResponseProtoMsg + ): MsgRegisterPayeeResponse { + return MsgRegisterPayeeResponse.decode(message.value) + }, + toProto(message: MsgRegisterPayeeResponse): Uint8Array { + return MsgRegisterPayeeResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRegisterPayeeResponse + ): MsgRegisterPayeeResponseProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterPayeeResponse', + value: MsgRegisterPayeeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRegisterPayeeResponse.typeUrl, + MsgRegisterPayeeResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRegisterPayeeResponse.aminoType, + MsgRegisterPayeeResponse.typeUrl +) +function createBaseMsgRegisterCounterpartyPayee(): MsgRegisterCounterpartyPayee { + return { + portId: '', + channelId: '', + relayer: '', + counterpartyPayee: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.relayer !== '') { + writer.uint32(26).string(message.relayer) + } + if (message.counterpartyPayee !== '') { + writer.uint32(34).string(message.counterpartyPayee) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRegisterCounterpartyPayee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterCounterpartyPayee() + 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.relayer = reader.string() + break + case 4: + message.counterpartyPayee = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgRegisterCounterpartyPayee { + const message = createBaseMsgRegisterCounterpartyPayee() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.relayer = object.relayer ?? '' + message.counterpartyPayee = object.counterpartyPayee ?? '' + return message + }, + fromAmino( + object: MsgRegisterCounterpartyPayeeAmino + ): MsgRegisterCounterpartyPayee { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.relayer = message.relayer === '' ? undefined : message.relayer + obj.counterparty_payee = + message.counterpartyPayee === '' ? undefined : message.counterpartyPayee + return obj + }, + fromAminoMsg( + object: MsgRegisterCounterpartyPayeeAminoMsg + ): MsgRegisterCounterpartyPayee { + return MsgRegisterCounterpartyPayee.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRegisterCounterpartyPayee + ): MsgRegisterCounterpartyPayeeAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterCounterpartyPayee', + value: MsgRegisterCounterpartyPayee.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRegisterCounterpartyPayeeProtoMsg + ): MsgRegisterCounterpartyPayee { + return MsgRegisterCounterpartyPayee.decode(message.value) + }, + toProto(message: MsgRegisterCounterpartyPayee): Uint8Array { + return MsgRegisterCounterpartyPayee.encode(message).finish() + }, + toProtoMsg( + message: MsgRegisterCounterpartyPayee + ): MsgRegisterCounterpartyPayeeProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee', + value: MsgRegisterCounterpartyPayee.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRegisterCounterpartyPayeeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterCounterpartyPayeeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgRegisterCounterpartyPayeeResponse { + const message = createBaseMsgRegisterCounterpartyPayeeResponse() + return message + }, + fromAmino( + _: MsgRegisterCounterpartyPayeeResponseAmino + ): MsgRegisterCounterpartyPayeeResponse { + const message = createBaseMsgRegisterCounterpartyPayeeResponse() + return message + }, + toAmino( + _: MsgRegisterCounterpartyPayeeResponse + ): MsgRegisterCounterpartyPayeeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgRegisterCounterpartyPayeeResponseAminoMsg + ): MsgRegisterCounterpartyPayeeResponse { + return MsgRegisterCounterpartyPayeeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRegisterCounterpartyPayeeResponse + ): MsgRegisterCounterpartyPayeeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterCounterpartyPayeeResponse', + value: MsgRegisterCounterpartyPayeeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRegisterCounterpartyPayeeResponseProtoMsg + ): MsgRegisterCounterpartyPayeeResponse { + return MsgRegisterCounterpartyPayeeResponse.decode(message.value) + }, + toProto(message: MsgRegisterCounterpartyPayeeResponse): Uint8Array { + return MsgRegisterCounterpartyPayeeResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRegisterCounterpartyPayeeResponse + ): MsgRegisterCounterpartyPayeeResponseProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse', + value: MsgRegisterCounterpartyPayeeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRegisterCounterpartyPayeeResponse.typeUrl, + MsgRegisterCounterpartyPayeeResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRegisterCounterpartyPayeeResponse.aminoType, + MsgRegisterCounterpartyPayeeResponse.typeUrl +) +function createBaseMsgPayPacketFee(): MsgPayPacketFee { + return { + fee: Fee.fromPartial({}), + sourcePortId: '', + sourceChannelId: '', + signer: '', + relayers: [] + } +} +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() + } + if (message.sourcePortId !== '') { + writer.uint32(18).string(message.sourcePortId) + } + if (message.sourceChannelId !== '') { + writer.uint32(26).string(message.sourceChannelId) + } + if (message.signer !== '') { + writer.uint32(34).string(message.signer) + } + for (const v of message.relayers) { + writer.uint32(42).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayPacketFee { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgPayPacketFee() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.fee = Fee.decode(reader, reader.uint32()) + break + case 2: + message.sourcePortId = reader.string() + break + case 3: + message.sourceChannelId = reader.string() + break + case 4: + message.signer = reader.string() + break + case 5: + message.relayers.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgPayPacketFee { + const message = createBaseMsgPayPacketFee() + message.fee = + object.fee !== undefined && object.fee !== null + ? Fee.fromPartial(object.fee) + : undefined + message.sourcePortId = object.sourcePortId ?? '' + message.sourceChannelId = object.sourceChannelId ?? '' + message.signer = object.signer ?? '' + message.relayers = object.relayers?.map((e) => e) || [] + return message + }, + fromAmino(object: MsgPayPacketFeeAmino): MsgPayPacketFee { + 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) + : Fee.toAmino(Fee.fromPartial({})) + obj.source_port_id = + message.sourcePortId === '' ? undefined : message.sourcePortId + obj.source_channel_id = + message.sourceChannelId === '' ? undefined : message.sourceChannelId + obj.signer = message.signer === '' ? undefined : message.signer + if (message.relayers) { + obj.relayers = message.relayers.map((e) => e) + } else { + obj.relayers = message.relayers + } + return obj + }, + fromAminoMsg(object: MsgPayPacketFeeAminoMsg): MsgPayPacketFee { + return MsgPayPacketFee.fromAmino(object.value) + }, + toAminoMsg(message: MsgPayPacketFee): MsgPayPacketFeeAminoMsg { + return { + type: 'cosmos-sdk/MsgPayPacketFee', + value: MsgPayPacketFee.toAmino(message) + } + }, + fromProtoMsg(message: MsgPayPacketFeeProtoMsg): MsgPayPacketFee { + return MsgPayPacketFee.decode(message.value) + }, + toProto(message: MsgPayPacketFee): Uint8Array { + return MsgPayPacketFee.encode(message).finish() + }, + toProtoMsg(message: MsgPayPacketFee): MsgPayPacketFeeProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFee', + value: MsgPayPacketFee.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgPayPacketFeeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgPayPacketFeeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgPayPacketFeeResponse { + const message = createBaseMsgPayPacketFeeResponse() + return message + }, + fromAmino(_: MsgPayPacketFeeResponseAmino): MsgPayPacketFeeResponse { + const message = createBaseMsgPayPacketFeeResponse() + return message + }, + toAmino(_: MsgPayPacketFeeResponse): MsgPayPacketFeeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgPayPacketFeeResponseAminoMsg + ): MsgPayPacketFeeResponse { + return MsgPayPacketFeeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgPayPacketFeeResponse + ): MsgPayPacketFeeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgPayPacketFeeResponse', + value: MsgPayPacketFeeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgPayPacketFeeResponseProtoMsg + ): MsgPayPacketFeeResponse { + return MsgPayPacketFeeResponse.decode(message.value) + }, + toProto(message: MsgPayPacketFeeResponse): Uint8Array { + return MsgPayPacketFeeResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgPayPacketFeeResponse + ): MsgPayPacketFeeResponseProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeResponse', + value: MsgPayPacketFeeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgPayPacketFeeResponse.typeUrl, + MsgPayPacketFeeResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgPayPacketFeeResponse.aminoType, + MsgPayPacketFeeResponse.typeUrl +) +function createBaseMsgPayPacketFeeAsync(): MsgPayPacketFeeAsync { + return { + packetId: PacketId.fromPartial({}), + packetFee: PacketFee.fromPartial({}) + } +} +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() + } + if (message.packetFee !== undefined) { + PacketFee.encode(message.packetFee, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgPayPacketFeeAsync { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgPayPacketFeeAsync() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packetId = PacketId.decode(reader, reader.uint32()) + break + case 2: + message.packetFee = PacketFee.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgPayPacketFeeAsync { + const message = createBaseMsgPayPacketFeeAsync() + message.packetId = + object.packetId !== undefined && object.packetId !== null + ? PacketId.fromPartial(object.packetId) + : undefined + message.packetFee = + object.packetFee !== undefined && object.packetFee !== null + ? PacketFee.fromPartial(object.packetFee) + : undefined + return message + }, + fromAmino(object: MsgPayPacketFeeAsyncAmino): MsgPayPacketFeeAsync { + 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) + : PacketId.toAmino(PacketId.fromPartial({})) + obj.packet_fee = message.packetFee + ? PacketFee.toAmino(message.packetFee) + : PacketFee.toAmino(PacketFee.fromPartial({})) + return obj + }, + fromAminoMsg(object: MsgPayPacketFeeAsyncAminoMsg): MsgPayPacketFeeAsync { + return MsgPayPacketFeeAsync.fromAmino(object.value) + }, + toAminoMsg(message: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncAminoMsg { + return { + type: 'cosmos-sdk/MsgPayPacketFeeAsync', + value: MsgPayPacketFeeAsync.toAmino(message) + } + }, + fromProtoMsg(message: MsgPayPacketFeeAsyncProtoMsg): MsgPayPacketFeeAsync { + return MsgPayPacketFeeAsync.decode(message.value) + }, + toProto(message: MsgPayPacketFeeAsync): Uint8Array { + return MsgPayPacketFeeAsync.encode(message).finish() + }, + toProtoMsg(message: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsync', + value: MsgPayPacketFeeAsync.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgPayPacketFeeAsyncResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgPayPacketFeeAsyncResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgPayPacketFeeAsyncResponse { + const message = createBaseMsgPayPacketFeeAsyncResponse() + return message + }, + fromAmino( + _: MsgPayPacketFeeAsyncResponseAmino + ): MsgPayPacketFeeAsyncResponse { + const message = createBaseMsgPayPacketFeeAsyncResponse() + return message + }, + toAmino(_: MsgPayPacketFeeAsyncResponse): MsgPayPacketFeeAsyncResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgPayPacketFeeAsyncResponseAminoMsg + ): MsgPayPacketFeeAsyncResponse { + return MsgPayPacketFeeAsyncResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgPayPacketFeeAsyncResponse + ): MsgPayPacketFeeAsyncResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgPayPacketFeeAsyncResponse', + value: MsgPayPacketFeeAsyncResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgPayPacketFeeAsyncResponseProtoMsg + ): MsgPayPacketFeeAsyncResponse { + return MsgPayPacketFeeAsyncResponse.decode(message.value) + }, + toProto(message: MsgPayPacketFeeAsyncResponse): Uint8Array { + return MsgPayPacketFeeAsyncResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgPayPacketFeeAsyncResponse + ): MsgPayPacketFeeAsyncResponseProtoMsg { + return { + typeUrl: '/ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse', + value: MsgPayPacketFeeAsyncResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgPayPacketFeeAsyncResponse.typeUrl, + MsgPayPacketFeeAsyncResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgPayPacketFeeAsyncResponse.aminoType, + MsgPayPacketFeeAsyncResponse.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/controller.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/controller.ts new file mode 100644 index 0000000..314cc63 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/controller.ts @@ -0,0 +1,143 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +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. + */ +export interface Params { + /** controller_enabled enables or disables the controller submodule. */ + controllerEnabled: boolean +} +export interface ParamsProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.Params' + value: Uint8Array +} +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the controller submodule. + */ +export interface ParamsAmino { + /** controller_enabled enables or disables the controller submodule. */ + controller_enabled?: boolean +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/Params' + value: ParamsAmino +} +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the controller submodule. + */ +export interface ParamsSDKType { + controller_enabled: boolean +} +function createBaseParams(): Params { + return { + controllerEnabled: false + } +} +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) + } + 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.controllerEnabled = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.controllerEnabled = object.controllerEnabled ?? false + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = {} + obj.controller_enabled = + message.controllerEnabled === false + ? undefined + : message.controllerEnabled + 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.applications.interchain_accounts.controller.v1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts new file mode 100644 index 0000000..b1b0576 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts @@ -0,0 +1,21 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from './tx' +export const AminoConverter = { + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount': + { + aminoType: 'cosmos-sdk/MsgRegisterInterchainAccount', + toAmino: MsgRegisterInterchainAccount.toAmino, + fromAmino: MsgRegisterInterchainAccount.fromAmino + }, + '/ibc.applications.interchain_accounts.controller.v1.MsgSendTx': { + 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 + } +} diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts new file mode 100644 index 0000000..85a5675 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts @@ -0,0 +1,91 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount', + value: MsgRegisterInterchainAccount.encode(value).finish() + } + }, + sendTx(value: MsgSendTx) { + return { + 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: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount', + value + } + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgSendTx', + value + } + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams', + value + } + } + }, + fromPartial: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount', + value: MsgRegisterInterchainAccount.fromPartial(value) + } + }, + sendTx(value: MsgSendTx) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.ts new file mode 100644 index 0000000..8d54071 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/controller/v1/tx.ts @@ -0,0 +1,956 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Order } from '../../../../core/channel/v1/channel' +import { + InterchainAccountPacketData, + InterchainAccountPacketDataAmino, + InterchainAccountPacketDataSDKType +} from '../../v1/packet' +import { Params, ParamsAmino, ParamsSDKType } from './controller' +import { isSet } from '../../../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../../registry' +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccount { + owner: string + connectionId: string + version: string + ordering: Order +} +export interface MsgRegisterInterchainAccountProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount' + value: Uint8Array +} +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountAmino { + owner?: string + connection_id?: string + version?: string + ordering?: Order +} +export interface MsgRegisterInterchainAccountAminoMsg { + type: 'cosmos-sdk/MsgRegisterInterchainAccount' + value: MsgRegisterInterchainAccountAmino +} +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountSDKType { + owner: string + connection_id: string + version: string + ordering: Order +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponse { + channelId: string + portId: string +} +export interface MsgRegisterInterchainAccountResponseProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse' + value: Uint8Array +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponseAmino { + channel_id?: string + port_id?: string +} +export interface MsgRegisterInterchainAccountResponseAminoMsg { + type: 'cosmos-sdk/MsgRegisterInterchainAccountResponse' + value: MsgRegisterInterchainAccountResponseAmino +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponseSDKType { + channel_id: string + port_id: string +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTx { + owner: string + connectionId: string + packetData: InterchainAccountPacketData + /** + * Relative timeout timestamp provided will be added to the current block time during transaction execution. + * The timeout timestamp must be non-zero. + */ + relativeTimeout: bigint +} +export interface MsgSendTxProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.MsgSendTx' + value: Uint8Array +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTxAmino { + 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 +} +export interface MsgSendTxAminoMsg { + type: 'cosmos-sdk/MsgSendTx' + value: MsgSendTxAmino +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTxSDKType { + owner: string + connection_id: string + packet_data: InterchainAccountPacketDataSDKType + relative_timeout: bigint +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +export interface MsgSendTxResponse { + sequence: bigint +} +export interface MsgSendTxResponseProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse' + value: Uint8Array +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +export interface MsgSendTxResponseAmino { + sequence?: string +} +export interface MsgSendTxResponseAminoMsg { + type: 'cosmos-sdk/MsgSendTxResponse' + value: MsgSendTxResponseAmino +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +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: '', + connectionId: '', + version: '', + ordering: 0 + } +} +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' && + isSet(o.ordering))) + ) + }, + 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' && + isSet(o.ordering))) + ) + }, + 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' && + isSet(o.ordering))) + ) + }, + encode( + message: MsgRegisterInterchainAccount, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.owner !== '') { + writer.uint32(10).string(message.owner) + } + if (message.connectionId !== '') { + writer.uint32(18).string(message.connectionId) + } + if (message.version !== '') { + writer.uint32(26).string(message.version) + } + if (message.ordering !== 0) { + writer.uint32(32).int32(message.ordering) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRegisterInterchainAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterInterchainAccount() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.connectionId = reader.string() + break + case 3: + message.version = reader.string() + break + case 4: + message.ordering = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgRegisterInterchainAccount { + const message = createBaseMsgRegisterInterchainAccount() + message.owner = object.owner ?? '' + message.connectionId = object.connectionId ?? '' + message.version = object.version ?? '' + message.ordering = object.ordering ?? 0 + return message + }, + fromAmino( + object: MsgRegisterInterchainAccountAmino + ): MsgRegisterInterchainAccount { + 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 + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering + } + return message + }, + toAmino( + message: MsgRegisterInterchainAccount + ): MsgRegisterInterchainAccountAmino { + const obj: any = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.connection_id = + message.connectionId === '' ? undefined : message.connectionId + obj.version = message.version === '' ? undefined : message.version + obj.ordering = message.ordering === 0 ? undefined : message.ordering + return obj + }, + fromAminoMsg( + object: MsgRegisterInterchainAccountAminoMsg + ): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRegisterInterchainAccount + ): MsgRegisterInterchainAccountAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterInterchainAccount', + value: MsgRegisterInterchainAccount.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRegisterInterchainAccountProtoMsg + ): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.decode(message.value) + }, + toProto(message: MsgRegisterInterchainAccount): Uint8Array { + return MsgRegisterInterchainAccount.encode(message).finish() + }, + toProtoMsg( + message: MsgRegisterInterchainAccount + ): MsgRegisterInterchainAccountProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount', + value: MsgRegisterInterchainAccount.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRegisterInterchainAccount.typeUrl, + MsgRegisterInterchainAccount +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRegisterInterchainAccount.aminoType, + MsgRegisterInterchainAccount.typeUrl +) +function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchainAccountResponse { + return { + channelId: '', + portId: '' + } +} +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) + } + if (message.portId !== '') { + writer.uint32(18).string(message.portId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRegisterInterchainAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRegisterInterchainAccountResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.channelId = reader.string() + break + case 2: + message.portId = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgRegisterInterchainAccountResponse { + const message = createBaseMsgRegisterInterchainAccountResponse() + message.channelId = object.channelId ?? '' + message.portId = object.portId ?? '' + return message + }, + fromAmino( + object: MsgRegisterInterchainAccountResponseAmino + ): MsgRegisterInterchainAccountResponse { + 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 = {} + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.port_id = message.portId === '' ? undefined : message.portId + return obj + }, + fromAminoMsg( + object: MsgRegisterInterchainAccountResponseAminoMsg + ): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRegisterInterchainAccountResponse + ): MsgRegisterInterchainAccountResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRegisterInterchainAccountResponse', + value: MsgRegisterInterchainAccountResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRegisterInterchainAccountResponseProtoMsg + ): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.decode(message.value) + }, + toProto(message: MsgRegisterInterchainAccountResponse): Uint8Array { + return MsgRegisterInterchainAccountResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRegisterInterchainAccountResponse + ): MsgRegisterInterchainAccountResponseProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse', + value: MsgRegisterInterchainAccountResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRegisterInterchainAccountResponse.typeUrl, + MsgRegisterInterchainAccountResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRegisterInterchainAccountResponse.aminoType, + MsgRegisterInterchainAccountResponse.typeUrl +) +function createBaseMsgSendTx(): MsgSendTx { + return { + owner: '', + connectionId: '', + packetData: InterchainAccountPacketData.fromPartial({}), + relativeTimeout: BigInt(0) + } +} +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) + } + if (message.connectionId !== '') { + writer.uint32(18).string(message.connectionId) + } + if (message.packetData !== undefined) { + InterchainAccountPacketData.encode( + message.packetData, + writer.uint32(26).fork() + ).ldelim() + } + if (message.relativeTimeout !== BigInt(0)) { + writer.uint32(32).uint64(message.relativeTimeout) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSendTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.connectionId = reader.string() + break + case 3: + message.packetData = InterchainAccountPacketData.decode( + reader, + reader.uint32() + ) + break + case 4: + message.relativeTimeout = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSendTx { + const message = createBaseMsgSendTx() + message.owner = object.owner ?? '' + message.connectionId = object.connectionId ?? '' + message.packetData = + object.packetData !== undefined && object.packetData !== null + ? InterchainAccountPacketData.fromPartial(object.packetData) + : undefined + message.relativeTimeout = + object.relativeTimeout !== undefined && object.relativeTimeout !== null + ? BigInt(object.relativeTimeout.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgSendTxAmino): MsgSendTx { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.connection_id = + message.connectionId === '' ? undefined : message.connectionId + obj.packet_data = message.packetData + ? InterchainAccountPacketData.toAmino(message.packetData) + : undefined + obj.relative_timeout = + message.relativeTimeout !== BigInt(0) + ? message.relativeTimeout.toString() + : undefined + return obj + }, + fromAminoMsg(object: MsgSendTxAminoMsg): MsgSendTx { + return MsgSendTx.fromAmino(object.value) + }, + toAminoMsg(message: MsgSendTx): MsgSendTxAminoMsg { + return { + type: 'cosmos-sdk/MsgSendTx', + value: MsgSendTx.toAmino(message) + } + }, + fromProtoMsg(message: MsgSendTxProtoMsg): MsgSendTx { + return MsgSendTx.decode(message.value) + }, + toProto(message: MsgSendTx): Uint8Array { + return MsgSendTx.encode(message).finish() + }, + toProtoMsg(message: MsgSendTx): MsgSendTxProtoMsg { + return { + typeUrl: '/ibc.applications.interchain_accounts.controller.v1.MsgSendTx', + value: MsgSendTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgSendTx.typeUrl, MsgSendTx) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSendTx.aminoType, + MsgSendTx.typeUrl +) +function createBaseMsgSendTxResponse(): MsgSendTxResponse { + return { + sequence: BigInt(0) + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTxResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSendTxResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + const message = createBaseMsgSendTxResponse() + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence) + } + return message + }, + toAmino(message: MsgSendTxResponse): MsgSendTxResponseAmino { + const obj: any = {} + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: MsgSendTxResponseAminoMsg): MsgSendTxResponse { + return MsgSendTxResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgSendTxResponse): MsgSendTxResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSendTxResponse', + value: MsgSendTxResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgSendTxResponseProtoMsg): MsgSendTxResponse { + return MsgSendTxResponse.decode(message.value) + }, + toProto(message: MsgSendTxResponse): Uint8Array { + return MsgSendTxResponse.encode(message).finish() + }, + toProtoMsg(message: MsgSendTxResponse): MsgSendTxResponseProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse', + value: MsgSendTxResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/host.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/host.ts new file mode 100644 index 0000000..81df4e5 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/host.ts @@ -0,0 +1,329 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../../../../helpers' +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the host submodule. + */ +export interface Params { + /** host_enabled enables or disables the host submodule. */ + hostEnabled: boolean + /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ + allowMessages: string[] +} +export interface ParamsProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.Params' + value: Uint8Array +} +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the host submodule. + */ +export interface ParamsAmino { + /** host_enabled enables or disables the host submodule. */ + host_enabled?: boolean + /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ + allow_messages?: string[] +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/Params' + value: ParamsAmino +} +/** + * Params defines the set of on-chain interchain accounts parameters. + * The following parameters may be used to disable the host submodule. + */ +export interface ParamsSDKType { + host_enabled: boolean + allow_messages: string[] +} +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequest { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path: string + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + data: Uint8Array +} +export interface QueryRequestProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.QueryRequest' + value: Uint8Array +} +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequestAmino { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path?: string + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + data?: string +} +export interface QueryRequestAminoMsg { + type: 'cosmos-sdk/QueryRequest' + value: QueryRequestAmino +} +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequestSDKType { + path: string + data: Uint8Array +} +function createBaseParams(): Params { + return { + hostEnabled: false, + allowMessages: [] + } +} +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) + } + for (const v of message.allowMessages) { + writer.uint32(18).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.hostEnabled = reader.bool() + break + case 2: + message.allowMessages.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Params { + const message = createBaseParams() + message.hostEnabled = object.hostEnabled ?? false + message.allowMessages = object.allowMessages?.map((e) => e) || [] + return message + }, + fromAmino(object: ParamsAmino): Params { + 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 = {} + obj.host_enabled = + message.hostEnabled === false ? undefined : message.hostEnabled + if (message.allowMessages) { + obj.allow_messages = message.allowMessages.map((e) => e) + } else { + obj.allow_messages = message.allowMessages + } + 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.applications.interchain_accounts.host.v1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseQueryRequest(): QueryRequest { + return { + path: '', + data: new Uint8Array() + } +} +export const QueryRequest = { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.QueryRequest', + aminoType: 'cosmos-sdk/QueryRequest', + is(o: any): o is QueryRequest { + return ( + o && + (o.$typeUrl === QueryRequest.typeUrl || + (typeof o.path === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + isSDK(o: any): o is QueryRequestSDKType { + return ( + o && + (o.$typeUrl === QueryRequest.typeUrl || + (typeof o.path === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + isAmino(o: any): o is QueryRequestAmino { + return ( + o && + (o.$typeUrl === QueryRequest.typeUrl || + (typeof o.path === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + encode( + message: QueryRequest, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.path !== '') { + writer.uint32(10).string(message.path) + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRequest { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryRequest() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.path = reader.string() + break + case 2: + message.data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): QueryRequest { + const message = createBaseQueryRequest() + message.path = object.path ?? '' + message.data = object.data ?? new Uint8Array() + return message + }, + fromAmino(object: QueryRequestAmino): QueryRequest { + const message = createBaseQueryRequest() + if (object.path !== undefined && object.path !== null) { + message.path = object.path + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data) + } + return message + }, + toAmino(message: QueryRequest): QueryRequestAmino { + const obj: any = {} + obj.path = message.path === '' ? undefined : message.path + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg(object: QueryRequestAminoMsg): QueryRequest { + return QueryRequest.fromAmino(object.value) + }, + toAminoMsg(message: QueryRequest): QueryRequestAminoMsg { + return { + type: 'cosmos-sdk/QueryRequest', + value: QueryRequest.toAmino(message) + } + }, + fromProtoMsg(message: QueryRequestProtoMsg): QueryRequest { + return QueryRequest.decode(message.value) + }, + toProto(message: QueryRequest): Uint8Array { + return QueryRequest.encode(message).finish() + }, + toProtoMsg(message: QueryRequest): QueryRequestProtoMsg { + return { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.QueryRequest', + value: QueryRequest.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(QueryRequest.typeUrl, QueryRequest) +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryRequest.aminoType, + QueryRequest.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.amino.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.amino.ts new file mode 100644 index 0000000..628c5af --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.amino.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgUpdateParams, MsgModuleQuerySafe } from './tx' +export const AminoConverter = { + '/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams': { + aminoType: 'cosmos-sdk/MsgUpdateParams', + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe': { + aminoType: 'cosmos-sdk/MsgModuleQuerySafe', + toAmino: MsgModuleQuerySafe.toAmino, + fromAmino: MsgModuleQuerySafe.fromAmino + } +} diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.registry.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.registry.ts new file mode 100644 index 0000000..be4d28d --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.registry.ts @@ -0,0 +1,69 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgUpdateParams, MsgModuleQuerySafe } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams', + MsgUpdateParams + ], + [ + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + MsgModuleQuerySafe + ] +] +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() + } + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + value: MsgModuleQuerySafe.encode(value).finish() + } + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams', + value + } + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + value + } + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams', + value: MsgUpdateParams.fromPartial(value) + } + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + value: MsgModuleQuerySafe.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.ts new file mode 100644 index 0000000..38f4513 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/host/v1/tx.ts @@ -0,0 +1,604 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Params, + ParamsAmino, + ParamsSDKType, + QueryRequest, + QueryRequestAmino, + QueryRequestSDKType +} from './host' +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../../../../helpers' +/** 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 {} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafe { + /** signer address */ + signer: string + /** requests defines the module safe queries to execute. */ + requests: QueryRequest[] +} +export interface MsgModuleQuerySafeProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe' + value: Uint8Array +} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeAmino { + /** signer address */ + signer?: string + /** requests defines the module safe queries to execute. */ + requests?: QueryRequestAmino[] +} +export interface MsgModuleQuerySafeAminoMsg { + type: 'cosmos-sdk/MsgModuleQuerySafe' + value: MsgModuleQuerySafeAmino +} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeSDKType { + signer: string + requests: QueryRequestSDKType[] +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponse { + /** height at which the responses were queried */ + height: bigint + /** protobuf encoded responses for each query */ + responses: Uint8Array[] +} +export interface MsgModuleQuerySafeResponseProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse' + value: Uint8Array +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponseAmino { + /** height at which the responses were queried */ + height?: string + /** protobuf encoded responses for each query */ + responses?: string[] +} +export interface MsgModuleQuerySafeResponseAminoMsg { + type: 'cosmos-sdk/MsgModuleQuerySafeResponse' + value: MsgModuleQuerySafeResponseAmino +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponseSDKType { + height: bigint + responses: Uint8Array[] +} +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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) +function createBaseMsgModuleQuerySafe(): MsgModuleQuerySafe { + return { + signer: '', + requests: [] + } +} +export const MsgModuleQuerySafe = { + typeUrl: '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + aminoType: 'cosmos-sdk/MsgModuleQuerySafe', + is(o: any): o is MsgModuleQuerySafe { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafe.typeUrl || + (typeof o.signer === 'string' && + Array.isArray(o.requests) && + (!o.requests.length || QueryRequest.is(o.requests[0])))) + ) + }, + isSDK(o: any): o is MsgModuleQuerySafeSDKType { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafe.typeUrl || + (typeof o.signer === 'string' && + Array.isArray(o.requests) && + (!o.requests.length || QueryRequest.isSDK(o.requests[0])))) + ) + }, + isAmino(o: any): o is MsgModuleQuerySafeAmino { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafe.typeUrl || + (typeof o.signer === 'string' && + Array.isArray(o.requests) && + (!o.requests.length || QueryRequest.isAmino(o.requests[0])))) + ) + }, + encode( + message: MsgModuleQuerySafe, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.signer !== '') { + writer.uint32(10).string(message.signer) + } + for (const v of message.requests) { + QueryRequest.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgModuleQuerySafe { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgModuleQuerySafe() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.signer = reader.string() + break + case 2: + message.requests.push(QueryRequest.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgModuleQuerySafe { + const message = createBaseMsgModuleQuerySafe() + message.signer = object.signer ?? '' + message.requests = + object.requests?.map((e) => QueryRequest.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgModuleQuerySafeAmino): MsgModuleQuerySafe { + const message = createBaseMsgModuleQuerySafe() + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer + } + message.requests = + object.requests?.map((e) => QueryRequest.fromAmino(e)) || [] + return message + }, + toAmino(message: MsgModuleQuerySafe): MsgModuleQuerySafeAmino { + const obj: any = {} + obj.signer = message.signer === '' ? undefined : message.signer + if (message.requests) { + obj.requests = message.requests.map((e) => + e ? QueryRequest.toAmino(e) : undefined + ) + } else { + obj.requests = message.requests + } + return obj + }, + fromAminoMsg(object: MsgModuleQuerySafeAminoMsg): MsgModuleQuerySafe { + return MsgModuleQuerySafe.fromAmino(object.value) + }, + toAminoMsg(message: MsgModuleQuerySafe): MsgModuleQuerySafeAminoMsg { + return { + type: 'cosmos-sdk/MsgModuleQuerySafe', + value: MsgModuleQuerySafe.toAmino(message) + } + }, + fromProtoMsg(message: MsgModuleQuerySafeProtoMsg): MsgModuleQuerySafe { + return MsgModuleQuerySafe.decode(message.value) + }, + toProto(message: MsgModuleQuerySafe): Uint8Array { + return MsgModuleQuerySafe.encode(message).finish() + }, + toProtoMsg(message: MsgModuleQuerySafe): MsgModuleQuerySafeProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe', + value: MsgModuleQuerySafe.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgModuleQuerySafe.typeUrl, MsgModuleQuerySafe) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgModuleQuerySafe.aminoType, + MsgModuleQuerySafe.typeUrl +) +function createBaseMsgModuleQuerySafeResponse(): MsgModuleQuerySafeResponse { + return { + height: BigInt(0), + responses: [] + } +} +export const MsgModuleQuerySafeResponse = { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse', + aminoType: 'cosmos-sdk/MsgModuleQuerySafeResponse', + is(o: any): o is MsgModuleQuerySafeResponse { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafeResponse.typeUrl || + (typeof o.height === 'bigint' && + Array.isArray(o.responses) && + (!o.responses.length || + o.responses[0] instanceof Uint8Array || + typeof o.responses[0] === 'string'))) + ) + }, + isSDK(o: any): o is MsgModuleQuerySafeResponseSDKType { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafeResponse.typeUrl || + (typeof o.height === 'bigint' && + Array.isArray(o.responses) && + (!o.responses.length || + o.responses[0] instanceof Uint8Array || + typeof o.responses[0] === 'string'))) + ) + }, + isAmino(o: any): o is MsgModuleQuerySafeResponseAmino { + return ( + o && + (o.$typeUrl === MsgModuleQuerySafeResponse.typeUrl || + (typeof o.height === 'bigint' && + Array.isArray(o.responses) && + (!o.responses.length || + o.responses[0] instanceof Uint8Array || + typeof o.responses[0] === 'string'))) + ) + }, + encode( + message: MsgModuleQuerySafeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height) + } + for (const v of message.responses) { + writer.uint32(18).bytes(v!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgModuleQuerySafeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgModuleQuerySafeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() + break + case 2: + message.responses.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgModuleQuerySafeResponse { + const message = createBaseMsgModuleQuerySafeResponse() + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.responses = object.responses?.map((e) => e) || [] + return message + }, + fromAmino( + object: MsgModuleQuerySafeResponseAmino + ): MsgModuleQuerySafeResponse { + const message = createBaseMsgModuleQuerySafeResponse() + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height) + } + message.responses = object.responses?.map((e) => bytesFromBase64(e)) || [] + return message + }, + toAmino( + message: MsgModuleQuerySafeResponse + ): MsgModuleQuerySafeResponseAmino { + const obj: any = {} + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + if (message.responses) { + obj.responses = message.responses.map((e) => base64FromBytes(e)) + } else { + obj.responses = message.responses + } + return obj + }, + fromAminoMsg( + object: MsgModuleQuerySafeResponseAminoMsg + ): MsgModuleQuerySafeResponse { + return MsgModuleQuerySafeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgModuleQuerySafeResponse + ): MsgModuleQuerySafeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgModuleQuerySafeResponse', + value: MsgModuleQuerySafeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgModuleQuerySafeResponseProtoMsg + ): MsgModuleQuerySafeResponse { + return MsgModuleQuerySafeResponse.decode(message.value) + }, + toProto(message: MsgModuleQuerySafeResponse): Uint8Array { + return MsgModuleQuerySafeResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgModuleQuerySafeResponse + ): MsgModuleQuerySafeResponseProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse', + value: MsgModuleQuerySafeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgModuleQuerySafeResponse.typeUrl, + MsgModuleQuerySafeResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgModuleQuerySafeResponse.aminoType, + MsgModuleQuerySafeResponse.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/interchain_accounts/v1/packet.ts b/src/proto/osmojs/ibc/applications/interchain_accounts/v1/packet.ts new file mode 100644 index 0000000..c9fda82 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/interchain_accounts/v1/packet.ts @@ -0,0 +1,351 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { isSet, bytesFromBase64, base64FromBytes } from '../../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +/** + * Type defines a classification of message issued from a controller chain to its associated interchain accounts + * host + */ +export enum Type { + /** TYPE_UNSPECIFIED - Default zero value enumeration */ + TYPE_UNSPECIFIED = 0, + /** TYPE_EXECUTE_TX - Execute a transaction on an interchain accounts host chain */ + TYPE_EXECUTE_TX = 1, + UNRECOGNIZED = -1 +} +export const TypeSDKType = Type +export const TypeAmino = Type +export function typeFromJSON(object: any): Type { + switch (object) { + case 0: + case 'TYPE_UNSPECIFIED': + return Type.TYPE_UNSPECIFIED + case 1: + case 'TYPE_EXECUTE_TX': + return Type.TYPE_EXECUTE_TX + case -1: + case 'UNRECOGNIZED': + default: + return Type.UNRECOGNIZED + } +} +export function typeToJSON(object: Type): string { + switch (object) { + case Type.TYPE_UNSPECIFIED: + return 'TYPE_UNSPECIFIED' + case Type.TYPE_EXECUTE_TX: + return 'TYPE_EXECUTE_TX' + case Type.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. */ +export interface InterchainAccountPacketData { + type: Type + data: Uint8Array + memo: string +} +export interface InterchainAccountPacketDataProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.v1.InterchainAccountPacketData' + value: Uint8Array +} +/** InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. */ +export interface InterchainAccountPacketDataAmino { + type?: Type + data?: string + memo?: string +} +export interface InterchainAccountPacketDataAminoMsg { + type: 'cosmos-sdk/InterchainAccountPacketData' + value: InterchainAccountPacketDataAmino +} +/** InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. */ +export interface InterchainAccountPacketDataSDKType { + type: Type + data: Uint8Array + memo: string +} +/** CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. */ +export interface CosmosTx { + messages: Any[] +} +export interface CosmosTxProtoMsg { + typeUrl: '/ibc.applications.interchain_accounts.v1.CosmosTx' + value: Uint8Array +} +/** 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[] +} +export interface CosmosTxAminoMsg { + type: 'cosmos-sdk/CosmosTx' + value: CosmosTxAmino +} +/** CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. */ +export interface CosmosTxSDKType { + messages: AnySDKType[] +} +function createBaseInterchainAccountPacketData(): InterchainAccountPacketData { + return { + type: 0, + data: new Uint8Array(), + memo: '' + } +} +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) + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data) + } + if (message.memo !== '') { + writer.uint32(26).string(message.memo) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): InterchainAccountPacketData { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInterchainAccountPacketData() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any + break + case 2: + message.data = reader.bytes() + break + case 3: + message.memo = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): InterchainAccountPacketData { + const message = createBaseInterchainAccountPacketData() + message.type = object.type ?? 0 + message.data = object.data ?? new Uint8Array() + message.memo = object.memo ?? '' + return message + }, + fromAmino( + object: InterchainAccountPacketDataAmino + ): InterchainAccountPacketData { + const message = createBaseInterchainAccountPacketData() + if (object.type !== undefined && object.type !== null) { + message.type = 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 === 0 ? undefined : message.type + obj.data = message.data ? base64FromBytes(message.data) : undefined + obj.memo = message.memo === '' ? undefined : message.memo + return obj + }, + fromAminoMsg( + object: InterchainAccountPacketDataAminoMsg + ): InterchainAccountPacketData { + return InterchainAccountPacketData.fromAmino(object.value) + }, + toAminoMsg( + message: InterchainAccountPacketData + ): InterchainAccountPacketDataAminoMsg { + return { + type: 'cosmos-sdk/InterchainAccountPacketData', + value: InterchainAccountPacketData.toAmino(message) + } + }, + fromProtoMsg( + message: InterchainAccountPacketDataProtoMsg + ): InterchainAccountPacketData { + return InterchainAccountPacketData.decode(message.value) + }, + toProto(message: InterchainAccountPacketData): Uint8Array { + return InterchainAccountPacketData.encode(message).finish() + }, + toProtoMsg( + message: InterchainAccountPacketData + ): InterchainAccountPacketDataProtoMsg { + return { + typeUrl: + '/ibc.applications.interchain_accounts.v1.InterchainAccountPacketData', + value: InterchainAccountPacketData.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + InterchainAccountPacketData.typeUrl, + InterchainAccountPacketData +) +GlobalDecoderRegistry.registerAminoProtoMapping( + InterchainAccountPacketData.aminoType, + InterchainAccountPacketData.typeUrl +) +function createBaseCosmosTx(): CosmosTx { + return { + messages: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CosmosTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCosmosTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CosmosTx { + const message = createBaseCosmosTx() + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [] + return message + }, + fromAmino(object: CosmosTxAmino): CosmosTx { + const message = createBaseCosmosTx() + message.messages = object.messages?.map((e) => Any.fromAmino(e)) || [] + return message + }, + toAmino(message: CosmosTx): CosmosTxAmino { + const obj: any = {} + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? Any.toAmino(e) : undefined + ) + } else { + obj.messages = message.messages + } + return obj + }, + fromAminoMsg(object: CosmosTxAminoMsg): CosmosTx { + return CosmosTx.fromAmino(object.value) + }, + toAminoMsg(message: CosmosTx): CosmosTxAminoMsg { + return { + type: 'cosmos-sdk/CosmosTx', + value: CosmosTx.toAmino(message) + } + }, + fromProtoMsg(message: CosmosTxProtoMsg): CosmosTx { + return CosmosTx.decode(message.value) + }, + toProto(message: CosmosTx): Uint8Array { + return CosmosTx.encode(message).finish() + }, + toProtoMsg(message: CosmosTx): CosmosTxProtoMsg { + return { + typeUrl: '/ibc.applications.interchain_accounts.v1.CosmosTx', + value: CosmosTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CosmosTx.typeUrl, CosmosTx) +GlobalDecoderRegistry.registerAminoProtoMapping( + CosmosTx.aminoType, + CosmosTx.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/transfer/v1/authz.ts b/src/proto/osmojs/ibc/applications/transfer/v1/authz.ts new file mode 100644 index 0000000..bda2ec8 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/transfer/v1/authz.ts @@ -0,0 +1,390 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType +} from '../../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +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 */ + sourcePort: string + /** the channel by which the packet will be sent */ + sourceChannel: string + /** spend limitation on the channel */ + 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' + value: Uint8Array +} +/** 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 + /** the channel by which the packet will be sent */ + source_channel?: string + /** spend limitation on the channel */ + spend_limit?: CoinAmino[] + /** allow list of receivers, an empty allow list permits any receiver address */ + 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' + value: AllocationAmino +} +/** Allocation defines the spend limit for a particular port and channel */ +export interface AllocationSDKType { + source_port: string + 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?: '/ibc.applications.transfer.v1.TransferAuthorization' + /** port and channel amounts */ + allocations: Allocation[] +} +export interface TransferAuthorizationProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.TransferAuthorization' + value: Uint8Array +} +/** + * 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 TransferAuthorizationAmino { + /** port and channel amounts */ + allocations?: AllocationAmino[] +} +export interface TransferAuthorizationAminoMsg { + type: 'cosmos-sdk/TransferAuthorization' + value: TransferAuthorizationAmino +} +/** + * 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 TransferAuthorizationSDKType { + $typeUrl?: '/ibc.applications.transfer.v1.TransferAuthorization' + allocations: AllocationSDKType[] +} +function createBaseAllocation(): Allocation { + return { + sourcePort: '', + sourceChannel: '', + spendLimit: [], + 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) + } + if (message.sourceChannel !== '') { + writer.uint32(18).string(message.sourceChannel) + } + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAllocation() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string() + break + case 2: + message.sourceChannel = reader.string() + break + case 3: + message.spendLimit.push(Coin.decode(reader, reader.uint32())) + break + case 4: + message.allowList.push(reader.string()) + break + case 5: + message.allowedPacketData.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + obj.source_port = message.sourcePort === '' ? undefined : message.sourcePort + obj.source_channel = + message.sourceChannel === '' ? undefined : message.sourceChannel + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.spend_limit = message.spendLimit + } + if (message.allowList) { + obj.allow_list = message.allowList.map((e) => e) + } else { + obj.allow_list = message.allowList + } + if (message.allowedPacketData) { + obj.allowed_packet_data = message.allowedPacketData.map((e) => e) + } else { + obj.allowed_packet_data = message.allowedPacketData + } + return obj + }, + fromAminoMsg(object: AllocationAminoMsg): Allocation { + return Allocation.fromAmino(object.value) + }, + toAminoMsg(message: Allocation): AllocationAminoMsg { + return { + type: 'cosmos-sdk/Allocation', + value: Allocation.toAmino(message) + } + }, + fromProtoMsg(message: AllocationProtoMsg): Allocation { + return Allocation.decode(message.value) + }, + toProto(message: Allocation): Uint8Array { + return Allocation.encode(message).finish() + }, + toProtoMsg(message: Allocation): AllocationProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.Allocation', + value: Allocation.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Allocation.typeUrl, Allocation) +GlobalDecoderRegistry.registerAminoProtoMapping( + Allocation.aminoType, + Allocation.typeUrl +) +function createBaseTransferAuthorization(): TransferAuthorization { + return { + $typeUrl: '/ibc.applications.transfer.v1.TransferAuthorization', + allocations: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TransferAuthorization { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTransferAuthorization() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.allocations.push(Allocation.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TransferAuthorization { + const message = createBaseTransferAuthorization() + message.allocations = + object.allocations?.map((e) => Allocation.fromPartial(e)) || [] + return message + }, + fromAmino(object: TransferAuthorizationAmino): TransferAuthorization { + const message = createBaseTransferAuthorization() + message.allocations = + object.allocations?.map((e) => Allocation.fromAmino(e)) || [] + return message + }, + toAmino(message: TransferAuthorization): TransferAuthorizationAmino { + const obj: any = {} + if (message.allocations) { + obj.allocations = message.allocations.map((e) => + e ? Allocation.toAmino(e) : undefined + ) + } else { + obj.allocations = message.allocations + } + return obj + }, + fromAminoMsg(object: TransferAuthorizationAminoMsg): TransferAuthorization { + return TransferAuthorization.fromAmino(object.value) + }, + toAminoMsg(message: TransferAuthorization): TransferAuthorizationAminoMsg { + return { + type: 'cosmos-sdk/TransferAuthorization', + value: TransferAuthorization.toAmino(message) + } + }, + fromProtoMsg(message: TransferAuthorizationProtoMsg): TransferAuthorization { + return TransferAuthorization.decode(message.value) + }, + toProto(message: TransferAuthorization): Uint8Array { + return TransferAuthorization.encode(message).finish() + }, + toProtoMsg(message: TransferAuthorization): TransferAuthorizationProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.TransferAuthorization', + value: TransferAuthorization.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + TransferAuthorization.typeUrl, + TransferAuthorization +) +GlobalDecoderRegistry.registerAminoProtoMapping( + TransferAuthorization.aminoType, + TransferAuthorization.typeUrl +) diff --git a/src/proto/osmojs/ibc/applications/transfer/v1/tx.amino.ts b/src/proto/osmojs/ibc/applications/transfer/v1/tx.amino.ts new file mode 100644 index 0000000..80f1cd6 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/transfer/v1/tx.amino.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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 + } +} diff --git a/src/proto/osmojs/ibc/applications/transfer/v1/tx.registry.ts b/src/proto/osmojs/ibc/applications/transfer/v1/tx.registry.ts new file mode 100644 index 0000000..a2227e3 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/transfer/v1/tx.registry.ts @@ -0,0 +1,57 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + transfer(value: MsgTransfer) { + return { + 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: { + transfer(value: MsgTransfer) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value + } + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value + } + } + }, + fromPartial: { + transfer(value: MsgTransfer) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.fromPartial(value) + } + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgUpdateParams', + value: MsgUpdateParams.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/ibc/applications/transfer/v1/tx.ts b/src/proto/osmojs/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 0000000..6a73055 --- /dev/null +++ b/src/proto/osmojs/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,716 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType +} from '../../../../cosmos/base/v1beta1/coin' +import { + Height, + HeightAmino, + HeightSDKType, + Params, + ParamsAmino, + ParamsSDKType +} from '../../../core/client/v1/client' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string + /** the channel by which the packet will be sent */ + sourceChannel: string + /** the tokens to be transferred */ + token: Coin + /** the sender address */ + sender: string + /** the recipient address on the destination chain */ + receiver: string + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Height + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: bigint + /** optional memo */ + memo: string +} +export interface MsgTransferProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer' + value: Uint8Array +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferAmino { + /** the port on which the packet will be sent */ + source_port?: string + /** the channel by which the packet will be sent */ + source_channel?: string + /** the tokens to be transferred */ + token: CoinAmino + /** the sender address */ + sender?: string + /** the recipient address on the destination chain */ + receiver?: string + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeout_height: HeightAmino + /** + * Timeout timestamp in absolute nanoseconds since unix epoch. + * The timeout is disabled when set to 0. + */ + timeout_timestamp?: string + /** optional memo */ + memo?: string +} +export interface MsgTransferAminoMsg { + type: 'cosmos-sdk/MsgTransfer' + value: MsgTransferAmino +} +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransferSDKType { + source_port: string + source_channel: string + token: CoinSDKType + sender: string + receiver: string + timeout_height: HeightSDKType + timeout_timestamp: bigint + memo: string +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse { + /** sequence number of the transfer packet sent */ + sequence: bigint +} +export interface MsgTransferResponseProtoMsg { + typeUrl: '/ibc.applications.transfer.v1.MsgTransferResponse' + value: Uint8Array +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponseAmino { + /** sequence number of the transfer packet sent */ + sequence?: string +} +export interface MsgTransferResponseAminoMsg { + type: 'cosmos-sdk/MsgTransferResponse' + value: MsgTransferResponseAmino +} +/** MsgTransferResponse defines the Msg/Transfer response type. */ +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: Coin.fromPartial({}), + sender: '', + receiver: '', + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0), + memo: '' + } +} +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) + } + if (message.sourceChannel !== '') { + writer.uint32(18).string(message.sourceChannel) + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim() + } + if (message.sender !== '') { + writer.uint32(34).string(message.sender) + } + if (message.receiver !== '') { + writer.uint32(42).string(message.receiver) + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim() + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(56).uint64(message.timeoutTimestamp) + } + if (message.memo !== '') { + writer.uint32(66).string(message.memo) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTransfer() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string() + break + case 2: + message.sourceChannel = reader.string() + break + case 3: + message.token = Coin.decode(reader, reader.uint32()) + break + case 4: + message.sender = reader.string() + break + case 5: + message.receiver = reader.string() + break + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()) + break + case 7: + message.timeoutTimestamp = reader.uint64() + break + case 8: + message.memo = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgTransfer { + const message = createBaseMsgTransfer() + message.sourcePort = object.sourcePort ?? '' + message.sourceChannel = object.sourceChannel ?? '' + message.token = + object.token !== undefined && object.token !== null + ? Coin.fromPartial(object.token) + : undefined + message.sender = object.sender ?? '' + message.receiver = object.receiver ?? '' + message.timeoutHeight = + object.timeoutHeight !== undefined && object.timeoutHeight !== null + ? Height.fromPartial(object.timeoutHeight) + : undefined + message.timeoutTimestamp = + object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null + ? BigInt(object.timeoutTimestamp.toString()) + : BigInt(0) + message.memo = object.memo ?? '' + return message + }, + fromAmino(object: MsgTransferAmino): MsgTransfer { + 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 === '' ? undefined : message.sourcePort + obj.source_channel = + message.sourceChannel === '' ? undefined : message.sourceChannel + obj.token = message.token + ? Coin.toAmino(message.token) + : Coin.toAmino(Coin.fromPartial({})) + obj.sender = message.sender === '' ? undefined : message.sender + obj.receiver = message.receiver === '' ? undefined : message.receiver + obj.timeout_height = message.timeoutHeight + ? Height.toAmino(message.timeoutHeight) + : {} + obj.timeout_timestamp = + message.timeoutTimestamp !== BigInt(0) + ? message.timeoutTimestamp.toString() + : undefined + obj.memo = message.memo === '' ? undefined : message.memo + return obj + }, + fromAminoMsg(object: MsgTransferAminoMsg): MsgTransfer { + return MsgTransfer.fromAmino(object.value) + }, + toAminoMsg(message: MsgTransfer): MsgTransferAminoMsg { + return { + type: 'cosmos-sdk/MsgTransfer', + value: MsgTransfer.toAmino(message) + } + }, + fromProtoMsg(message: MsgTransferProtoMsg): MsgTransfer { + return MsgTransfer.decode(message.value) + }, + toProto(message: MsgTransfer): Uint8Array { + return MsgTransfer.encode(message).finish() + }, + toProtoMsg(message: MsgTransfer): MsgTransferProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransfer', + value: MsgTransfer.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgTransfer.typeUrl, MsgTransfer) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTransfer.aminoType, + MsgTransfer.typeUrl +) +function createBaseMsgTransferResponse(): MsgTransferResponse { + return { + sequence: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTransferResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTransferResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + const message = createBaseMsgTransferResponse() + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence) + } + return message + }, + toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { + const obj: any = {} + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { + return MsgTransferResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgTransferResponse): MsgTransferResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgTransferResponse', + value: MsgTransferResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgTransferResponseProtoMsg): MsgTransferResponse { + return MsgTransferResponse.decode(message.value) + }, + toProto(message: MsgTransferResponse): Uint8Array { + return MsgTransferResponse.encode(message).finish() + }, + toProtoMsg(message: MsgTransferResponse): MsgTransferResponseProtoMsg { + return { + typeUrl: '/ibc.applications.transfer.v1.MsgTransferResponse', + value: MsgTransferResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/ibc/client.ts b/src/proto/osmojs/ibc/client.ts new file mode 100644 index 0000000..cee1239 --- /dev/null +++ b/src/proto/osmojs/ibc/client.ts @@ -0,0 +1,84 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing' +import { + defaultRegistryTypes, + AminoTypes, + SigningStargateClient +} from '@cosmjs/stargate' +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, + ...ibcLightclientsWasmV1TxAmino.AminoConverter +} +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 +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +} = {}): { + registry: Registry + aminoTypes: AminoTypes +} => { + const registry = new Registry([...defaultTypes, ...ibcProtoRegistry]) + const aminoTypes = new AminoTypes({ + ...ibcAminoConverters + }) + return { + registry, + aminoTypes + } +} +export const getSigningIbcClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint + signer: OfflineSigner + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +}) => { + const { registry, aminoTypes } = getSigningIbcClientOptions({ + defaultTypes + }) + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes + } + ) + return client +} diff --git a/src/proto/osmojs/ibc/core/channel/v1/channel.ts b/src/proto/osmojs/ibc/core/channel/v1/channel.ts new file mode 100644 index 0000000..68562dc --- /dev/null +++ b/src/proto/osmojs/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1953 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Height, HeightAmino, HeightSDKType } from '../../client/v1/client' +import { isSet, bytesFromBase64, base64FromBytes } from '../../../../../helpers' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * 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 +export const StateAmino = State +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case 'STATE_UNINITIALIZED_UNSPECIFIED': + return State.STATE_UNINITIALIZED_UNSPECIFIED + case 1: + case 'STATE_INIT': + return State.STATE_INIT + case 2: + case 'STATE_TRYOPEN': + return State.STATE_TRYOPEN + case 3: + case 'STATE_OPEN': + return State.STATE_OPEN + 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: + return State.UNRECOGNIZED + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return 'STATE_UNINITIALIZED_UNSPECIFIED' + case State.STATE_INIT: + return 'STATE_INIT' + case State.STATE_TRYOPEN: + return 'STATE_TRYOPEN' + case State.STATE_OPEN: + 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' + } +} +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1 +} +export const OrderSDKType = Order +export const OrderAmino = Order +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case 'ORDER_NONE_UNSPECIFIED': + return Order.ORDER_NONE_UNSPECIFIED + case 1: + case 'ORDER_UNORDERED': + return Order.ORDER_UNORDERED + case 2: + case 'ORDER_ORDERED': + return Order.ORDER_ORDERED + case -1: + case 'UNRECOGNIZED': + default: + return Order.UNRECOGNIZED + } +} +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return 'ORDER_NONE_UNSPECIFIED' + case Order.ORDER_UNORDERED: + return 'ORDER_UNORDERED' + case Order.ORDER_ORDERED: + return 'ORDER_ORDERED' + case Order.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State + /** whether the channel is ordered or unordered */ + ordering: Order + /** counterparty channel end */ + counterparty: Counterparty + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + 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' + value: Uint8Array +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelAmino { + /** current state of the channel end */ + state?: State + /** whether the channel is ordered or unordered */ + 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[] + /** 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 + */ + upgrade_sequence?: string +} +export interface ChannelAminoMsg { + type: 'cosmos-sdk/Channel' + value: ChannelAmino +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelSDKType { + state: State + ordering: Order + counterparty: CounterpartySDKType + connection_hops: string[] + version: string + upgrade_sequence: bigint +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State + /** whether the channel is ordered or unordered */ + ordering: Order + /** counterparty channel end */ + counterparty: Counterparty + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[] + /** opaque channel version, which is agreed upon during the handshake */ + version: string + /** port identifier */ + 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' + value: Uint8Array +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelAmino { + /** current state of the channel end */ + state?: State + /** whether the channel is ordered or unordered */ + 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[] + /** opaque channel version, which is agreed upon during the handshake */ + version?: string + /** port identifier */ + port_id?: string + /** channel identifier */ + 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' + value: IdentifiedChannelAmino +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelSDKType { + state: State + ordering: Order + counterparty: CounterpartySDKType + connection_hops: string[] + version: string + port_id: string + channel_id: string + upgrade_sequence: bigint +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string + /** channel end on the counterparty chain */ + channelId: string +} +export interface CounterpartyProtoMsg { + typeUrl: '/ibc.core.channel.v1.Counterparty' + value: Uint8Array +} +/** 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 + /** channel end on the counterparty chain */ + channel_id?: string +} +export interface CounterpartyAminoMsg { + type: 'cosmos-sdk/Counterparty' + value: CounterpartyAmino +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartySDKType { + port_id: string + channel_id: string +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: bigint + /** identifies the port on the sending chain. */ + sourcePort: string + /** identifies the channel end on the sending chain. */ + sourceChannel: string + /** identifies the port on the receiving chain. */ + destinationPort: string + /** identifies the channel end on the receiving chain. */ + destinationChannel: string + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array + /** block height after which the packet times out */ + timeoutHeight: Height + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: bigint +} +export interface PacketProtoMsg { + typeUrl: '/ibc.core.channel.v1.Packet' + value: Uint8Array +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketAmino { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence?: string + /** identifies the port on the sending chain. */ + source_port?: string + /** identifies the channel end on the sending chain. */ + source_channel?: string + /** identifies the port on the receiving chain. */ + destination_port?: string + /** identifies the channel end on the receiving chain. */ + destination_channel?: string + /** actual opaque bytes transferred directly to the application module */ + 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 +} +export interface PacketAminoMsg { + type: 'cosmos-sdk/Packet' + value: PacketAmino +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketSDKType { + sequence: bigint + source_port: string + source_channel: string + destination_port: string + destination_channel: string + data: Uint8Array + timeout_height: HeightSDKType + timeout_timestamp: bigint +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string + /** channel unique identifier. */ + channelId: string + /** packet sequence. */ + sequence: bigint + /** embedded data that represents packet state. */ + data: Uint8Array +} +export interface PacketStateProtoMsg { + typeUrl: '/ibc.core.channel.v1.PacketState' + value: Uint8Array +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateAmino { + /** channel port identifier. */ + port_id?: string + /** channel unique identifier. */ + channel_id?: string + /** packet sequence. */ + sequence?: string + /** embedded data that represents packet state. */ + data?: string +} +export interface PacketStateAminoMsg { + type: 'cosmos-sdk/PacketState' + value: PacketStateAmino +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateSDKType { + port_id: string + channel_id: string + sequence: bigint + data: Uint8Array +} +/** + * 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 PacketId { + /** channel port identifier */ + portId: string + /** channel unique identifier */ + channelId: string + /** packet sequence */ + sequence: bigint +} +export interface PacketIdProtoMsg { + typeUrl: '/ibc.core.channel.v1.PacketId' + value: Uint8Array +} +/** + * 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 + /** channel unique identifier */ + channel_id?: string + /** packet sequence */ + sequence?: string +} +export interface PacketIdAminoMsg { + type: 'cosmos-sdk/PacketId' + value: PacketIdAmino +} +/** + * 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 PacketIdSDKType { + port_id: string + channel_id: string + sequence: bigint +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result?: Uint8Array + error?: string +} +export interface AcknowledgementProtoMsg { + typeUrl: '/ibc.core.channel.v1.Acknowledgement' + value: Uint8Array +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementAmino { + result?: string + error?: string +} +export interface AcknowledgementAminoMsg { + type: 'cosmos-sdk/Acknowledgement' + value: AcknowledgementAmino +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +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: '', + 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) + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering) + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseChannel() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any + break + case 2: + message.ordering = reader.int32() as any + break + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 4: + message.connectionHops.push(reader.string()) + break + case 5: + message.version = reader.string() + break + case 6: + message.upgradeSequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Channel { + const message = createBaseChannel() + message.state = object.state ?? 0 + message.ordering = object.ordering ?? 0 + 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 { + const message = createBaseChannel() + if (object.state !== undefined && object.state !== null) { + message.state = object.state + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = 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 === 0 ? undefined : message.state + obj.ordering = message.ordering === 0 ? undefined : message.ordering + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map((e) => e) + } else { + obj.connection_hops = message.connectionHops + } + obj.version = message.version === '' ? undefined : message.version + obj.upgrade_sequence = + message.upgradeSequence !== BigInt(0) + ? message.upgradeSequence.toString() + : undefined + return obj + }, + fromAminoMsg(object: ChannelAminoMsg): Channel { + return Channel.fromAmino(object.value) + }, + toAminoMsg(message: Channel): ChannelAminoMsg { + return { + type: 'cosmos-sdk/Channel', + value: Channel.toAmino(message) + } + }, + fromProtoMsg(message: ChannelProtoMsg): Channel { + return Channel.decode(message.value) + }, + toProto(message: Channel): Uint8Array { + return Channel.encode(message).finish() + }, + toProtoMsg(message: Channel): ChannelProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.Channel', + value: Channel.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Channel.typeUrl, Channel) +GlobalDecoderRegistry.registerAminoProtoMapping( + Channel.aminoType, + Channel.typeUrl +) +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: '', + portId: '', + 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) + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering) + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!) + } + if (message.version !== '') { + writer.uint32(42).string(message.version) + } + if (message.portId !== '') { + writer.uint32(50).string(message.portId) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIdentifiedChannel() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any + break + case 2: + message.ordering = reader.int32() as any + break + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 4: + message.connectionHops.push(reader.string()) + break + case 5: + message.version = reader.string() + break + case 6: + message.portId = reader.string() + break + case 7: + message.channelId = reader.string() + break + case 8: + message.upgradeSequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): IdentifiedChannel { + const message = createBaseIdentifiedChannel() + message.state = object.state ?? 0 + message.ordering = object.ordering ?? 0 + 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.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 { + const message = createBaseIdentifiedChannel() + if (object.state !== undefined && object.state !== null) { + message.state = object.state + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = 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 === 0 ? undefined : message.state + obj.ordering = message.ordering === 0 ? undefined : message.ordering + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map((e) => e) + } else { + obj.connection_hops = message.connectionHops + } + obj.version = message.version === '' ? undefined : message.version + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.upgrade_sequence = + message.upgradeSequence !== BigInt(0) + ? message.upgradeSequence.toString() + : undefined + return obj + }, + fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { + return IdentifiedChannel.fromAmino(object.value) + }, + toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { + return { + type: 'cosmos-sdk/IdentifiedChannel', + value: IdentifiedChannel.toAmino(message) + } + }, + fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { + return IdentifiedChannel.decode(message.value) + }, + toProto(message: IdentifiedChannel): Uint8Array { + return IdentifiedChannel.encode(message).finish() + }, + toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.IdentifiedChannel', + value: IdentifiedChannel.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(IdentifiedChannel.typeUrl, IdentifiedChannel) +GlobalDecoderRegistry.registerAminoProtoMapping( + IdentifiedChannel.aminoType, + IdentifiedChannel.typeUrl +) +function createBaseCounterparty(): Counterparty { + return { + portId: '', + channelId: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCounterparty() + 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): Counterparty { + const message = createBaseCounterparty() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + return message + }, + fromAmino(object: CounterpartyAmino): Counterparty { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + return obj + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value) + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: 'cosmos-sdk/Counterparty', + value: Counterparty.toAmino(message) + } + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value) + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish() + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.Counterparty', + value: Counterparty.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty) +GlobalDecoderRegistry.registerAminoProtoMapping( + Counterparty.aminoType, + Counterparty.typeUrl +) +function createBasePacket(): Packet { + return { + sequence: BigInt(0), + sourcePort: '', + sourceChannel: '', + destinationPort: '', + destinationChannel: '', + data: new Uint8Array(), + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + } +} +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) + } + if (message.sourcePort !== '') { + writer.uint32(18).string(message.sourcePort) + } + if (message.sourceChannel !== '') { + writer.uint32(26).string(message.sourceChannel) + } + if (message.destinationPort !== '') { + writer.uint32(34).string(message.destinationPort) + } + if (message.destinationChannel !== '') { + writer.uint32(42).string(message.destinationChannel) + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data) + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim() + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(64).uint64(message.timeoutTimestamp) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePacket() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() + break + case 2: + message.sourcePort = reader.string() + break + case 3: + message.sourceChannel = reader.string() + break + case 4: + message.destinationPort = reader.string() + break + case 5: + message.destinationChannel = reader.string() + break + case 6: + message.data = reader.bytes() + break + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()) + break + case 8: + message.timeoutTimestamp = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Packet { + const message = createBasePacket() + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + message.sourcePort = object.sourcePort ?? '' + message.sourceChannel = object.sourceChannel ?? '' + message.destinationPort = object.destinationPort ?? '' + message.destinationChannel = object.destinationChannel ?? '' + message.data = object.data ?? new Uint8Array() + message.timeoutHeight = + object.timeoutHeight !== undefined && object.timeoutHeight !== null + ? Height.fromPartial(object.timeoutHeight) + : undefined + message.timeoutTimestamp = + object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null + ? BigInt(object.timeoutTimestamp.toString()) + : BigInt(0) + return message + }, + fromAmino(object: PacketAmino): Packet { + 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 = {} + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + obj.source_port = message.sourcePort === '' ? undefined : message.sourcePort + obj.source_channel = + message.sourceChannel === '' ? undefined : message.sourceChannel + obj.destination_port = + message.destinationPort === '' ? undefined : message.destinationPort + obj.destination_channel = + message.destinationChannel === '' ? undefined : message.destinationChannel + obj.data = message.data ? base64FromBytes(message.data) : undefined + obj.timeout_height = message.timeoutHeight + ? Height.toAmino(message.timeoutHeight) + : {} + obj.timeout_timestamp = + message.timeoutTimestamp !== BigInt(0) + ? message.timeoutTimestamp.toString() + : undefined + return obj + }, + fromAminoMsg(object: PacketAminoMsg): Packet { + return Packet.fromAmino(object.value) + }, + toAminoMsg(message: Packet): PacketAminoMsg { + return { + type: 'cosmos-sdk/Packet', + value: Packet.toAmino(message) + } + }, + fromProtoMsg(message: PacketProtoMsg): Packet { + return Packet.decode(message.value) + }, + toProto(message: Packet): Uint8Array { + return Packet.encode(message).finish() + }, + toProtoMsg(message: Packet): PacketProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.Packet', + value: Packet.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Packet.typeUrl, Packet) +GlobalDecoderRegistry.registerAminoProtoMapping( + Packet.aminoType, + Packet.typeUrl +) +function createBasePacketState(): PacketState { + return { + portId: '', + channelId: '', + sequence: BigInt(0), + data: new Uint8Array() + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence) + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePacketState() + 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.sequence = reader.uint64() + break + case 4: + message.data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PacketState { + const message = createBasePacketState() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + message.data = object.data ?? new Uint8Array() + return message + }, + fromAmino(object: PacketStateAmino): PacketState { + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg(object: PacketStateAminoMsg): PacketState { + return PacketState.fromAmino(object.value) + }, + toAminoMsg(message: PacketState): PacketStateAminoMsg { + return { + type: 'cosmos-sdk/PacketState', + value: PacketState.toAmino(message) + } + }, + fromProtoMsg(message: PacketStateProtoMsg): PacketState { + return PacketState.decode(message.value) + }, + toProto(message: PacketState): Uint8Array { + return PacketState.encode(message).finish() + }, + toProtoMsg(message: PacketState): PacketStateProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.PacketState', + value: PacketState.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PacketState.typeUrl, PacketState) +GlobalDecoderRegistry.registerAminoProtoMapping( + PacketState.aminoType, + PacketState.typeUrl +) +function createBasePacketId(): PacketId { + return { + portId: '', + channelId: '', + sequence: BigInt(0) + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketId { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePacketId() + 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.sequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PacketId { + const message = createBasePacketId() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.sequence = + object.sequence !== undefined && object.sequence !== null + ? BigInt(object.sequence.toString()) + : BigInt(0) + return message + }, + fromAmino(object: PacketIdAmino): PacketId { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.sequence = + message.sequence !== BigInt(0) ? message.sequence.toString() : undefined + return obj + }, + fromAminoMsg(object: PacketIdAminoMsg): PacketId { + return PacketId.fromAmino(object.value) + }, + toAminoMsg(message: PacketId): PacketIdAminoMsg { + return { + type: 'cosmos-sdk/PacketId', + value: PacketId.toAmino(message) + } + }, + fromProtoMsg(message: PacketIdProtoMsg): PacketId { + return PacketId.decode(message.value) + }, + toProto(message: PacketId): Uint8Array { + return PacketId.encode(message).finish() + }, + toProtoMsg(message: PacketId): PacketIdProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.PacketId', + value: PacketId.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PacketId.typeUrl, PacketId) +GlobalDecoderRegistry.registerAminoProtoMapping( + PacketId.aminoType, + PacketId.typeUrl +) +function createBaseAcknowledgement(): Acknowledgement { + return { + result: undefined, + error: undefined + } +} +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) + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAcknowledgement() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 21: + message.result = reader.bytes() + break + case 22: + message.error = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Acknowledgement { + const message = createBaseAcknowledgement() + message.result = object.result ?? undefined + message.error = object.error ?? undefined + return message + }, + fromAmino(object: AcknowledgementAmino): Acknowledgement { + 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 ? base64FromBytes(message.result) : undefined + obj.error = message.error === null ? undefined : message.error + return obj + }, + fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { + return Acknowledgement.fromAmino(object.value) + }, + toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { + return { + type: 'cosmos-sdk/Acknowledgement', + value: Acknowledgement.toAmino(message) + } + }, + fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { + return Acknowledgement.decode(message.value) + }, + toProto(message: Acknowledgement): Uint8Array { + return Acknowledgement.encode(message).finish() + }, + toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.Acknowledgement', + value: Acknowledgement.encode(message).finish() + } + } +} +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 + }, + 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 !== BigInt(0) ? 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 + }, + 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 +) diff --git a/src/proto/osmojs/ibc/core/channel/v1/tx.amino.ts b/src/proto/osmojs/ibc/core/channel/v1/tx.amino.ts new file mode 100644 index 0000000..ac1be66 --- /dev/null +++ b/src/proto/osmojs/ibc/core/channel/v1/tx.amino.ts @@ -0,0 +1,120 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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', + toAmino: MsgChannelOpenInit.toAmino, + fromAmino: MsgChannelOpenInit.fromAmino + }, + '/ibc.core.channel.v1.MsgChannelOpenTry': { + aminoType: 'cosmos-sdk/MsgChannelOpenTry', + toAmino: MsgChannelOpenTry.toAmino, + fromAmino: MsgChannelOpenTry.fromAmino + }, + '/ibc.core.channel.v1.MsgChannelOpenAck': { + aminoType: 'cosmos-sdk/MsgChannelOpenAck', + toAmino: MsgChannelOpenAck.toAmino, + fromAmino: MsgChannelOpenAck.fromAmino + }, + '/ibc.core.channel.v1.MsgChannelOpenConfirm': { + aminoType: 'cosmos-sdk/MsgChannelOpenConfirm', + toAmino: MsgChannelOpenConfirm.toAmino, + fromAmino: MsgChannelOpenConfirm.fromAmino + }, + '/ibc.core.channel.v1.MsgChannelCloseInit': { + aminoType: 'cosmos-sdk/MsgChannelCloseInit', + toAmino: MsgChannelCloseInit.toAmino, + fromAmino: MsgChannelCloseInit.fromAmino + }, + '/ibc.core.channel.v1.MsgChannelCloseConfirm': { + aminoType: 'cosmos-sdk/MsgChannelCloseConfirm', + toAmino: MsgChannelCloseConfirm.toAmino, + fromAmino: MsgChannelCloseConfirm.fromAmino + }, + '/ibc.core.channel.v1.MsgRecvPacket': { + aminoType: 'cosmos-sdk/MsgRecvPacket', + toAmino: MsgRecvPacket.toAmino, + fromAmino: MsgRecvPacket.fromAmino + }, + '/ibc.core.channel.v1.MsgTimeout': { + aminoType: 'cosmos-sdk/MsgTimeout', + toAmino: MsgTimeout.toAmino, + fromAmino: MsgTimeout.fromAmino + }, + '/ibc.core.channel.v1.MsgTimeoutOnClose': { + aminoType: 'cosmos-sdk/MsgTimeoutOnClose', + toAmino: MsgTimeoutOnClose.toAmino, + fromAmino: MsgTimeoutOnClose.fromAmino + }, + '/ibc.core.channel.v1.MsgAcknowledgement': { + 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 + } +} diff --git a/src/proto/osmojs/ibc/core/channel/v1/tx.registry.ts b/src/proto/osmojs/ibc/core/channel/v1/tx.registry.ts new file mode 100644 index 0000000..82eb0f8 --- /dev/null +++ b/src/proto/osmojs/ibc/core/channel/v1/tx.registry.ts @@ -0,0 +1,400 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInit', + value: MsgChannelOpenInit.encode(value).finish() + } + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTry', + value: MsgChannelOpenTry.encode(value).finish() + } + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAck', + value: MsgChannelOpenAck.encode(value).finish() + } + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirm', + value: MsgChannelOpenConfirm.encode(value).finish() + } + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInit', + value: MsgChannelCloseInit.encode(value).finish() + } + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirm', + value: MsgChannelCloseConfirm.encode(value).finish() + } + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacket', + value: MsgRecvPacket.encode(value).finish() + } + }, + timeout(value: MsgTimeout) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeout', + value: MsgTimeout.encode(value).finish() + } + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnClose', + value: MsgTimeoutOnClose.encode(value).finish() + } + }, + acknowledgement(value: MsgAcknowledgement) { + return { + 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: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInit', + value + } + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTry', + value + } + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAck', + value + } + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirm', + value + } + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInit', + value + } + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirm', + value + } + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacket', + value + } + }, + timeout(value: MsgTimeout) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeout', + value + } + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnClose', + value + } + }, + acknowledgement(value: MsgAcknowledgement) { + return { + 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: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInit', + value: MsgChannelOpenInit.fromPartial(value) + } + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTry', + value: MsgChannelOpenTry.fromPartial(value) + } + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAck', + value: MsgChannelOpenAck.fromPartial(value) + } + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirm', + value: MsgChannelOpenConfirm.fromPartial(value) + } + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInit', + value: MsgChannelCloseInit.fromPartial(value) + } + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirm', + value: MsgChannelCloseConfirm.fromPartial(value) + } + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacket', + value: MsgRecvPacket.fromPartial(value) + } + }, + timeout(value: MsgTimeout) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeout', + value: MsgTimeout.fromPartial(value) + } + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnClose', + value: MsgTimeoutOnClose.fromPartial(value) + } + }, + acknowledgement(value: MsgAcknowledgement) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/ibc/core/channel/v1/tx.ts b/src/proto/osmojs/ibc/core/channel/v1/tx.ts new file mode 100644 index 0000000..b5be8b9 --- /dev/null +++ b/src/proto/osmojs/ibc/core/channel/v1/tx.ts @@ -0,0 +1,7000 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Channel, + ChannelAmino, + ChannelSDKType, + Packet, + PacketAmino, + PacketSDKType, + State +} 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 { GlobalDecoderRegistry } from '../../../../registry' +import { bytesFromBase64, base64FromBytes, isSet } from '../../../../../helpers' +/** ResponseResultType defines the possible outcomes of the execution of a message */ +export enum ResponseResultType { + /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0, + /** RESPONSE_RESULT_TYPE_NOOP - The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) */ + 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 +export const ResponseResultTypeAmino = ResponseResultType +export function responseResultTypeFromJSON(object: any): ResponseResultType { + switch (object) { + case 0: + case 'RESPONSE_RESULT_TYPE_UNSPECIFIED': + return ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED + case 1: + case 'RESPONSE_RESULT_TYPE_NOOP': + return ResponseResultType.RESPONSE_RESULT_TYPE_NOOP + 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: + return ResponseResultType.UNRECOGNIZED + } +} +export function responseResultTypeToJSON(object: ResponseResultType): string { + switch (object) { + case ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED: + return 'RESPONSE_RESULT_TYPE_UNSPECIFIED' + case ResponseResultType.RESPONSE_RESULT_TYPE_NOOP: + 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' + } +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string + channel: Channel + signer: string +} +export interface MsgChannelOpenInitProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInit' + value: Uint8Array +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitAmino { + port_id?: string + channel?: ChannelAmino + signer?: string +} +export interface MsgChannelOpenInitAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenInit' + value: MsgChannelOpenInitAmino +} +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInitSDKType { + port_id: string + channel: ChannelSDKType + signer: string +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse { + channelId: string + version: string +} +export interface MsgChannelOpenInitResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInitResponse' + value: Uint8Array +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseAmino { + channel_id?: string + version?: string +} +export interface MsgChannelOpenInitResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenInitResponse' + value: MsgChannelOpenInitResponseAmino +} +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponseSDKType { + channel_id: string + version: string +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTry { + portId: string + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + previousChannelId: string + /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ + channel: Channel + counterpartyVersion: string + proofInit: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgChannelOpenTryProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTry' + value: Uint8Array +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTryAmino { + port_id?: string + /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ + /** @deprecated */ + 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?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgChannelOpenTryAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenTry' + value: MsgChannelOpenTryAmino +} +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. The version field within the Channel field has been deprecated. Its + * value will be ignored by core IBC. + */ +export interface MsgChannelOpenTrySDKType { + port_id: string + /** @deprecated */ + previous_channel_id: string + channel: ChannelSDKType + counterparty_version: string + proof_init: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse { + version: string + channelId: string +} +export interface MsgChannelOpenTryResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTryResponse' + value: Uint8Array +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseAmino { + version?: string + channel_id?: string +} +export interface MsgChannelOpenTryResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenTryResponse' + value: MsgChannelOpenTryResponseAmino +} +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponseSDKType { + version: string + channel_id: string +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. + */ +export interface MsgChannelOpenAck { + portId: string + channelId: string + counterpartyChannelId: string + counterpartyVersion: string + proofTry: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgChannelOpenAckProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAck' + value: Uint8Array +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. + */ +export interface MsgChannelOpenAckAmino { + port_id?: string + channel_id?: string + counterparty_channel_id?: string + counterparty_version?: string + proof_try?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgChannelOpenAckAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenAck' + value: MsgChannelOpenAckAmino +} +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. + */ +export interface MsgChannelOpenAckSDKType { + port_id: string + channel_id: string + counterparty_channel_id: string + counterparty_version: string + proof_try: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse {} +export interface MsgChannelOpenAckResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAckResponse' + value: Uint8Array +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseAmino {} +export interface MsgChannelOpenAckResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenAckResponse' + value: MsgChannelOpenAckResponseAmino +} +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponseSDKType {} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string + channelId: string + proofAck: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgChannelOpenConfirmProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirm' + value: Uint8Array +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmAmino { + port_id?: string + channel_id?: string + proof_ack?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgChannelOpenConfirmAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenConfirm' + value: MsgChannelOpenConfirmAmino +} +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirmSDKType { + port_id: string + channel_id: string + proof_ack: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponse {} +export interface MsgChannelOpenConfirmResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirmResponse' + value: Uint8Array +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseAmino {} +export interface MsgChannelOpenConfirmResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelOpenConfirmResponse' + value: MsgChannelOpenConfirmResponseAmino +} +/** + * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response + * type. + */ +export interface MsgChannelOpenConfirmResponseSDKType {} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string + channelId: string + signer: string +} +export interface MsgChannelCloseInitProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInit' + value: Uint8Array +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitAmino { + port_id?: string + channel_id?: string + signer?: string +} +export interface MsgChannelCloseInitAminoMsg { + type: 'cosmos-sdk/MsgChannelCloseInit' + value: MsgChannelCloseInitAmino +} +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInitSDKType { + port_id: string + channel_id: string + signer: string +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse {} +export interface MsgChannelCloseInitResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInitResponse' + value: Uint8Array +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseAmino {} +export interface MsgChannelCloseInitResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelCloseInitResponse' + value: MsgChannelCloseInitResponseAmino +} +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponseSDKType {} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string + channelId: string + proofInit: Uint8Array + proofHeight: Height + signer: string + counterpartyUpgradeSequence: bigint +} +export interface MsgChannelCloseConfirmProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirm' + value: Uint8Array +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmAmino { + port_id?: string + channel_id?: string + proof_init?: string + proof_height?: HeightAmino + signer?: string + counterparty_upgrade_sequence?: string +} +export interface MsgChannelCloseConfirmAminoMsg { + type: 'cosmos-sdk/MsgChannelCloseConfirm' + value: MsgChannelCloseConfirmAmino +} +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirmSDKType { + port_id: string + channel_id: string + proof_init: Uint8Array + proof_height: HeightSDKType + signer: string + counterparty_upgrade_sequence: bigint +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponse {} +export interface MsgChannelCloseConfirmResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirmResponse' + value: Uint8Array +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseAmino {} +export interface MsgChannelCloseConfirmResponseAminoMsg { + type: 'cosmos-sdk/MsgChannelCloseConfirmResponse' + value: MsgChannelCloseConfirmResponseAmino +} +/** + * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response + * type. + */ +export interface MsgChannelCloseConfirmResponseSDKType {} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet: Packet + proofCommitment: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgRecvPacketProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacket' + value: Uint8Array +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketAmino { + packet?: PacketAmino + proof_commitment?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgRecvPacketAminoMsg { + type: 'cosmos-sdk/MsgRecvPacket' + value: MsgRecvPacketAmino +} +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacketSDKType { + packet: PacketSDKType + proof_commitment: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse { + result: ResponseResultType +} +export interface MsgRecvPacketResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacketResponse' + value: Uint8Array +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseAmino { + result?: ResponseResultType +} +export interface MsgRecvPacketResponseAminoMsg { + type: 'cosmos-sdk/MsgRecvPacketResponse' + value: MsgRecvPacketResponseAmino +} +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponseSDKType { + result: ResponseResultType +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet: Packet + proofUnreceived: Uint8Array + proofHeight: Height + nextSequenceRecv: bigint + signer: string +} +export interface MsgTimeoutProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgTimeout' + value: Uint8Array +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutAmino { + packet?: PacketAmino + proof_unreceived?: string + proof_height?: HeightAmino + next_sequence_recv?: string + signer?: string +} +export interface MsgTimeoutAminoMsg { + type: 'cosmos-sdk/MsgTimeout' + value: MsgTimeoutAmino +} +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeoutSDKType { + packet: PacketSDKType + proof_unreceived: Uint8Array + proof_height: HeightSDKType + next_sequence_recv: bigint + signer: string +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse { + result: ResponseResultType +} +export interface MsgTimeoutResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutResponse' + value: Uint8Array +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseAmino { + result?: ResponseResultType +} +export interface MsgTimeoutResponseAminoMsg { + type: 'cosmos-sdk/MsgTimeoutResponse' + value: MsgTimeoutResponseAmino +} +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponseSDKType { + result: ResponseResultType +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet: Packet + proofUnreceived: Uint8Array + proofClose: Uint8Array + proofHeight: Height + nextSequenceRecv: bigint + signer: string + counterpartyUpgradeSequence: bigint +} +export interface MsgTimeoutOnCloseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnClose' + value: Uint8Array +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseAmino { + packet?: PacketAmino + proof_unreceived?: string + proof_close?: string + proof_height?: HeightAmino + next_sequence_recv?: string + signer?: string + counterparty_upgrade_sequence?: string +} +export interface MsgTimeoutOnCloseAminoMsg { + type: 'cosmos-sdk/MsgTimeoutOnClose' + value: MsgTimeoutOnCloseAmino +} +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnCloseSDKType { + packet: PacketSDKType + proof_unreceived: Uint8Array + proof_close: Uint8Array + proof_height: HeightSDKType + next_sequence_recv: bigint + signer: string + counterparty_upgrade_sequence: bigint +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse { + result: ResponseResultType +} +export interface MsgTimeoutOnCloseResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnCloseResponse' + value: Uint8Array +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseAmino { + result?: ResponseResultType +} +export interface MsgTimeoutOnCloseResponseAminoMsg { + type: 'cosmos-sdk/MsgTimeoutOnCloseResponse' + value: MsgTimeoutOnCloseResponseAmino +} +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponseSDKType { + result: ResponseResultType +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet: Packet + acknowledgement: Uint8Array + proofAcked: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgAcknowledgementProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgAcknowledgement' + value: Uint8Array +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementAmino { + packet?: PacketAmino + acknowledgement?: string + proof_acked?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgAcknowledgementAminoMsg { + type: 'cosmos-sdk/MsgAcknowledgement' + value: MsgAcknowledgementAmino +} +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgementSDKType { + packet: PacketSDKType + acknowledgement: Uint8Array + proof_acked: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse { + result: ResponseResultType +} +export interface MsgAcknowledgementResponseProtoMsg { + typeUrl: '/ibc.core.channel.v1.MsgAcknowledgementResponse' + value: Uint8Array +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseAmino { + result?: ResponseResultType +} +export interface MsgAcknowledgementResponseAminoMsg { + type: 'cosmos-sdk/MsgAcknowledgementResponse' + value: MsgAcknowledgementResponseAmino +} +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponseSDKType { + result: ResponseResultType +} +/** + * MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +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 + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +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 + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +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 + counterpartyUpgradeSequence: bigint + 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 + counterparty_upgrade_sequence?: string + 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 + counterparty_upgrade_sequence: bigint + 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: '', + channel: Channel.fromPartial({}), + signer: '' + } +} +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) + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(26).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenInit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenInit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.portId = reader.string() + break + case 2: + message.channel = Channel.decode(reader, reader.uint32()) + break + case 3: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgChannelOpenInit { + const message = createBaseMsgChannelOpenInit() + message.portId = object.portId ?? '' + message.channel = + object.channel !== undefined && object.channel !== null + ? Channel.fromPartial(object.channel) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgChannelOpenInitAminoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenInit', + value: MsgChannelOpenInit.toAmino(message) + } + }, + fromProtoMsg(message: MsgChannelOpenInitProtoMsg): MsgChannelOpenInit { + return MsgChannelOpenInit.decode(message.value) + }, + toProto(message: MsgChannelOpenInit): Uint8Array { + return MsgChannelOpenInit.encode(message).finish() + }, + toProtoMsg(message: MsgChannelOpenInit): MsgChannelOpenInitProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInit', + value: MsgChannelOpenInit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgChannelOpenInit.typeUrl, MsgChannelOpenInit) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenInit.aminoType, + MsgChannelOpenInit.typeUrl +) +function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { + return { + channelId: '', + version: '' + } +} +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) + } + if (message.version !== '') { + writer.uint32(18).string(message.version) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenInitResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenInitResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.channelId = reader.string() + break + case 2: + message.version = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgChannelOpenInitResponse { + const message = createBaseMsgChannelOpenInitResponse() + message.channelId = object.channelId ?? '' + message.version = object.version ?? '' + return message + }, + fromAmino( + object: MsgChannelOpenInitResponseAmino + ): MsgChannelOpenInitResponse { + 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 = {} + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.version = message.version === '' ? undefined : message.version + return obj + }, + fromAminoMsg( + object: MsgChannelOpenInitResponseAminoMsg + ): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelOpenInitResponse + ): MsgChannelOpenInitResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenInitResponse', + value: MsgChannelOpenInitResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelOpenInitResponseProtoMsg + ): MsgChannelOpenInitResponse { + return MsgChannelOpenInitResponse.decode(message.value) + }, + toProto(message: MsgChannelOpenInitResponse): Uint8Array { + return MsgChannelOpenInitResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelOpenInitResponse + ): MsgChannelOpenInitResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenInitResponse', + value: MsgChannelOpenInitResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelOpenInitResponse.typeUrl, + MsgChannelOpenInitResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenInitResponse.aminoType, + MsgChannelOpenInitResponse.typeUrl +) +function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { + return { + portId: '', + previousChannelId: '', + channel: Channel.fromPartial({}), + counterpartyVersion: '', + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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) + } + if (message.previousChannelId !== '') { + writer.uint32(18).string(message.previousChannelId) + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim() + } + if (message.counterpartyVersion !== '') { + writer.uint32(34).string(message.counterpartyVersion) + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit) + } + 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): MsgChannelOpenTry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenTry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.portId = reader.string() + break + case 2: + message.previousChannelId = reader.string() + break + case 3: + message.channel = Channel.decode(reader, reader.uint32()) + break + case 4: + message.counterpartyVersion = reader.string() + break + case 5: + message.proofInit = 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): MsgChannelOpenTry { + const message = createBaseMsgChannelOpenTry() + message.portId = object.portId ?? '' + message.previousChannelId = object.previousChannelId ?? '' + message.channel = + object.channel !== undefined && object.channel !== null + ? Channel.fromPartial(object.channel) + : undefined + message.counterpartyVersion = object.counterpartyVersion ?? '' + message.proofInit = object.proofInit ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { + 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 === '' ? undefined : message.portId + obj.previous_channel_id = + message.previousChannelId === '' ? undefined : message.previousChannelId + obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined + obj.counterparty_version = + message.counterpartyVersion === '' + ? undefined + : message.counterpartyVersion + obj.proof_init = message.proofInit + ? base64FromBytes(message.proofInit) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgChannelOpenTryAminoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenTry', + value: MsgChannelOpenTry.toAmino(message) + } + }, + fromProtoMsg(message: MsgChannelOpenTryProtoMsg): MsgChannelOpenTry { + return MsgChannelOpenTry.decode(message.value) + }, + toProto(message: MsgChannelOpenTry): Uint8Array { + return MsgChannelOpenTry.encode(message).finish() + }, + toProtoMsg(message: MsgChannelOpenTry): MsgChannelOpenTryProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTry', + value: MsgChannelOpenTry.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgChannelOpenTry.typeUrl, MsgChannelOpenTry) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenTry.aminoType, + MsgChannelOpenTry.typeUrl +) +function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { + return { + version: '', + channelId: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenTryResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenTryResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.version = reader.string() + break + case 2: + message.channelId = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgChannelOpenTryResponse { + const message = createBaseMsgChannelOpenTryResponse() + message.version = object.version ?? '' + message.channelId = object.channelId ?? '' + return message + }, + fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { + 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 = {} + obj.version = message.version === '' ? undefined : message.version + obj.channel_id = message.channelId === '' ? undefined : message.channelId + return obj + }, + fromAminoMsg( + object: MsgChannelOpenTryResponseAminoMsg + ): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelOpenTryResponse + ): MsgChannelOpenTryResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenTryResponse', + value: MsgChannelOpenTryResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelOpenTryResponseProtoMsg + ): MsgChannelOpenTryResponse { + return MsgChannelOpenTryResponse.decode(message.value) + }, + toProto(message: MsgChannelOpenTryResponse): Uint8Array { + return MsgChannelOpenTryResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelOpenTryResponse + ): MsgChannelOpenTryResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenTryResponse', + value: MsgChannelOpenTryResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelOpenTryResponse.typeUrl, + MsgChannelOpenTryResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenTryResponse.aminoType, + MsgChannelOpenTryResponse.typeUrl +) +function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { + return { + portId: '', + channelId: '', + counterpartyChannelId: '', + counterpartyVersion: '', + proofTry: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.counterpartyChannelId !== '') { + writer.uint32(26).string(message.counterpartyChannelId) + } + if (message.counterpartyVersion !== '') { + writer.uint32(34).string(message.counterpartyVersion) + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry) + } + 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): MsgChannelOpenAck { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenAck() + 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.counterpartyChannelId = reader.string() + break + case 4: + message.counterpartyVersion = reader.string() + break + case 5: + message.proofTry = 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): MsgChannelOpenAck { + const message = createBaseMsgChannelOpenAck() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.counterpartyChannelId = object.counterpartyChannelId ?? '' + message.counterpartyVersion = object.counterpartyVersion ?? '' + message.proofTry = object.proofTry ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.counterparty_channel_id = + message.counterpartyChannelId === '' + ? undefined + : message.counterpartyChannelId + obj.counterparty_version = + message.counterpartyVersion === '' + ? undefined + : message.counterpartyVersion + obj.proof_try = message.proofTry + ? base64FromBytes(message.proofTry) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgChannelOpenAckAminoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenAck', + value: MsgChannelOpenAck.toAmino(message) + } + }, + fromProtoMsg(message: MsgChannelOpenAckProtoMsg): MsgChannelOpenAck { + return MsgChannelOpenAck.decode(message.value) + }, + toProto(message: MsgChannelOpenAck): Uint8Array { + return MsgChannelOpenAck.encode(message).finish() + }, + toProtoMsg(message: MsgChannelOpenAck): MsgChannelOpenAckProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAck', + value: MsgChannelOpenAck.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenAckResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenAckResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse() + return message + }, + fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { + const message = createBaseMsgChannelOpenAckResponse() + return message + }, + toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgChannelOpenAckResponseAminoMsg + ): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelOpenAckResponse + ): MsgChannelOpenAckResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenAckResponse', + value: MsgChannelOpenAckResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelOpenAckResponseProtoMsg + ): MsgChannelOpenAckResponse { + return MsgChannelOpenAckResponse.decode(message.value) + }, + toProto(message: MsgChannelOpenAckResponse): Uint8Array { + return MsgChannelOpenAckResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelOpenAckResponse + ): MsgChannelOpenAckResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenAckResponse', + value: MsgChannelOpenAckResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelOpenAckResponse.typeUrl, + MsgChannelOpenAckResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenAckResponse.aminoType, + MsgChannelOpenAckResponse.typeUrl +) +function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { + return { + portId: '', + channelId: '', + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(42).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenConfirm { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenConfirm() + 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.proofAck = reader.bytes() + break + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 5: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgChannelOpenConfirm { + const message = createBaseMsgChannelOpenConfirm() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.proofAck = object.proofAck ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.proof_ack = message.proofAck + ? base64FromBytes(message.proofAck) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgChannelOpenConfirmAminoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenConfirm', + value: MsgChannelOpenConfirm.toAmino(message) + } + }, + fromProtoMsg(message: MsgChannelOpenConfirmProtoMsg): MsgChannelOpenConfirm { + return MsgChannelOpenConfirm.decode(message.value) + }, + toProto(message: MsgChannelOpenConfirm): Uint8Array { + return MsgChannelOpenConfirm.encode(message).finish() + }, + toProtoMsg(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirm', + value: MsgChannelOpenConfirm.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelOpenConfirmResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelOpenConfirmResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse() + return message + }, + fromAmino( + _: MsgChannelOpenConfirmResponseAmino + ): MsgChannelOpenConfirmResponse { + const message = createBaseMsgChannelOpenConfirmResponse() + return message + }, + toAmino( + _: MsgChannelOpenConfirmResponse + ): MsgChannelOpenConfirmResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgChannelOpenConfirmResponseAminoMsg + ): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelOpenConfirmResponse + ): MsgChannelOpenConfirmResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelOpenConfirmResponse', + value: MsgChannelOpenConfirmResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelOpenConfirmResponseProtoMsg + ): MsgChannelOpenConfirmResponse { + return MsgChannelOpenConfirmResponse.decode(message.value) + }, + toProto(message: MsgChannelOpenConfirmResponse): Uint8Array { + return MsgChannelOpenConfirmResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelOpenConfirmResponse + ): MsgChannelOpenConfirmResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelOpenConfirmResponse', + value: MsgChannelOpenConfirmResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelOpenConfirmResponse.typeUrl, + MsgChannelOpenConfirmResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelOpenConfirmResponse.aminoType, + MsgChannelOpenConfirmResponse.typeUrl +) +function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { + return { + portId: '', + channelId: '', + signer: '' + } +} +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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.signer !== '') { + writer.uint32(26).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelCloseInit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelCloseInit() + 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.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgChannelCloseInit { + const message = createBaseMsgChannelCloseInit() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { + 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 = {} + obj.port_id = message.portId === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgChannelCloseInitAminoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelCloseInit', + value: MsgChannelCloseInit.toAmino(message) + } + }, + fromProtoMsg(message: MsgChannelCloseInitProtoMsg): MsgChannelCloseInit { + return MsgChannelCloseInit.decode(message.value) + }, + toProto(message: MsgChannelCloseInit): Uint8Array { + return MsgChannelCloseInit.encode(message).finish() + }, + toProtoMsg(message: MsgChannelCloseInit): MsgChannelCloseInitProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInit', + value: MsgChannelCloseInit.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelCloseInitResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelCloseInitResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse() + return message + }, + fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { + const message = createBaseMsgChannelCloseInitResponse() + return message + }, + toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgChannelCloseInitResponseAminoMsg + ): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelCloseInitResponse + ): MsgChannelCloseInitResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelCloseInitResponse', + value: MsgChannelCloseInitResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelCloseInitResponseProtoMsg + ): MsgChannelCloseInitResponse { + return MsgChannelCloseInitResponse.decode(message.value) + }, + toProto(message: MsgChannelCloseInitResponse): Uint8Array { + return MsgChannelCloseInitResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelCloseInitResponse + ): MsgChannelCloseInitResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseInitResponse', + value: MsgChannelCloseInitResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelCloseInitResponse.typeUrl, + MsgChannelCloseInitResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelCloseInitResponse.aminoType, + MsgChannelCloseInitResponse.typeUrl +) +function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { + return { + portId: '', + channelId: '', + proofInit: new Uint8Array(), + proofHeight: Height.fromPartial({}), + 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) + } + if (message.channelId !== '') { + writer.uint32(18).string(message.channelId) + } + if (message.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelCloseConfirm() + 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.proofInit = reader.bytes() + break + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 5: + message.signer = reader.string() + break + case 6: + message.counterpartyUpgradeSequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgChannelCloseConfirm { + const message = createBaseMsgChannelCloseConfirm() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + 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 { + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.proof_init = message.proofInit + ? base64FromBytes(message.proofInit) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + obj.counterparty_upgrade_sequence = + message.counterpartyUpgradeSequence !== BigInt(0) + ? message.counterpartyUpgradeSequence.toString() + : undefined + return obj + }, + fromAminoMsg(object: MsgChannelCloseConfirmAminoMsg): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.fromAmino(object.value) + }, + toAminoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelCloseConfirm', + value: MsgChannelCloseConfirm.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelCloseConfirmProtoMsg + ): MsgChannelCloseConfirm { + return MsgChannelCloseConfirm.decode(message.value) + }, + toProto(message: MsgChannelCloseConfirm): Uint8Array { + return MsgChannelCloseConfirm.encode(message).finish() + }, + toProtoMsg(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirm', + value: MsgChannelCloseConfirm.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChannelCloseConfirmResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChannelCloseConfirmResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse() + return message + }, + fromAmino( + _: MsgChannelCloseConfirmResponseAmino + ): MsgChannelCloseConfirmResponse { + const message = createBaseMsgChannelCloseConfirmResponse() + return message + }, + toAmino( + _: MsgChannelCloseConfirmResponse + ): MsgChannelCloseConfirmResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgChannelCloseConfirmResponseAminoMsg + ): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgChannelCloseConfirmResponse + ): MsgChannelCloseConfirmResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgChannelCloseConfirmResponse', + value: MsgChannelCloseConfirmResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChannelCloseConfirmResponseProtoMsg + ): MsgChannelCloseConfirmResponse { + return MsgChannelCloseConfirmResponse.decode(message.value) + }, + toProto(message: MsgChannelCloseConfirmResponse): Uint8Array { + return MsgChannelCloseConfirmResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgChannelCloseConfirmResponse + ): MsgChannelCloseConfirmResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgChannelCloseConfirmResponse', + value: MsgChannelCloseConfirmResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgChannelCloseConfirmResponse.typeUrl, + MsgChannelCloseConfirmResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgChannelCloseConfirmResponse.aminoType, + MsgChannelCloseConfirmResponse.typeUrl +) +function createBaseMsgRecvPacket(): MsgRecvPacket { + return { + packet: Packet.fromPartial({}), + proofCommitment: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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() + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(34).string(message.signer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacket { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRecvPacket() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()) + break + case 2: + message.proofCommitment = reader.bytes() + break + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 4: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgRecvPacket { + const message = createBaseMsgRecvPacket() + message.packet = + object.packet !== undefined && object.packet !== null + ? Packet.fromPartial(object.packet) + : undefined + message.proofCommitment = object.proofCommitment ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { + 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 + ? base64FromBytes(message.proofCommitment) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgRecvPacketAminoMsg): MsgRecvPacket { + return MsgRecvPacket.fromAmino(object.value) + }, + toAminoMsg(message: MsgRecvPacket): MsgRecvPacketAminoMsg { + return { + type: 'cosmos-sdk/MsgRecvPacket', + value: MsgRecvPacket.toAmino(message) + } + }, + fromProtoMsg(message: MsgRecvPacketProtoMsg): MsgRecvPacket { + return MsgRecvPacket.decode(message.value) + }, + toProto(message: MsgRecvPacket): Uint8Array { + return MsgRecvPacket.encode(message).finish() + }, + toProtoMsg(message: MsgRecvPacket): MsgRecvPacketProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacket', + value: MsgRecvPacket.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgRecvPacket.typeUrl, MsgRecvPacket) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRecvPacket.aminoType, + MsgRecvPacket.typeUrl +) +function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { + return { + result: 0 + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRecvPacketResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRecvPacketResponse() + 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): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse() + message.result = object.result ?? 0 + return message + }, + fromAmino(object: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { + const message = createBaseMsgRecvPacketResponse() + if (object.result !== undefined && object.result !== null) { + message.result = object.result + } + return message + }, + toAmino(message: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : message.result + return obj + }, + fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRecvPacketResponse', + value: MsgRecvPacketResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgRecvPacketResponseProtoMsg): MsgRecvPacketResponse { + return MsgRecvPacketResponse.decode(message.value) + }, + toProto(message: MsgRecvPacketResponse): Uint8Array { + return MsgRecvPacketResponse.encode(message).finish() + }, + toProtoMsg(message: MsgRecvPacketResponse): MsgRecvPacketResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgRecvPacketResponse', + value: MsgRecvPacketResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRecvPacketResponse.typeUrl, + MsgRecvPacketResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRecvPacketResponse.aminoType, + MsgRecvPacketResponse.typeUrl +) +function createBaseMsgTimeout(): MsgTimeout { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + signer: '' + } +} +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() + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim() + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(32).uint64(message.nextSequenceRecv) + } + if (message.signer !== '') { + writer.uint32(42).string(message.signer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeout { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTimeout() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()) + break + case 2: + message.proofUnreceived = reader.bytes() + break + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 4: + message.nextSequenceRecv = reader.uint64() + break + case 5: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgTimeout { + const message = createBaseMsgTimeout() + message.packet = + object.packet !== undefined && object.packet !== null + ? Packet.fromPartial(object.packet) + : undefined + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array() + 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 ?? '' + return message + }, + fromAmino(object: MsgTimeoutAmino): MsgTimeout { + 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 + ? base64FromBytes(message.proofUnreceived) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.next_sequence_recv = + message.nextSequenceRecv !== BigInt(0) + ? message.nextSequenceRecv.toString() + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgTimeoutAminoMsg): MsgTimeout { + return MsgTimeout.fromAmino(object.value) + }, + toAminoMsg(message: MsgTimeout): MsgTimeoutAminoMsg { + return { + type: 'cosmos-sdk/MsgTimeout', + value: MsgTimeout.toAmino(message) + } + }, + fromProtoMsg(message: MsgTimeoutProtoMsg): MsgTimeout { + return MsgTimeout.decode(message.value) + }, + toProto(message: MsgTimeout): Uint8Array { + return MsgTimeout.encode(message).finish() + }, + toProtoMsg(message: MsgTimeout): MsgTimeoutProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeout', + value: MsgTimeout.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgTimeout.typeUrl, MsgTimeout) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTimeout.aminoType, + MsgTimeout.typeUrl +) +function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { + return { + result: 0 + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTimeoutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTimeoutResponse() + 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): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse() + message.result = object.result ?? 0 + return message + }, + fromAmino(object: MsgTimeoutResponseAmino): MsgTimeoutResponse { + const message = createBaseMsgTimeoutResponse() + if (object.result !== undefined && object.result !== null) { + message.result = object.result + } + return message + }, + toAmino(message: MsgTimeoutResponse): MsgTimeoutResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : message.result + return obj + }, + fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgTimeoutResponse', + value: MsgTimeoutResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgTimeoutResponseProtoMsg): MsgTimeoutResponse { + return MsgTimeoutResponse.decode(message.value) + }, + toProto(message: MsgTimeoutResponse): Uint8Array { + return MsgTimeoutResponse.encode(message).finish() + }, + toProtoMsg(message: MsgTimeoutResponse): MsgTimeoutResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutResponse', + value: MsgTimeoutResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgTimeoutResponse.typeUrl, MsgTimeoutResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTimeoutResponse.aminoType, + MsgTimeoutResponse.typeUrl +) +function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { + return { + packet: Packet.fromPartial({}), + proofUnreceived: new Uint8Array(), + proofClose: new Uint8Array(), + proofHeight: Height.fromPartial({}), + nextSequenceRecv: BigInt(0), + 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() + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived) + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim() + } + if (message.nextSequenceRecv !== BigInt(0)) { + writer.uint32(40).uint64(message.nextSequenceRecv) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTimeoutOnClose() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()) + break + case 2: + message.proofUnreceived = reader.bytes() + break + case 3: + message.proofClose = reader.bytes() + break + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 5: + message.nextSequenceRecv = reader.uint64() + break + case 6: + message.signer = reader.string() + break + case 7: + message.counterpartyUpgradeSequence = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgTimeoutOnClose { + const message = createBaseMsgTimeoutOnClose() + message.packet = + object.packet !== undefined && object.packet !== null + ? Packet.fromPartial(object.packet) + : undefined + message.proofUnreceived = object.proofUnreceived ?? new Uint8Array() + message.proofClose = object.proofClose ?? new Uint8Array() + 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 { + 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 + ? 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 !== BigInt(0) + ? message.nextSequenceRecv.toString() + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + obj.counterparty_upgrade_sequence = + message.counterpartyUpgradeSequence !== BigInt(0) + ? message.counterpartyUpgradeSequence.toString() + : undefined + return obj + }, + fromAminoMsg(object: MsgTimeoutOnCloseAminoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.fromAmino(object.value) + }, + toAminoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAminoMsg { + return { + type: 'cosmos-sdk/MsgTimeoutOnClose', + value: MsgTimeoutOnClose.toAmino(message) + } + }, + fromProtoMsg(message: MsgTimeoutOnCloseProtoMsg): MsgTimeoutOnClose { + return MsgTimeoutOnClose.decode(message.value) + }, + toProto(message: MsgTimeoutOnClose): Uint8Array { + return MsgTimeoutOnClose.encode(message).finish() + }, + toProtoMsg(message: MsgTimeoutOnClose): MsgTimeoutOnCloseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnClose', + value: MsgTimeoutOnClose.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgTimeoutOnClose.typeUrl, MsgTimeoutOnClose) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTimeoutOnClose.aminoType, + MsgTimeoutOnClose.typeUrl +) +function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { + return { + result: 0 + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgTimeoutOnCloseResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgTimeoutOnCloseResponse() + 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 + ): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse() + message.result = object.result ?? 0 + return message + }, + fromAmino(object: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { + const message = createBaseMsgTimeoutOnCloseResponse() + if (object.result !== undefined && object.result !== null) { + message.result = object.result + } + return message + }, + toAmino(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : message.result + return obj + }, + fromAminoMsg( + object: MsgTimeoutOnCloseResponseAminoMsg + ): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgTimeoutOnCloseResponse + ): MsgTimeoutOnCloseResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgTimeoutOnCloseResponse', + value: MsgTimeoutOnCloseResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgTimeoutOnCloseResponseProtoMsg + ): MsgTimeoutOnCloseResponse { + return MsgTimeoutOnCloseResponse.decode(message.value) + }, + toProto(message: MsgTimeoutOnCloseResponse): Uint8Array { + return MsgTimeoutOnCloseResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgTimeoutOnCloseResponse + ): MsgTimeoutOnCloseResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgTimeoutOnCloseResponse', + value: MsgTimeoutOnCloseResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgTimeoutOnCloseResponse.typeUrl, + MsgTimeoutOnCloseResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgTimeoutOnCloseResponse.aminoType, + MsgTimeoutOnCloseResponse.typeUrl +) +function createBaseMsgAcknowledgement(): MsgAcknowledgement { + return { + packet: Packet.fromPartial({}), + acknowledgement: new Uint8Array(), + proofAcked: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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() + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement) + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(42).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAcknowledgement { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAcknowledgement() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()) + break + case 2: + message.acknowledgement = reader.bytes() + break + case 3: + message.proofAcked = reader.bytes() + break + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 5: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgAcknowledgement { + const message = createBaseMsgAcknowledgement() + message.packet = + object.packet !== undefined && object.packet !== null + ? Packet.fromPartial(object.packet) + : undefined + message.acknowledgement = object.acknowledgement ?? new Uint8Array() + message.proofAcked = object.proofAcked ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { + 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 + ? 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 === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgAcknowledgementAminoMsg): MsgAcknowledgement { + return MsgAcknowledgement.fromAmino(object.value) + }, + toAminoMsg(message: MsgAcknowledgement): MsgAcknowledgementAminoMsg { + return { + type: 'cosmos-sdk/MsgAcknowledgement', + value: MsgAcknowledgement.toAmino(message) + } + }, + fromProtoMsg(message: MsgAcknowledgementProtoMsg): MsgAcknowledgement { + return MsgAcknowledgement.decode(message.value) + }, + toProto(message: MsgAcknowledgement): Uint8Array { + return MsgAcknowledgement.encode(message).finish() + }, + toProtoMsg(message: MsgAcknowledgement): MsgAcknowledgementProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgAcknowledgement', + value: MsgAcknowledgement.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgAcknowledgement.typeUrl, MsgAcknowledgement) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAcknowledgement.aminoType, + MsgAcknowledgement.typeUrl +) +function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { + return { + result: 0 + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAcknowledgementResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAcknowledgementResponse() + 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 + ): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse() + message.result = object.result ?? 0 + return message + }, + fromAmino( + object: MsgAcknowledgementResponseAmino + ): MsgAcknowledgementResponse { + const message = createBaseMsgAcknowledgementResponse() + if (object.result !== undefined && object.result !== null) { + message.result = object.result + } + return message + }, + toAmino( + message: MsgAcknowledgementResponse + ): MsgAcknowledgementResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : message.result + return obj + }, + fromAminoMsg( + object: MsgAcknowledgementResponseAminoMsg + ): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgAcknowledgementResponse + ): MsgAcknowledgementResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgAcknowledgementResponse', + value: MsgAcknowledgementResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAcknowledgementResponseProtoMsg + ): MsgAcknowledgementResponse { + return MsgAcknowledgementResponse.decode(message.value) + }, + toProto(message: MsgAcknowledgementResponse): Uint8Array { + return MsgAcknowledgementResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgAcknowledgementResponse + ): MsgAcknowledgementResponseProtoMsg { + return { + typeUrl: '/ibc.core.channel.v1.MsgAcknowledgementResponse', + value: MsgAcknowledgementResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.fields = message.fields + ? UpgradeFields.toAmino(message.fields) + : undefined + obj.signer = message.signer === '' ? undefined : 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 + }, + 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 !== BigInt(0) + ? 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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + if (message.proposedUpgradeConnectionHops) { + obj.proposed_upgrade_connection_hops = + message.proposedUpgradeConnectionHops.map((e) => e) + } else { + obj.proposed_upgrade_connection_hops = + message.proposedUpgradeConnectionHops + } + obj.counterparty_upgrade_fields = message.counterpartyUpgradeFields + ? UpgradeFields.toAmino(message.counterpartyUpgradeFields) + : undefined + obj.counterparty_upgrade_sequence = + message.counterpartyUpgradeSequence !== BigInt(0) + ? 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 === '' ? undefined : 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 + }, + 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 = 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 !== BigInt(0) + ? message.upgradeSequence.toString() + : undefined + obj.result = message.result === 0 ? undefined : 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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : 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 === '' ? undefined : 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 + }, + 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 = object.result + } + return message + }, + toAmino( + message: MsgChannelUpgradeAckResponse + ): MsgChannelUpgradeAckResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : 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 + }, + 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 = 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.counterparty_channel_state = + message.counterpartyChannelState === 0 + ? undefined + : 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 === '' ? undefined : 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 + }, + 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 = object.result + } + return message + }, + toAmino( + message: MsgChannelUpgradeConfirmResponse + ): MsgChannelUpgradeConfirmResponseAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : 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, + counterpartyUpgradeSequence: BigInt(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) && + typeof o.counterpartyUpgradeSequence === 'bigint' && + (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) && + typeof o.counterparty_upgrade_sequence === 'bigint' && + (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) && + typeof o.counterparty_upgrade_sequence === 'bigint' && + (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.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(32).uint64(message.counterpartyUpgradeSequence) + } + if (message.proofChannel.length !== 0) { + writer.uint32(42).bytes(message.proofChannel) + } + 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 + ): 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.counterpartyUpgradeSequence = reader.uint64() + break + case 5: + message.proofChannel = 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): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen() + message.portId = object.portId ?? '' + message.channelId = object.channelId ?? '' + message.counterpartyChannelState = object.counterpartyChannelState ?? 0 + message.counterpartyUpgradeSequence = + object.counterpartyUpgradeSequence !== undefined && + object.counterpartyUpgradeSequence !== null + ? BigInt(object.counterpartyUpgradeSequence.toString()) + : BigInt(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 = object.counterparty_channel_state + } + 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_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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.counterparty_channel_state = + message.counterpartyChannelState === 0 + ? undefined + : message.counterpartyChannelState + obj.counterparty_upgrade_sequence = + message.counterpartyUpgradeSequence !== BigInt(0) + ? message.counterpartyUpgradeSequence.toString() + : undefined + obj.proof_channel = message.proofChannel + ? base64FromBytes(message.proofChannel) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : message.portId + obj.channel_id = message.channelId === '' ? undefined : message.channelId + obj.limit = + message.limit !== BigInt(0) ? message.limit.toString() : undefined + obj.signer = message.signer === '' ? undefined : 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 + }, + 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 !== BigInt(0) + ? message.totalPrunedSequences.toString() + : undefined + obj.total_remaining_sequences = + message.totalRemainingSequences !== BigInt(0) + ? 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 +) diff --git a/src/proto/osmojs/ibc/core/channel/v1/upgrade.ts b/src/proto/osmojs/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 0000000..b9cbe64 --- /dev/null +++ b/src/proto/osmojs/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,527 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Timeout, TimeoutAmino, TimeoutSDKType, Order } from './channel' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +import { isSet } from '../../../../../helpers' +/** + * 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 + }, + 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 !== BigInt(0) + ? 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 + }, + 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 = 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 = message.ordering === 0 ? undefined : message.ordering + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map((e) => e) + } else { + obj.connection_hops = message.connectionHops + } + obj.version = message.version === '' ? undefined : 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 + }, + 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 !== BigInt(0) ? message.sequence.toString() : undefined + obj.message = message.message === '' ? undefined : 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 +) diff --git a/src/proto/osmojs/ibc/core/client/v1/client.ts b/src/proto/osmojs/ibc/core/client/v1/client.ts new file mode 100644 index 0000000..ee635b6 --- /dev/null +++ b/src/proto/osmojs/ibc/core/client/v1/client.ts @@ -0,0 +1,1292 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { + Plan, + PlanAmino, + PlanSDKType +} from '../../../../cosmos/upgrade/v1beta1/upgrade' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string + /** client state */ + clientState?: Any +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: '/ibc.core.client.v1.IdentifiedClientState' + value: Uint8Array +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id?: string + /** client state */ + client_state?: AnyAmino +} +export interface IdentifiedClientStateAminoMsg { + type: 'cosmos-sdk/IdentifiedClientState' + value: IdentifiedClientStateAmino +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateSDKType { + client_id: string + client_state?: AnySDKType +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height + /** consensus state */ + consensusState?: Any +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight' + value: Uint8Array +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height?: HeightAmino + /** consensus state */ + consensus_state?: AnyAmino +} +export interface ConsensusStateWithHeightAminoMsg { + type: 'cosmos-sdk/ConsensusStateWithHeight' + value: ConsensusStateWithHeightAmino +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightSDKType { + height: HeightSDKType + consensus_state?: AnySDKType +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[] +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: '/ibc.core.client.v1.ClientConsensusStates' + value: Uint8Array +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id?: string + /** consensus states and their heights associated with the client */ + consensus_states?: ConsensusStateWithHeightAmino[] +} +export interface ClientConsensusStatesAminoMsg { + type: 'cosmos-sdk/ClientConsensusStates' + value: ClientConsensusStatesAmino +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesSDKType { + client_id: string + consensus_states: ConsensusStateWithHeightSDKType[] +} +/** + * 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?: '/ibc.core.client.v1.ClientUpdateProposal' + /** the title of the update proposal */ + title: string + /** the description of the proposal */ + description: string + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string +} +export interface ClientUpdateProposalProtoMsg { + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal' + value: Uint8Array +} +/** + * 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 + /** the description of the proposal */ + description?: string + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substitute_client_id?: string +} +export interface ClientUpdateProposalAminoMsg { + type: 'cosmos-sdk/ClientUpdateProposal' + value: ClientUpdateProposalAmino +} +/** + * 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?: '/ibc.core.client.v1.ClientUpdateProposal' + title: string + description: string + subject_client_id: string + substitute_client_id: string +} +/** + * 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?: '/ibc.core.client.v1.UpgradeProposal' + title: string + description: string + 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 + */ + upgradedClientState?: Any +} +export interface UpgradeProposalProtoMsg { + typeUrl: '/ibc.core.client.v1.UpgradeProposal' + value: Uint8Array +} +/** + * 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 + 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 + */ + upgraded_client_state?: AnyAmino +} +export interface UpgradeProposalAminoMsg { + type: 'cosmos-sdk/UpgradeProposal' + value: UpgradeProposalAmino +} +/** + * 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?: '/ibc.core.client.v1.UpgradeProposal' + title: string + description: string + plan: PlanSDKType + upgraded_client_state?: AnySDKType +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: '', + clientState: undefined + } +} +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) + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): IdentifiedClientState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIdentifiedClientState() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.clientState = Any.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): IdentifiedClientState { + const message = createBaseIdentifiedClientState() + message.clientId = object.clientId ?? '' + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined + return message + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.client_state = message.clientState + ? Any.toAmino(message.clientState) + : undefined + return obj + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value) + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: 'cosmos-sdk/IdentifiedClientState', + value: IdentifiedClientState.toAmino(message) + } + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value) + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish() + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.IdentifiedClientState', + value: IdentifiedClientState.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + IdentifiedClientState.typeUrl, + IdentifiedClientState +) +GlobalDecoderRegistry.registerAminoProtoMapping( + IdentifiedClientState.aminoType, + IdentifiedClientState.typeUrl +) +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined + } +} +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() + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ConsensusStateWithHeight { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensusStateWithHeight() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()) + break + case 2: + message.consensusState = Any.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight() + message.height = + object.height !== undefined && object.height !== null + ? Height.fromPartial(object.height) + : undefined + message.consensusState = + object.consensusState !== undefined && object.consensusState !== null + ? Any.fromPartial(object.consensusState) + : undefined + return message + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + 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 = {} + obj.height = message.height ? Height.toAmino(message.height) : undefined + obj.consensus_state = message.consensusState + ? Any.toAmino(message.consensusState) + : undefined + return obj + }, + fromAminoMsg( + object: ConsensusStateWithHeightAminoMsg + ): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value) + }, + toAminoMsg( + message: ConsensusStateWithHeight + ): ConsensusStateWithHeightAminoMsg { + return { + type: 'cosmos-sdk/ConsensusStateWithHeight', + value: ConsensusStateWithHeight.toAmino(message) + } + }, + fromProtoMsg( + message: ConsensusStateWithHeightProtoMsg + ): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value) + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish() + }, + toProtoMsg( + message: ConsensusStateWithHeight + ): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight', + value: ConsensusStateWithHeight.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ConsensusStateWithHeight.typeUrl, + ConsensusStateWithHeight +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ConsensusStateWithHeight.aminoType, + ConsensusStateWithHeight.typeUrl +) +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: '', + consensusStates: [] + } +} +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) + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ClientConsensusStates { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseClientConsensusStates() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.consensusStates.push( + ConsensusStateWithHeight.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ClientConsensusStates { + const message = createBaseClientConsensusStates() + message.clientId = object.clientId ?? '' + message.consensusStates = + object.consensusStates?.map((e) => + ConsensusStateWithHeight.fromPartial(e) + ) || [] + return message + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map((e) => + e ? ConsensusStateWithHeight.toAmino(e) : undefined + ) + } else { + obj.consensus_states = message.consensusStates + } + return obj + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value) + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: 'cosmos-sdk/ClientConsensusStates', + value: ClientConsensusStates.toAmino(message) + } + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value) + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish() + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ClientConsensusStates', + value: ClientConsensusStates.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ClientConsensusStates.typeUrl, + ClientConsensusStates +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ClientConsensusStates.aminoType, + ClientConsensusStates.typeUrl +) +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + } +} +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 + }, + 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 !== BigInt(0) + ? message.revisionNumber.toString() + : undefined + obj.revision_height = + message.revisionHeight !== BigInt(0) + ? 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 + }, + 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 = message.allowedClients + } + 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) + } + return writer + }, + 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 = createBaseClientUpdateProposal() + 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.subjectClientId = reader.string() + break + case 4: + message.substituteClientId = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + 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 + }, + 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: ClientUpdateProposal): ClientUpdateProposalAmino { + const obj: any = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.subject_client_id = + message.subjectClientId === '' ? undefined : message.subjectClientId + obj.substitute_client_id = + message.substituteClientId === '' ? undefined : message.substituteClientId + return obj + }, + fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { + return ClientUpdateProposal.fromAmino(object.value) + }, + toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { + return { + type: 'cosmos-sdk/ClientUpdateProposal', + value: ClientUpdateProposal.toAmino(message) + } + }, + fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { + return ClientUpdateProposal.decode(message.value) + }, + toProto(message: ClientUpdateProposal): Uint8Array { + return ClientUpdateProposal.encode(message).finish() + }, + toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', + value: ClientUpdateProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ClientUpdateProposal.typeUrl, + ClientUpdateProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ClientUpdateProposal.aminoType, + ClientUpdateProposal.typeUrl +) +function createBaseUpgradeProposal(): UpgradeProposal { + return { + $typeUrl: '/ibc.core.client.v1.UpgradeProposal', + title: '', + description: '', + plan: Plan.fromPartial({}), + upgradedClientState: undefined + } +} +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) + } + 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): UpgradeProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpgradeProposal() + 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()) + break + default: + reader.skipType(tag & 7) + break + } + } + 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 + return message + }, + 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: UpgradeProposal): UpgradeProposalAmino { + const obj: any = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : 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: UpgradeProposalAminoMsg): UpgradeProposal { + return UpgradeProposal.fromAmino(object.value) + }, + toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { + return { + type: 'cosmos-sdk/UpgradeProposal', + value: UpgradeProposal.toAmino(message) + } + }, + fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { + return UpgradeProposal.decode(message.value) + }, + toProto(message: UpgradeProposal): Uint8Array { + return UpgradeProposal.encode(message).finish() + }, + toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.UpgradeProposal', + value: UpgradeProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(UpgradeProposal.typeUrl, UpgradeProposal) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpgradeProposal.aminoType, + UpgradeProposal.typeUrl +) diff --git a/src/proto/osmojs/ibc/core/client/v1/tx.amino.ts b/src/proto/osmojs/ibc/core/client/v1/tx.amino.ts new file mode 100644 index 0000000..8ff7662 --- /dev/null +++ b/src/proto/osmojs/ibc/core/client/v1/tx.amino.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgCreateClient, + MsgUpdateClient, + MsgUpgradeClient, + MsgSubmitMisbehaviour, + MsgRecoverClient, + MsgIBCSoftwareUpgrade, + MsgUpdateParams +} from './tx' +export const AminoConverter = { + '/ibc.core.client.v1.MsgCreateClient': { + aminoType: 'cosmos-sdk/MsgCreateClient', + toAmino: MsgCreateClient.toAmino, + fromAmino: MsgCreateClient.fromAmino + }, + '/ibc.core.client.v1.MsgUpdateClient': { + aminoType: 'cosmos-sdk/MsgUpdateClient', + toAmino: MsgUpdateClient.toAmino, + fromAmino: MsgUpdateClient.fromAmino + }, + '/ibc.core.client.v1.MsgUpgradeClient': { + aminoType: 'cosmos-sdk/MsgUpgradeClient', + toAmino: MsgUpgradeClient.toAmino, + fromAmino: MsgUpgradeClient.fromAmino + }, + '/ibc.core.client.v1.MsgSubmitMisbehaviour': { + 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 + } +} diff --git a/src/proto/osmojs/ibc/core/client/v1/tx.registry.ts b/src/proto/osmojs/ibc/core/client/v1/tx.registry.ts new file mode 100644 index 0000000..7364c93 --- /dev/null +++ b/src/proto/osmojs/ibc/core/client/v1/tx.registry.ts @@ -0,0 +1,160 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + createClient(value: MsgCreateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgCreateClient', + value: MsgCreateClient.encode(value).finish() + } + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpdateClient', + value: MsgUpdateClient.encode(value).finish() + } + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClient', + value: MsgUpgradeClient.encode(value).finish() + } + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + 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: { + createClient(value: MsgCreateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgCreateClient', + value + } + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpdateClient', + value + } + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClient', + value + } + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + 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: { + createClient(value: MsgCreateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgCreateClient', + value: MsgCreateClient.fromPartial(value) + } + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpdateClient', + value: MsgUpdateClient.fromPartial(value) + } + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClient', + value: MsgUpgradeClient.fromPartial(value) + } + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + 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) + } + } + } +} diff --git a/src/proto/osmojs/ibc/core/client/v1/tx.ts b/src/proto/osmojs/ibc/core/client/v1/tx.ts new file mode 100644 index 0000000..8f392d9 --- /dev/null +++ b/src/proto/osmojs/ibc/core/client/v1/tx.ts @@ -0,0 +1,2059 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { + Plan, + PlanAmino, + PlanSDKType +} from '../../../../cosmos/upgrade/v1beta1/upgrade' +import { Params, ParamsAmino, ParamsSDKType } from './client' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../../../helpers' +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any + /** signer address */ + signer: string +} +export interface MsgCreateClientProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgCreateClient' + value: Uint8Array +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientAmino { + /** light client state */ + client_state?: AnyAmino + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensus_state?: AnyAmino + /** signer address */ + signer?: string +} +export interface MsgCreateClientAminoMsg { + type: 'cosmos-sdk/MsgCreateClient' + value: MsgCreateClientAmino +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientSDKType { + client_state?: AnySDKType + consensus_state?: AnySDKType + signer: string +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse {} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgCreateClientResponse' + value: Uint8Array +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino {} +export interface MsgCreateClientResponseAminoMsg { + type: 'cosmos-sdk/MsgCreateClientResponse' + value: MsgCreateClientResponseAmino +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseSDKType {} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string + /** client message to update the light client */ + clientMessage?: Any + /** signer address */ + signer: string +} +export interface MsgUpdateClientProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgUpdateClient' + value: Uint8Array +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id?: string + /** client message to update the light client */ + client_message?: AnyAmino + /** signer address */ + signer?: string +} +export interface MsgUpdateClientAminoMsg { + type: 'cosmos-sdk/MsgUpdateClient' + value: MsgUpdateClientAmino +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientSDKType { + client_id: string + client_message?: AnySDKType + signer: string +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} +export interface MsgUpdateClientResponseProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgUpdateClientResponse' + value: Uint8Array +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseAmino {} +export interface MsgUpdateClientResponseAminoMsg { + type: 'cosmos-sdk/MsgUpdateClientResponse' + value: MsgUpdateClientResponseAmino +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseSDKType {} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string + /** upgraded client state */ + clientState?: Any + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState?: Any + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array + /** signer address */ + signer: string +} +export interface MsgUpgradeClientProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClient' + value: Uint8Array +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientAmino { + /** client unique identifier */ + client_id?: string + /** upgraded client state */ + client_state?: AnyAmino + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensus_state?: AnyAmino + /** proof that old chain committed to new client */ + proof_upgrade_client?: string + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state?: string + /** signer address */ + signer?: string +} +export interface MsgUpgradeClientAminoMsg { + type: 'cosmos-sdk/MsgUpgradeClient' + value: MsgUpgradeClientAmino +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientSDKType { + client_id: string + client_state?: AnySDKType + consensus_state?: AnySDKType + proof_upgrade_client: Uint8Array + proof_upgrade_consensus_state: Uint8Array + signer: string +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} +export interface MsgUpgradeClientResponseProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClientResponse' + value: Uint8Array +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseAmino {} +export interface MsgUpgradeClientResponseAminoMsg { + type: 'cosmos-sdk/MsgUpgradeClientResponse' + value: MsgUpgradeClientResponseAmino +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseSDKType {} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviour { + /** client unique identifier */ + clientId: string + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any + /** signer address */ + signer: string +} +export interface MsgSubmitMisbehaviourProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgSubmitMisbehaviour' + value: Uint8Array +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviourAmino { + /** client unique identifier */ + client_id?: string + /** misbehaviour used for freezing the light client */ + misbehaviour?: AnyAmino + /** signer address */ + signer?: string +} +export interface MsgSubmitMisbehaviourAminoMsg { + type: 'cosmos-sdk/MsgSubmitMisbehaviour' + value: MsgSubmitMisbehaviourAmino +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviourSDKType { + client_id: string + misbehaviour?: AnySDKType + signer: string +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse {} +export interface MsgSubmitMisbehaviourResponseProtoMsg { + typeUrl: '/ibc.core.client.v1.MsgSubmitMisbehaviourResponse' + value: Uint8Array +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseAmino {} +export interface MsgSubmitMisbehaviourResponseAminoMsg { + type: 'cosmos-sdk/MsgSubmitMisbehaviourResponse' + value: MsgSubmitMisbehaviourResponseAmino +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * 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, + consensusState: undefined, + signer: '' + } +} +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() + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(26).string(message.signer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateClient() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()) + break + case 2: + message.consensusState = Any.decode(reader, reader.uint32()) + break + case 3: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateClient { + const message = createBaseMsgCreateClient() + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined + message.consensusState = + object.consensusState !== undefined && object.consensusState !== null + ? Any.fromPartial(object.consensusState) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgCreateClientAmino): MsgCreateClient { + 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 = {} + obj.client_state = message.clientState + ? Any.toAmino(message.clientState) + : undefined + obj.consensus_state = message.consensusState + ? Any.toAmino(message.consensusState) + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { + return MsgCreateClient.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateClient): MsgCreateClientAminoMsg { + return { + type: 'cosmos-sdk/MsgCreateClient', + value: MsgCreateClient.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreateClientProtoMsg): MsgCreateClient { + return MsgCreateClient.decode(message.value) + }, + toProto(message: MsgCreateClient): Uint8Array { + return MsgCreateClient.encode(message).finish() + }, + toProtoMsg(message: MsgCreateClient): MsgCreateClientProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgCreateClient', + value: MsgCreateClient.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateClientResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateClientResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse() + return message + }, + fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse() + return message + }, + toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgCreateClientResponseAminoMsg + ): MsgCreateClientResponse { + return MsgCreateClientResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateClientResponse + ): MsgCreateClientResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgCreateClientResponse', + value: MsgCreateClientResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateClientResponseProtoMsg + ): MsgCreateClientResponse { + return MsgCreateClientResponse.decode(message.value) + }, + toProto(message: MsgCreateClientResponse): Uint8Array { + return MsgCreateClientResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateClientResponse + ): MsgCreateClientResponseProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgCreateClientResponse', + value: MsgCreateClientResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateClientResponse.typeUrl, + MsgCreateClientResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateClientResponse.aminoType, + MsgCreateClientResponse.typeUrl +) +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { + clientId: '', + clientMessage: undefined, + signer: '' + } +} +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) + } + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(26).string(message.signer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpdateClient() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.clientMessage = Any.decode(reader, reader.uint32()) + break + case 3: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUpdateClient { + const message = createBaseMsgUpdateClient() + message.clientId = object.clientId ?? '' + message.clientMessage = + object.clientMessage !== undefined && object.clientMessage !== null + ? Any.fromPartial(object.clientMessage) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.client_message = message.clientMessage + ? Any.toAmino(message.clientMessage) + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { + return MsgUpdateClient.fromAmino(object.value) + }, + toAminoMsg(message: MsgUpdateClient): MsgUpdateClientAminoMsg { + return { + type: 'cosmos-sdk/MsgUpdateClient', + value: MsgUpdateClient.toAmino(message) + } + }, + fromProtoMsg(message: MsgUpdateClientProtoMsg): MsgUpdateClient { + return MsgUpdateClient.decode(message.value) + }, + toProto(message: MsgUpdateClient): Uint8Array { + return MsgUpdateClient.encode(message).finish() + }, + toProtoMsg(message: MsgUpdateClient): MsgUpdateClientProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgUpdateClient', + value: MsgUpdateClient.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpdateClientResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpdateClientResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse() + return message + }, + fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse() + return message + }, + toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgUpdateClientResponseAminoMsg + ): MsgUpdateClientResponse { + return MsgUpdateClientResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUpdateClientResponse + ): MsgUpdateClientResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgUpdateClientResponse', + value: MsgUpdateClientResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUpdateClientResponseProtoMsg + ): MsgUpdateClientResponse { + return MsgUpdateClientResponse.decode(message.value) + }, + toProto(message: MsgUpdateClientResponse): Uint8Array { + return MsgUpdateClientResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUpdateClientResponse + ): MsgUpdateClientResponseProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgUpdateClientResponse', + value: MsgUpdateClientResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUpdateClientResponse.typeUrl, + MsgUpdateClientResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpdateClientResponse.aminoType, + MsgUpdateClientResponse.typeUrl +) +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: '', + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: '' + } +} +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) + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim() + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim() + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient) + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState) + } + if (message.signer !== '') { + writer.uint32(50).string(message.signer) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpgradeClient() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.clientState = Any.decode(reader, reader.uint32()) + break + case 3: + message.consensusState = Any.decode(reader, reader.uint32()) + break + case 4: + message.proofUpgradeClient = reader.bytes() + break + case 5: + message.proofUpgradeConsensusState = reader.bytes() + break + case 6: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient() + message.clientId = object.clientId ?? '' + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined + message.consensusState = + object.consensusState !== undefined && object.consensusState !== null + ? Any.fromPartial(object.consensusState) + : undefined + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array() + message.proofUpgradeConsensusState = + object.proofUpgradeConsensusState ?? new Uint8Array() + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { + 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 === '' ? undefined : 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 + ? base64FromBytes(message.proofUpgradeClient) + : undefined + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState + ? base64FromBytes(message.proofUpgradeConsensusState) + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { + return MsgUpgradeClient.fromAmino(object.value) + }, + toAminoMsg(message: MsgUpgradeClient): MsgUpgradeClientAminoMsg { + return { + type: 'cosmos-sdk/MsgUpgradeClient', + value: MsgUpgradeClient.toAmino(message) + } + }, + fromProtoMsg(message: MsgUpgradeClientProtoMsg): MsgUpgradeClient { + return MsgUpgradeClient.decode(message.value) + }, + toProto(message: MsgUpgradeClient): Uint8Array { + return MsgUpgradeClient.encode(message).finish() + }, + toProtoMsg(message: MsgUpgradeClient): MsgUpgradeClientProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClient', + value: MsgUpgradeClient.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpgradeClientResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpgradeClientResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse() + return message + }, + fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse() + return message + }, + toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgUpgradeClientResponseAminoMsg + ): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUpgradeClientResponse + ): MsgUpgradeClientResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgUpgradeClientResponse', + value: MsgUpgradeClientResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUpgradeClientResponseProtoMsg + ): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.decode(message.value) + }, + toProto(message: MsgUpgradeClientResponse): Uint8Array { + return MsgUpgradeClientResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUpgradeClientResponse + ): MsgUpgradeClientResponseProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgUpgradeClientResponse', + value: MsgUpgradeClientResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUpgradeClientResponse.typeUrl, + MsgUpgradeClientResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUpgradeClientResponse.aminoType, + MsgUpgradeClientResponse.typeUrl +) +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { + clientId: '', + misbehaviour: undefined, + signer: '' + } +} +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) + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(26).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSubmitMisbehaviour { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitMisbehaviour() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()) + break + case 3: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour() + message.clientId = object.clientId ?? '' + message.misbehaviour = + object.misbehaviour !== undefined && object.misbehaviour !== null + ? Any.fromPartial(object.misbehaviour) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.misbehaviour = message.misbehaviour + ? Any.toAmino(message.misbehaviour) + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.fromAmino(object.value) + }, + toAminoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAminoMsg { + return { + type: 'cosmos-sdk/MsgSubmitMisbehaviour', + value: MsgSubmitMisbehaviour.toAmino(message) + } + }, + fromProtoMsg(message: MsgSubmitMisbehaviourProtoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.decode(message.value) + }, + toProto(message: MsgSubmitMisbehaviour): Uint8Array { + return MsgSubmitMisbehaviour.encode(message).finish() + }, + toProtoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgSubmitMisbehaviour', + value: MsgSubmitMisbehaviour.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSubmitMisbehaviourResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitMisbehaviourResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse() + return message + }, + fromAmino( + _: MsgSubmitMisbehaviourResponseAmino + ): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse() + return message + }, + toAmino( + _: MsgSubmitMisbehaviourResponse + ): MsgSubmitMisbehaviourResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSubmitMisbehaviourResponseAminoMsg + ): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSubmitMisbehaviourResponse + ): MsgSubmitMisbehaviourResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgSubmitMisbehaviourResponse', + value: MsgSubmitMisbehaviourResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSubmitMisbehaviourResponseProtoMsg + ): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.decode(message.value) + }, + toProto(message: MsgSubmitMisbehaviourResponse): Uint8Array { + return MsgSubmitMisbehaviourResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSubmitMisbehaviourResponse + ): MsgSubmitMisbehaviourResponseProtoMsg { + return { + typeUrl: '/ibc.core.client.v1.MsgSubmitMisbehaviourResponse', + value: MsgSubmitMisbehaviourResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.subjectClientId + obj.substitute_client_id = + message.substituteClientId === '' ? undefined : message.substituteClientId + obj.signer = message.signer === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/ibc/core/commitment/v1/commitment.ts b/src/proto/osmojs/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 0000000..228d197 --- /dev/null +++ b/src/proto/osmojs/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,565 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + CommitmentProof, + CommitmentProofAmino, + CommitmentProofSDKType +} from '../../../../cosmos/ics23/v1/proofs' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { 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. + */ +export interface MerkleRoot { + hash: Uint8Array +} +export interface MerkleRootProtoMsg { + typeUrl: '/ibc.core.commitment.v1.MerkleRoot' + value: Uint8Array +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootAmino { + hash?: string +} +export interface MerkleRootAminoMsg { + type: 'cosmos-sdk/MerkleRoot' + value: MerkleRootAmino +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootSDKType { + hash: Uint8Array +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array +} +export interface MerklePrefixProtoMsg { + typeUrl: '/ibc.core.commitment.v1.MerklePrefix' + value: Uint8Array +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixAmino { + key_prefix?: string +} +export interface MerklePrefixAminoMsg { + type: 'cosmos-sdk/MerklePrefix' + value: MerklePrefixAmino +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixSDKType { + key_prefix: Uint8Array +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePath { + keyPath: string[] +} +export interface MerklePathProtoMsg { + typeUrl: '/ibc.core.commitment.v1.MerklePath' + value: Uint8Array +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathAmino { + key_path?: string[] +} +export interface MerklePathAminoMsg { + type: 'cosmos-sdk/MerklePath' + value: MerklePathAmino +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathSDKType { + key_path: string[] +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[] +} +export interface MerkleProofProtoMsg { + typeUrl: '/ibc.core.commitment.v1.MerkleProof' + value: Uint8Array +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofAmino { + proofs?: CommitmentProofAmino[] +} +export interface MerkleProofAminoMsg { + type: 'cosmos-sdk/MerkleProof' + value: MerkleProofAmino +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofSDKType { + proofs: CommitmentProofSDKType[] +} +function createBaseMerkleRoot(): MerkleRoot { + return { + hash: new Uint8Array() + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleRoot { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMerkleRoot() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MerkleRoot { + const message = createBaseMerkleRoot() + message.hash = object.hash ?? new Uint8Array() + return message + }, + fromAmino(object: MerkleRootAmino): MerkleRoot { + 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 ? base64FromBytes(message.hash) : undefined + return obj + }, + fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { + return MerkleRoot.fromAmino(object.value) + }, + toAminoMsg(message: MerkleRoot): MerkleRootAminoMsg { + return { + type: 'cosmos-sdk/MerkleRoot', + value: MerkleRoot.toAmino(message) + } + }, + fromProtoMsg(message: MerkleRootProtoMsg): MerkleRoot { + return MerkleRoot.decode(message.value) + }, + toProto(message: MerkleRoot): Uint8Array { + return MerkleRoot.encode(message).finish() + }, + toProtoMsg(message: MerkleRoot): MerkleRootProtoMsg { + return { + typeUrl: '/ibc.core.commitment.v1.MerkleRoot', + value: MerkleRoot.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MerkleRoot.typeUrl, MerkleRoot) +GlobalDecoderRegistry.registerAminoProtoMapping( + MerkleRoot.aminoType, + MerkleRoot.typeUrl +) +function createBaseMerklePrefix(): MerklePrefix { + return { + keyPrefix: new Uint8Array() + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePrefix { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMerklePrefix() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MerklePrefix { + const message = createBaseMerklePrefix() + message.keyPrefix = object.keyPrefix ?? new Uint8Array() + return message + }, + fromAmino(object: MerklePrefixAmino): MerklePrefix { + 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 + ? base64FromBytes(message.keyPrefix) + : undefined + return obj + }, + fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { + return MerklePrefix.fromAmino(object.value) + }, + toAminoMsg(message: MerklePrefix): MerklePrefixAminoMsg { + return { + type: 'cosmos-sdk/MerklePrefix', + value: MerklePrefix.toAmino(message) + } + }, + fromProtoMsg(message: MerklePrefixProtoMsg): MerklePrefix { + return MerklePrefix.decode(message.value) + }, + toProto(message: MerklePrefix): Uint8Array { + return MerklePrefix.encode(message).finish() + }, + toProtoMsg(message: MerklePrefix): MerklePrefixProtoMsg { + return { + typeUrl: '/ibc.core.commitment.v1.MerklePrefix', + value: MerklePrefix.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MerklePrefix.typeUrl, MerklePrefix) +GlobalDecoderRegistry.registerAminoProtoMapping( + MerklePrefix.aminoType, + MerklePrefix.typeUrl +) +function createBaseMerklePath(): MerklePath { + return { + keyPath: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerklePath { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMerklePath() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MerklePath { + const message = createBaseMerklePath() + message.keyPath = object.keyPath?.map((e) => e) || [] + return message + }, + fromAmino(object: MerklePathAmino): MerklePath { + const message = createBaseMerklePath() + message.keyPath = object.key_path?.map((e) => e) || [] + return message + }, + toAmino(message: MerklePath): MerklePathAmino { + const obj: any = {} + if (message.keyPath) { + obj.key_path = message.keyPath.map((e) => e) + } else { + obj.key_path = message.keyPath + } + return obj + }, + fromAminoMsg(object: MerklePathAminoMsg): MerklePath { + return MerklePath.fromAmino(object.value) + }, + toAminoMsg(message: MerklePath): MerklePathAminoMsg { + return { + type: 'cosmos-sdk/MerklePath', + value: MerklePath.toAmino(message) + } + }, + fromProtoMsg(message: MerklePathProtoMsg): MerklePath { + return MerklePath.decode(message.value) + }, + toProto(message: MerklePath): Uint8Array { + return MerklePath.encode(message).finish() + }, + toProtoMsg(message: MerklePath): MerklePathProtoMsg { + return { + typeUrl: '/ibc.core.commitment.v1.MerklePath', + value: MerklePath.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MerklePath.typeUrl, MerklePath) +GlobalDecoderRegistry.registerAminoProtoMapping( + MerklePath.aminoType, + MerklePath.typeUrl +) +function createBaseMerkleProof(): MerkleProof { + return { + proofs: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MerkleProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMerkleProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MerkleProof { + const message = createBaseMerkleProof() + message.proofs = + object.proofs?.map((e) => CommitmentProof.fromPartial(e)) || [] + return message + }, + fromAmino(object: MerkleProofAmino): MerkleProof { + const message = createBaseMerkleProof() + message.proofs = + object.proofs?.map((e) => CommitmentProof.fromAmino(e)) || [] + return message + }, + toAmino(message: MerkleProof): MerkleProofAmino { + const obj: any = {} + if (message.proofs) { + obj.proofs = message.proofs.map((e) => + e ? CommitmentProof.toAmino(e) : undefined + ) + } else { + obj.proofs = message.proofs + } + return obj + }, + fromAminoMsg(object: MerkleProofAminoMsg): MerkleProof { + return MerkleProof.fromAmino(object.value) + }, + toAminoMsg(message: MerkleProof): MerkleProofAminoMsg { + return { + type: 'cosmos-sdk/MerkleProof', + value: MerkleProof.toAmino(message) + } + }, + fromProtoMsg(message: MerkleProofProtoMsg): MerkleProof { + return MerkleProof.decode(message.value) + }, + toProto(message: MerkleProof): Uint8Array { + return MerkleProof.encode(message).finish() + }, + toProtoMsg(message: MerkleProof): MerkleProofProtoMsg { + return { + typeUrl: '/ibc.core.commitment.v1.MerkleProof', + value: MerkleProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MerkleProof.typeUrl, MerkleProof) +GlobalDecoderRegistry.registerAminoProtoMapping( + MerkleProof.aminoType, + MerkleProof.typeUrl +) diff --git a/src/proto/osmojs/ibc/core/connection/v1/connection.ts b/src/proto/osmojs/ibc/core/connection/v1/connection.ts new file mode 100644 index 0000000..dd70a88 --- /dev/null +++ b/src/proto/osmojs/ibc/core/connection/v1/connection.ts @@ -0,0 +1,1335 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MerklePrefix, + MerklePrefixAmino, + MerklePrefixSDKType +} from '../../commitment/v1/commitment' +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. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1 +} +export const StateSDKType = State +export const StateAmino = State +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case 'STATE_UNINITIALIZED_UNSPECIFIED': + return State.STATE_UNINITIALIZED_UNSPECIFIED + case 1: + case 'STATE_INIT': + return State.STATE_INIT + case 2: + case 'STATE_TRYOPEN': + return State.STATE_TRYOPEN + case 3: + case 'STATE_OPEN': + return State.STATE_OPEN + case -1: + case 'UNRECOGNIZED': + default: + return State.UNRECOGNIZED + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return 'STATE_UNINITIALIZED_UNSPECIFIED' + case State.STATE_INIT: + return 'STATE_INIT' + case State.STATE_TRYOPEN: + return 'STATE_TRYOPEN' + case State.STATE_OPEN: + return 'STATE_OPEN' + case State.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[] + /** current state of the connection end. */ + state: State + /** counterparty chain associated with this connection. */ + counterparty: Counterparty + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delayPeriod: bigint +} +export interface ConnectionEndProtoMsg { + typeUrl: '/ibc.core.connection.v1.ConnectionEnd' + value: Uint8Array +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndAmino { + /** client associated with this connection. */ + client_id?: string + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions?: VersionAmino[] + /** current state of the connection end. */ + state?: State + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delay_period?: string +} +export interface ConnectionEndAminoMsg { + type: 'cosmos-sdk/ConnectionEnd' + value: ConnectionEndAmino +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndSDKType { + client_id: string + versions: VersionSDKType[] + state: State + counterparty: CounterpartySDKType + delay_period: bigint +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string + /** client associated with this connection. */ + clientId: string + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[] + /** current state of the connection end. */ + state: State + /** counterparty chain associated with this connection. */ + counterparty: Counterparty + /** delay period associated with this connection. */ + delayPeriod: bigint +} +export interface IdentifiedConnectionProtoMsg { + typeUrl: '/ibc.core.connection.v1.IdentifiedConnection' + value: Uint8Array +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionAmino { + /** connection identifier. */ + id?: string + /** client associated with this connection. */ + client_id?: string + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions?: VersionAmino[] + /** current state of the connection end. */ + state?: State + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino + /** delay period associated with this connection. */ + delay_period?: string +} +export interface IdentifiedConnectionAminoMsg { + type: 'cosmos-sdk/IdentifiedConnection' + value: IdentifiedConnectionAmino +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionSDKType { + id: string + client_id: string + versions: VersionSDKType[] + state: State + counterparty: CounterpartySDKType + delay_period: bigint +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix +} +export interface CounterpartyProtoMsg { + typeUrl: '/ibc.core.connection.v1.Counterparty' + value: Uint8Array +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartyAmino { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id?: string + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id?: string + /** commitment merkle prefix of the counterparty chain. */ + prefix?: MerklePrefixAmino +} +export interface CounterpartyAminoMsg { + type: 'cosmos-sdk/Counterparty' + value: CounterpartyAmino +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartySDKType { + client_id: string + connection_id: string + prefix: MerklePrefixSDKType +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[] +} +export interface ClientPathsProtoMsg { + typeUrl: '/ibc.core.connection.v1.ClientPaths' + value: Uint8Array +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsAmino { + /** list of connection paths */ + paths?: string[] +} +export interface ClientPathsAminoMsg { + type: 'cosmos-sdk/ClientPaths' + value: ClientPathsAmino +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsSDKType { + paths: string[] +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string + /** list of connection paths */ + paths: string[] +} +export interface ConnectionPathsProtoMsg { + typeUrl: '/ibc.core.connection.v1.ConnectionPaths' + value: Uint8Array +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsAmino { + /** client state unique identifier */ + client_id?: string + /** list of connection paths */ + paths?: string[] +} +export interface ConnectionPathsAminoMsg { + type: 'cosmos-sdk/ConnectionPaths' + value: ConnectionPathsAmino +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsSDKType { + client_id: string + paths: string[] +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string + /** list of features compatible with the specified identifier */ + features: string[] +} +export interface VersionProtoMsg { + typeUrl: '/ibc.core.connection.v1.Version' + value: Uint8Array +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface VersionAmino { + /** unique version identifier */ + identifier?: string + /** list of features compatible with the specified identifier */ + features?: string[] +} +export interface VersionAminoMsg { + type: 'cosmos-sdk/Version' + value: VersionAmino +} +/** + * Version defines the versioning scheme used to negotiate the IBC version in + * the connection handshake. + */ +export interface VersionSDKType { + identifier: string + features: string[] +} +/** Params defines the set of Connection parameters. */ +export interface Params { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * 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. + */ + maxExpectedTimePerBlock: bigint +} +export interface ParamsProtoMsg { + typeUrl: '/ibc.core.connection.v1.Params' + value: Uint8Array +} +/** Params defines the set of Connection parameters. */ +export interface ParamsAmino { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * 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 +} +export interface ParamsAminoMsg { + type: 'cosmos-sdk/Params' + value: ParamsAmino +} +/** Params defines the set of Connection parameters. */ +export interface ParamsSDKType { + max_expected_time_per_block: bigint +} +function createBaseConnectionEnd(): ConnectionEnd { + return { + clientId: '', + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + } +} +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) + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state) + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(34).fork() + ).ldelim() + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionEnd { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConnectionEnd() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.versions.push(Version.decode(reader, reader.uint32())) + break + case 3: + message.state = reader.int32() as any + break + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 5: + message.delayPeriod = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ConnectionEnd { + const message = createBaseConnectionEnd() + message.clientId = object.clientId ?? '' + message.versions = object.versions?.map((e) => Version.fromPartial(e)) || [] + message.state = object.state ?? 0 + message.counterparty = + object.counterparty !== undefined && object.counterparty !== null + ? Counterparty.fromPartial(object.counterparty) + : undefined + message.delayPeriod = + object.delayPeriod !== undefined && object.delayPeriod !== null + ? BigInt(object.delayPeriod.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ConnectionEndAmino): ConnectionEnd { + 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 = 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + if (message.versions) { + obj.versions = message.versions.map((e) => + e ? Version.toAmino(e) : undefined + ) + } else { + obj.versions = message.versions + } + obj.state = message.state === 0 ? undefined : message.state + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + obj.delay_period = + message.delayPeriod !== BigInt(0) + ? message.delayPeriod.toString() + : undefined + return obj + }, + fromAminoMsg(object: ConnectionEndAminoMsg): ConnectionEnd { + return ConnectionEnd.fromAmino(object.value) + }, + toAminoMsg(message: ConnectionEnd): ConnectionEndAminoMsg { + return { + type: 'cosmos-sdk/ConnectionEnd', + value: ConnectionEnd.toAmino(message) + } + }, + fromProtoMsg(message: ConnectionEndProtoMsg): ConnectionEnd { + return ConnectionEnd.decode(message.value) + }, + toProto(message: ConnectionEnd): Uint8Array { + return ConnectionEnd.encode(message).finish() + }, + toProtoMsg(message: ConnectionEnd): ConnectionEndProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.ConnectionEnd', + value: ConnectionEnd.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ConnectionEnd.typeUrl, ConnectionEnd) +GlobalDecoderRegistry.registerAminoProtoMapping( + ConnectionEnd.aminoType, + ConnectionEnd.typeUrl +) +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { + id: '', + clientId: '', + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + } +} +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) + } + if (message.clientId !== '') { + writer.uint32(18).string(message.clientId) + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim() + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state) + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(42).fork() + ).ldelim() + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(48).uint64(message.delayPeriod) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): IdentifiedConnection { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseIdentifiedConnection() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.id = reader.string() + break + case 2: + message.clientId = reader.string() + break + case 3: + message.versions.push(Version.decode(reader, reader.uint32())) + break + case 4: + message.state = reader.int32() as any + break + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 6: + message.delayPeriod = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): IdentifiedConnection { + const message = createBaseIdentifiedConnection() + message.id = object.id ?? '' + message.clientId = object.clientId ?? '' + message.versions = object.versions?.map((e) => Version.fromPartial(e)) || [] + message.state = object.state ?? 0 + message.counterparty = + object.counterparty !== undefined && object.counterparty !== null + ? Counterparty.fromPartial(object.counterparty) + : undefined + message.delayPeriod = + object.delayPeriod !== undefined && object.delayPeriod !== null + ? BigInt(object.delayPeriod.toString()) + : BigInt(0) + return message + }, + fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { + 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 = 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 = {} + obj.id = message.id === '' ? undefined : message.id + obj.client_id = message.clientId === '' ? undefined : message.clientId + if (message.versions) { + obj.versions = message.versions.map((e) => + e ? Version.toAmino(e) : undefined + ) + } else { + obj.versions = message.versions + } + obj.state = message.state === 0 ? undefined : message.state + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + obj.delay_period = + message.delayPeriod !== BigInt(0) + ? message.delayPeriod.toString() + : undefined + return obj + }, + fromAminoMsg(object: IdentifiedConnectionAminoMsg): IdentifiedConnection { + return IdentifiedConnection.fromAmino(object.value) + }, + toAminoMsg(message: IdentifiedConnection): IdentifiedConnectionAminoMsg { + return { + type: 'cosmos-sdk/IdentifiedConnection', + value: IdentifiedConnection.toAmino(message) + } + }, + fromProtoMsg(message: IdentifiedConnectionProtoMsg): IdentifiedConnection { + return IdentifiedConnection.decode(message.value) + }, + toProto(message: IdentifiedConnection): Uint8Array { + return IdentifiedConnection.encode(message).finish() + }, + toProtoMsg(message: IdentifiedConnection): IdentifiedConnectionProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.IdentifiedConnection', + value: IdentifiedConnection.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + IdentifiedConnection.typeUrl, + IdentifiedConnection +) +GlobalDecoderRegistry.registerAminoProtoMapping( + IdentifiedConnection.aminoType, + IdentifiedConnection.typeUrl +) +function createBaseCounterparty(): Counterparty { + return { + clientId: '', + connectionId: '', + prefix: MerklePrefix.fromPartial({}) + } +} +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) + } + if (message.connectionId !== '') { + writer.uint32(18).string(message.connectionId) + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCounterparty() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.connectionId = reader.string() + break + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Counterparty { + const message = createBaseCounterparty() + message.clientId = object.clientId ?? '' + message.connectionId = object.connectionId ?? '' + message.prefix = + object.prefix !== undefined && object.prefix !== null + ? MerklePrefix.fromPartial(object.prefix) + : undefined + return message + }, + fromAmino(object: CounterpartyAmino): Counterparty { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.connection_id = + message.connectionId === '' ? undefined : message.connectionId + obj.prefix = message.prefix + ? MerklePrefix.toAmino(message.prefix) + : undefined + return obj + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value) + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: 'cosmos-sdk/Counterparty', + value: Counterparty.toAmino(message) + } + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value) + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish() + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.Counterparty', + value: Counterparty.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty) +GlobalDecoderRegistry.registerAminoProtoMapping( + Counterparty.aminoType, + Counterparty.typeUrl +) +function createBaseClientPaths(): ClientPaths { + return { + paths: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientPaths { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseClientPaths() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ClientPaths { + const message = createBaseClientPaths() + message.paths = object.paths?.map((e) => e) || [] + return message + }, + fromAmino(object: ClientPathsAmino): ClientPaths { + const message = createBaseClientPaths() + message.paths = object.paths?.map((e) => e) || [] + return message + }, + toAmino(message: ClientPaths): ClientPathsAmino { + const obj: any = {} + if (message.paths) { + obj.paths = message.paths.map((e) => e) + } else { + obj.paths = message.paths + } + return obj + }, + fromAminoMsg(object: ClientPathsAminoMsg): ClientPaths { + return ClientPaths.fromAmino(object.value) + }, + toAminoMsg(message: ClientPaths): ClientPathsAminoMsg { + return { + type: 'cosmos-sdk/ClientPaths', + value: ClientPaths.toAmino(message) + } + }, + fromProtoMsg(message: ClientPathsProtoMsg): ClientPaths { + return ClientPaths.decode(message.value) + }, + toProto(message: ClientPaths): Uint8Array { + return ClientPaths.encode(message).finish() + }, + toProtoMsg(message: ClientPaths): ClientPathsProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.ClientPaths', + value: ClientPaths.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ClientPaths.typeUrl, ClientPaths) +GlobalDecoderRegistry.registerAminoProtoMapping( + ClientPaths.aminoType, + ClientPaths.typeUrl +) +function createBaseConnectionPaths(): ConnectionPaths { + return { + clientId: '', + paths: [] + } +} +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) + } + for (const v of message.paths) { + writer.uint32(18).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionPaths { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConnectionPaths() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.paths.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ConnectionPaths { + const message = createBaseConnectionPaths() + message.clientId = object.clientId ?? '' + message.paths = object.paths?.map((e) => e) || [] + return message + }, + fromAmino(object: ConnectionPathsAmino): ConnectionPaths { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + if (message.paths) { + obj.paths = message.paths.map((e) => e) + } else { + obj.paths = message.paths + } + return obj + }, + fromAminoMsg(object: ConnectionPathsAminoMsg): ConnectionPaths { + return ConnectionPaths.fromAmino(object.value) + }, + toAminoMsg(message: ConnectionPaths): ConnectionPathsAminoMsg { + return { + type: 'cosmos-sdk/ConnectionPaths', + value: ConnectionPaths.toAmino(message) + } + }, + fromProtoMsg(message: ConnectionPathsProtoMsg): ConnectionPaths { + return ConnectionPaths.decode(message.value) + }, + toProto(message: ConnectionPaths): Uint8Array { + return ConnectionPaths.encode(message).finish() + }, + toProtoMsg(message: ConnectionPaths): ConnectionPathsProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.ConnectionPaths', + value: ConnectionPaths.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ConnectionPaths.typeUrl, ConnectionPaths) +GlobalDecoderRegistry.registerAminoProtoMapping( + ConnectionPaths.aminoType, + ConnectionPaths.typeUrl +) +function createBaseVersion(): Version { + return { + identifier: '', + features: [] + } +} +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) + } + for (const v of message.features) { + writer.uint32(18).string(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Version { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVersion() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.identifier = reader.string() + break + case 2: + message.features.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Version { + const message = createBaseVersion() + message.identifier = object.identifier ?? '' + message.features = object.features?.map((e) => e) || [] + return message + }, + fromAmino(object: VersionAmino): Version { + 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 = {} + obj.identifier = message.identifier === '' ? undefined : message.identifier + if (message.features) { + obj.features = message.features.map((e) => e) + } else { + obj.features = message.features + } + return obj + }, + fromAminoMsg(object: VersionAminoMsg): Version { + return Version.fromAmino(object.value) + }, + toAminoMsg(message: Version): VersionAminoMsg { + return { + type: 'cosmos-sdk/Version', + value: Version.toAmino(message) + } + }, + fromProtoMsg(message: VersionProtoMsg): Version { + return Version.decode(message.value) + }, + toProto(message: Version): Uint8Array { + return Version.encode(message).finish() + }, + toProtoMsg(message: Version): VersionProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.Version', + value: Version.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Version.typeUrl, Version) +GlobalDecoderRegistry.registerAminoProtoMapping( + Version.aminoType, + Version.typeUrl +) +function createBaseParams(): Params { + return { + maxExpectedTimePerBlock: BigInt(0) + } +} +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) + } + 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.maxExpectedTimePerBlock = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + obj.max_expected_time_per_block = + message.maxExpectedTimePerBlock !== BigInt(0) + ? message.maxExpectedTimePerBlock.toString() + : 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.connection.v1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) diff --git a/src/proto/osmojs/ibc/core/connection/v1/tx.amino.ts b/src/proto/osmojs/ibc/core/connection/v1/tx.amino.ts new file mode 100644 index 0000000..37e6d65 --- /dev/null +++ b/src/proto/osmojs/ibc/core/connection/v1/tx.amino.ts @@ -0,0 +1,36 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgConnectionOpenInit, + MsgConnectionOpenTry, + MsgConnectionOpenAck, + MsgConnectionOpenConfirm, + MsgUpdateParams +} from './tx' +export const AminoConverter = { + '/ibc.core.connection.v1.MsgConnectionOpenInit': { + aminoType: 'cosmos-sdk/MsgConnectionOpenInit', + toAmino: MsgConnectionOpenInit.toAmino, + fromAmino: MsgConnectionOpenInit.fromAmino + }, + '/ibc.core.connection.v1.MsgConnectionOpenTry': { + aminoType: 'cosmos-sdk/MsgConnectionOpenTry', + toAmino: MsgConnectionOpenTry.toAmino, + fromAmino: MsgConnectionOpenTry.fromAmino + }, + '/ibc.core.connection.v1.MsgConnectionOpenAck': { + aminoType: 'cosmos-sdk/MsgConnectionOpenAck', + toAmino: MsgConnectionOpenAck.toAmino, + fromAmino: MsgConnectionOpenAck.fromAmino + }, + '/ibc.core.connection.v1.MsgConnectionOpenConfirm': { + 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 + } +} diff --git a/src/proto/osmojs/ibc/core/connection/v1/tx.registry.ts b/src/proto/osmojs/ibc/core/connection/v1/tx.registry.ts new file mode 100644 index 0000000..73c71dc --- /dev/null +++ b/src/proto/osmojs/ibc/core/connection/v1/tx.registry.ts @@ -0,0 +1,123 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInit', + value: MsgConnectionOpenInit.encode(value).finish() + } + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTry', + value: MsgConnectionOpenTry.encode(value).finish() + } + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAck', + value: MsgConnectionOpenAck.encode(value).finish() + } + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + 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: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInit', + value + } + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTry', + value + } + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAck', + value + } + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirm', + value + } + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.core.connection.v1.MsgUpdateParams', + value + } + } + }, + fromPartial: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInit', + value: MsgConnectionOpenInit.fromPartial(value) + } + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTry', + value: MsgConnectionOpenTry.fromPartial(value) + } + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAck', + value: MsgConnectionOpenAck.fromPartial(value) + } + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirm', + value: MsgConnectionOpenConfirm.fromPartial(value) + } + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: '/ibc.core.connection.v1.MsgUpdateParams', + value: MsgUpdateParams.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/ibc/core/connection/v1/tx.ts b/src/proto/osmojs/ibc/core/connection/v1/tx.ts new file mode 100644 index 0000000..910727e --- /dev/null +++ b/src/proto/osmojs/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1988 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Counterparty, + CounterpartyAmino, + CounterpartySDKType, + Version, + VersionAmino, + VersionSDKType +} from './connection' +import { Any, AnyAmino, AnySDKType } from 'cosmjs-types/google/protobuf/any' +import { + Height, + HeightAmino, + HeightSDKType, + Params, + ParamsAmino, + ParamsSDKType +} from '../../client/v1/client' +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../../../helpers' +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string + counterparty: Counterparty + version?: Version + delayPeriod: bigint + signer: string +} +export interface MsgConnectionOpenInitProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInit' + value: Uint8Array +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitAmino { + client_id?: string + counterparty?: CounterpartyAmino + version?: VersionAmino + delay_period?: string + signer?: string +} +export interface MsgConnectionOpenInitAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenInit' + value: MsgConnectionOpenInitAmino +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitSDKType { + client_id: string + counterparty: CounterpartySDKType + version?: VersionSDKType + delay_period: bigint + signer: string +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse {} +export interface MsgConnectionOpenInitResponseProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInitResponse' + value: Uint8Array +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseAmino {} +export interface MsgConnectionOpenInitResponseAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenInitResponse' + value: MsgConnectionOpenInitResponseAmino +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseSDKType {} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previousConnectionId: string + clientState?: Any + counterparty: Counterparty + delayPeriod: bigint + counterpartyVersions: Version[] + proofHeight: Height + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proofInit: Uint8Array + /** proof of client state included in message */ + proofClient: Uint8Array + /** proof of client consensus state */ + proofConsensus: Uint8Array + consensusHeight: Height + signer: string + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array +} +export interface MsgConnectionOpenTryProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTry' + value: Uint8Array +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTryAmino { + client_id?: string + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previous_connection_id?: string + client_state?: AnyAmino + counterparty?: CounterpartyAmino + delay_period?: string + counterparty_versions?: VersionAmino[] + proof_height?: HeightAmino + /** + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> + * INIT` + */ + proof_init?: string + /** proof of client state included in message */ + proof_client?: string + /** proof of client consensus state */ + proof_consensus?: string + consensus_height?: HeightAmino + signer?: string + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string +} +export interface MsgConnectionOpenTryAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenTry' + value: MsgConnectionOpenTryAmino +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTrySDKType { + client_id: string + /** @deprecated */ + previous_connection_id: string + client_state?: AnySDKType + counterparty: CounterpartySDKType + delay_period: bigint + counterparty_versions: VersionSDKType[] + proof_height: HeightSDKType + proof_init: Uint8Array + proof_client: Uint8Array + proof_consensus: Uint8Array + consensus_height: HeightSDKType + signer: string + host_consensus_state_proof: Uint8Array +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} +export interface MsgConnectionOpenTryResponseProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTryResponse' + value: Uint8Array +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseAmino {} +export interface MsgConnectionOpenTryResponseAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenTryResponse' + value: MsgConnectionOpenTryResponseAmino +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseSDKType {} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string + counterpartyConnectionId: string + version?: Version + clientState?: Any + proofHeight: Height + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array + /** proof of client state included in message */ + proofClient: Uint8Array + /** proof of client consensus state */ + proofConsensus: Uint8Array + consensusHeight: Height + signer: string + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array +} +export interface MsgConnectionOpenAckProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAck' + value: Uint8Array +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckAmino { + connection_id?: string + counterparty_connection_id?: string + version?: VersionAmino + client_state?: AnyAmino + proof_height?: HeightAmino + /** + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> + * TRYOPEN` + */ + proof_try?: string + /** proof of client state included in message */ + proof_client?: string + /** proof of client consensus state */ + proof_consensus?: string + consensus_height?: HeightAmino + signer?: string + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string +} +export interface MsgConnectionOpenAckAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenAck' + value: MsgConnectionOpenAckAmino +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckSDKType { + connection_id: string + counterparty_connection_id: string + version?: VersionSDKType + client_state?: AnySDKType + proof_height: HeightSDKType + proof_try: Uint8Array + proof_client: Uint8Array + proof_consensus: Uint8Array + consensus_height: HeightSDKType + signer: string + host_consensus_state_proof: Uint8Array +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} +export interface MsgConnectionOpenAckResponseProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAckResponse' + value: Uint8Array +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseAmino {} +export interface MsgConnectionOpenAckResponseAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenAckResponse' + value: MsgConnectionOpenAckResponseAmino +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseSDKType {} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array + proofHeight: Height + signer: string +} +export interface MsgConnectionOpenConfirmProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirm' + value: Uint8Array +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmAmino { + connection_id?: string + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proof_ack?: string + proof_height?: HeightAmino + signer?: string +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenConfirm' + value: MsgConnectionOpenConfirmAmino +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmSDKType { + connection_id: string + proof_ack: Uint8Array + proof_height: HeightSDKType + signer: string +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse {} +export interface MsgConnectionOpenConfirmResponseProtoMsg { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse' + value: Uint8Array +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseAmino {} +export interface MsgConnectionOpenConfirmResponseAminoMsg { + type: 'cosmos-sdk/MsgConnectionOpenConfirmResponse' + value: MsgConnectionOpenConfirmResponseAmino +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * 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: 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) + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(18).fork() + ).ldelim() + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim() + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(32).uint64(message.delayPeriod) + } + if (message.signer !== '') { + writer.uint32(42).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenInit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenInit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 3: + message.version = Version.decode(reader, reader.uint32()) + break + case 4: + message.delayPeriod = reader.uint64() + break + case 5: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit() + message.clientId = object.clientId ?? '' + message.counterparty = + object.counterparty !== undefined && object.counterparty !== null + ? Counterparty.fromPartial(object.counterparty) + : undefined + message.version = + object.version !== undefined && object.version !== null + ? Version.fromPartial(object.version) + : undefined + message.delayPeriod = + object.delayPeriod !== undefined && object.delayPeriod !== null + ? BigInt(object.delayPeriod.toString()) + : BigInt(0) + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + obj.version = message.version ? Version.toAmino(message.version) : undefined + obj.delay_period = + message.delayPeriod !== BigInt(0) + ? message.delayPeriod.toString() + : undefined + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg(object: MsgConnectionOpenInitAminoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.fromAmino(object.value) + }, + toAminoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenInit', + value: MsgConnectionOpenInit.toAmino(message) + } + }, + fromProtoMsg(message: MsgConnectionOpenInitProtoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.decode(message.value) + }, + toProto(message: MsgConnectionOpenInit): Uint8Array { + return MsgConnectionOpenInit.encode(message).finish() + }, + toProtoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInit', + value: MsgConnectionOpenInit.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenInitResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenInitResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse() + return message + }, + fromAmino( + _: MsgConnectionOpenInitResponseAmino + ): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse() + return message + }, + toAmino( + _: MsgConnectionOpenInitResponse + ): MsgConnectionOpenInitResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgConnectionOpenInitResponseAminoMsg + ): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgConnectionOpenInitResponse + ): MsgConnectionOpenInitResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenInitResponse', + value: MsgConnectionOpenInitResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgConnectionOpenInitResponseProtoMsg + ): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.decode(message.value) + }, + toProto(message: MsgConnectionOpenInitResponse): Uint8Array { + return MsgConnectionOpenInitResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgConnectionOpenInitResponse + ): MsgConnectionOpenInitResponseProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenInitResponse', + value: MsgConnectionOpenInitResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgConnectionOpenInitResponse.typeUrl, + MsgConnectionOpenInitResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgConnectionOpenInitResponse.aminoType, + MsgConnectionOpenInitResponse.typeUrl +) +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: '', + previousConnectionId: '', + clientState: undefined, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0), + counterpartyVersions: [], + proofHeight: Height.fromPartial({}), + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: '', + hostConsensusStateProof: new Uint8Array() + } +} +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) + } + if (message.previousConnectionId !== '') { + writer.uint32(18).string(message.previousConnectionId) + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim() + } + if (message.counterparty !== undefined) { + Counterparty.encode( + message.counterparty, + writer.uint32(34).fork() + ).ldelim() + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod) + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim() + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim() + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit) + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient) + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus) + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(98).string(message.signer) + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(106).bytes(message.hostConsensusStateProof) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenTry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenTry() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.clientId = reader.string() + break + case 2: + message.previousConnectionId = reader.string() + break + case 3: + message.clientState = Any.decode(reader, reader.uint32()) + break + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()) + break + case 5: + message.delayPeriod = reader.uint64() + break + case 6: + message.counterpartyVersions.push( + Version.decode(reader, reader.uint32()) + ) + break + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 8: + message.proofInit = reader.bytes() + break + case 9: + message.proofClient = reader.bytes() + break + case 10: + message.proofConsensus = reader.bytes() + break + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()) + break + case 12: + message.signer = reader.string() + break + case 13: + message.hostConsensusStateProof = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry() + message.clientId = object.clientId ?? '' + message.previousConnectionId = object.previousConnectionId ?? '' + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined + message.counterparty = + object.counterparty !== undefined && object.counterparty !== null + ? Counterparty.fromPartial(object.counterparty) + : undefined + message.delayPeriod = + object.delayPeriod !== undefined && object.delayPeriod !== null + ? BigInt(object.delayPeriod.toString()) + : BigInt(0) + message.counterpartyVersions = + object.counterpartyVersions?.map((e) => Version.fromPartial(e)) || [] + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.proofInit = object.proofInit ?? new Uint8Array() + message.proofClient = object.proofClient ?? new Uint8Array() + message.proofConsensus = object.proofConsensus ?? new Uint8Array() + message.consensusHeight = + object.consensusHeight !== undefined && object.consensusHeight !== null + ? Height.fromPartial(object.consensusHeight) + : undefined + message.signer = object.signer ?? '' + message.hostConsensusStateProof = + object.hostConsensusStateProof ?? new Uint8Array() + return message + }, + fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { + 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 = {} + obj.client_id = message.clientId === '' ? undefined : message.clientId + obj.previous_connection_id = + message.previousConnectionId === '' + ? undefined + : message.previousConnectionId + obj.client_state = message.clientState + ? Any.toAmino(message.clientState) + : undefined + obj.counterparty = message.counterparty + ? Counterparty.toAmino(message.counterparty) + : undefined + obj.delay_period = + message.delayPeriod !== BigInt(0) + ? message.delayPeriod.toString() + : undefined + if (message.counterpartyVersions) { + obj.counterparty_versions = message.counterpartyVersions.map((e) => + e ? Version.toAmino(e) : undefined + ) + } else { + obj.counterparty_versions = message.counterpartyVersions + } + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + 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 === '' ? undefined : message.signer + obj.host_consensus_state_proof = message.hostConsensusStateProof + ? base64FromBytes(message.hostConsensusStateProof) + : undefined + return obj + }, + fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.fromAmino(object.value) + }, + toAminoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenTry', + value: MsgConnectionOpenTry.toAmino(message) + } + }, + fromProtoMsg(message: MsgConnectionOpenTryProtoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.decode(message.value) + }, + toProto(message: MsgConnectionOpenTry): Uint8Array { + return MsgConnectionOpenTry.encode(message).finish() + }, + toProtoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTry', + value: MsgConnectionOpenTry.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenTryResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenTryResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse() + return message + }, + fromAmino( + _: MsgConnectionOpenTryResponseAmino + ): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse() + return message + }, + toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgConnectionOpenTryResponseAminoMsg + ): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgConnectionOpenTryResponse + ): MsgConnectionOpenTryResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenTryResponse', + value: MsgConnectionOpenTryResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgConnectionOpenTryResponseProtoMsg + ): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.decode(message.value) + }, + toProto(message: MsgConnectionOpenTryResponse): Uint8Array { + return MsgConnectionOpenTryResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgConnectionOpenTryResponse + ): MsgConnectionOpenTryResponseProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenTryResponse', + value: MsgConnectionOpenTryResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgConnectionOpenTryResponse.typeUrl, + MsgConnectionOpenTryResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgConnectionOpenTryResponse.aminoType, + MsgConnectionOpenTryResponse.typeUrl +) +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: '', + counterpartyConnectionId: '', + version: undefined, + clientState: undefined, + proofHeight: Height.fromPartial({}), + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: '', + hostConsensusStateProof: new Uint8Array() + } +} +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) + } + if (message.counterpartyConnectionId !== '') { + writer.uint32(18).string(message.counterpartyConnectionId) + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim() + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim() + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim() + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry) + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient) + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus) + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(82).string(message.signer) + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(90).bytes(message.hostConsensusStateProof) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenAck { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenAck() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string() + break + case 2: + message.counterpartyConnectionId = reader.string() + break + case 3: + message.version = Version.decode(reader, reader.uint32()) + break + case 4: + message.clientState = Any.decode(reader, reader.uint32()) + break + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 6: + message.proofTry = reader.bytes() + break + case 7: + message.proofClient = reader.bytes() + break + case 8: + message.proofConsensus = reader.bytes() + break + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()) + break + case 10: + message.signer = reader.string() + break + case 11: + message.hostConsensusStateProof = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck() + message.connectionId = object.connectionId ?? '' + message.counterpartyConnectionId = object.counterpartyConnectionId ?? '' + message.version = + object.version !== undefined && object.version !== null + ? Version.fromPartial(object.version) + : undefined + message.clientState = + object.clientState !== undefined && object.clientState !== null + ? Any.fromPartial(object.clientState) + : undefined + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.proofTry = object.proofTry ?? new Uint8Array() + message.proofClient = object.proofClient ?? new Uint8Array() + message.proofConsensus = object.proofConsensus ?? new Uint8Array() + message.consensusHeight = + object.consensusHeight !== undefined && object.consensusHeight !== null + ? Height.fromPartial(object.consensusHeight) + : undefined + message.signer = object.signer ?? '' + message.hostConsensusStateProof = + object.hostConsensusStateProof ?? new Uint8Array() + return message + }, + fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { + 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 = {} + obj.connection_id = + message.connectionId === '' ? undefined : message.connectionId + obj.counterparty_connection_id = + message.counterpartyConnectionId === '' + ? undefined + : message.counterpartyConnectionId + 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 + ? 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 === '' ? undefined : message.signer + obj.host_consensus_state_proof = message.hostConsensusStateProof + ? base64FromBytes(message.hostConsensusStateProof) + : undefined + return obj + }, + fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.fromAmino(object.value) + }, + toAminoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenAck', + value: MsgConnectionOpenAck.toAmino(message) + } + }, + fromProtoMsg(message: MsgConnectionOpenAckProtoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.decode(message.value) + }, + toProto(message: MsgConnectionOpenAck): Uint8Array { + return MsgConnectionOpenAck.encode(message).finish() + }, + toProtoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAck', + value: MsgConnectionOpenAck.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenAckResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenAckResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse() + return message + }, + fromAmino( + _: MsgConnectionOpenAckResponseAmino + ): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse() + return message + }, + toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgConnectionOpenAckResponseAminoMsg + ): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgConnectionOpenAckResponse + ): MsgConnectionOpenAckResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenAckResponse', + value: MsgConnectionOpenAckResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgConnectionOpenAckResponseProtoMsg + ): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.decode(message.value) + }, + toProto(message: MsgConnectionOpenAckResponse): Uint8Array { + return MsgConnectionOpenAckResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgConnectionOpenAckResponse + ): MsgConnectionOpenAckResponseProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenAckResponse', + value: MsgConnectionOpenAckResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgConnectionOpenAckResponse.typeUrl, + MsgConnectionOpenAckResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgConnectionOpenAckResponse.aminoType, + MsgConnectionOpenAckResponse.typeUrl +) +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { + connectionId: '', + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: '' + } +} +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) + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck) + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim() + } + if (message.signer !== '') { + writer.uint32(34).string(message.signer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenConfirm { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenConfirm() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string() + break + case 2: + message.proofAck = reader.bytes() + break + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()) + break + case 4: + message.signer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm() + message.connectionId = object.connectionId ?? '' + message.proofAck = object.proofAck ?? new Uint8Array() + message.proofHeight = + object.proofHeight !== undefined && object.proofHeight !== null + ? Height.fromPartial(object.proofHeight) + : undefined + message.signer = object.signer ?? '' + return message + }, + fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { + 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 === '' ? undefined : message.connectionId + obj.proof_ack = message.proofAck + ? base64FromBytes(message.proofAck) + : undefined + obj.proof_height = message.proofHeight + ? Height.toAmino(message.proofHeight) + : {} + obj.signer = message.signer === '' ? undefined : message.signer + return obj + }, + fromAminoMsg( + object: MsgConnectionOpenConfirmAminoMsg + ): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.fromAmino(object.value) + }, + toAminoMsg( + message: MsgConnectionOpenConfirm + ): MsgConnectionOpenConfirmAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenConfirm', + value: MsgConnectionOpenConfirm.toAmino(message) + } + }, + fromProtoMsg( + message: MsgConnectionOpenConfirmProtoMsg + ): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.decode(message.value) + }, + toProto(message: MsgConnectionOpenConfirm): Uint8Array { + return MsgConnectionOpenConfirm.encode(message).finish() + }, + toProtoMsg( + message: MsgConnectionOpenConfirm + ): MsgConnectionOpenConfirmProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirm', + value: MsgConnectionOpenConfirm.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgConnectionOpenConfirmResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgConnectionOpenConfirmResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse() + return message + }, + fromAmino( + _: MsgConnectionOpenConfirmResponseAmino + ): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse() + return message + }, + toAmino( + _: MsgConnectionOpenConfirmResponse + ): MsgConnectionOpenConfirmResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgConnectionOpenConfirmResponseAminoMsg + ): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgConnectionOpenConfirmResponse + ): MsgConnectionOpenConfirmResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgConnectionOpenConfirmResponse', + value: MsgConnectionOpenConfirmResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgConnectionOpenConfirmResponseProtoMsg + ): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.decode(message.value) + }, + toProto(message: MsgConnectionOpenConfirmResponse): Uint8Array { + return MsgConnectionOpenConfirmResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgConnectionOpenConfirmResponse + ): MsgConnectionOpenConfirmResponseProtoMsg { + return { + typeUrl: '/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse', + value: MsgConnectionOpenConfirmResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.amino.ts b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.amino.ts new file mode 100644 index 0000000..eb7a0bc --- /dev/null +++ b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.amino.ts @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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 + } +} diff --git a/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.registry.ts b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.registry.ts new file mode 100644 index 0000000..82c298b --- /dev/null +++ b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.registry.ts @@ -0,0 +1,76 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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) + } + } + } +} diff --git a/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.ts b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.ts new file mode 100644 index 0000000..03ad537 --- /dev/null +++ b/src/proto/osmojs/ibc/lightclients/wasm/v1/tx.ts @@ -0,0 +1,831 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../../binary' +import { 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 + }, + 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : 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 + }, + 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 + }, + 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 === '' ? undefined : message.signer + obj.client_id = message.clientId === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/index.ts b/src/proto/osmojs/index.ts new file mode 100644 index 0000000..fbc4c7e --- /dev/null +++ b/src/proto/osmojs/index.ts @@ -0,0 +1,27 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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 './capability/bundle' +export * from './ibc/bundle' +export * from './ibc/client' +export * from './cosmwasm/bundle' +export * from './cosmwasm/client' +export * from './osmosis/bundle' +export * from './osmosis/client' +export * from './amino/bundle' +export * from './cosmos_proto/bundle' +export * from './gogoproto/bundle' +export * from './tendermint/bundle' +export * from './google/bundle' +export * from '../varint' +export * from '../utf8' +export * from '../binary' +export * from './types' +export * from './registry' diff --git a/src/proto/osmojs/osmosis/client.ts b/src/proto/osmojs/osmosis/client.ts new file mode 100644 index 0000000..6e5b5bc --- /dev/null +++ b/src/proto/osmojs/osmosis/client.ts @@ -0,0 +1,112 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing' +import { + defaultRegistryTypes, + AminoTypes, + SigningStargateClient +} from '@cosmjs/stargate' +import { HttpEndpoint } from '@cosmjs/tendermint-rpc' +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 osmosisSmartaccountV1beta1TxRegistry from './smartaccount/v1beta1/tx.registry' +import * as osmosisSuperfluidTxRegistry from './superfluid/tx.registry' +import * as osmosisTokenfactoryV1beta1TxRegistry from './tokenfactory/v1beta1/tx.registry' +import * as osmosisTxfeesV1beta1TxRegistry from './txfees/v1beta1/tx.registry' +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 osmosisSmartaccountV1beta1TxAmino from './smartaccount/v1beta1/tx.amino' +import * as osmosisSuperfluidTxAmino from './superfluid/tx.amino' +import * as osmosisTokenfactoryV1beta1TxAmino from './tokenfactory/v1beta1/tx.amino' +import * as osmosisTxfeesV1beta1TxAmino from './txfees/v1beta1/tx.amino' +import * as osmosisValsetprefV1beta1TxAmino from './valsetpref/v1beta1/tx.amino' +export const osmosisAminoConverters = { + ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino.AminoConverter, + ...osmosisConcentratedliquidityV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsBalancerV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsStableswapV1beta1TxAmino.AminoConverter, + ...osmosisGammV1beta1TxAmino.AminoConverter, + ...osmosisIbchooksTxAmino.AminoConverter, + ...osmosisIncentivesTxAmino.AminoConverter, + ...osmosisLockupTxAmino.AminoConverter, + ...osmosisPoolmanagerV1beta1TxAmino.AminoConverter, + ...osmosisProtorevV1beta1TxAmino.AminoConverter, + ...osmosisSmartaccountV1beta1TxAmino.AminoConverter, + ...osmosisSuperfluidTxAmino.AminoConverter, + ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, + ...osmosisTxfeesV1beta1TxAmino.AminoConverter, + ...osmosisValsetprefV1beta1TxAmino.AminoConverter +} +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, + ...osmosisSmartaccountV1beta1TxRegistry.registry, + ...osmosisSuperfluidTxRegistry.registry, + ...osmosisTokenfactoryV1beta1TxRegistry.registry, + ...osmosisTxfeesV1beta1TxRegistry.registry, + ...osmosisValsetprefV1beta1TxRegistry.registry +] +export const getSigningOsmosisClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +} = {}): { + registry: Registry + aminoTypes: AminoTypes +} => { + const registry = new Registry([...defaultTypes, ...osmosisProtoRegistry]) + const aminoTypes = new AminoTypes({ + ...osmosisAminoConverters + }) + return { + registry, + aminoTypes + } +} +export const getSigningOsmosisClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint + signer: OfflineSigner + defaultTypes?: ReadonlyArray<[string, GeneratedType]> +}) => { + const { registry, aminoTypes } = getSigningOsmosisClientOptions({ + defaultTypes + }) + const client = await SigningStargateClient.connectWithSigner( + rpcEndpoint, + signer, + { + registry: registry as any, + aminoTypes + } + ) + return client +} diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts new file mode 100644 index 0000000..c2331d8 --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts @@ -0,0 +1,12 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgCreateConcentratedPool } from './tx' +export const AminoConverter = { + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool': + { + aminoType: + 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool', + toAmino: MsgCreateConcentratedPool.toAmino, + fromAmino: MsgCreateConcentratedPool.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts new file mode 100644 index 0000000..35e1bf0 --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts @@ -0,0 +1,44 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgCreateConcentratedPool } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + MsgCreateConcentratedPool + ] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.encode(value).finish() + } + } + }, + withTypeUrl: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value + } + } + }, + fromPartial: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts new file mode 100644 index 0000000..653f985 --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts @@ -0,0 +1,377 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { Decimal } from '@cosmjs/math' +import { GlobalDecoderRegistry } from '../../../../../registry' +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPool { + sender: string + denom0: string + denom1: string + tickSpacing: bigint + spreadFactor: string +} +export interface MsgCreateConcentratedPoolProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool' + value: Uint8Array +} +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPoolAmino { + sender?: string + denom0?: string + denom1?: string + tick_spacing?: string + spread_factor?: string +} +export interface MsgCreateConcentratedPoolAminoMsg { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool' + value: MsgCreateConcentratedPoolAmino +} +/** ===================== MsgCreateConcentratedPool */ +export interface MsgCreateConcentratedPoolSDKType { + sender: string + denom0: string + denom1: string + tick_spacing: bigint + spread_factor: string +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponse { + poolId: bigint +} +export interface MsgCreateConcentratedPoolResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse' + value: Uint8Array +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponseAmino { + pool_id?: string +} +export interface MsgCreateConcentratedPoolResponseAminoMsg { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response' + value: MsgCreateConcentratedPoolResponseAmino +} +/** Returns a unique poolID to identify the pool with. */ +export interface MsgCreateConcentratedPoolResponseSDKType { + pool_id: bigint +} +function createBaseMsgCreateConcentratedPool(): MsgCreateConcentratedPool { + return { + sender: '', + denom0: '', + denom1: '', + tickSpacing: BigInt(0), + spreadFactor: '' + } +} +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) + } + if (message.denom0 !== '') { + writer.uint32(18).string(message.denom0) + } + if (message.denom1 !== '') { + writer.uint32(26).string(message.denom1) + } + if (message.tickSpacing !== BigInt(0)) { + writer.uint32(32).uint64(message.tickSpacing) + } + if (message.spreadFactor !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.spreadFactor, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateConcentratedPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateConcentratedPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.denom0 = reader.string() + break + case 3: + message.denom1 = reader.string() + break + case 4: + message.tickSpacing = reader.uint64() + break + case 5: + message.spreadFactor = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCreateConcentratedPool { + const message = createBaseMsgCreateConcentratedPool() + message.sender = object.sender ?? '' + message.denom0 = object.denom0 ?? '' + message.denom1 = object.denom1 ?? '' + message.tickSpacing = + object.tickSpacing !== undefined && object.tickSpacing !== null + ? BigInt(object.tickSpacing.toString()) + : BigInt(0) + message.spreadFactor = object.spreadFactor ?? '' + return message + }, + fromAmino(object: MsgCreateConcentratedPoolAmino): MsgCreateConcentratedPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.denom0 = message.denom0 === '' ? undefined : message.denom0 + obj.denom1 = message.denom1 === '' ? undefined : message.denom1 + obj.tick_spacing = + message.tickSpacing !== BigInt(0) + ? message.tickSpacing.toString() + : undefined + obj.spread_factor = + message.spreadFactor === '' ? undefined : message.spreadFactor + return obj + }, + fromAminoMsg( + object: MsgCreateConcentratedPoolAminoMsg + ): MsgCreateConcentratedPool { + return MsgCreateConcentratedPool.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateConcentratedPool + ): MsgCreateConcentratedPoolAminoMsg { + return { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool', + value: MsgCreateConcentratedPool.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateConcentratedPoolProtoMsg + ): MsgCreateConcentratedPool { + return MsgCreateConcentratedPool.decode(message.value) + }, + toProto(message: MsgCreateConcentratedPool): Uint8Array { + return MsgCreateConcentratedPool.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateConcentratedPool + ): MsgCreateConcentratedPoolProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool', + value: MsgCreateConcentratedPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateConcentratedPool.typeUrl, + MsgCreateConcentratedPool +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateConcentratedPool.aminoType, + MsgCreateConcentratedPool.typeUrl +) +function createBaseMsgCreateConcentratedPoolResponse(): MsgCreateConcentratedPoolResponse { + return { + poolId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateConcentratedPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateConcentratedPoolResponse() + 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 + ): MsgCreateConcentratedPoolResponse { + const message = createBaseMsgCreateConcentratedPoolResponse() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgCreateConcentratedPoolResponseAmino + ): MsgCreateConcentratedPoolResponse { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgCreateConcentratedPoolResponseAminoMsg + ): MsgCreateConcentratedPoolResponse { + return MsgCreateConcentratedPoolResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateConcentratedPoolResponse + ): MsgCreateConcentratedPoolResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response', + value: MsgCreateConcentratedPoolResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateConcentratedPoolResponseProtoMsg + ): MsgCreateConcentratedPoolResponse { + return MsgCreateConcentratedPoolResponse.decode(message.value) + }, + toProto(message: MsgCreateConcentratedPoolResponse): Uint8Array { + return MsgCreateConcentratedPoolResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateConcentratedPoolResponse + ): MsgCreateConcentratedPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse', + value: MsgCreateConcentratedPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateConcentratedPoolResponse.typeUrl, + MsgCreateConcentratedPoolResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateConcentratedPoolResponse.aminoType, + MsgCreateConcentratedPoolResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.amino.ts new file mode 100644 index 0000000..2de3771 --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.amino.ts @@ -0,0 +1,42 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgCreatePosition, + MsgWithdrawPosition, + MsgAddToPosition, + MsgCollectSpreadRewards, + MsgCollectIncentives, + MsgTransferPositions +} from './tx' +export const AminoConverter = { + '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition': { + aminoType: 'osmosis/cl-create-position', + toAmino: MsgCreatePosition.toAmino, + fromAmino: MsgCreatePosition.fromAmino + }, + '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition': { + aminoType: 'osmosis/cl-withdraw-position', + toAmino: MsgWithdrawPosition.toAmino, + fromAmino: MsgWithdrawPosition.fromAmino + }, + '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition': { + aminoType: 'osmosis/cl-add-to-position', + toAmino: MsgAddToPosition.toAmino, + fromAmino: MsgAddToPosition.fromAmino + }, + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards': { + aminoType: 'osmosis/cl-col-sp-rewards', + toAmino: MsgCollectSpreadRewards.toAmino, + fromAmino: MsgCollectSpreadRewards.fromAmino + }, + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives': { + 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 + } +} diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.registry.ts new file mode 100644 index 0000000..d35942b --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.registry.ts @@ -0,0 +1,158 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.encode(value).finish() + } + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.encode(value).finish() + } + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.encode(value).finish() + } + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.encode(value).finish() + } + }, + collectIncentives(value: MsgCollectIncentives) { + return { + 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: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value + } + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value + } + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value + } + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value + } + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value + } + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value + } + } + }, + fromPartial: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.fromPartial(value) + } + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.fromPartial(value) + } + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.fromPartial(value) + } + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.fromPartial(value) + } + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value: MsgCollectIncentives.fromPartial(value) + } + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions', + value: MsgTransferPositions.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.ts b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.ts new file mode 100644 index 0000000..07000de --- /dev/null +++ b/src/proto/osmojs/osmosis/concentratedliquidity/v1beta1/tx.ts @@ -0,0 +1,2557 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +import { Decimal } from '@cosmjs/math' +/** ===================== MsgCreatePosition */ +export interface MsgCreatePosition { + poolId: bigint + sender: string + lowerTick: bigint + upperTick: bigint + /** + * 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). + */ + tokensProvided: Coin[] + tokenMinAmount0: string + tokenMinAmount1: string +} +export interface MsgCreatePositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition' + value: Uint8Array +} +/** ===================== MsgCreatePosition */ +export interface MsgCreatePositionAmino { + 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 +} +export interface MsgCreatePositionAminoMsg { + type: 'osmosis/cl-create-position' + value: MsgCreatePositionAmino +} +/** ===================== MsgCreatePosition */ +export interface MsgCreatePositionSDKType { + pool_id: bigint + sender: string + lower_tick: bigint + upper_tick: bigint + tokens_provided: CoinSDKType[] + token_min_amount0: string + token_min_amount1: string +} +export interface MsgCreatePositionResponse { + positionId: bigint + amount0: string + amount1: string + liquidityCreated: 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. + */ + lowerTick: bigint + upperTick: bigint +} +export interface MsgCreatePositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse' + value: Uint8Array +} +export interface MsgCreatePositionResponseAmino { + 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 +} +export interface MsgCreatePositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/create-position-response' + value: MsgCreatePositionResponseAmino +} +export interface MsgCreatePositionResponseSDKType { + position_id: bigint + amount0: string + amount1: string + liquidity_created: string + lower_tick: bigint + upper_tick: bigint +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPosition { + positionId: bigint + sender: string + /** amount0 represents the amount of token0 willing to put in. */ + amount0: string + /** amount1 represents the amount of token1 willing to put in. */ + 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. + */ + tokenMinAmount0: 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. + */ + tokenMinAmount1: string +} +export interface MsgAddToPositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition' + value: Uint8Array +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPositionAmino { + position_id?: string + sender?: string + /** amount0 represents the amount of token0 willing to put in. */ + amount0?: string + /** amount1 represents the amount of token1 willing to put in. */ + 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_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 +} +export interface MsgAddToPositionAminoMsg { + type: 'osmosis/cl-add-to-position' + value: MsgAddToPositionAmino +} +/** ===================== MsgAddToPosition */ +export interface MsgAddToPositionSDKType { + position_id: bigint + sender: string + amount0: string + amount1: string + token_min_amount0: string + token_min_amount1: string +} +export interface MsgAddToPositionResponse { + positionId: bigint + amount0: string + amount1: string +} +export interface MsgAddToPositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse' + value: Uint8Array +} +export interface MsgAddToPositionResponseAmino { + position_id?: string + amount0?: string + amount1?: string +} +export interface MsgAddToPositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/add-to-position-response' + value: MsgAddToPositionResponseAmino +} +export interface MsgAddToPositionResponseSDKType { + position_id: bigint + amount0: string + amount1: string +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPosition { + positionId: bigint + sender: string + liquidityAmount: string +} +export interface MsgWithdrawPositionProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition' + value: Uint8Array +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPositionAmino { + position_id?: string + sender?: string + liquidity_amount?: string +} +export interface MsgWithdrawPositionAminoMsg { + type: 'osmosis/cl-withdraw-position' + value: MsgWithdrawPositionAmino +} +/** ===================== MsgWithdrawPosition */ +export interface MsgWithdrawPositionSDKType { + position_id: bigint + sender: string + liquidity_amount: string +} +export interface MsgWithdrawPositionResponse { + amount0: string + amount1: string +} +export interface MsgWithdrawPositionResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse' + value: Uint8Array +} +export interface MsgWithdrawPositionResponseAmino { + amount0?: string + amount1?: string +} +export interface MsgWithdrawPositionResponseAminoMsg { + type: 'osmosis/concentratedliquidity/withdraw-position-response' + value: MsgWithdrawPositionResponseAmino +} +export interface MsgWithdrawPositionResponseSDKType { + amount0: string + amount1: string +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewards { + positionIds: bigint[] + sender: string +} +export interface MsgCollectSpreadRewardsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards' + value: Uint8Array +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewardsAmino { + position_ids?: string[] + sender?: string +} +export interface MsgCollectSpreadRewardsAminoMsg { + type: 'osmosis/cl-col-sp-rewards' + value: MsgCollectSpreadRewardsAmino +} +/** ===================== MsgCollectSpreadRewards */ +export interface MsgCollectSpreadRewardsSDKType { + position_ids: bigint[] + sender: string +} +export interface MsgCollectSpreadRewardsResponse { + collectedSpreadRewards: Coin[] +} +export interface MsgCollectSpreadRewardsResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse' + value: Uint8Array +} +export interface MsgCollectSpreadRewardsResponseAmino { + collected_spread_rewards?: CoinAmino[] +} +export interface MsgCollectSpreadRewardsResponseAminoMsg { + type: 'osmosis/concentratedliquidity/collect-spread-rewards-response' + value: MsgCollectSpreadRewardsResponseAmino +} +export interface MsgCollectSpreadRewardsResponseSDKType { + collected_spread_rewards: CoinSDKType[] +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentives { + positionIds: bigint[] + sender: string +} +export interface MsgCollectIncentivesProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives' + value: Uint8Array +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentivesAmino { + position_ids?: string[] + sender?: string +} +export interface MsgCollectIncentivesAminoMsg { + type: 'osmosis/cl-collect-incentives' + value: MsgCollectIncentivesAmino +} +/** ===================== MsgCollectIncentives */ +export interface MsgCollectIncentivesSDKType { + position_ids: bigint[] + sender: string +} +export interface MsgCollectIncentivesResponse { + collectedIncentives: Coin[] + forfeitedIncentives: Coin[] +} +export interface MsgCollectIncentivesResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse' + value: Uint8Array +} +export interface MsgCollectIncentivesResponseAmino { + collected_incentives?: CoinAmino[] + forfeited_incentives?: CoinAmino[] +} +export interface MsgCollectIncentivesResponseAminoMsg { + type: 'osmosis/concentratedliquidity/collect-incentives-response' + value: MsgCollectIncentivesResponseAmino +} +export interface MsgCollectIncentivesResponseSDKType { + collected_incentives: CoinSDKType[] + forfeited_incentives: CoinSDKType[] +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositions { + positionIds: bigint[] + sender: string +} +export interface MsgFungifyChargedPositionsProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions' + value: Uint8Array +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositionsAmino { + position_ids?: string[] + sender?: string +} +export interface MsgFungifyChargedPositionsAminoMsg { + type: 'osmosis/cl-fungify-charged-positions' + value: MsgFungifyChargedPositionsAmino +} +/** ===================== MsgFungifyChargedPositions */ +export interface MsgFungifyChargedPositionsSDKType { + position_ids: bigint[] + sender: string +} +export interface MsgFungifyChargedPositionsResponse { + newPositionId: bigint +} +export interface MsgFungifyChargedPositionsResponseProtoMsg { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse' + value: Uint8Array +} +export interface MsgFungifyChargedPositionsResponseAmino { + new_position_id?: string +} +export interface MsgFungifyChargedPositionsResponseAminoMsg { + type: 'osmosis/concentratedliquidity/fungify-charged-positions-response' + value: MsgFungifyChargedPositionsResponseAmino +} +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), + sender: '', + lowerTick: BigInt(0), + upperTick: BigInt(0), + tokensProvided: [], + tokenMinAmount0: '', + tokenMinAmount1: '' + } +} +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) + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + if (message.lowerTick !== BigInt(0)) { + writer.uint32(24).int64(message.lowerTick) + } + if (message.upperTick !== BigInt(0)) { + writer.uint32(32).int64(message.upperTick) + } + for (const v of message.tokensProvided) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim() + } + if (message.tokenMinAmount0 !== '') { + writer.uint32(50).string(message.tokenMinAmount0) + } + if (message.tokenMinAmount1 !== '') { + writer.uint32(58).string(message.tokenMinAmount1) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreatePosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64() + break + case 2: + message.sender = reader.string() + break + case 3: + message.lowerTick = reader.int64() + break + case 4: + message.upperTick = reader.int64() + break + case 5: + message.tokensProvided.push(Coin.decode(reader, reader.uint32())) + break + case 6: + message.tokenMinAmount0 = reader.string() + break + case 7: + message.tokenMinAmount1 = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreatePosition { + const message = createBaseMsgCreatePosition() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.sender = object.sender ?? '' + message.lowerTick = + object.lowerTick !== undefined && object.lowerTick !== null + ? BigInt(object.lowerTick.toString()) + : BigInt(0) + message.upperTick = + object.upperTick !== undefined && object.upperTick !== null + ? BigInt(object.upperTick.toString()) + : BigInt(0) + message.tokensProvided = + object.tokensProvided?.map((e) => Coin.fromPartial(e)) || [] + message.tokenMinAmount0 = object.tokenMinAmount0 ?? '' + message.tokenMinAmount1 = object.tokenMinAmount1 ?? '' + return message + }, + fromAmino(object: MsgCreatePositionAmino): MsgCreatePosition { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.sender = message.sender === '' ? undefined : message.sender + obj.lower_tick = + message.lowerTick !== BigInt(0) ? message.lowerTick.toString() : undefined + obj.upper_tick = + message.upperTick !== BigInt(0) ? message.upperTick.toString() : undefined + if (message.tokensProvided) { + obj.tokens_provided = message.tokensProvided.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.tokens_provided = message.tokensProvided + } + obj.token_min_amount0 = + message.tokenMinAmount0 === '' ? undefined : message.tokenMinAmount0 + obj.token_min_amount1 = + message.tokenMinAmount1 === '' ? undefined : message.tokenMinAmount1 + return obj + }, + fromAminoMsg(object: MsgCreatePositionAminoMsg): MsgCreatePosition { + return MsgCreatePosition.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreatePosition): MsgCreatePositionAminoMsg { + return { + type: 'osmosis/cl-create-position', + value: MsgCreatePosition.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreatePositionProtoMsg): MsgCreatePosition { + return MsgCreatePosition.decode(message.value) + }, + toProto(message: MsgCreatePosition): Uint8Array { + return MsgCreatePosition.encode(message).finish() + }, + toProtoMsg(message: MsgCreatePosition): MsgCreatePositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition', + value: MsgCreatePosition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgCreatePosition.typeUrl, MsgCreatePosition) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreatePosition.aminoType, + MsgCreatePosition.typeUrl +) +function createBaseMsgCreatePositionResponse(): MsgCreatePositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '', + liquidityCreated: '', + lowerTick: BigInt(0), + upperTick: BigInt(0) + } +} +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) + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0) + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1) + } + if (message.liquidityCreated !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.liquidityCreated, 18).atomics) + } + if (message.lowerTick !== BigInt(0)) { + writer.uint32(48).int64(message.lowerTick) + } + if (message.upperTick !== BigInt(0)) { + writer.uint32(56).int64(message.upperTick) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreatePositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreatePositionResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.amount0 = reader.string() + break + case 3: + message.amount1 = reader.string() + break + case 5: + message.liquidityCreated = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 6: + message.lowerTick = reader.int64() + break + case 7: + message.upperTick = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCreatePositionResponse { + const message = createBaseMsgCreatePositionResponse() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + message.liquidityCreated = object.liquidityCreated ?? '' + message.lowerTick = + object.lowerTick !== undefined && object.lowerTick !== null + ? BigInt(object.lowerTick.toString()) + : BigInt(0) + message.upperTick = + object.upperTick !== undefined && object.upperTick !== null + ? BigInt(object.upperTick.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgCreatePositionResponseAmino): MsgCreatePositionResponse { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.amount0 = message.amount0 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + obj.liquidity_created = + message.liquidityCreated === '' ? undefined : message.liquidityCreated + obj.lower_tick = + message.lowerTick !== BigInt(0) ? message.lowerTick.toString() : undefined + obj.upper_tick = + message.upperTick !== BigInt(0) ? message.upperTick.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgCreatePositionResponseAminoMsg + ): MsgCreatePositionResponse { + return MsgCreatePositionResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreatePositionResponse + ): MsgCreatePositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/create-position-response', + value: MsgCreatePositionResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreatePositionResponseProtoMsg + ): MsgCreatePositionResponse { + return MsgCreatePositionResponse.decode(message.value) + }, + toProto(message: MsgCreatePositionResponse): Uint8Array { + return MsgCreatePositionResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreatePositionResponse + ): MsgCreatePositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse', + value: MsgCreatePositionResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreatePositionResponse.typeUrl, + MsgCreatePositionResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreatePositionResponse.aminoType, + MsgCreatePositionResponse.typeUrl +) +function createBaseMsgAddToPosition(): MsgAddToPosition { + return { + positionId: BigInt(0), + sender: '', + amount0: '', + amount1: '', + tokenMinAmount0: '', + tokenMinAmount1: '' + } +} +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) + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + if (message.amount0 !== '') { + writer.uint32(26).string(message.amount0) + } + if (message.amount1 !== '') { + writer.uint32(34).string(message.amount1) + } + if (message.tokenMinAmount0 !== '') { + writer.uint32(42).string(message.tokenMinAmount0) + } + if (message.tokenMinAmount1 !== '') { + writer.uint32(50).string(message.tokenMinAmount1) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddToPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddToPosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.sender = reader.string() + break + case 3: + message.amount0 = reader.string() + break + case 4: + message.amount1 = reader.string() + break + case 5: + message.tokenMinAmount0 = reader.string() + break + case 6: + message.tokenMinAmount1 = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgAddToPosition { + const message = createBaseMsgAddToPosition() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.sender = object.sender ?? '' + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + message.tokenMinAmount0 = object.tokenMinAmount0 ?? '' + message.tokenMinAmount1 = object.tokenMinAmount1 ?? '' + return message + }, + fromAmino(object: MsgAddToPositionAmino): MsgAddToPosition { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.sender = message.sender === '' ? undefined : message.sender + obj.amount0 = message.amount0 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + obj.token_min_amount0 = + message.tokenMinAmount0 === '' ? undefined : message.tokenMinAmount0 + obj.token_min_amount1 = + message.tokenMinAmount1 === '' ? undefined : message.tokenMinAmount1 + return obj + }, + fromAminoMsg(object: MsgAddToPositionAminoMsg): MsgAddToPosition { + return MsgAddToPosition.fromAmino(object.value) + }, + toAminoMsg(message: MsgAddToPosition): MsgAddToPositionAminoMsg { + return { + type: 'osmosis/cl-add-to-position', + value: MsgAddToPosition.toAmino(message) + } + }, + fromProtoMsg(message: MsgAddToPositionProtoMsg): MsgAddToPosition { + return MsgAddToPosition.decode(message.value) + }, + toProto(message: MsgAddToPosition): Uint8Array { + return MsgAddToPosition.encode(message).finish() + }, + toProtoMsg(message: MsgAddToPosition): MsgAddToPositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition', + value: MsgAddToPosition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgAddToPosition.typeUrl, MsgAddToPosition) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToPosition.aminoType, + MsgAddToPosition.typeUrl +) +function createBaseMsgAddToPositionResponse(): MsgAddToPositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '' + } +} +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) + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0) + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddToPositionResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.amount0 = reader.string() + break + case 3: + message.amount1 = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgAddToPositionResponse { + const message = createBaseMsgAddToPositionResponse() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + return message + }, + fromAmino(object: MsgAddToPositionResponseAmino): MsgAddToPositionResponse { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.amount0 = message.amount0 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + return obj + }, + fromAminoMsg( + object: MsgAddToPositionResponseAminoMsg + ): MsgAddToPositionResponse { + return MsgAddToPositionResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgAddToPositionResponse + ): MsgAddToPositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/add-to-position-response', + value: MsgAddToPositionResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddToPositionResponseProtoMsg + ): MsgAddToPositionResponse { + return MsgAddToPositionResponse.decode(message.value) + }, + toProto(message: MsgAddToPositionResponse): Uint8Array { + return MsgAddToPositionResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgAddToPositionResponse + ): MsgAddToPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse', + value: MsgAddToPositionResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgAddToPositionResponse.typeUrl, + MsgAddToPositionResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToPositionResponse.aminoType, + MsgAddToPositionResponse.typeUrl +) +function createBaseMsgWithdrawPosition(): MsgWithdrawPosition { + return { + positionId: BigInt(0), + sender: '', + liquidityAmount: '' + } +} +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) + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + if (message.liquidityAmount !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.liquidityAmount, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawPosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.sender = reader.string() + break + case 3: + message.liquidityAmount = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgWithdrawPosition { + const message = createBaseMsgWithdrawPosition() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.sender = object.sender ?? '' + message.liquidityAmount = object.liquidityAmount ?? '' + return message + }, + fromAmino(object: MsgWithdrawPositionAmino): MsgWithdrawPosition { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.sender = message.sender === '' ? undefined : message.sender + obj.liquidity_amount = + message.liquidityAmount === '' ? undefined : message.liquidityAmount + return obj + }, + fromAminoMsg(object: MsgWithdrawPositionAminoMsg): MsgWithdrawPosition { + return MsgWithdrawPosition.fromAmino(object.value) + }, + toAminoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionAminoMsg { + return { + type: 'osmosis/cl-withdraw-position', + value: MsgWithdrawPosition.toAmino(message) + } + }, + fromProtoMsg(message: MsgWithdrawPositionProtoMsg): MsgWithdrawPosition { + return MsgWithdrawPosition.decode(message.value) + }, + toProto(message: MsgWithdrawPosition): Uint8Array { + return MsgWithdrawPosition.encode(message).finish() + }, + toProtoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition', + value: MsgWithdrawPosition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgWithdrawPosition.typeUrl, MsgWithdrawPosition) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawPosition.aminoType, + MsgWithdrawPosition.typeUrl +) +function createBaseMsgWithdrawPositionResponse(): MsgWithdrawPositionResponse { + return { + amount0: '', + amount1: '' + } +} +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) + } + if (message.amount1 !== '') { + writer.uint32(18).string(message.amount1) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawPositionResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.amount0 = reader.string() + break + case 2: + message.amount1 = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgWithdrawPositionResponse { + const message = createBaseMsgWithdrawPositionResponse() + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + return message + }, + fromAmino( + object: MsgWithdrawPositionResponseAmino + ): MsgWithdrawPositionResponse { + 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 = {} + obj.amount0 = message.amount0 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + return obj + }, + fromAminoMsg( + object: MsgWithdrawPositionResponseAminoMsg + ): MsgWithdrawPositionResponse { + return MsgWithdrawPositionResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawPositionResponse + ): MsgWithdrawPositionResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/withdraw-position-response', + value: MsgWithdrawPositionResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawPositionResponseProtoMsg + ): MsgWithdrawPositionResponse { + return MsgWithdrawPositionResponse.decode(message.value) + }, + toProto(message: MsgWithdrawPositionResponse): Uint8Array { + return MsgWithdrawPositionResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawPositionResponse + ): MsgWithdrawPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse', + value: MsgWithdrawPositionResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawPositionResponse.typeUrl, + MsgWithdrawPositionResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawPositionResponse.aminoType, + MsgWithdrawPositionResponse.typeUrl +) +function createBaseMsgCollectSpreadRewards(): MsgCollectSpreadRewards { + return { + positionIds: [], + sender: '' + } +} +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) { + writer.uint64(v) + } + writer.ldelim() + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectSpreadRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCollectSpreadRewards() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCollectSpreadRewards { + const message = createBaseMsgCollectSpreadRewards() + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || [] + message.sender = object.sender ?? '' + return message + }, + fromAmino(object: MsgCollectSpreadRewardsAmino): MsgCollectSpreadRewards { + 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 = {} + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()) + } else { + obj.position_ids = message.positionIds + } + obj.sender = message.sender === '' ? undefined : message.sender + return obj + }, + fromAminoMsg( + object: MsgCollectSpreadRewardsAminoMsg + ): MsgCollectSpreadRewards { + return MsgCollectSpreadRewards.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCollectSpreadRewards + ): MsgCollectSpreadRewardsAminoMsg { + return { + type: 'osmosis/cl-col-sp-rewards', + value: MsgCollectSpreadRewards.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCollectSpreadRewardsProtoMsg + ): MsgCollectSpreadRewards { + return MsgCollectSpreadRewards.decode(message.value) + }, + toProto(message: MsgCollectSpreadRewards): Uint8Array { + return MsgCollectSpreadRewards.encode(message).finish() + }, + toProtoMsg( + message: MsgCollectSpreadRewards + ): MsgCollectSpreadRewardsProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards', + value: MsgCollectSpreadRewards.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCollectSpreadRewards.typeUrl, + MsgCollectSpreadRewards +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectSpreadRewards.aminoType, + MsgCollectSpreadRewards.typeUrl +) +function createBaseMsgCollectSpreadRewardsResponse(): MsgCollectSpreadRewardsResponse { + return { + collectedSpreadRewards: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectSpreadRewardsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCollectSpreadRewardsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.collectedSpreadRewards.push( + Coin.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCollectSpreadRewardsResponse { + const message = createBaseMsgCollectSpreadRewardsResponse() + message.collectedSpreadRewards = + object.collectedSpreadRewards?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgCollectSpreadRewardsResponseAmino + ): MsgCollectSpreadRewardsResponse { + const message = createBaseMsgCollectSpreadRewardsResponse() + message.collectedSpreadRewards = + object.collected_spread_rewards?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseAmino { + const obj: any = {} + if (message.collectedSpreadRewards) { + obj.collected_spread_rewards = message.collectedSpreadRewards.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.collected_spread_rewards = message.collectedSpreadRewards + } + return obj + }, + fromAminoMsg( + object: MsgCollectSpreadRewardsResponseAminoMsg + ): MsgCollectSpreadRewardsResponse { + return MsgCollectSpreadRewardsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/collect-spread-rewards-response', + value: MsgCollectSpreadRewardsResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCollectSpreadRewardsResponseProtoMsg + ): MsgCollectSpreadRewardsResponse { + return MsgCollectSpreadRewardsResponse.decode(message.value) + }, + toProto(message: MsgCollectSpreadRewardsResponse): Uint8Array { + return MsgCollectSpreadRewardsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCollectSpreadRewardsResponse + ): MsgCollectSpreadRewardsResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse', + value: MsgCollectSpreadRewardsResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCollectSpreadRewardsResponse.typeUrl, + MsgCollectSpreadRewardsResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectSpreadRewardsResponse.aminoType, + MsgCollectSpreadRewardsResponse.typeUrl +) +function createBaseMsgCollectIncentives(): MsgCollectIncentives { + return { + positionIds: [], + sender: '' + } +} +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) { + writer.uint64(v) + } + writer.ldelim() + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectIncentives { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCollectIncentives() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCollectIncentives { + const message = createBaseMsgCollectIncentives() + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || [] + message.sender = object.sender ?? '' + return message + }, + fromAmino(object: MsgCollectIncentivesAmino): MsgCollectIncentives { + 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 = {} + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()) + } else { + obj.position_ids = message.positionIds + } + obj.sender = message.sender === '' ? undefined : message.sender + return obj + }, + fromAminoMsg(object: MsgCollectIncentivesAminoMsg): MsgCollectIncentives { + return MsgCollectIncentives.fromAmino(object.value) + }, + toAminoMsg(message: MsgCollectIncentives): MsgCollectIncentivesAminoMsg { + return { + type: 'osmosis/cl-collect-incentives', + value: MsgCollectIncentives.toAmino(message) + } + }, + fromProtoMsg(message: MsgCollectIncentivesProtoMsg): MsgCollectIncentives { + return MsgCollectIncentives.decode(message.value) + }, + toProto(message: MsgCollectIncentives): Uint8Array { + return MsgCollectIncentives.encode(message).finish() + }, + toProtoMsg(message: MsgCollectIncentives): MsgCollectIncentivesProtoMsg { + return { + typeUrl: '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives', + value: MsgCollectIncentives.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCollectIncentives.typeUrl, + MsgCollectIncentives +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectIncentives.aminoType, + MsgCollectIncentives.typeUrl +) +function createBaseMsgCollectIncentivesResponse(): MsgCollectIncentivesResponse { + return { + collectedIncentives: [], + forfeitedIncentives: [] + } +} +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() + } + for (const v of message.forfeitedIncentives) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCollectIncentivesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCollectIncentivesResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.collectedIncentives.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.forfeitedIncentives.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCollectIncentivesResponse { + const message = createBaseMsgCollectIncentivesResponse() + message.collectedIncentives = + object.collectedIncentives?.map((e) => Coin.fromPartial(e)) || [] + message.forfeitedIncentives = + object.forfeitedIncentives?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgCollectIncentivesResponseAmino + ): MsgCollectIncentivesResponse { + 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 = {} + if (message.collectedIncentives) { + obj.collected_incentives = message.collectedIncentives.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.collected_incentives = message.collectedIncentives + } + if (message.forfeitedIncentives) { + obj.forfeited_incentives = message.forfeitedIncentives.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.forfeited_incentives = message.forfeitedIncentives + } + return obj + }, + fromAminoMsg( + object: MsgCollectIncentivesResponseAminoMsg + ): MsgCollectIncentivesResponse { + return MsgCollectIncentivesResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCollectIncentivesResponse + ): MsgCollectIncentivesResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/collect-incentives-response', + value: MsgCollectIncentivesResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCollectIncentivesResponseProtoMsg + ): MsgCollectIncentivesResponse { + return MsgCollectIncentivesResponse.decode(message.value) + }, + toProto(message: MsgCollectIncentivesResponse): Uint8Array { + return MsgCollectIncentivesResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCollectIncentivesResponse + ): MsgCollectIncentivesResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse', + value: MsgCollectIncentivesResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCollectIncentivesResponse.typeUrl, + MsgCollectIncentivesResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCollectIncentivesResponse.aminoType, + MsgCollectIncentivesResponse.typeUrl +) +function createBaseMsgFungifyChargedPositions(): MsgFungifyChargedPositions { + return { + positionIds: [], + sender: '' + } +} +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) { + writer.uint64(v) + } + writer.ldelim() + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFungifyChargedPositions { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFungifyChargedPositions() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgFungifyChargedPositions { + const message = createBaseMsgFungifyChargedPositions() + message.positionIds = + object.positionIds?.map((e) => BigInt(e.toString())) || [] + message.sender = object.sender ?? '' + return message + }, + fromAmino( + object: MsgFungifyChargedPositionsAmino + ): MsgFungifyChargedPositions { + 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 = {} + if (message.positionIds) { + obj.position_ids = message.positionIds.map((e) => e.toString()) + } else { + obj.position_ids = message.positionIds + } + obj.sender = message.sender === '' ? undefined : message.sender + return obj + }, + fromAminoMsg( + object: MsgFungifyChargedPositionsAminoMsg + ): MsgFungifyChargedPositions { + return MsgFungifyChargedPositions.fromAmino(object.value) + }, + toAminoMsg( + message: MsgFungifyChargedPositions + ): MsgFungifyChargedPositionsAminoMsg { + return { + type: 'osmosis/cl-fungify-charged-positions', + value: MsgFungifyChargedPositions.toAmino(message) + } + }, + fromProtoMsg( + message: MsgFungifyChargedPositionsProtoMsg + ): MsgFungifyChargedPositions { + return MsgFungifyChargedPositions.decode(message.value) + }, + toProto(message: MsgFungifyChargedPositions): Uint8Array { + return MsgFungifyChargedPositions.encode(message).finish() + }, + toProtoMsg( + message: MsgFungifyChargedPositions + ): MsgFungifyChargedPositionsProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions', + value: MsgFungifyChargedPositions.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgFungifyChargedPositions.typeUrl, + MsgFungifyChargedPositions +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgFungifyChargedPositions.aminoType, + MsgFungifyChargedPositions.typeUrl +) +function createBaseMsgFungifyChargedPositionsResponse(): MsgFungifyChargedPositionsResponse { + return { + newPositionId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgFungifyChargedPositionsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgFungifyChargedPositionsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.newPositionId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + obj.new_position_id = + message.newPositionId !== BigInt(0) + ? message.newPositionId.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgFungifyChargedPositionsResponseAminoMsg + ): MsgFungifyChargedPositionsResponse { + return MsgFungifyChargedPositionsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgFungifyChargedPositionsResponse + ): MsgFungifyChargedPositionsResponseAminoMsg { + return { + type: 'osmosis/concentratedliquidity/fungify-charged-positions-response', + value: MsgFungifyChargedPositionsResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgFungifyChargedPositionsResponseProtoMsg + ): MsgFungifyChargedPositionsResponse { + return MsgFungifyChargedPositionsResponse.decode(message.value) + }, + toProto(message: MsgFungifyChargedPositionsResponse): Uint8Array { + return MsgFungifyChargedPositionsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgFungifyChargedPositionsResponse + ): MsgFungifyChargedPositionsResponseProtoMsg { + return { + typeUrl: + '/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse', + value: MsgFungifyChargedPositionsResponse.encode(message).finish() + } + } +} +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 + }, + 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 = message.positionIds + } + obj.sender = message.sender === '' ? undefined : message.sender + obj.new_owner = message.newOwner === '' ? undefined : 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 + }, + 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 +) diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts new file mode 100644 index 0000000..67c02a4 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgCreateBalancerPool } from './tx' +export const AminoConverter = { + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool': { + aminoType: 'osmosis/gamm/create-balancer-pool', + toAmino: MsgCreateBalancerPool.toAmino, + fromAmino: MsgCreateBalancerPool.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts new file mode 100644 index 0000000..3fd50fd --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts @@ -0,0 +1,44 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgCreateBalancerPool } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + MsgCreateBalancerPool + ] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.encode(value).finish() + } + } + }, + withTypeUrl: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value + } + } + }, + fromPartial: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts new file mode 100644 index 0000000..55dc625 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts @@ -0,0 +1,356 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + PoolParams, + PoolParamsAmino, + PoolParamsSDKType, + PoolAsset, + PoolAssetAmino, + PoolAssetSDKType +} from '../../../v1beta1/balancerPool' +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../../registry' +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPool { + sender: string + poolParams?: PoolParams + poolAssets: PoolAsset[] + futurePoolGovernor: string +} +export interface MsgCreateBalancerPoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool' + value: Uint8Array +} +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPoolAmino { + sender?: string + pool_params?: PoolParamsAmino + pool_assets?: PoolAssetAmino[] + future_pool_governor?: string +} +export interface MsgCreateBalancerPoolAminoMsg { + type: 'osmosis/gamm/create-balancer-pool' + value: MsgCreateBalancerPoolAmino +} +/** ===================== MsgCreatePool */ +export interface MsgCreateBalancerPoolSDKType { + sender: string + pool_params?: PoolParamsSDKType + pool_assets: PoolAssetSDKType[] + future_pool_governor: string +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponse { + poolId: bigint +} +export interface MsgCreateBalancerPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse' + value: Uint8Array +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponseAmino { + pool_id?: string +} +export interface MsgCreateBalancerPoolResponseAminoMsg { + type: 'osmosis/gamm/poolmodels/balancer/create-balancer-pool-response' + value: MsgCreateBalancerPoolResponseAmino +} +/** Returns the poolID */ +export interface MsgCreateBalancerPoolResponseSDKType { + pool_id: bigint +} +function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { + return { + sender: '', + 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) + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim() + } + for (const v of message.poolAssets) { + PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim() + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateBalancerPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateBalancerPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break + case 3: + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())) + break + case 4: + message.futurePoolGovernor = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateBalancerPool { + const message = createBaseMsgCreateBalancerPool() + message.sender = object.sender ?? '' + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.poolAssets = + object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || [] + message.futurePoolGovernor = object.futurePoolGovernor ?? '' + return message + }, + fromAmino(object: MsgCreateBalancerPoolAmino): MsgCreateBalancerPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined + if (message.poolAssets) { + obj.pool_assets = message.poolAssets.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ) + } else { + obj.pool_assets = message.poolAssets + } + obj.future_pool_governor = + message.futurePoolGovernor === '' ? undefined : message.futurePoolGovernor + return obj + }, + fromAminoMsg(object: MsgCreateBalancerPoolAminoMsg): MsgCreateBalancerPool { + return MsgCreateBalancerPool.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateBalancerPool): MsgCreateBalancerPoolAminoMsg { + return { + type: 'osmosis/gamm/create-balancer-pool', + value: MsgCreateBalancerPool.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreateBalancerPoolProtoMsg): MsgCreateBalancerPool { + return MsgCreateBalancerPool.decode(message.value) + }, + toProto(message: MsgCreateBalancerPool): Uint8Array { + return MsgCreateBalancerPool.encode(message).finish() + }, + toProtoMsg(message: MsgCreateBalancerPool): MsgCreateBalancerPoolProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool', + value: MsgCreateBalancerPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateBalancerPool.typeUrl, + MsgCreateBalancerPool +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateBalancerPool.aminoType, + MsgCreateBalancerPool.typeUrl +) +function createBaseMsgCreateBalancerPoolResponse(): MsgCreateBalancerPoolResponse { + return { + poolId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateBalancerPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateBalancerPoolResponse() + 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 + ): MsgCreateBalancerPoolResponse { + const message = createBaseMsgCreateBalancerPoolResponse() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgCreateBalancerPoolResponseAmino + ): MsgCreateBalancerPoolResponse { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgCreateBalancerPoolResponseAminoMsg + ): MsgCreateBalancerPoolResponse { + return MsgCreateBalancerPoolResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateBalancerPoolResponse + ): MsgCreateBalancerPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/poolmodels/balancer/create-balancer-pool-response', + value: MsgCreateBalancerPoolResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateBalancerPoolResponseProtoMsg + ): MsgCreateBalancerPoolResponse { + return MsgCreateBalancerPoolResponse.decode(message.value) + }, + toProto(message: MsgCreateBalancerPoolResponse): Uint8Array { + return MsgCreateBalancerPoolResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateBalancerPoolResponse + ): MsgCreateBalancerPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse', + value: MsgCreateBalancerPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateBalancerPoolResponse.typeUrl, + MsgCreateBalancerPoolResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateBalancerPoolResponse.aminoType, + MsgCreateBalancerPoolResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts new file mode 100644 index 0000000..d6454c3 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts @@ -0,0 +1,500 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Coin, + CoinAmino, + CoinSDKType +} from '../../../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { Decimal } from '@cosmjs/math' +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 + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParams { + swapFee: 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 + */ + exitFee: string +} +export interface PoolParamsProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams' + value: Uint8Array +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsAmino { + 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 +} +export interface PoolParamsAminoMsg { + type: 'osmosis/gamm/StableswapPoolParams' + value: PoolParamsAmino +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsSDKType { + swap_fee: string + exit_fee: string +} +/** Pool is the stableswap Pool struct */ +export interface Pool { + $typeUrl?: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool' + address: string + id: bigint + poolParams: PoolParams + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * 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. + */ + futurePoolGovernor: string + /** sum of all LP shares */ + totalShares: Coin + /** assets in the pool */ + poolLiquidity: Coin[] + /** for calculation amognst assets with different precisions */ + scalingFactors: bigint[] + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scalingFactorController: string +} +export interface PoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool' + value: Uint8Array +} +/** Pool is the stableswap Pool struct */ +export interface PoolAmino { + address?: string + id?: string + pool_params?: PoolParamsAmino + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * 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 + /** sum of all LP shares */ + total_shares?: CoinAmino + /** assets in the pool */ + pool_liquidity?: CoinAmino[] + /** for calculation amognst assets with different precisions */ + scaling_factors?: string[] + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scaling_factor_controller?: string +} +export interface PoolAminoMsg { + type: 'osmosis/gamm/StableswapPool' + value: PoolAmino +} +/** Pool is the stableswap Pool struct */ +export interface PoolSDKType { + $typeUrl?: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool' + address: string + id: bigint + pool_params: PoolParamsSDKType + future_pool_governor: string + total_shares: CoinSDKType + pool_liquidity: CoinSDKType[] + scaling_factors: bigint[] + scaling_factor_controller: string +} +function createBasePoolParams(): PoolParams { + return { + swapFee: '', + exitFee: '' + } +} +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) + } + if (message.exitFee !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.exitFee, 18).atomics) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 2: + message.exitFee = Decimal.fromAtomics(reader.string(), 18).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PoolParams { + const message = createBasePoolParams() + message.swapFee = object.swapFee ?? '' + message.exitFee = object.exitFee ?? '' + return message + }, + fromAmino(object: PoolParamsAmino): PoolParams { + 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 = {} + obj.swap_fee = message.swapFee === '' ? undefined : message.swapFee + obj.exit_fee = message.exitFee === '' ? undefined : message.exitFee + return obj + }, + fromAminoMsg(object: PoolParamsAminoMsg): PoolParams { + return PoolParams.fromAmino(object.value) + }, + toAminoMsg(message: PoolParams): PoolParamsAminoMsg { + return { + type: 'osmosis/gamm/StableswapPoolParams', + value: PoolParams.toAmino(message) + } + }, + fromProtoMsg(message: PoolParamsProtoMsg): PoolParams { + return PoolParams.decode(message.value) + }, + toProto(message: PoolParams): Uint8Array { + return PoolParams.encode(message).finish() + }, + toProtoMsg(message: PoolParams): PoolParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams', + value: PoolParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams) +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolParams.aminoType, + PoolParams.typeUrl +) +function createBasePool(): Pool { + return { + $typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + address: '', + id: BigInt(0), + poolParams: PoolParams.fromPartial({}), + futurePoolGovernor: '', + totalShares: Coin.fromPartial({}), + poolLiquidity: [], + scalingFactors: [], + scalingFactorController: '' + } +} +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) + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id) + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim() + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor) + } + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(42).fork()).ldelim() + } + for (const v of message.poolLiquidity) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim() + } + writer.uint32(58).fork() + for (const v of message.scalingFactors) { + writer.uint64(v) + } + writer.ldelim() + if (message.scalingFactorController !== '') { + writer.uint32(66).string(message.scalingFactorController) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.string() + break + case 2: + message.id = reader.uint64() + break + case 3: + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break + case 4: + message.futurePoolGovernor = reader.string() + break + case 5: + message.totalShares = Coin.decode(reader, reader.uint32()) + break + case 6: + message.poolLiquidity.push(Coin.decode(reader, reader.uint32())) + break + case 7: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()) + } + } else { + message.scalingFactors.push(reader.uint64()) + } + break + case 8: + message.scalingFactorController = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Pool { + const message = createBasePool() + message.address = object.address ?? '' + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0) + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.futurePoolGovernor = object.futurePoolGovernor ?? '' + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined + message.poolLiquidity = + object.poolLiquidity?.map((e) => Coin.fromPartial(e)) || [] + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || [] + message.scalingFactorController = object.scalingFactorController ?? '' + return message + }, + fromAmino(object: PoolAmino): Pool { + 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 = {} + obj.address = message.address === '' ? undefined : message.address + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined + obj.future_pool_governor = + message.futurePoolGovernor === '' ? undefined : message.futurePoolGovernor + obj.total_shares = message.totalShares + ? Coin.toAmino(message.totalShares) + : undefined + if (message.poolLiquidity) { + obj.pool_liquidity = message.poolLiquidity.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.pool_liquidity = message.poolLiquidity + } + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()) + } else { + obj.scaling_factors = message.scalingFactors + } + obj.scaling_factor_controller = + message.scalingFactorController === '' + ? undefined + : message.scalingFactorController + return obj + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value) + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: 'osmosis/gamm/StableswapPool', + value: Pool.toAmino(message) + } + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value) + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish() + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + value: Pool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Pool.typeUrl, Pool) +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl) diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts new file mode 100644 index 0000000..7451f6e --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts @@ -0,0 +1,19 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgCreateStableswapPool, + MsgStableSwapAdjustScalingFactors +} from './tx' +export const AminoConverter = { + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool': { + aminoType: 'osmosis/gamm/create-stableswap-pool', + toAmino: MsgCreateStableswapPool.toAmino, + fromAmino: MsgCreateStableswapPool.fromAmino + }, + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors': + { + aminoType: 'osmosis/gamm/stableswap-adjust-scaling-factors', + toAmino: MsgStableSwapAdjustScalingFactors.toAmino, + fromAmino: MsgStableSwapAdjustScalingFactors.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts new file mode 100644 index 0000000..f7fb223 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts @@ -0,0 +1,72 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { + MsgCreateStableswapPool, + MsgStableSwapAdjustScalingFactors +} from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + MsgCreateStableswapPool + ], + [ + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + MsgStableSwapAdjustScalingFactors + ] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.encode(value).finish() + } + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.encode(value).finish() + } + } + }, + withTypeUrl: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value + } + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value + } + } + }, + fromPartial: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.fromPartial(value) + } + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts new file mode 100644 index 0000000..ee62519 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts @@ -0,0 +1,751 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + PoolParams, + PoolParamsAmino, + PoolParamsSDKType +} from './stableswap_pool' +import { + Coin, + CoinAmino, + CoinSDKType +} from '../../../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../../../binary' +import { GlobalDecoderRegistry } from '../../../../../registry' +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPool { + sender: string + poolParams?: PoolParams + initialPoolLiquidity: Coin[] + scalingFactors: bigint[] + futurePoolGovernor: string + scalingFactorController: string +} +export interface MsgCreateStableswapPoolProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool' + value: Uint8Array +} +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPoolAmino { + sender?: string + pool_params?: PoolParamsAmino + initial_pool_liquidity?: CoinAmino[] + scaling_factors?: string[] + future_pool_governor?: string + scaling_factor_controller?: string +} +export interface MsgCreateStableswapPoolAminoMsg { + type: 'osmosis/gamm/create-stableswap-pool' + value: MsgCreateStableswapPoolAmino +} +/** ===================== MsgCreatePool */ +export interface MsgCreateStableswapPoolSDKType { + sender: string + pool_params?: PoolParamsSDKType + initial_pool_liquidity: CoinSDKType[] + scaling_factors: bigint[] + future_pool_governor: string + scaling_factor_controller: string +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponse { + poolId: bigint +} +export interface MsgCreateStableswapPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse' + value: Uint8Array +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponseAmino { + pool_id?: string +} +export interface MsgCreateStableswapPoolResponseAminoMsg { + type: 'osmosis/gamm/create-stableswap-pool-response' + value: MsgCreateStableswapPoolResponseAmino +} +/** Returns a poolID with custom poolName. */ +export interface MsgCreateStableswapPoolResponseSDKType { + pool_id: bigint +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactors { + sender: string + poolId: bigint + scalingFactors: bigint[] +} +export interface MsgStableSwapAdjustScalingFactorsProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors' + value: Uint8Array +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactorsAmino { + sender?: string + pool_id?: string + scaling_factors?: string[] +} +export interface MsgStableSwapAdjustScalingFactorsAminoMsg { + type: 'osmosis/gamm/stableswap-adjust-scaling-factors' + value: MsgStableSwapAdjustScalingFactorsAmino +} +/** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed. Adjusts stableswap scaling factors. + */ +export interface MsgStableSwapAdjustScalingFactorsSDKType { + sender: string + pool_id: bigint + scaling_factors: bigint[] +} +export interface MsgStableSwapAdjustScalingFactorsResponse {} +export interface MsgStableSwapAdjustScalingFactorsResponseProtoMsg { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse' + value: Uint8Array +} +export interface MsgStableSwapAdjustScalingFactorsResponseAmino {} +export interface MsgStableSwapAdjustScalingFactorsResponseAminoMsg { + type: 'osmosis/gamm/stable-swap-adjust-scaling-factors-response' + value: MsgStableSwapAdjustScalingFactorsResponseAmino +} +export interface MsgStableSwapAdjustScalingFactorsResponseSDKType {} +function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { + return { + sender: '', + poolParams: undefined, + initialPoolLiquidity: [], + scalingFactors: [], + futurePoolGovernor: '', + scalingFactorController: '' + } +} +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) + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim() + } + for (const v of message.initialPoolLiquidity) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + writer.uint32(34).fork() + for (const v of message.scalingFactors) { + writer.uint64(v) + } + writer.ldelim() + if (message.futurePoolGovernor !== '') { + writer.uint32(42).string(message.futurePoolGovernor) + } + if (message.scalingFactorController !== '') { + writer.uint32(50).string(message.scalingFactorController) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateStableswapPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateStableswapPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break + case 3: + message.initialPoolLiquidity.push( + Coin.decode(reader, reader.uint32()) + ) + break + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()) + } + } else { + message.scalingFactors.push(reader.uint64()) + } + break + case 5: + message.futurePoolGovernor = reader.string() + break + case 6: + message.scalingFactorController = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCreateStableswapPool { + const message = createBaseMsgCreateStableswapPool() + message.sender = object.sender ?? '' + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.initialPoolLiquidity = + object.initialPoolLiquidity?.map((e) => Coin.fromPartial(e)) || [] + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || [] + message.futurePoolGovernor = object.futurePoolGovernor ?? '' + message.scalingFactorController = object.scalingFactorController ?? '' + return message + }, + fromAmino(object: MsgCreateStableswapPoolAmino): MsgCreateStableswapPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined + if (message.initialPoolLiquidity) { + obj.initial_pool_liquidity = message.initialPoolLiquidity.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.initial_pool_liquidity = message.initialPoolLiquidity + } + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()) + } else { + obj.scaling_factors = message.scalingFactors + } + obj.future_pool_governor = + message.futurePoolGovernor === '' ? undefined : message.futurePoolGovernor + obj.scaling_factor_controller = + message.scalingFactorController === '' + ? undefined + : message.scalingFactorController + return obj + }, + fromAminoMsg( + object: MsgCreateStableswapPoolAminoMsg + ): MsgCreateStableswapPool { + return MsgCreateStableswapPool.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateStableswapPool + ): MsgCreateStableswapPoolAminoMsg { + return { + type: 'osmosis/gamm/create-stableswap-pool', + value: MsgCreateStableswapPool.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateStableswapPoolProtoMsg + ): MsgCreateStableswapPool { + return MsgCreateStableswapPool.decode(message.value) + }, + toProto(message: MsgCreateStableswapPool): Uint8Array { + return MsgCreateStableswapPool.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateStableswapPool + ): MsgCreateStableswapPoolProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool', + value: MsgCreateStableswapPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateStableswapPool.typeUrl, + MsgCreateStableswapPool +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateStableswapPool.aminoType, + MsgCreateStableswapPool.typeUrl +) +function createBaseMsgCreateStableswapPoolResponse(): MsgCreateStableswapPoolResponse { + return { + poolId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateStableswapPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateStableswapPoolResponse() + 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 + ): MsgCreateStableswapPoolResponse { + const message = createBaseMsgCreateStableswapPoolResponse() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgCreateStableswapPoolResponseAmino + ): MsgCreateStableswapPoolResponse { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgCreateStableswapPoolResponseAminoMsg + ): MsgCreateStableswapPoolResponse { + return MsgCreateStableswapPoolResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCreateStableswapPoolResponse + ): MsgCreateStableswapPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/create-stableswap-pool-response', + value: MsgCreateStableswapPoolResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateStableswapPoolResponseProtoMsg + ): MsgCreateStableswapPoolResponse { + return MsgCreateStableswapPoolResponse.decode(message.value) + }, + toProto(message: MsgCreateStableswapPoolResponse): Uint8Array { + return MsgCreateStableswapPoolResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCreateStableswapPoolResponse + ): MsgCreateStableswapPoolResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse', + value: MsgCreateStableswapPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateStableswapPoolResponse.typeUrl, + MsgCreateStableswapPoolResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateStableswapPoolResponse.aminoType, + MsgCreateStableswapPoolResponse.typeUrl +) +function createBaseMsgStableSwapAdjustScalingFactors(): MsgStableSwapAdjustScalingFactors { + return { + sender: '', + poolId: BigInt(0), + scalingFactors: [] + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + writer.uint32(26).fork() + for (const v of message.scalingFactors) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgStableSwapAdjustScalingFactors { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgStableSwapAdjustScalingFactors() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.scalingFactors.push(reader.uint64()) + } + } else { + message.scalingFactors.push(reader.uint64()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgStableSwapAdjustScalingFactors { + const message = createBaseMsgStableSwapAdjustScalingFactors() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.scalingFactors = + object.scalingFactors?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino( + object: MsgStableSwapAdjustScalingFactorsAmino + ): MsgStableSwapAdjustScalingFactors { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map((e) => e.toString()) + } else { + obj.scaling_factors = message.scalingFactors + } + return obj + }, + fromAminoMsg( + object: MsgStableSwapAdjustScalingFactorsAminoMsg + ): MsgStableSwapAdjustScalingFactors { + return MsgStableSwapAdjustScalingFactors.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStableSwapAdjustScalingFactors + ): MsgStableSwapAdjustScalingFactorsAminoMsg { + return { + type: 'osmosis/gamm/stableswap-adjust-scaling-factors', + value: MsgStableSwapAdjustScalingFactors.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStableSwapAdjustScalingFactorsProtoMsg + ): MsgStableSwapAdjustScalingFactors { + return MsgStableSwapAdjustScalingFactors.decode(message.value) + }, + toProto(message: MsgStableSwapAdjustScalingFactors): Uint8Array { + return MsgStableSwapAdjustScalingFactors.encode(message).finish() + }, + toProtoMsg( + message: MsgStableSwapAdjustScalingFactors + ): MsgStableSwapAdjustScalingFactorsProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors', + value: MsgStableSwapAdjustScalingFactors.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgStableSwapAdjustScalingFactorsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgStableSwapAdjustScalingFactorsResponse { + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse() + return message + }, + fromAmino( + _: MsgStableSwapAdjustScalingFactorsResponseAmino + ): MsgStableSwapAdjustScalingFactorsResponse { + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse() + return message + }, + toAmino( + _: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgStableSwapAdjustScalingFactorsResponseAminoMsg + ): MsgStableSwapAdjustScalingFactorsResponse { + return MsgStableSwapAdjustScalingFactorsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseAminoMsg { + return { + type: 'osmosis/gamm/stable-swap-adjust-scaling-factors-response', + value: MsgStableSwapAdjustScalingFactorsResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgStableSwapAdjustScalingFactorsResponseProtoMsg + ): MsgStableSwapAdjustScalingFactorsResponse { + return MsgStableSwapAdjustScalingFactorsResponse.decode(message.value) + }, + toProto(message: MsgStableSwapAdjustScalingFactorsResponse): Uint8Array { + return MsgStableSwapAdjustScalingFactorsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgStableSwapAdjustScalingFactorsResponse + ): MsgStableSwapAdjustScalingFactorsResponseProtoMsg { + return { + typeUrl: + '/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse', + value: MsgStableSwapAdjustScalingFactorsResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgStableSwapAdjustScalingFactorsResponse.typeUrl, + MsgStableSwapAdjustScalingFactorsResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgStableSwapAdjustScalingFactorsResponse.aminoType, + MsgStableSwapAdjustScalingFactorsResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/balancerPool.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/balancerPool.ts new file mode 100644 index 0000000..dbe5997 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/balancerPool.ts @@ -0,0 +1,964 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { toTimestamp, fromTimestamp } from '../../../../helpers' +import { GlobalDecoderRegistry } from '../../../registry' +import { Decimal } from '@cosmjs/math' +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParams { + /** + * The start time for beginning the weight change. + * If a parameter change / pool instantiation leaves this blank, + * it should be generated by the state_machine as the current time. + */ + startTime: Date + /** Duration for the weights to change over */ + duration: Duration + /** + * The initial pool weights. These are copied from the pool's settings + * at the time of weight change instantiation. + * The amount PoolAsset.token.amount field is ignored if present, + * future type refactorings should just have a type with the denom & weight + * here. + */ + initialPoolWeights: PoolAsset[] + /** + * 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. + */ + targetPoolWeights: PoolAsset[] +} +export interface SmoothWeightChangeParamsProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.SmoothWeightChangeParams' + value: Uint8Array +} +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParamsAmino { + /** + * The start time for beginning the weight change. + * If a parameter change / pool instantiation leaves this blank, + * it should be generated by the state_machine as the current time. + */ + start_time?: string + /** Duration for the weights to change over */ + duration?: DurationAmino + /** + * The initial pool weights. These are copied from the pool's settings + * at the time of weight change instantiation. + * The amount PoolAsset.token.amount field is ignored if present, + * future type refactorings should just have a type with the denom & weight + * here. + */ + 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[] +} +export interface SmoothWeightChangeParamsAminoMsg { + type: 'osmosis/gamm/smooth-weight-change-params' + value: SmoothWeightChangeParamsAmino +} +/** + * Parameters for changing the weights in a balancer pool smoothly from + * a start weight and end weight over a period of time. + * Currently, the only smooth change supported is linear changing between + * the two weights, but more types may be added in the future. + * When these parameters are set, the weight w(t) for pool time `t` is the + * following: + * t <= start_time: w(t) = initial_pool_weights + * start_time < t <= start_time + duration: + * w(t) = initial_pool_weights + (t - start_time) * + * (target_pool_weights - initial_pool_weights) / (duration) + * t > start_time + duration: w(t) = target_pool_weights + */ +export interface SmoothWeightChangeParamsSDKType { + start_time: Date + duration: DurationSDKType + initial_pool_weights: PoolAssetSDKType[] + target_pool_weights: PoolAssetSDKType[] +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParams { + swapFee: 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 + */ + exitFee: string + smoothWeightChangeParams?: SmoothWeightChangeParams +} +export interface PoolParamsProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.PoolParams' + value: Uint8Array +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsAmino { + 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 + smooth_weight_change_params?: SmoothWeightChangeParamsAmino +} +export interface PoolParamsAminoMsg { + type: 'osmosis/gamm/BalancerPoolParams' + value: PoolParamsAmino +} +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParamsSDKType { + swap_fee: string + exit_fee: string + smooth_weight_change_params?: SmoothWeightChangeParamsSDKType +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAsset { + /** + * Coins we are talking about, + * the denomination must be unique amongst all PoolAssets for this pool. + */ + token: Coin + /** Weight that is not normalized. This weight must be less than 2^50 */ + weight: string +} +export interface PoolAssetProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.PoolAsset' + value: Uint8Array +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAssetAmino { + /** + * Coins we are talking about, + * the denomination must be unique amongst all PoolAssets for this pool. + */ + token?: CoinAmino + /** Weight that is not normalized. This weight must be less than 2^50 */ + weight?: string +} +export interface PoolAssetAminoMsg { + type: 'osmosis/gamm/pool-asset' + value: PoolAssetAmino +} +/** + * Pool asset is an internal struct that combines the amount of the + * token in the pool, and its balancer weight. + * This is an awkward packaging of data, + * and should be revisited in a future state migration. + */ +export interface PoolAssetSDKType { + token: CoinSDKType + weight: string +} +export interface Pool { + $typeUrl?: '/osmosis.gamm.v1beta1.Pool' + address: string + id: bigint + poolParams: PoolParams + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * 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. + * TODO: Further improve these docs + */ + futurePoolGovernor: string + /** sum of all LP tokens sent out */ + totalShares: Coin + /** + * These are assumed to be sorted by denomiation. + * They contain the pool asset and the information about the weight + */ + poolAssets: PoolAsset[] + /** sum of all non-normalized pool weights */ + totalWeight: string +} +export interface PoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.Pool' + value: Uint8Array +} +export interface PoolAmino { + address?: string + id?: string + pool_params?: PoolParamsAmino + /** + * This string specifies who will govern the pool in the future. + * Valid forms of this are: + * {token name},{duration} + * {duration} + * where {token name} if specified is the token which determines the + * governor, and if not specified is the LP token for this pool.duration is + * 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. + * TODO: Further improve these docs + */ + 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[] + /** sum of all non-normalized pool weights */ + total_weight?: string +} +export interface PoolAminoMsg { + type: 'osmosis/gamm/BalancerPool' + value: PoolAmino +} +export interface PoolSDKType { + $typeUrl?: '/osmosis.gamm.v1beta1.Pool' + address: string + id: bigint + pool_params: PoolParamsSDKType + future_pool_governor: string + total_shares: CoinSDKType + pool_assets: PoolAssetSDKType[] + total_weight: string +} +function createBaseSmoothWeightChangeParams(): SmoothWeightChangeParams { + return { + 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() + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim() + } + for (const v of message.initialPoolWeights) { + PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim() + } + for (const v of message.targetPoolWeights) { + PoolAsset.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SmoothWeightChangeParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSmoothWeightChangeParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 2: + message.duration = Duration.decode(reader, reader.uint32()) + break + case 3: + message.initialPoolWeights.push( + PoolAsset.decode(reader, reader.uint32()) + ) + break + case 4: + message.targetPoolWeights.push( + PoolAsset.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SmoothWeightChangeParams { + const message = createBaseSmoothWeightChangeParams() + message.startTime = object.startTime ?? undefined + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + message.initialPoolWeights = + object.initialPoolWeights?.map((e) => PoolAsset.fromPartial(e)) || [] + message.targetPoolWeights = + object.targetPoolWeights?.map((e) => PoolAsset.fromPartial(e)) || [] + return message + }, + fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { + 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 + ? 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 + ) + } else { + obj.initial_pool_weights = message.initialPoolWeights + } + if (message.targetPoolWeights) { + obj.target_pool_weights = message.targetPoolWeights.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ) + } else { + obj.target_pool_weights = message.targetPoolWeights + } + return obj + }, + fromAminoMsg( + object: SmoothWeightChangeParamsAminoMsg + ): SmoothWeightChangeParams { + return SmoothWeightChangeParams.fromAmino(object.value) + }, + toAminoMsg( + message: SmoothWeightChangeParams + ): SmoothWeightChangeParamsAminoMsg { + return { + type: 'osmosis/gamm/smooth-weight-change-params', + value: SmoothWeightChangeParams.toAmino(message) + } + }, + fromProtoMsg( + message: SmoothWeightChangeParamsProtoMsg + ): SmoothWeightChangeParams { + return SmoothWeightChangeParams.decode(message.value) + }, + toProto(message: SmoothWeightChangeParams): Uint8Array { + return SmoothWeightChangeParams.encode(message).finish() + }, + toProtoMsg( + message: SmoothWeightChangeParams + ): SmoothWeightChangeParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.SmoothWeightChangeParams', + value: SmoothWeightChangeParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SmoothWeightChangeParams.typeUrl, + SmoothWeightChangeParams +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SmoothWeightChangeParams.aminoType, + SmoothWeightChangeParams.typeUrl +) +function createBasePoolParams(): PoolParams { + return { + swapFee: '', + exitFee: '', + smoothWeightChangeParams: undefined + } +} +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) + } + if (message.exitFee !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.exitFee, 18).atomics) + } + if (message.smoothWeightChangeParams !== undefined) { + SmoothWeightChangeParams.encode( + message.smoothWeightChangeParams, + writer.uint32(26).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 2: + message.exitFee = Decimal.fromAtomics(reader.string(), 18).toString() + break + case 3: + message.smoothWeightChangeParams = SmoothWeightChangeParams.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PoolParams { + const message = createBasePoolParams() + message.swapFee = object.swapFee ?? '' + message.exitFee = object.exitFee ?? '' + message.smoothWeightChangeParams = + object.smoothWeightChangeParams !== undefined && + object.smoothWeightChangeParams !== null + ? SmoothWeightChangeParams.fromPartial(object.smoothWeightChangeParams) + : undefined + return message + }, + fromAmino(object: PoolParamsAmino): PoolParams { + 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 = {} + obj.swap_fee = message.swapFee === '' ? undefined : message.swapFee + obj.exit_fee = message.exitFee === '' ? undefined : message.exitFee + obj.smooth_weight_change_params = message.smoothWeightChangeParams + ? SmoothWeightChangeParams.toAmino(message.smoothWeightChangeParams) + : undefined + return obj + }, + fromAminoMsg(object: PoolParamsAminoMsg): PoolParams { + return PoolParams.fromAmino(object.value) + }, + toAminoMsg(message: PoolParams): PoolParamsAminoMsg { + return { + type: 'osmosis/gamm/BalancerPoolParams', + value: PoolParams.toAmino(message) + } + }, + fromProtoMsg(message: PoolParamsProtoMsg): PoolParams { + return PoolParams.decode(message.value) + }, + toProto(message: PoolParams): Uint8Array { + return PoolParams.encode(message).finish() + }, + toProtoMsg(message: PoolParams): PoolParamsProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.PoolParams', + value: PoolParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams) +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolParams.aminoType, + PoolParams.typeUrl +) +function createBasePoolAsset(): PoolAsset { + return { + 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() + } + if (message.weight !== '') { + writer.uint32(18).string(message.weight) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolAsset { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolAsset() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.token = Coin.decode(reader, reader.uint32()) + break + case 2: + message.weight = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PoolAsset { + const message = createBasePoolAsset() + message.token = + object.token !== undefined && object.token !== null + ? Coin.fromPartial(object.token) + : undefined + message.weight = object.weight ?? '' + return message + }, + fromAmino(object: PoolAssetAmino): PoolAsset { + 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 = {} + obj.token = message.token ? Coin.toAmino(message.token) : undefined + obj.weight = message.weight === '' ? undefined : message.weight + return obj + }, + fromAminoMsg(object: PoolAssetAminoMsg): PoolAsset { + return PoolAsset.fromAmino(object.value) + }, + toAminoMsg(message: PoolAsset): PoolAssetAminoMsg { + return { + type: 'osmosis/gamm/pool-asset', + value: PoolAsset.toAmino(message) + } + }, + fromProtoMsg(message: PoolAssetProtoMsg): PoolAsset { + return PoolAsset.decode(message.value) + }, + toProto(message: PoolAsset): Uint8Array { + return PoolAsset.encode(message).finish() + }, + toProtoMsg(message: PoolAsset): PoolAssetProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.PoolAsset', + value: PoolAsset.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PoolAsset.typeUrl, PoolAsset) +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolAsset.aminoType, + PoolAsset.typeUrl +) +function createBasePool(): Pool { + return { + $typeUrl: '/osmosis.gamm.v1beta1.Pool', + address: '', + id: BigInt(0), + poolParams: PoolParams.fromPartial({}), + futurePoolGovernor: '', + 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) + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id) + } + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim() + } + if (message.futurePoolGovernor !== '') { + writer.uint32(34).string(message.futurePoolGovernor) + } + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(42).fork()).ldelim() + } + for (const v of message.poolAssets) { + PoolAsset.encode(v!, writer.uint32(50).fork()).ldelim() + } + if (message.totalWeight !== '') { + writer.uint32(58).string(message.totalWeight) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.string() + break + case 2: + message.id = reader.uint64() + break + case 3: + message.poolParams = PoolParams.decode(reader, reader.uint32()) + break + case 4: + message.futurePoolGovernor = reader.string() + break + case 5: + message.totalShares = Coin.decode(reader, reader.uint32()) + break + case 6: + message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())) + break + case 7: + message.totalWeight = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Pool { + const message = createBasePool() + message.address = object.address ?? '' + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0) + message.poolParams = + object.poolParams !== undefined && object.poolParams !== null + ? PoolParams.fromPartial(object.poolParams) + : undefined + message.futurePoolGovernor = object.futurePoolGovernor ?? '' + message.totalShares = + object.totalShares !== undefined && object.totalShares !== null + ? Coin.fromPartial(object.totalShares) + : undefined + message.poolAssets = + object.poolAssets?.map((e) => PoolAsset.fromPartial(e)) || [] + message.totalWeight = object.totalWeight ?? '' + return message + }, + fromAmino(object: PoolAmino): Pool { + 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 = {} + obj.address = message.address === '' ? undefined : message.address + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined + obj.pool_params = message.poolParams + ? PoolParams.toAmino(message.poolParams) + : undefined + obj.future_pool_governor = + message.futurePoolGovernor === '' ? undefined : message.futurePoolGovernor + obj.total_shares = message.totalShares + ? Coin.toAmino(message.totalShares) + : undefined + if (message.poolAssets) { + obj.pool_assets = message.poolAssets.map((e) => + e ? PoolAsset.toAmino(e) : undefined + ) + } else { + obj.pool_assets = message.poolAssets + } + obj.total_weight = + message.totalWeight === '' ? undefined : message.totalWeight + return obj + }, + fromAminoMsg(object: PoolAminoMsg): Pool { + return Pool.fromAmino(object.value) + }, + toAminoMsg(message: Pool): PoolAminoMsg { + return { + type: 'osmosis/gamm/BalancerPool', + value: Pool.toAmino(message) + } + }, + fromProtoMsg(message: PoolProtoMsg): Pool { + return Pool.decode(message.value) + }, + toProto(message: Pool): Uint8Array { + return Pool.encode(message).finish() + }, + toProtoMsg(message: Pool): PoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.Pool', + value: Pool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Pool.typeUrl, Pool) +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl) diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/gov.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/gov.ts new file mode 100644 index 0000000..c4368e9 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/gov.ts @@ -0,0 +1,1144 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + BalancerToConcentratedPoolLink, + BalancerToConcentratedPoolLinkAmino, + BalancerToConcentratedPoolLinkSDKType +} from './shared' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + * proposal’s records override the existing MigrationRecords set in the module. + * Each record specifies a single connection between a single balancer pool and + * a single concentrated pool. + */ +export interface ReplaceMigrationRecordsProposal { + $typeUrl?: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal' + title: string + description: string + records: BalancerToConcentratedPoolLink[] +} +export interface ReplaceMigrationRecordsProposalProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal' + value: Uint8Array +} +/** + * ReplaceMigrationRecordsProposal is a gov Content type for updating the + * migration records. If a ReplaceMigrationRecordsProposal passes, the + * proposal’s records override the existing MigrationRecords set in the module. + * Each record specifies a single connection between a single balancer pool and + * a single concentrated pool. + */ +export interface ReplaceMigrationRecordsProposalAmino { + title?: string + description?: string + records?: BalancerToConcentratedPoolLinkAmino[] +} +export interface ReplaceMigrationRecordsProposalAminoMsg { + type: 'osmosis/ReplaceMigrationRecordsProposal' + value: ReplaceMigrationRecordsProposalAmino +} +/** + * ReplaceMigrationRecordsProposal is a gov Content type for updating the + * migration records. If a ReplaceMigrationRecordsProposal passes, the + * proposal’s records override the existing MigrationRecords set in the module. + * Each record specifies a single connection between a single balancer pool and + * a single concentrated pool. + */ +export interface ReplaceMigrationRecordsProposalSDKType { + $typeUrl?: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal' + title: string + description: string + records: BalancerToConcentratedPoolLinkSDKType[] +} +/** + * For example: if the existing DistrRecords were: + * [(Balancer 1, CL 5), (Balancer 2, CL 6), (Balancer 3, CL 7)] + * And an UpdateMigrationRecordsProposal includes + * [(Balancer 2, CL 0), (Balancer 3, CL 4), (Balancer 4, CL 10)] + * This would leave Balancer 1 record, delete Balancer 2 record, + * Edit Balancer 3 record, and Add Balancer 4 record + * The result MigrationRecords in state would be: + * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] + */ +export interface UpdateMigrationRecordsProposal { + $typeUrl?: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal' + title: string + description: string + records: BalancerToConcentratedPoolLink[] +} +export interface UpdateMigrationRecordsProposalProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal' + value: Uint8Array +} +/** + * For example: if the existing DistrRecords were: + * [(Balancer 1, CL 5), (Balancer 2, CL 6), (Balancer 3, CL 7)] + * And an UpdateMigrationRecordsProposal includes + * [(Balancer 2, CL 0), (Balancer 3, CL 4), (Balancer 4, CL 10)] + * This would leave Balancer 1 record, delete Balancer 2 record, + * Edit Balancer 3 record, and Add Balancer 4 record + * The result MigrationRecords in state would be: + * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] + */ +export interface UpdateMigrationRecordsProposalAmino { + title?: string + description?: string + records?: BalancerToConcentratedPoolLinkAmino[] +} +export interface UpdateMigrationRecordsProposalAminoMsg { + type: 'osmosis/UpdateMigrationRecordsProposal' + value: UpdateMigrationRecordsProposalAmino +} +/** + * For example: if the existing DistrRecords were: + * [(Balancer 1, CL 5), (Balancer 2, CL 6), (Balancer 3, CL 7)] + * And an UpdateMigrationRecordsProposal includes + * [(Balancer 2, CL 0), (Balancer 3, CL 4), (Balancer 4, CL 10)] + * This would leave Balancer 1 record, delete Balancer 2 record, + * Edit Balancer 3 record, and Add Balancer 4 record + * The result MigrationRecords in state would be: + * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] + */ +export interface UpdateMigrationRecordsProposalSDKType { + $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', + title: '', + description: '', + records: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.records) { + BalancerToConcentratedPoolLink.encode( + v!, + writer.uint32(26).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ReplaceMigrationRecordsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseReplaceMigrationRecordsProposal() + 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.records.push( + BalancerToConcentratedPoolLink.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ReplaceMigrationRecordsProposal { + const message = createBaseReplaceMigrationRecordsProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.records = + object.records?.map((e) => + BalancerToConcentratedPoolLink.fromPartial(e) + ) || [] + return message + }, + fromAmino( + object: ReplaceMigrationRecordsProposalAmino + ): ReplaceMigrationRecordsProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.records) { + obj.records = message.records.map((e) => + e ? BalancerToConcentratedPoolLink.toAmino(e) : undefined + ) + } else { + obj.records = message.records + } + return obj + }, + fromAminoMsg( + object: ReplaceMigrationRecordsProposalAminoMsg + ): ReplaceMigrationRecordsProposal { + return ReplaceMigrationRecordsProposal.fromAmino(object.value) + }, + toAminoMsg( + message: ReplaceMigrationRecordsProposal + ): ReplaceMigrationRecordsProposalAminoMsg { + return { + type: 'osmosis/ReplaceMigrationRecordsProposal', + value: ReplaceMigrationRecordsProposal.toAmino(message) + } + }, + fromProtoMsg( + message: ReplaceMigrationRecordsProposalProtoMsg + ): ReplaceMigrationRecordsProposal { + return ReplaceMigrationRecordsProposal.decode(message.value) + }, + toProto(message: ReplaceMigrationRecordsProposal): Uint8Array { + return ReplaceMigrationRecordsProposal.encode(message).finish() + }, + toProtoMsg( + message: ReplaceMigrationRecordsProposal + ): ReplaceMigrationRecordsProposalProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal', + value: ReplaceMigrationRecordsProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ReplaceMigrationRecordsProposal.typeUrl, + ReplaceMigrationRecordsProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ReplaceMigrationRecordsProposal.aminoType, + ReplaceMigrationRecordsProposal.typeUrl +) +function createBaseUpdateMigrationRecordsProposal(): UpdateMigrationRecordsProposal { + return { + $typeUrl: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal', + title: '', + description: '', + records: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.records) { + BalancerToConcentratedPoolLink.encode( + v!, + writer.uint32(26).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateMigrationRecordsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdateMigrationRecordsProposal() + 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.records.push( + BalancerToConcentratedPoolLink.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): UpdateMigrationRecordsProposal { + const message = createBaseUpdateMigrationRecordsProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.records = + object.records?.map((e) => + BalancerToConcentratedPoolLink.fromPartial(e) + ) || [] + return message + }, + fromAmino( + object: UpdateMigrationRecordsProposalAmino + ): UpdateMigrationRecordsProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.records) { + obj.records = message.records.map((e) => + e ? BalancerToConcentratedPoolLink.toAmino(e) : undefined + ) + } else { + obj.records = message.records + } + return obj + }, + fromAminoMsg( + object: UpdateMigrationRecordsProposalAminoMsg + ): UpdateMigrationRecordsProposal { + return UpdateMigrationRecordsProposal.fromAmino(object.value) + }, + toAminoMsg( + message: UpdateMigrationRecordsProposal + ): UpdateMigrationRecordsProposalAminoMsg { + return { + type: 'osmosis/UpdateMigrationRecordsProposal', + value: UpdateMigrationRecordsProposal.toAmino(message) + } + }, + fromProtoMsg( + message: UpdateMigrationRecordsProposalProtoMsg + ): UpdateMigrationRecordsProposal { + return UpdateMigrationRecordsProposal.decode(message.value) + }, + toProto(message: UpdateMigrationRecordsProposal): Uint8Array { + return UpdateMigrationRecordsProposal.encode(message).finish() + }, + toProtoMsg( + message: UpdateMigrationRecordsProposal + ): UpdateMigrationRecordsProposalProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal', + value: UpdateMigrationRecordsProposal.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.denom0 + obj.denom1 = message.denom1 === '' ? undefined : message.denom1 + obj.tick_spacing = + message.tickSpacing !== BigInt(0) + ? message.tickSpacing.toString() + : undefined + obj.exponent_at_price_one = + message.exponentAtPriceOne === '' ? undefined : message.exponentAtPriceOne + obj.spread_factor = + message.spreadFactor === '' ? undefined : message.spreadFactor + obj.balancer_pool_id = + message.balancerPoolId !== BigInt(0) + ? 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 + }, + 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 === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : 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 = message.poolRecordsWithCfmmLink + } + 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 + }, + 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 === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.controller_address = + message.controllerAddress === '' ? undefined : 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 +) diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/shared.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/shared.ts new file mode 100644 index 0000000..ea518fd --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/shared.ts @@ -0,0 +1,356 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * MigrationRecords contains all the links between balancer and concentrated + * pools + */ +export interface MigrationRecords { + balancerToConcentratedPoolLinks: BalancerToConcentratedPoolLink[] +} +export interface MigrationRecordsProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MigrationRecords' + value: Uint8Array +} +/** + * MigrationRecords contains all the links between balancer and concentrated + * pools + */ +export interface MigrationRecordsAmino { + balancer_to_concentrated_pool_links?: BalancerToConcentratedPoolLinkAmino[] +} +export interface MigrationRecordsAminoMsg { + type: 'osmosis/gamm/migration-records' + value: MigrationRecordsAmino +} +/** + * MigrationRecords contains all the links between balancer and concentrated + * pools + */ +export interface MigrationRecordsSDKType { + balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkSDKType[] +} +/** + * BalancerToConcentratedPoolLink defines a single link between a single + * balancer pool and a single concentrated liquidity pool. This link is used to + * allow a balancer pool to migrate to a single canonical full range + * concentrated liquidity pool position + * A balancer pool can be linked to a maximum of one cl pool, and a cl pool can + * be linked to a maximum of one balancer pool. + */ +export interface BalancerToConcentratedPoolLink { + balancerPoolId: bigint + clPoolId: bigint +} +export interface BalancerToConcentratedPoolLinkProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.BalancerToConcentratedPoolLink' + value: Uint8Array +} +/** + * BalancerToConcentratedPoolLink defines a single link between a single + * balancer pool and a single concentrated liquidity pool. This link is used to + * allow a balancer pool to migrate to a single canonical full range + * concentrated liquidity pool position + * A balancer pool can be linked to a maximum of one cl pool, and a cl pool can + * be linked to a maximum of one balancer pool. + */ +export interface BalancerToConcentratedPoolLinkAmino { + balancer_pool_id?: string + cl_pool_id?: string +} +export interface BalancerToConcentratedPoolLinkAminoMsg { + type: 'osmosis/gamm/balancer-to-concentrated-pool-link' + value: BalancerToConcentratedPoolLinkAmino +} +/** + * BalancerToConcentratedPoolLink defines a single link between a single + * balancer pool and a single concentrated liquidity pool. This link is used to + * allow a balancer pool to migrate to a single canonical full range + * concentrated liquidity pool position + * A balancer pool can be linked to a maximum of one cl pool, and a cl pool can + * be linked to a maximum of one balancer pool. + */ +export interface BalancerToConcentratedPoolLinkSDKType { + balancer_pool_id: bigint + cl_pool_id: bigint +} +function createBaseMigrationRecords(): MigrationRecords { + return { + balancerToConcentratedPoolLinks: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrationRecords { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMigrationRecords() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.balancerToConcentratedPoolLinks.push( + BalancerToConcentratedPoolLink.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MigrationRecords { + const message = createBaseMigrationRecords() + message.balancerToConcentratedPoolLinks = + object.balancerToConcentratedPoolLinks?.map((e) => + BalancerToConcentratedPoolLink.fromPartial(e) + ) || [] + return message + }, + fromAmino(object: MigrationRecordsAmino): MigrationRecords { + 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 = {} + if (message.balancerToConcentratedPoolLinks) { + obj.balancer_to_concentrated_pool_links = + message.balancerToConcentratedPoolLinks.map((e) => + e ? BalancerToConcentratedPoolLink.toAmino(e) : undefined + ) + } else { + obj.balancer_to_concentrated_pool_links = + message.balancerToConcentratedPoolLinks + } + return obj + }, + fromAminoMsg(object: MigrationRecordsAminoMsg): MigrationRecords { + return MigrationRecords.fromAmino(object.value) + }, + toAminoMsg(message: MigrationRecords): MigrationRecordsAminoMsg { + return { + type: 'osmosis/gamm/migration-records', + value: MigrationRecords.toAmino(message) + } + }, + fromProtoMsg(message: MigrationRecordsProtoMsg): MigrationRecords { + return MigrationRecords.decode(message.value) + }, + toProto(message: MigrationRecords): Uint8Array { + return MigrationRecords.encode(message).finish() + }, + toProtoMsg(message: MigrationRecords): MigrationRecordsProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MigrationRecords', + value: MigrationRecords.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MigrationRecords.typeUrl, MigrationRecords) +GlobalDecoderRegistry.registerAminoProtoMapping( + MigrationRecords.aminoType, + MigrationRecords.typeUrl +) +function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { + return { + balancerPoolId: BigInt(0), + clPoolId: BigInt(0) + } +} +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) + } + if (message.clPoolId !== BigInt(0)) { + writer.uint32(16).uint64(message.clPoolId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): BalancerToConcentratedPoolLink { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBalancerToConcentratedPoolLink() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.balancerPoolId = reader.uint64() + break + case 2: + message.clPoolId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): BalancerToConcentratedPoolLink { + const message = createBaseBalancerToConcentratedPoolLink() + message.balancerPoolId = + object.balancerPoolId !== undefined && object.balancerPoolId !== null + ? BigInt(object.balancerPoolId.toString()) + : BigInt(0) + message.clPoolId = + object.clPoolId !== undefined && object.clPoolId !== null + ? BigInt(object.clPoolId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: BalancerToConcentratedPoolLinkAmino + ): BalancerToConcentratedPoolLink { + 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 = {} + obj.balancer_pool_id = + message.balancerPoolId !== BigInt(0) + ? message.balancerPoolId.toString() + : undefined + obj.cl_pool_id = + message.clPoolId !== BigInt(0) ? message.clPoolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: BalancerToConcentratedPoolLinkAminoMsg + ): BalancerToConcentratedPoolLink { + return BalancerToConcentratedPoolLink.fromAmino(object.value) + }, + toAminoMsg( + message: BalancerToConcentratedPoolLink + ): BalancerToConcentratedPoolLinkAminoMsg { + return { + type: 'osmosis/gamm/balancer-to-concentrated-pool-link', + value: BalancerToConcentratedPoolLink.toAmino(message) + } + }, + fromProtoMsg( + message: BalancerToConcentratedPoolLinkProtoMsg + ): BalancerToConcentratedPoolLink { + return BalancerToConcentratedPoolLink.decode(message.value) + }, + toProto(message: BalancerToConcentratedPoolLink): Uint8Array { + return BalancerToConcentratedPoolLink.encode(message).finish() + }, + toProtoMsg( + message: BalancerToConcentratedPoolLink + ): BalancerToConcentratedPoolLinkProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.BalancerToConcentratedPoolLink', + value: BalancerToConcentratedPoolLink.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + BalancerToConcentratedPoolLink.typeUrl, + BalancerToConcentratedPoolLink +) +GlobalDecoderRegistry.registerAminoProtoMapping( + BalancerToConcentratedPoolLink.aminoType, + BalancerToConcentratedPoolLink.typeUrl +) diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.amino.ts new file mode 100644 index 0000000..d2efd61 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.amino.ts @@ -0,0 +1,54 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgJoinPool, + MsgExitPool, + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgJoinSwapExternAmountIn, + MsgJoinSwapShareAmountOut, + MsgExitSwapExternAmountOut, + MsgExitSwapShareAmountIn +} from './tx' +export const AminoConverter = { + '/osmosis.gamm.v1beta1.MsgJoinPool': { + aminoType: 'osmosis/gamm/join-pool', + toAmino: MsgJoinPool.toAmino, + fromAmino: MsgJoinPool.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgExitPool': { + aminoType: 'osmosis/gamm/exit-pool', + toAmino: MsgExitPool.toAmino, + fromAmino: MsgExitPool.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn': { + aminoType: 'osmosis/gamm/swap-exact-amount-in', + toAmino: MsgSwapExactAmountIn.toAmino, + fromAmino: MsgSwapExactAmountIn.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut': { + aminoType: 'osmosis/gamm/swap-exact-amount-out', + toAmino: MsgSwapExactAmountOut.toAmino, + fromAmino: MsgSwapExactAmountOut.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn': { + aminoType: 'osmosis/gamm/join-swap-extern-amount-in', + toAmino: MsgJoinSwapExternAmountIn.toAmino, + fromAmino: MsgJoinSwapExternAmountIn.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut': { + aminoType: 'osmosis/gamm/join-swap-share-amount-out', + toAmino: MsgJoinSwapShareAmountOut.toAmino, + fromAmino: MsgJoinSwapShareAmountOut.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut': { + aminoType: 'osmosis/gamm/exit-swap-extern-amount-out', + toAmino: MsgExitSwapExternAmountOut.toAmino, + fromAmino: MsgExitSwapExternAmountOut.fromAmino + }, + '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn': { + aminoType: 'osmosis/gamm/exit-swap-share-amount-in', + toAmino: MsgExitSwapShareAmountIn.toAmino, + fromAmino: MsgExitSwapShareAmountIn.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.registry.ts new file mode 100644 index 0000000..144e036 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.registry.ts @@ -0,0 +1,189 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { + MsgJoinPool, + MsgExitPool, + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgJoinSwapExternAmountIn, + MsgJoinSwapShareAmountOut, + MsgExitSwapExternAmountOut, + MsgExitSwapShareAmountIn +} from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.gamm.v1beta1.MsgJoinPool', MsgJoinPool], + ['/osmosis.gamm.v1beta1.MsgExitPool', MsgExitPool], + ['/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', MsgSwapExactAmountIn], + ['/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', MsgSwapExactAmountOut], + [ + '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + MsgJoinSwapExternAmountIn + ], + [ + '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + MsgJoinSwapShareAmountOut + ], + [ + '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + MsgExitSwapExternAmountOut + ], + ['/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', MsgExitSwapShareAmountIn] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.encode(value).finish() + } + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.encode(value).finish() + } + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(value).finish() + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(value).finish() + } + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.encode(value).finish() + } + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.encode(value).finish() + } + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.encode(value).finish() + } + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.encode(value).finish() + } + } + }, + withTypeUrl: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value + } + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value + } + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value + } + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value + } + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value + } + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value + } + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value + } + } + }, + fromPartial: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.fromPartial(value) + } + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.fromPartial(value) + } + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.fromPartial(value) + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.fromPartial(value) + } + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.fromPartial(value) + } + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.fromPartial(value) + } + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.fromPartial(value) + } + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/gamm/v1beta1/tx.ts b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.ts new file mode 100644 index 0000000..b91e504 --- /dev/null +++ b/src/proto/osmojs/osmosis/gamm/v1beta1/tx.ts @@ -0,0 +1,2783 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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 { GlobalDecoderRegistry } from '../../../registry' +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPool { + sender: string + poolId: bigint + shareOutAmount: string + tokenInMaxs: Coin[] +} +export interface MsgJoinPoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool' + value: Uint8Array +} +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPoolAmino { + sender?: string + pool_id?: string + share_out_amount?: string + token_in_maxs?: CoinAmino[] +} +export interface MsgJoinPoolAminoMsg { + type: 'osmosis/gamm/join-pool' + value: MsgJoinPoolAmino +} +/** + * ===================== MsgJoinPool + * This is really MsgJoinPoolNoSwap + */ +export interface MsgJoinPoolSDKType { + sender: string + pool_id: bigint + share_out_amount: string + token_in_maxs: CoinSDKType[] +} +export interface MsgJoinPoolResponse { + shareOutAmount: string + tokenIn: Coin[] +} +export interface MsgJoinPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPoolResponse' + value: Uint8Array +} +export interface MsgJoinPoolResponseAmino { + share_out_amount?: string + token_in?: CoinAmino[] +} +export interface MsgJoinPoolResponseAminoMsg { + type: 'osmosis/gamm/join-pool-response' + value: MsgJoinPoolResponseAmino +} +export interface MsgJoinPoolResponseSDKType { + share_out_amount: string + token_in: CoinSDKType[] +} +/** ===================== MsgExitPool */ +export interface MsgExitPool { + sender: string + poolId: bigint + shareInAmount: string + tokenOutMins: Coin[] +} +export interface MsgExitPoolProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool' + value: Uint8Array +} +/** ===================== MsgExitPool */ +export interface MsgExitPoolAmino { + sender?: string + pool_id?: string + share_in_amount?: string + token_out_mins?: CoinAmino[] +} +export interface MsgExitPoolAminoMsg { + type: 'osmosis/gamm/exit-pool' + value: MsgExitPoolAmino +} +/** ===================== MsgExitPool */ +export interface MsgExitPoolSDKType { + sender: string + pool_id: bigint + share_in_amount: string + token_out_mins: CoinSDKType[] +} +export interface MsgExitPoolResponse { + tokenOut: Coin[] +} +export interface MsgExitPoolResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPoolResponse' + value: Uint8Array +} +export interface MsgExitPoolResponseAmino { + token_out?: CoinAmino[] +} +export interface MsgExitPoolResponseAminoMsg { + type: 'osmosis/gamm/exit-pool-response' + value: MsgExitPoolResponseAmino +} +export interface MsgExitPoolResponseSDKType { + token_out: CoinSDKType[] +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountIn { + sender: string + routes: SwapAmountInRoute[] + tokenIn: Coin + tokenOutMinAmount: string +} +export interface MsgSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn' + value: Uint8Array +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInAmino { + sender?: string + routes?: SwapAmountInRouteAmino[] + token_in?: CoinAmino + token_out_min_amount?: string +} +export interface MsgSwapExactAmountInAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-in' + value: MsgSwapExactAmountInAmino +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInSDKType { + sender: string + routes: SwapAmountInRouteSDKType[] + token_in: CoinSDKType + token_out_min_amount: string +} +export interface MsgSwapExactAmountInResponse { + tokenOutAmount: string +} +export interface MsgSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse' + value: Uint8Array +} +export interface MsgSwapExactAmountInResponseAmino { + token_out_amount?: string +} +export interface MsgSwapExactAmountInResponseAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-in-response' + value: MsgSwapExactAmountInResponseAmino +} +export interface MsgSwapExactAmountInResponseSDKType { + token_out_amount: string +} +export interface MsgSwapExactAmountOut { + sender: string + routes: SwapAmountOutRoute[] + tokenInMaxAmount: string + tokenOut: Coin +} +export interface MsgSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut' + value: Uint8Array +} +export interface MsgSwapExactAmountOutAmino { + sender?: string + routes?: SwapAmountOutRouteAmino[] + token_in_max_amount?: string + token_out?: CoinAmino +} +export interface MsgSwapExactAmountOutAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-out' + value: MsgSwapExactAmountOutAmino +} +export interface MsgSwapExactAmountOutSDKType { + sender: string + routes: SwapAmountOutRouteSDKType[] + token_in_max_amount: string + token_out: CoinSDKType +} +export interface MsgSwapExactAmountOutResponse { + tokenInAmount: string +} +export interface MsgSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse' + value: Uint8Array +} +export interface MsgSwapExactAmountOutResponseAmino { + token_in_amount?: string +} +export interface MsgSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/gamm/swap-exact-amount-out-response' + value: MsgSwapExactAmountOutResponseAmino +} +export interface MsgSwapExactAmountOutResponseSDKType { + token_in_amount: string +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountIn { + sender: string + poolId: bigint + tokenIn: Coin + shareOutMinAmount: string +} +export interface MsgJoinSwapExternAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn' + value: Uint8Array +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountInAmino { + sender?: string + pool_id?: string + token_in?: CoinAmino + share_out_min_amount?: string +} +export interface MsgJoinSwapExternAmountInAminoMsg { + type: 'osmosis/gamm/join-swap-extern-amount-in' + value: MsgJoinSwapExternAmountInAmino +} +/** + * ===================== MsgJoinSwapExternAmountIn + * TODO: Rename to MsgJoinSwapExactAmountIn + */ +export interface MsgJoinSwapExternAmountInSDKType { + sender: string + pool_id: bigint + token_in: CoinSDKType + share_out_min_amount: string +} +export interface MsgJoinSwapExternAmountInResponse { + shareOutAmount: string +} +export interface MsgJoinSwapExternAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse' + value: Uint8Array +} +export interface MsgJoinSwapExternAmountInResponseAmino { + share_out_amount?: string +} +export interface MsgJoinSwapExternAmountInResponseAminoMsg { + type: 'osmosis/gamm/join-swap-extern-amount-in-response' + value: MsgJoinSwapExternAmountInResponseAmino +} +export interface MsgJoinSwapExternAmountInResponseSDKType { + share_out_amount: string +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOut { + sender: string + poolId: bigint + tokenInDenom: string + shareOutAmount: string + tokenInMaxAmount: string +} +export interface MsgJoinSwapShareAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut' + value: Uint8Array +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOutAmino { + 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' + value: MsgJoinSwapShareAmountOutAmino +} +/** ===================== MsgJoinSwapShareAmountOut */ +export interface MsgJoinSwapShareAmountOutSDKType { + sender: string + pool_id: bigint + token_in_denom: string + share_out_amount: string + token_in_max_amount: string +} +export interface MsgJoinSwapShareAmountOutResponse { + tokenInAmount: string +} +export interface MsgJoinSwapShareAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse' + value: Uint8Array +} +export interface MsgJoinSwapShareAmountOutResponseAmino { + token_in_amount?: string +} +export interface MsgJoinSwapShareAmountOutResponseAminoMsg { + type: 'osmosis/gamm/join-swap-share-amount-out-response' + value: MsgJoinSwapShareAmountOutResponseAmino +} +export interface MsgJoinSwapShareAmountOutResponseSDKType { + token_in_amount: string +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountIn { + sender: string + poolId: bigint + tokenOutDenom: string + shareInAmount: string + tokenOutMinAmount: string +} +export interface MsgExitSwapShareAmountInProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn' + value: Uint8Array +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountInAmino { + 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' + value: MsgExitSwapShareAmountInAmino +} +/** ===================== MsgExitSwapShareAmountIn */ +export interface MsgExitSwapShareAmountInSDKType { + sender: string + pool_id: bigint + token_out_denom: string + share_in_amount: string + token_out_min_amount: string +} +export interface MsgExitSwapShareAmountInResponse { + tokenOutAmount: string +} +export interface MsgExitSwapShareAmountInResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse' + value: Uint8Array +} +export interface MsgExitSwapShareAmountInResponseAmino { + token_out_amount?: string +} +export interface MsgExitSwapShareAmountInResponseAminoMsg { + type: 'osmosis/gamm/exit-swap-share-amount-in-response' + value: MsgExitSwapShareAmountInResponseAmino +} +export interface MsgExitSwapShareAmountInResponseSDKType { + token_out_amount: string +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOut { + sender: string + poolId: bigint + tokenOut: Coin + shareInMaxAmount: string +} +export interface MsgExitSwapExternAmountOutProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut' + value: Uint8Array +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOutAmino { + sender?: string + pool_id?: string + token_out?: CoinAmino + share_in_max_amount?: string +} +export interface MsgExitSwapExternAmountOutAminoMsg { + type: 'osmosis/gamm/exit-swap-extern-amount-out' + value: MsgExitSwapExternAmountOutAmino +} +/** ===================== MsgExitSwapExternAmountOut */ +export interface MsgExitSwapExternAmountOutSDKType { + sender: string + pool_id: bigint + token_out: CoinSDKType + share_in_max_amount: string +} +export interface MsgExitSwapExternAmountOutResponse { + shareInAmount: string +} +export interface MsgExitSwapExternAmountOutResponseProtoMsg { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse' + value: Uint8Array +} +export interface MsgExitSwapExternAmountOutResponseAmino { + share_in_amount?: string +} +export interface MsgExitSwapExternAmountOutResponseAminoMsg { + type: 'osmosis/gamm/exit-swap-extern-amount-out-response' + value: MsgExitSwapExternAmountOutResponseAmino +} +export interface MsgExitSwapExternAmountOutResponseSDKType { + share_in_amount: string +} +function createBaseMsgJoinPool(): MsgJoinPool { + return { + sender: '', + poolId: BigInt(0), + shareOutAmount: '', + tokenInMaxs: [] + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.shareOutAmount !== '') { + writer.uint32(26).string(message.shareOutAmount) + } + for (const v of message.tokenInMaxs) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgJoinPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.shareOutAmount = reader.string() + break + case 4: + message.tokenInMaxs.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgJoinPool { + const message = createBaseMsgJoinPool() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.shareOutAmount = object.shareOutAmount ?? '' + message.tokenInMaxs = + object.tokenInMaxs?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgJoinPoolAmino): MsgJoinPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount + if (message.tokenInMaxs) { + obj.token_in_maxs = message.tokenInMaxs.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.token_in_maxs = message.tokenInMaxs + } + return obj + }, + fromAminoMsg(object: MsgJoinPoolAminoMsg): MsgJoinPool { + return MsgJoinPool.fromAmino(object.value) + }, + toAminoMsg(message: MsgJoinPool): MsgJoinPoolAminoMsg { + return { + type: 'osmosis/gamm/join-pool', + value: MsgJoinPool.toAmino(message) + } + }, + fromProtoMsg(message: MsgJoinPoolProtoMsg): MsgJoinPool { + return MsgJoinPool.decode(message.value) + }, + toProto(message: MsgJoinPool): Uint8Array { + return MsgJoinPool.encode(message).finish() + }, + toProtoMsg(message: MsgJoinPool): MsgJoinPoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPool', + value: MsgJoinPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgJoinPool.typeUrl, MsgJoinPool) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinPool.aminoType, + MsgJoinPool.typeUrl +) +function createBaseMsgJoinPoolResponse(): MsgJoinPoolResponse { + return { + shareOutAmount: '', + tokenIn: [] + } +} +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) + } + for (const v of message.tokenIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinPoolResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.shareOutAmount = reader.string() + break + case 2: + message.tokenIn.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgJoinPoolResponse { + const message = createBaseMsgJoinPoolResponse() + message.shareOutAmount = object.shareOutAmount ?? '' + message.tokenIn = object.tokenIn?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgJoinPoolResponseAmino): MsgJoinPoolResponse { + 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 = {} + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount + if (message.tokenIn) { + obj.token_in = message.tokenIn.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.token_in = message.tokenIn + } + return obj + }, + fromAminoMsg(object: MsgJoinPoolResponseAminoMsg): MsgJoinPoolResponse { + return MsgJoinPoolResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgJoinPoolResponse): MsgJoinPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/join-pool-response', + value: MsgJoinPoolResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgJoinPoolResponseProtoMsg): MsgJoinPoolResponse { + return MsgJoinPoolResponse.decode(message.value) + }, + toProto(message: MsgJoinPoolResponse): Uint8Array { + return MsgJoinPoolResponse.encode(message).finish() + }, + toProtoMsg(message: MsgJoinPoolResponse): MsgJoinPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinPoolResponse', + value: MsgJoinPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgJoinPoolResponse.typeUrl, MsgJoinPoolResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinPoolResponse.aminoType, + MsgJoinPoolResponse.typeUrl +) +function createBaseMsgExitPool(): MsgExitPool { + return { + sender: '', + poolId: BigInt(0), + shareInAmount: '', + tokenOutMins: [] + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.shareInAmount !== '') { + writer.uint32(26).string(message.shareInAmount) + } + for (const v of message.tokenOutMins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExitPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.shareInAmount = reader.string() + break + case 4: + message.tokenOutMins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExitPool { + const message = createBaseMsgExitPool() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.shareInAmount = object.shareInAmount ?? '' + message.tokenOutMins = + object.tokenOutMins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgExitPoolAmino): MsgExitPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount + if (message.tokenOutMins) { + obj.token_out_mins = message.tokenOutMins.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.token_out_mins = message.tokenOutMins + } + return obj + }, + fromAminoMsg(object: MsgExitPoolAminoMsg): MsgExitPool { + return MsgExitPool.fromAmino(object.value) + }, + toAminoMsg(message: MsgExitPool): MsgExitPoolAminoMsg { + return { + type: 'osmosis/gamm/exit-pool', + value: MsgExitPool.toAmino(message) + } + }, + fromProtoMsg(message: MsgExitPoolProtoMsg): MsgExitPool { + return MsgExitPool.decode(message.value) + }, + toProto(message: MsgExitPool): Uint8Array { + return MsgExitPool.encode(message).finish() + }, + toProtoMsg(message: MsgExitPool): MsgExitPoolProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPool', + value: MsgExitPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgExitPool.typeUrl, MsgExitPool) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitPool.aminoType, + MsgExitPool.typeUrl +) +function createBaseMsgExitPoolResponse(): MsgExitPoolResponse { + return { + tokenOut: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitPoolResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenOut.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExitPoolResponse { + const message = createBaseMsgExitPoolResponse() + message.tokenOut = object.tokenOut?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgExitPoolResponseAmino): MsgExitPoolResponse { + const message = createBaseMsgExitPoolResponse() + message.tokenOut = object.token_out?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino(message: MsgExitPoolResponse): MsgExitPoolResponseAmino { + const obj: any = {} + if (message.tokenOut) { + obj.token_out = message.tokenOut.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.token_out = message.tokenOut + } + return obj + }, + fromAminoMsg(object: MsgExitPoolResponseAminoMsg): MsgExitPoolResponse { + return MsgExitPoolResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgExitPoolResponse): MsgExitPoolResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-pool-response', + value: MsgExitPoolResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgExitPoolResponseProtoMsg): MsgExitPoolResponse { + return MsgExitPoolResponse.decode(message.value) + }, + toProto(message: MsgExitPoolResponse): Uint8Array { + return MsgExitPoolResponse.encode(message).finish() + }, + toProtoMsg(message: MsgExitPoolResponse): MsgExitPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitPoolResponse', + value: MsgExitPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgExitPoolResponse.typeUrl, MsgExitPoolResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitPoolResponse.aminoType, + MsgExitPoolResponse.typeUrl +) +function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { + return { + sender: '', + routes: [], + 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) + } + for (const v of message.routes) { + SwapAmountInRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim() + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountIn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push(SwapAmountInRoute.decode(reader, reader.uint32())) + break + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()) + break + case 4: + message.tokenOutMinAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromPartial(e)) || [] + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.tokenOutMinAmount = object.tokenOutMinAmount ?? '' + return message + }, + fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount + return obj + }, + fromAminoMsg(object: MsgSwapExactAmountInAminoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.fromAmino(object.value) + }, + toAminoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-in', + value: MsgSwapExactAmountIn.toAmino(message) + } + }, + fromProtoMsg(message: MsgSwapExactAmountInProtoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.decode(message.value) + }, + toProto(message: MsgSwapExactAmountIn): Uint8Array { + return MsgSwapExactAmountIn.encode(message).finish() + }, + toProtoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountIn.typeUrl, + MsgSwapExactAmountIn +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountIn.aminoType, + MsgSwapExactAmountIn.typeUrl +) +function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountInResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse() + message.tokenOutAmount = object.tokenOutAmount ?? '' + return message + }, + fromAmino( + object: MsgSwapExactAmountInResponseAmino + ): MsgSwapExactAmountInResponse { + 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 = {} + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount + return obj + }, + fromAminoMsg( + object: MsgSwapExactAmountInResponseAminoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-in-response', + value: MsgSwapExactAmountInResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSwapExactAmountInResponseProtoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.decode(message.value) + }, + toProto(message: MsgSwapExactAmountInResponse): Uint8Array { + return MsgSwapExactAmountInResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse', + value: MsgSwapExactAmountInResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountInResponse.typeUrl, + MsgSwapExactAmountInResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountInResponse.aminoType, + MsgSwapExactAmountInResponse.typeUrl +) +function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenInMaxAmount: '', + 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) + } + for (const v of message.routes) { + SwapAmountOutRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(26).string(message.tokenInMaxAmount) + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountOut() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push( + SwapAmountOutRoute.decode(reader, reader.uint32()) + ) + break + case 3: + message.tokenInMaxAmount = reader.string() + break + case 4: + message.tokenOut = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromPartial(e)) || [] + message.tokenInMaxAmount = object.tokenInMaxAmount ?? '' + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + return message + }, + fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined + return obj + }, + fromAminoMsg(object: MsgSwapExactAmountOutAminoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.fromAmino(object.value) + }, + toAminoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-out', + value: MsgSwapExactAmountOut.toAmino(message) + } + }, + fromProtoMsg(message: MsgSwapExactAmountOutProtoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.decode(message.value) + }, + toProto(message: MsgSwapExactAmountOut): Uint8Array { + return MsgSwapExactAmountOut.encode(message).finish() + }, + toProtoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountOut.typeUrl, + MsgSwapExactAmountOut +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOut.aminoType, + MsgSwapExactAmountOut.typeUrl +) +function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountOutResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse() + message.tokenInAmount = object.tokenInAmount ?? '' + return message + }, + fromAmino( + object: MsgSwapExactAmountOutResponseAmino + ): MsgSwapExactAmountOutResponse { + 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 = {} + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount + return obj + }, + fromAminoMsg( + object: MsgSwapExactAmountOutResponseAminoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/swap-exact-amount-out-response', + value: MsgSwapExactAmountOutResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSwapExactAmountOutResponseProtoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.decode(message.value) + }, + toProto(message: MsgSwapExactAmountOutResponse): Uint8Array { + return MsgSwapExactAmountOutResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse', + value: MsgSwapExactAmountOutResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountOutResponse.typeUrl, + MsgSwapExactAmountOutResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOutResponse.aminoType, + MsgSwapExactAmountOutResponse.typeUrl +) +function createBaseMsgJoinSwapExternAmountIn(): MsgJoinSwapExternAmountIn { + return { + sender: '', + poolId: BigInt(0), + 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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim() + } + if (message.shareOutMinAmount !== '') { + writer.uint32(34).string(message.shareOutMinAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapExternAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinSwapExternAmountIn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()) + break + case 4: + message.shareOutMinAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgJoinSwapExternAmountIn { + const message = createBaseMsgJoinSwapExternAmountIn() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.shareOutMinAmount = object.shareOutMinAmount ?? '' + return message + }, + fromAmino(object: MsgJoinSwapExternAmountInAmino): MsgJoinSwapExternAmountIn { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined + obj.share_out_min_amount = + message.shareOutMinAmount === '' ? undefined : message.shareOutMinAmount + return obj + }, + fromAminoMsg( + object: MsgJoinSwapExternAmountInAminoMsg + ): MsgJoinSwapExternAmountIn { + return MsgJoinSwapExternAmountIn.fromAmino(object.value) + }, + toAminoMsg( + message: MsgJoinSwapExternAmountIn + ): MsgJoinSwapExternAmountInAminoMsg { + return { + type: 'osmosis/gamm/join-swap-extern-amount-in', + value: MsgJoinSwapExternAmountIn.toAmino(message) + } + }, + fromProtoMsg( + message: MsgJoinSwapExternAmountInProtoMsg + ): MsgJoinSwapExternAmountIn { + return MsgJoinSwapExternAmountIn.decode(message.value) + }, + toProto(message: MsgJoinSwapExternAmountIn): Uint8Array { + return MsgJoinSwapExternAmountIn.encode(message).finish() + }, + toProtoMsg( + message: MsgJoinSwapExternAmountIn + ): MsgJoinSwapExternAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn', + value: MsgJoinSwapExternAmountIn.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgJoinSwapExternAmountIn.typeUrl, + MsgJoinSwapExternAmountIn +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapExternAmountIn.aminoType, + MsgJoinSwapExternAmountIn.typeUrl +) +function createBaseMsgJoinSwapExternAmountInResponse(): MsgJoinSwapExternAmountInResponse { + return { + shareOutAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapExternAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinSwapExternAmountInResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.shareOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgJoinSwapExternAmountInResponse { + const message = createBaseMsgJoinSwapExternAmountInResponse() + message.shareOutAmount = object.shareOutAmount ?? '' + return message + }, + fromAmino( + object: MsgJoinSwapExternAmountInResponseAmino + ): MsgJoinSwapExternAmountInResponse { + 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 = {} + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount + return obj + }, + fromAminoMsg( + object: MsgJoinSwapExternAmountInResponseAminoMsg + ): MsgJoinSwapExternAmountInResponse { + return MsgJoinSwapExternAmountInResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgJoinSwapExternAmountInResponse + ): MsgJoinSwapExternAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/join-swap-extern-amount-in-response', + value: MsgJoinSwapExternAmountInResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgJoinSwapExternAmountInResponseProtoMsg + ): MsgJoinSwapExternAmountInResponse { + return MsgJoinSwapExternAmountInResponse.decode(message.value) + }, + toProto(message: MsgJoinSwapExternAmountInResponse): Uint8Array { + return MsgJoinSwapExternAmountInResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgJoinSwapExternAmountInResponse + ): MsgJoinSwapExternAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse', + value: MsgJoinSwapExternAmountInResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgJoinSwapExternAmountInResponse.typeUrl, + MsgJoinSwapExternAmountInResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapExternAmountInResponse.aminoType, + MsgJoinSwapExternAmountInResponse.typeUrl +) +function createBaseMsgJoinSwapShareAmountOut(): MsgJoinSwapShareAmountOut { + return { + sender: '', + poolId: BigInt(0), + tokenInDenom: '', + shareOutAmount: '', + tokenInMaxAmount: '' + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.tokenInDenom !== '') { + writer.uint32(26).string(message.tokenInDenom) + } + if (message.shareOutAmount !== '') { + writer.uint32(34).string(message.shareOutAmount) + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(42).string(message.tokenInMaxAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapShareAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinSwapShareAmountOut() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.tokenInDenom = reader.string() + break + case 4: + message.shareOutAmount = reader.string() + break + case 5: + message.tokenInMaxAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgJoinSwapShareAmountOut { + const message = createBaseMsgJoinSwapShareAmountOut() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenInDenom = object.tokenInDenom ?? '' + message.shareOutAmount = object.shareOutAmount ?? '' + message.tokenInMaxAmount = object.tokenInMaxAmount ?? '' + return message + }, + fromAmino(object: MsgJoinSwapShareAmountOutAmino): MsgJoinSwapShareAmountOut { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom + obj.share_out_amount = + message.shareOutAmount === '' ? undefined : message.shareOutAmount + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount + return obj + }, + fromAminoMsg( + object: MsgJoinSwapShareAmountOutAminoMsg + ): MsgJoinSwapShareAmountOut { + return MsgJoinSwapShareAmountOut.fromAmino(object.value) + }, + toAminoMsg( + message: MsgJoinSwapShareAmountOut + ): MsgJoinSwapShareAmountOutAminoMsg { + return { + type: 'osmosis/gamm/join-swap-share-amount-out', + value: MsgJoinSwapShareAmountOut.toAmino(message) + } + }, + fromProtoMsg( + message: MsgJoinSwapShareAmountOutProtoMsg + ): MsgJoinSwapShareAmountOut { + return MsgJoinSwapShareAmountOut.decode(message.value) + }, + toProto(message: MsgJoinSwapShareAmountOut): Uint8Array { + return MsgJoinSwapShareAmountOut.encode(message).finish() + }, + toProtoMsg( + message: MsgJoinSwapShareAmountOut + ): MsgJoinSwapShareAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut', + value: MsgJoinSwapShareAmountOut.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgJoinSwapShareAmountOut.typeUrl, + MsgJoinSwapShareAmountOut +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapShareAmountOut.aminoType, + MsgJoinSwapShareAmountOut.typeUrl +) +function createBaseMsgJoinSwapShareAmountOutResponse(): MsgJoinSwapShareAmountOutResponse { + return { + tokenInAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgJoinSwapShareAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgJoinSwapShareAmountOutResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgJoinSwapShareAmountOutResponse { + const message = createBaseMsgJoinSwapShareAmountOutResponse() + message.tokenInAmount = object.tokenInAmount ?? '' + return message + }, + fromAmino( + object: MsgJoinSwapShareAmountOutResponseAmino + ): MsgJoinSwapShareAmountOutResponse { + 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 = {} + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount + return obj + }, + fromAminoMsg( + object: MsgJoinSwapShareAmountOutResponseAminoMsg + ): MsgJoinSwapShareAmountOutResponse { + return MsgJoinSwapShareAmountOutResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgJoinSwapShareAmountOutResponse + ): MsgJoinSwapShareAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/join-swap-share-amount-out-response', + value: MsgJoinSwapShareAmountOutResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgJoinSwapShareAmountOutResponseProtoMsg + ): MsgJoinSwapShareAmountOutResponse { + return MsgJoinSwapShareAmountOutResponse.decode(message.value) + }, + toProto(message: MsgJoinSwapShareAmountOutResponse): Uint8Array { + return MsgJoinSwapShareAmountOutResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgJoinSwapShareAmountOutResponse + ): MsgJoinSwapShareAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse', + value: MsgJoinSwapShareAmountOutResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgJoinSwapShareAmountOutResponse.typeUrl, + MsgJoinSwapShareAmountOutResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgJoinSwapShareAmountOutResponse.aminoType, + MsgJoinSwapShareAmountOutResponse.typeUrl +) +function createBaseMsgExitSwapShareAmountIn(): MsgExitSwapShareAmountIn { + return { + sender: '', + poolId: BigInt(0), + tokenOutDenom: '', + shareInAmount: '', + tokenOutMinAmount: '' + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.tokenOutDenom !== '') { + writer.uint32(26).string(message.tokenOutDenom) + } + if (message.shareInAmount !== '') { + writer.uint32(34).string(message.shareInAmount) + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(42).string(message.tokenOutMinAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapShareAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitSwapShareAmountIn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.tokenOutDenom = reader.string() + break + case 4: + message.shareInAmount = reader.string() + break + case 5: + message.tokenOutMinAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgExitSwapShareAmountIn { + const message = createBaseMsgExitSwapShareAmountIn() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenOutDenom = object.tokenOutDenom ?? '' + message.shareInAmount = object.shareInAmount ?? '' + message.tokenOutMinAmount = object.tokenOutMinAmount ?? '' + return message + }, + fromAmino(object: MsgExitSwapShareAmountInAmino): MsgExitSwapShareAmountIn { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount + return obj + }, + fromAminoMsg( + object: MsgExitSwapShareAmountInAminoMsg + ): MsgExitSwapShareAmountIn { + return MsgExitSwapShareAmountIn.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExitSwapShareAmountIn + ): MsgExitSwapShareAmountInAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-share-amount-in', + value: MsgExitSwapShareAmountIn.toAmino(message) + } + }, + fromProtoMsg( + message: MsgExitSwapShareAmountInProtoMsg + ): MsgExitSwapShareAmountIn { + return MsgExitSwapShareAmountIn.decode(message.value) + }, + toProto(message: MsgExitSwapShareAmountIn): Uint8Array { + return MsgExitSwapShareAmountIn.encode(message).finish() + }, + toProtoMsg( + message: MsgExitSwapShareAmountIn + ): MsgExitSwapShareAmountInProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn', + value: MsgExitSwapShareAmountIn.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgExitSwapShareAmountIn.typeUrl, + MsgExitSwapShareAmountIn +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapShareAmountIn.aminoType, + MsgExitSwapShareAmountIn.typeUrl +) +function createBaseMsgExitSwapShareAmountInResponse(): MsgExitSwapShareAmountInResponse { + return { + tokenOutAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapShareAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitSwapShareAmountInResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgExitSwapShareAmountInResponse { + const message = createBaseMsgExitSwapShareAmountInResponse() + message.tokenOutAmount = object.tokenOutAmount ?? '' + return message + }, + fromAmino( + object: MsgExitSwapShareAmountInResponseAmino + ): MsgExitSwapShareAmountInResponse { + 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 = {} + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount + return obj + }, + fromAminoMsg( + object: MsgExitSwapShareAmountInResponseAminoMsg + ): MsgExitSwapShareAmountInResponse { + return MsgExitSwapShareAmountInResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExitSwapShareAmountInResponse + ): MsgExitSwapShareAmountInResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-share-amount-in-response', + value: MsgExitSwapShareAmountInResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgExitSwapShareAmountInResponseProtoMsg + ): MsgExitSwapShareAmountInResponse { + return MsgExitSwapShareAmountInResponse.decode(message.value) + }, + toProto(message: MsgExitSwapShareAmountInResponse): Uint8Array { + return MsgExitSwapShareAmountInResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgExitSwapShareAmountInResponse + ): MsgExitSwapShareAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse', + value: MsgExitSwapShareAmountInResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgExitSwapShareAmountInResponse.typeUrl, + MsgExitSwapShareAmountInResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapShareAmountInResponse.aminoType, + MsgExitSwapShareAmountInResponse.typeUrl +) +function createBaseMsgExitSwapExternAmountOut(): MsgExitSwapExternAmountOut { + return { + sender: '', + poolId: BigInt(0), + 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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim() + } + if (message.shareInMaxAmount !== '') { + writer.uint32(34).string(message.shareInMaxAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapExternAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitSwapExternAmountOut() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + case 3: + message.tokenOut = Coin.decode(reader, reader.uint32()) + break + case 4: + message.shareInMaxAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgExitSwapExternAmountOut { + const message = createBaseMsgExitSwapExternAmountOut() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + message.shareInMaxAmount = object.shareInMaxAmount ?? '' + return message + }, + fromAmino( + object: MsgExitSwapExternAmountOutAmino + ): MsgExitSwapExternAmountOut { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined + obj.share_in_max_amount = + message.shareInMaxAmount === '' ? undefined : message.shareInMaxAmount + return obj + }, + fromAminoMsg( + object: MsgExitSwapExternAmountOutAminoMsg + ): MsgExitSwapExternAmountOut { + return MsgExitSwapExternAmountOut.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExitSwapExternAmountOut + ): MsgExitSwapExternAmountOutAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-extern-amount-out', + value: MsgExitSwapExternAmountOut.toAmino(message) + } + }, + fromProtoMsg( + message: MsgExitSwapExternAmountOutProtoMsg + ): MsgExitSwapExternAmountOut { + return MsgExitSwapExternAmountOut.decode(message.value) + }, + toProto(message: MsgExitSwapExternAmountOut): Uint8Array { + return MsgExitSwapExternAmountOut.encode(message).finish() + }, + toProtoMsg( + message: MsgExitSwapExternAmountOut + ): MsgExitSwapExternAmountOutProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut', + value: MsgExitSwapExternAmountOut.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgExitSwapExternAmountOut.typeUrl, + MsgExitSwapExternAmountOut +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapExternAmountOut.aminoType, + MsgExitSwapExternAmountOut.typeUrl +) +function createBaseMsgExitSwapExternAmountOutResponse(): MsgExitSwapExternAmountOutResponse { + return { + shareInAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExitSwapExternAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExitSwapExternAmountOutResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.shareInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgExitSwapExternAmountOutResponse { + const message = createBaseMsgExitSwapExternAmountOutResponse() + message.shareInAmount = object.shareInAmount ?? '' + return message + }, + fromAmino( + object: MsgExitSwapExternAmountOutResponseAmino + ): MsgExitSwapExternAmountOutResponse { + 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 = {} + obj.share_in_amount = + message.shareInAmount === '' ? undefined : message.shareInAmount + return obj + }, + fromAminoMsg( + object: MsgExitSwapExternAmountOutResponseAminoMsg + ): MsgExitSwapExternAmountOutResponse { + return MsgExitSwapExternAmountOutResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExitSwapExternAmountOutResponse + ): MsgExitSwapExternAmountOutResponseAminoMsg { + return { + type: 'osmosis/gamm/exit-swap-extern-amount-out-response', + value: MsgExitSwapExternAmountOutResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgExitSwapExternAmountOutResponseProtoMsg + ): MsgExitSwapExternAmountOutResponse { + return MsgExitSwapExternAmountOutResponse.decode(message.value) + }, + toProto(message: MsgExitSwapExternAmountOutResponse): Uint8Array { + return MsgExitSwapExternAmountOutResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgExitSwapExternAmountOutResponse + ): MsgExitSwapExternAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse', + value: MsgExitSwapExternAmountOutResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgExitSwapExternAmountOutResponse.typeUrl, + MsgExitSwapExternAmountOutResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExitSwapExternAmountOutResponse.aminoType, + MsgExitSwapExternAmountOutResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/ibchooks/tx.amino.ts b/src/proto/osmojs/osmosis/ibchooks/tx.amino.ts new file mode 100644 index 0000000..088b12e --- /dev/null +++ b/src/proto/osmojs/osmosis/ibchooks/tx.amino.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgEmitIBCAck } from './tx' +export const AminoConverter = { + '/osmosis.ibchooks.MsgEmitIBCAck': { + aminoType: 'osmosis/ibchooks/emit-ibc-ack', + toAmino: MsgEmitIBCAck.toAmino, + fromAmino: MsgEmitIBCAck.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/ibchooks/tx.registry.ts b/src/proto/osmojs/osmosis/ibchooks/tx.registry.ts new file mode 100644 index 0000000..83dc89c --- /dev/null +++ b/src/proto/osmojs/osmosis/ibchooks/tx.registry.ts @@ -0,0 +1,38 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@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) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/ibchooks/tx.ts b/src/proto/osmojs/osmosis/ibchooks/tx.ts new file mode 100644 index 0000000..2358903 --- /dev/null +++ b/src/proto/osmojs/osmosis/ibchooks/tx.ts @@ -0,0 +1,312 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary' +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 + }, + 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 === '' ? undefined : message.sender + obj.packet_sequence = + message.packetSequence !== BigInt(0) + ? message.packetSequence.toString() + : undefined + obj.channel = message.channel === '' ? undefined : 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 + }, + 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 === '' ? undefined : message.contractResult + obj.ibc_ack = message.ibcAck === '' ? undefined : 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 +) diff --git a/src/proto/osmojs/osmosis/incentives/gauge.ts b/src/proto/osmojs/osmosis/incentives/gauge.ts new file mode 100644 index 0000000..880b755 --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/gauge.ts @@ -0,0 +1,514 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + QueryCondition, + QueryConditionAmino, + QueryConditionSDKType +} from '../lockup/lock' +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { toTimestamp, fromTimestamp } 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 + * duration for which a given denom is locked. + */ +export interface Gauge { + /** id is the unique ID of a Gauge */ + id: bigint + /** + * 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 + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled, Intended for use with incentives that get refilled daily. + */ + isPerpetual: boolean + /** + * distribute_to is where the gauge rewards are distributed to. + * This is queried via lock duration or by timestamp + */ + distributeTo: QueryCondition + /** + * coins is the total amount of coins that have been in the gauge + * Can distribute multiple coin denoms + */ + coins: Coin[] + /** start_time is the distribution start time */ + startTime: Date + /** + * num_epochs_paid_over is the number of total epochs distribution will be + * completed over + */ + numEpochsPaidOver: bigint + /** + * filled_epochs is the number of epochs distribution has been completed on + * already + */ + filledEpochs: bigint + /** distributed_coins are coins that have been distributed already */ + distributedCoins: Coin[] +} +export interface GaugeProtoMsg { + typeUrl: '/osmosis.incentives.Gauge' + value: Uint8Array +} +/** + * Gauge is an object that stores and distributes yields to recipients who + * satisfy certain conditions. Currently gauges support conditions around the + * duration for which a given denom is locked. + */ +export interface GaugeAmino { + /** id is the unique ID of a Gauge */ + 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 + * gauge is in the active period. Perpetual gauges distribute all their tokens + * 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 + /** + * distribute_to is where the gauge rewards are distributed to. + * This is queried via lock duration or by timestamp + */ + distribute_to?: QueryConditionAmino + /** + * coins is the total amount of coins that have been in the gauge + * Can distribute multiple coin denoms + */ + coins?: CoinAmino[] + /** start_time is the distribution start time */ + start_time?: string + /** + * num_epochs_paid_over is the number of total epochs distribution will be + * completed over + */ + num_epochs_paid_over?: string + /** + * filled_epochs is the number of epochs distribution has been completed on + * already + */ + filled_epochs?: string + /** distributed_coins are coins that have been distributed already */ + distributed_coins?: CoinAmino[] +} +export interface GaugeAminoMsg { + type: 'osmosis/incentives/gauge' + value: GaugeAmino +} +/** + * Gauge is an object that stores and distributes yields to recipients who + * satisfy certain conditions. Currently gauges support conditions around the + * duration for which a given denom is locked. + */ +export interface GaugeSDKType { + id: bigint + is_perpetual: boolean + distribute_to: QueryConditionSDKType + coins: CoinSDKType[] + start_time: Date + num_epochs_paid_over: bigint + filled_epochs: bigint + distributed_coins: CoinSDKType[] +} +export interface LockableDurationsInfo { + /** List of incentivised durations that gauges will pay out to */ + lockableDurations: Duration[] +} +export interface LockableDurationsInfoProtoMsg { + typeUrl: '/osmosis.incentives.LockableDurationsInfo' + value: Uint8Array +} +export interface LockableDurationsInfoAmino { + /** List of incentivised durations that gauges will pay out to */ + lockable_durations?: DurationAmino[] +} +export interface LockableDurationsInfoAminoMsg { + type: 'osmosis/incentives/lockable-durations-info' + value: LockableDurationsInfoAmino +} +export interface LockableDurationsInfoSDKType { + lockable_durations: DurationSDKType[] +} +function createBaseGauge(): Gauge { + return { + id: BigInt(0), + isPerpetual: false, + distributeTo: QueryCondition.fromPartial({}), + coins: [], + startTime: new Date(), + numEpochsPaidOver: BigInt(0), + filledEpochs: BigInt(0), + distributedCoins: [] + } +} +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) + } + if (message.isPerpetual === true) { + writer.uint32(16).bool(message.isPerpetual) + } + if (message.distributeTo !== undefined) { + QueryCondition.encode( + message.distributeTo, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(42).fork() + ).ldelim() + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(48).uint64(message.numEpochsPaidOver) + } + if (message.filledEpochs !== BigInt(0)) { + writer.uint32(56).uint64(message.filledEpochs) + } + for (const v of message.distributedCoins) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Gauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGauge() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.id = reader.uint64() + break + case 2: + message.isPerpetual = reader.bool() + break + case 3: + message.distributeTo = QueryCondition.decode(reader, reader.uint32()) + break + case 4: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + case 5: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 6: + message.numEpochsPaidOver = reader.uint64() + break + case 7: + message.filledEpochs = reader.uint64() + break + case 8: + message.distributedCoins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Gauge { + const message = createBaseGauge() + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0) + message.isPerpetual = object.isPerpetual ?? false + message.distributeTo = + object.distributeTo !== undefined && object.distributeTo !== null + ? QueryCondition.fromPartial(object.distributeTo) + : undefined + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + message.startTime = object.startTime ?? undefined + message.numEpochsPaidOver = + object.numEpochsPaidOver !== undefined && + object.numEpochsPaidOver !== null + ? BigInt(object.numEpochsPaidOver.toString()) + : BigInt(0) + message.filledEpochs = + object.filledEpochs !== undefined && object.filledEpochs !== null + ? BigInt(object.filledEpochs.toString()) + : BigInt(0) + message.distributedCoins = + object.distributedCoins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: GaugeAmino): Gauge { + 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 = {} + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined + obj.is_perpetual = + message.isPerpetual === false ? undefined : message.isPerpetual + obj.distribute_to = message.distributeTo + ? QueryCondition.toAmino(message.distributeTo) + : undefined + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + obj.start_time = message.startTime + ? Timestamp.toAmino(toTimestamp(message.startTime)) + : undefined + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined + obj.filled_epochs = + message.filledEpochs !== BigInt(0) + ? message.filledEpochs.toString() + : undefined + if (message.distributedCoins) { + obj.distributed_coins = message.distributedCoins.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.distributed_coins = message.distributedCoins + } + return obj + }, + fromAminoMsg(object: GaugeAminoMsg): Gauge { + return Gauge.fromAmino(object.value) + }, + toAminoMsg(message: Gauge): GaugeAminoMsg { + return { + type: 'osmosis/incentives/gauge', + value: Gauge.toAmino(message) + } + }, + fromProtoMsg(message: GaugeProtoMsg): Gauge { + return Gauge.decode(message.value) + }, + toProto(message: Gauge): Uint8Array { + return Gauge.encode(message).finish() + }, + toProtoMsg(message: Gauge): GaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.Gauge', + value: Gauge.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Gauge.typeUrl, Gauge) +GlobalDecoderRegistry.registerAminoProtoMapping(Gauge.aminoType, Gauge.typeUrl) +function createBaseLockableDurationsInfo(): LockableDurationsInfo { + return { + lockableDurations: [] + } +} +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() + } + 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 { + 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 = message.lockableDurations + } + return obj + }, + fromAminoMsg(object: LockableDurationsInfoAminoMsg): LockableDurationsInfo { + return LockableDurationsInfo.fromAmino(object.value) + }, + toAminoMsg(message: LockableDurationsInfo): LockableDurationsInfoAminoMsg { + return { + type: 'osmosis/incentives/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.incentives.LockableDurationsInfo', + value: LockableDurationsInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + LockableDurationsInfo.typeUrl, + LockableDurationsInfo +) +GlobalDecoderRegistry.registerAminoProtoMapping( + LockableDurationsInfo.aminoType, + LockableDurationsInfo.typeUrl +) diff --git a/src/proto/osmojs/osmosis/incentives/gov.ts b/src/proto/osmojs/osmosis/incentives/gov.ts new file mode 100644 index 0000000..290aab8 --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/gov.ts @@ -0,0 +1,194 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { CreateGroup, CreateGroupAmino, CreateGroupSDKType } from './group' +import { BinaryReader, BinaryWriter } from '../../../binary' +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 { + $typeUrl?: '/osmosis.incentives.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 { + $typeUrl?: '/osmosis.incentives.CreateGroupsProposal' + title: string + description: string + create_groups: CreateGroupSDKType[] +} +function createBaseCreateGroupsProposal(): CreateGroupsProposal { + return { + $typeUrl: '/osmosis.incentives.CreateGroupsProposal', + 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 + }, + 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 === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.createGroups) { + obj.create_groups = message.createGroups.map((e) => + e ? CreateGroup.toAmino(e) : undefined + ) + } else { + obj.create_groups = message.createGroups + } + 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 +) diff --git a/src/proto/osmojs/osmosis/incentives/group.ts b/src/proto/osmojs/osmosis/incentives/group.ts new file mode 100644 index 0000000..5b8ff63 --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/group.ts @@ -0,0 +1,890 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Gauge, GaugeAmino, GaugeSDKType } from './gauge' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { GlobalDecoderRegistry } from '../../registry' +import { isSet } from '../../../helpers' +/** 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 + }, + 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 === '' ? undefined : message.totalWeight + if (message.gaugeRecords) { + obj.gauge_records = message.gaugeRecords.map((e) => + e ? InternalGaugeRecord.toAmino(e) : undefined + ) + } else { + obj.gauge_records = message.gaugeRecords + } + 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 + }, + 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 !== BigInt(0) ? message.gaugeId.toString() : undefined + obj.current_weight = + message.currentWeight === '' ? undefined : message.currentWeight + obj.cumulative_weight = + message.cumulativeWeight === '' ? undefined : 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 + }, + 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 = object.splitting_policy + } + return message + }, + toAmino(message: Group): GroupAmino { + const obj: any = {} + obj.group_gauge_id = + message.groupGaugeId !== BigInt(0) + ? message.groupGaugeId.toString() + : undefined + obj.internal_gauge_info = message.internalGaugeInfo + ? InternalGaugeInfo.toAmino(message.internalGaugeInfo) + : undefined + obj.splitting_policy = + message.splittingPolicy === 0 ? undefined : 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 + }, + 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 = message.poolIds + } + 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 + }, + 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 +) diff --git a/src/proto/osmojs/osmosis/incentives/tx.amino.ts b/src/proto/osmojs/osmosis/incentives/tx.amino.ts new file mode 100644 index 0000000..f54403b --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/tx.amino.ts @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from './tx' +export const AminoConverter = { + '/osmosis.incentives.MsgCreateGauge': { + aminoType: 'osmosis/incentives/create-gauge', + toAmino: MsgCreateGauge.toAmino, + fromAmino: MsgCreateGauge.fromAmino + }, + '/osmosis.incentives.MsgAddToGauge': { + 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 + } +} diff --git a/src/proto/osmojs/osmosis/incentives/tx.registry.ts b/src/proto/osmojs/osmosis/incentives/tx.registry.ts new file mode 100644 index 0000000..b3f5f99 --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/tx.registry.ts @@ -0,0 +1,76 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.encode(value).finish() + } + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.encode(value).finish() + } + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value: MsgCreateGroup.encode(value).finish() + } + } + }, + withTypeUrl: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value + } + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value + } + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value + } + } + }, + fromPartial: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.fromPartial(value) + } + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.fromPartial(value) + } + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: '/osmosis.incentives.MsgCreateGroup', + value: MsgCreateGroup.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/incentives/tx.ts b/src/proto/osmojs/osmosis/incentives/tx.ts new file mode 100644 index 0000000..c160365 --- /dev/null +++ b/src/proto/osmojs/osmosis/incentives/tx.ts @@ -0,0 +1,1038 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + QueryCondition, + QueryConditionAmino, + QueryConditionSDKType +} from '../lockup/lock' +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { toTimestamp, fromTimestamp } from '../../../helpers' +import { GlobalDecoderRegistry } from '../../registry' +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGauge { + /** + * is_perpetual shows if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled + */ + isPerpetual: boolean + /** owner is the address of gauge creator */ + owner: string + /** + * distribute_to show which lock the gauge should distribute to by time + * duration or by timestamp + */ + distributeTo: QueryCondition + /** coins are coin(s) to be distributed by the gauge */ + coins: Coin[] + /** start_time is the distribution start time */ + startTime: Date + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * over + */ + numEpochsPaidOver: bigint + /** + * 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 + * "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct + * unset, including "QueryCondition.Denom". However, note that, internally, + * the empty string in "QueryCondition.Denom" ends up being overwritten with + * incentivestypes.NoLockExternalGaugeDenom() so that the gauges + * associated with a pool can be queried by this prefix if needed. + */ + poolId: bigint +} +export interface MsgCreateGaugeProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGauge' + value: Uint8Array +} +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGaugeAmino { + /** + * is_perpetual shows if it's a perpetual or non-perpetual gauge + * Non-perpetual gauges distribute their tokens equally per epoch while the + * gauge is in the active period. Perpetual gauges distribute all their tokens + * at a single time and only distribute their tokens again once the gauge is + * refilled + */ + is_perpetual?: boolean + /** owner is the address of gauge creator */ + 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[] + /** start_time is the distribution start time */ + start_time?: string + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * over + */ + 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 + * "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct + * unset, including "QueryCondition.Denom". However, note that, internally, + * the empty string in "QueryCondition.Denom" ends up being overwritten with + * incentivestypes.NoLockExternalGaugeDenom() so that the gauges + * associated with a pool can be queried by this prefix if needed. + */ + pool_id?: string +} +export interface MsgCreateGaugeAminoMsg { + type: 'osmosis/incentives/create-gauge' + value: MsgCreateGaugeAmino +} +/** MsgCreateGauge creates a gague to distribute rewards to users */ +export interface MsgCreateGaugeSDKType { + is_perpetual: boolean + owner: string + distribute_to: QueryConditionSDKType + coins: CoinSDKType[] + start_time: Date + num_epochs_paid_over: bigint + pool_id: bigint +} +export interface MsgCreateGaugeResponse {} +export interface MsgCreateGaugeResponseProtoMsg { + typeUrl: '/osmosis.incentives.MsgCreateGaugeResponse' + value: Uint8Array +} +export interface MsgCreateGaugeResponseAmino {} +export interface MsgCreateGaugeResponseAminoMsg { + type: 'osmosis/incentives/create-gauge-response' + value: MsgCreateGaugeResponseAmino +} +export interface MsgCreateGaugeResponseSDKType {} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGauge { + /** owner is the gauge owner's address */ + owner: string + /** gauge_id is the ID of gauge that rewards are getting added to */ + gaugeId: bigint + /** rewards are the coin(s) to add to gauge */ + rewards: Coin[] +} +export interface MsgAddToGaugeProtoMsg { + typeUrl: '/osmosis.incentives.MsgAddToGauge' + value: Uint8Array +} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGaugeAmino { + /** owner is the gauge owner's address */ + owner?: string + /** gauge_id is the ID of gauge that rewards are getting added to */ + gauge_id?: string + /** rewards are the coin(s) to add to gauge */ + rewards?: CoinAmino[] +} +export interface MsgAddToGaugeAminoMsg { + type: 'osmosis/incentives/add-to-gauge' + value: MsgAddToGaugeAmino +} +/** MsgAddToGauge adds coins to a previously created gauge */ +export interface MsgAddToGaugeSDKType { + owner: string + gauge_id: bigint + rewards: CoinSDKType[] +} +export interface MsgAddToGaugeResponse {} +export interface MsgAddToGaugeResponseProtoMsg { + typeUrl: '/osmosis.incentives.MsgAddToGaugeResponse' + value: Uint8Array +} +export interface MsgAddToGaugeResponseAmino {} +export interface MsgAddToGaugeResponseAminoMsg { + type: 'osmosis/incentives/add-to-gauge-response' + 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: 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) + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner) + } + if (message.distributeTo !== undefined) { + QueryCondition.encode( + message.distributeTo, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(42).fork() + ).ldelim() + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(48).uint64(message.numEpochsPaidOver) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(56).uint64(message.poolId) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateGauge() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.isPerpetual = reader.bool() + break + case 2: + message.owner = reader.string() + break + case 3: + message.distributeTo = QueryCondition.decode(reader, reader.uint32()) + break + case 4: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + case 5: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 6: + message.numEpochsPaidOver = reader.uint64() + break + case 7: + message.poolId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateGauge { + const message = createBaseMsgCreateGauge() + message.isPerpetual = object.isPerpetual ?? false + message.owner = object.owner ?? '' + message.distributeTo = + object.distributeTo !== undefined && object.distributeTo !== null + ? QueryCondition.fromPartial(object.distributeTo) + : undefined + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + message.startTime = object.startTime ?? undefined + message.numEpochsPaidOver = + object.numEpochsPaidOver !== undefined && + object.numEpochsPaidOver !== null + ? BigInt(object.numEpochsPaidOver.toString()) + : BigInt(0) + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgCreateGaugeAmino): MsgCreateGauge { + 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 = {} + obj.is_perpetual = + message.isPerpetual === false ? undefined : message.isPerpetual + obj.owner = message.owner === '' ? undefined : message.owner + obj.distribute_to = message.distributeTo + ? QueryCondition.toAmino(message.distributeTo) + : undefined + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + obj.start_time = message.startTime + ? Timestamp.toAmino(toTimestamp(message.startTime)) + : undefined + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg(object: MsgCreateGaugeAminoMsg): MsgCreateGauge { + return MsgCreateGauge.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateGauge): MsgCreateGaugeAminoMsg { + return { + type: 'osmosis/incentives/create-gauge', + value: MsgCreateGauge.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreateGaugeProtoMsg): MsgCreateGauge { + return MsgCreateGauge.decode(message.value) + }, + toProto(message: MsgCreateGauge): Uint8Array { + return MsgCreateGauge.encode(message).finish() + }, + toProtoMsg(message: MsgCreateGauge): MsgCreateGaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGauge', + value: MsgCreateGauge.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateGaugeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateGaugeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgCreateGaugeResponse { + const message = createBaseMsgCreateGaugeResponse() + return message + }, + fromAmino(_: MsgCreateGaugeResponseAmino): MsgCreateGaugeResponse { + const message = createBaseMsgCreateGaugeResponse() + return message + }, + toAmino(_: MsgCreateGaugeResponse): MsgCreateGaugeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgCreateGaugeResponseAminoMsg): MsgCreateGaugeResponse { + return MsgCreateGaugeResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateGaugeResponse): MsgCreateGaugeResponseAminoMsg { + return { + type: 'osmosis/incentives/create-gauge-response', + value: MsgCreateGaugeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateGaugeResponseProtoMsg + ): MsgCreateGaugeResponse { + return MsgCreateGaugeResponse.decode(message.value) + }, + toProto(message: MsgCreateGaugeResponse): Uint8Array { + return MsgCreateGaugeResponse.encode(message).finish() + }, + toProtoMsg(message: MsgCreateGaugeResponse): MsgCreateGaugeResponseProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgCreateGaugeResponse', + value: MsgCreateGaugeResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateGaugeResponse.typeUrl, + MsgCreateGaugeResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateGaugeResponse.aminoType, + MsgCreateGaugeResponse.typeUrl +) +function createBaseMsgAddToGauge(): MsgAddToGauge { + return { + owner: '', + gaugeId: BigInt(0), + rewards: [] + } +} +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) + } + if (message.gaugeId !== BigInt(0)) { + writer.uint32(16).uint64(message.gaugeId) + } + for (const v of message.rewards) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddToGauge { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddToGauge() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.gaugeId = reader.uint64() + break + case 3: + message.rewards.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgAddToGauge { + const message = createBaseMsgAddToGauge() + message.owner = object.owner ?? '' + message.gaugeId = + object.gaugeId !== undefined && object.gaugeId !== null + ? BigInt(object.gaugeId.toString()) + : BigInt(0) + message.rewards = object.rewards?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgAddToGaugeAmino): MsgAddToGauge { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.gauge_id = + message.gaugeId !== BigInt(0) ? message.gaugeId.toString() : undefined + if (message.rewards) { + obj.rewards = message.rewards.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.rewards = message.rewards + } + return obj + }, + fromAminoMsg(object: MsgAddToGaugeAminoMsg): MsgAddToGauge { + return MsgAddToGauge.fromAmino(object.value) + }, + toAminoMsg(message: MsgAddToGauge): MsgAddToGaugeAminoMsg { + return { + type: 'osmosis/incentives/add-to-gauge', + value: MsgAddToGauge.toAmino(message) + } + }, + fromProtoMsg(message: MsgAddToGaugeProtoMsg): MsgAddToGauge { + return MsgAddToGauge.decode(message.value) + }, + toProto(message: MsgAddToGauge): Uint8Array { + return MsgAddToGauge.encode(message).finish() + }, + toProtoMsg(message: MsgAddToGauge): MsgAddToGaugeProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgAddToGauge', + value: MsgAddToGauge.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToGaugeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddToGaugeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgAddToGaugeResponse { + const message = createBaseMsgAddToGaugeResponse() + return message + }, + fromAmino(_: MsgAddToGaugeResponseAmino): MsgAddToGaugeResponse { + const message = createBaseMsgAddToGaugeResponse() + return message + }, + toAmino(_: MsgAddToGaugeResponse): MsgAddToGaugeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgAddToGaugeResponseAminoMsg): MsgAddToGaugeResponse { + return MsgAddToGaugeResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgAddToGaugeResponse): MsgAddToGaugeResponseAminoMsg { + return { + type: 'osmosis/incentives/add-to-gauge-response', + value: MsgAddToGaugeResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgAddToGaugeResponseProtoMsg): MsgAddToGaugeResponse { + return MsgAddToGaugeResponse.decode(message.value) + }, + toProto(message: MsgAddToGaugeResponse): Uint8Array { + return MsgAddToGaugeResponse.encode(message).finish() + }, + toProtoMsg(message: MsgAddToGaugeResponse): MsgAddToGaugeResponseProtoMsg { + return { + typeUrl: '/osmosis.incentives.MsgAddToGaugeResponse', + value: MsgAddToGaugeResponse.encode(message).finish() + } + } +} +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 + }, + 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 = message.coins + } + obj.num_epochs_paid_over = + message.numEpochsPaidOver !== BigInt(0) + ? message.numEpochsPaidOver.toString() + : undefined + obj.owner = message.owner === '' ? undefined : message.owner + if (message.poolIds) { + obj.pool_ids = message.poolIds.map((e) => e.toString()) + } else { + obj.pool_ids = message.poolIds + } + 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 + }, + 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 !== BigInt(0) ? 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 +) diff --git a/src/proto/osmojs/osmosis/lockup/lock.ts b/src/proto/osmojs/osmosis/lockup/lock.ts new file mode 100644 index 0000000..9ae86d8 --- /dev/null +++ b/src/proto/osmojs/osmosis/lockup/lock.ts @@ -0,0 +1,832 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { Timestamp } from 'cosmjs-types/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. + */ +export enum LockQueryType { + ByDuration = 0, + ByTime = 1, + NoLock = 2, + ByGroup = 3, + UNRECOGNIZED = -1 +} +export const LockQueryTypeSDKType = LockQueryType +export const LockQueryTypeAmino = LockQueryType +export function lockQueryTypeFromJSON(object: any): LockQueryType { + switch (object) { + case 0: + case 'ByDuration': + return LockQueryType.ByDuration + case 1: + case 'ByTime': + return LockQueryType.ByTime + case 2: + case 'NoLock': + return LockQueryType.NoLock + case 3: + case 'ByGroup': + return LockQueryType.ByGroup + case -1: + case 'UNRECOGNIZED': + default: + return LockQueryType.UNRECOGNIZED + } +} +export function lockQueryTypeToJSON(object: LockQueryType): string { + switch (object) { + case LockQueryType.ByDuration: + return 'ByDuration' + case LockQueryType.ByTime: + return 'ByTime' + case LockQueryType.NoLock: + return 'NoLock' + case LockQueryType.ByGroup: + return 'ByGroup' + case LockQueryType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLock { + /** + * ID is the unique id of the lock. + * The ID of the lock is decided upon lock creation, incrementing by 1 for + * every lock. + */ + ID: bigint + /** + * Owner is the account address of the lock owner. + * Only the owner can modify the state of the lock. + */ + owner: string + /** + * Duration is the time needed for a lock to mature after unlocking has + * started. + */ + duration: Duration + /** + * EndTime refers to the time at which the lock would mature and get deleted. + * This value is first initialized when an unlock has started for the lock, + * end time being block time + duration. + */ + endTime: Date + /** Coins are the tokens locked within the lock, kept in the module account. */ + coins: Coin[] + /** + * 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. + */ + rewardReceiverAddress: string +} +export interface PeriodLockProtoMsg { + typeUrl: '/osmosis.lockup.PeriodLock' + value: Uint8Array +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLockAmino { + /** + * ID is the unique id of the lock. + * The ID of the lock is decided upon lock creation, incrementing by 1 for + * every lock. + */ + ID?: string + /** + * Owner is the account address of the lock owner. + * Only the owner can modify the state of the lock. + */ + owner?: string + /** + * Duration is the time needed for a lock to mature after unlocking has + * started. + */ + duration?: DurationAmino + /** + * EndTime refers to the time at which the lock would mature and get deleted. + * This value is first initialized when an unlock has started for the lock, + * end time being block time + duration. + */ + end_time?: string + /** Coins are the tokens locked within the lock, kept in the module account. */ + 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 +} +export interface PeriodLockAminoMsg { + type: 'osmosis/lockup/period-lock' + value: PeriodLockAmino +} +/** + * PeriodLock is a single lock unit by period defined by the x/lockup module. + * It's a record of a locked coin at a specific time. It stores owner, duration, + * unlock time and the number of coins locked. A state of a period lock is + * created upon lock creation, and deleted once the lock has been matured after + * the `duration` has passed since unbonding started. + */ +export interface PeriodLockSDKType { + ID: bigint + owner: string + duration: DurationSDKType + end_time: Date + coins: CoinSDKType[] + reward_receiver_address: string +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryCondition { + /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ + lockQueryType: LockQueryType + /** Denom represents the token denomination we are looking to lock up */ + 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 + * `ByLockDuration`. + */ + duration: Duration + /** + * Timestamp is used by locks started before the specified duration. + * Timestamp field must not be nil when the lock query type is `ByLockTime`. + * Querying locks with timestamp is currently not implemented. + */ + timestamp: Date +} +export interface QueryConditionProtoMsg { + typeUrl: '/osmosis.lockup.QueryCondition' + value: Uint8Array +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryConditionAmino { + /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ + lock_query_type?: LockQueryType + /** Denom represents the token denomination we are looking to lock up */ + 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 + * `ByLockDuration`. + */ + duration?: DurationAmino + /** + * Timestamp is used by locks started before the specified duration. + * Timestamp field must not be nil when the lock query type is `ByLockTime`. + * Querying locks with timestamp is currently not implemented. + */ + timestamp?: string +} +export interface QueryConditionAminoMsg { + type: 'osmosis/lockup/query-condition' + value: QueryConditionAmino +} +/** + * QueryCondition is a struct used for querying locks upon different conditions. + * Duration field and timestamp fields could be optional, depending on the + * LockQueryType. + */ +export interface QueryConditionSDKType { + lock_query_type: LockQueryType + denom: string + duration: DurationSDKType + timestamp: Date +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +export interface SyntheticLock { + /** + * Underlying Lock ID is the underlying native lock's id for this synthetic + * lockup. A synthetic lock MUST have an underlying lock. + */ + underlyingLockId: bigint + /** + * SynthDenom is the synthetic denom that is a combination of + * gamm share + bonding status + validator address. + */ + synthDenom: string + /** + * used for unbonding synthetic lockups, for active synthetic lockups, this + * value is set to uninitialized value + */ + endTime: Date + /** + * Duration is the duration for a synthetic lock to mature + * at the point of unbonding has started. + */ + duration: Duration +} +export interface SyntheticLockProtoMsg { + typeUrl: '/osmosis.lockup.SyntheticLock' + value: Uint8Array +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +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 + /** + * SynthDenom is the synthetic denom that is a combination of + * gamm share + bonding status + validator address. + */ + synth_denom?: string + /** + * used for unbonding synthetic lockups, for active synthetic lockups, this + * value is set to uninitialized value + */ + end_time?: string + /** + * Duration is the duration for a synthetic lock to mature + * at the point of unbonding has started. + */ + duration?: DurationAmino +} +export interface SyntheticLockAminoMsg { + type: 'osmosis/lockup/synthetic-lock' + value: SyntheticLockAmino +} +/** + * SyntheticLock is creating virtual lockup where new denom is combination of + * original denom and synthetic suffix. At the time of synthetic lockup creation + * and deletion, accumulation store is also being updated and on querier side, + * they can query as freely as native lockup. + */ +export interface SyntheticLockSDKType { + underlying_lock_id: bigint + synth_denom: string + end_time: Date + duration: DurationSDKType +} +function createBasePeriodLock(): PeriodLock { + return { + ID: BigInt(0), + owner: '', + 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) + } + if (message.owner !== '') { + writer.uint32(18).string(message.owner) + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim() + } + if (message.endTime !== undefined) { + Timestamp.encode( + toTimestamp(message.endTime), + writer.uint32(34).fork() + ).ldelim() + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim() + } + if (message.rewardReceiverAddress !== '') { + writer.uint32(50).string(message.rewardReceiverAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PeriodLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePeriodLock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.ID = reader.uint64() + break + case 2: + message.owner = reader.string() + break + case 3: + message.duration = Duration.decode(reader, reader.uint32()) + break + case 4: + message.endTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 5: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + case 6: + message.rewardReceiverAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PeriodLock { + const message = createBasePeriodLock() + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + message.owner = object.owner ?? '' + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + message.endTime = object.endTime ?? undefined + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + message.rewardReceiverAddress = object.rewardReceiverAddress ?? '' + return message + }, + fromAmino(object: PeriodLockAmino): PeriodLock { + 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 !== BigInt(0) ? message.ID.toString() : undefined + obj.owner = message.owner === '' ? undefined : message.owner + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined + 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 { + obj.coins = message.coins + } + obj.reward_receiver_address = + message.rewardReceiverAddress === '' + ? undefined + : message.rewardReceiverAddress + return obj + }, + fromAminoMsg(object: PeriodLockAminoMsg): PeriodLock { + return PeriodLock.fromAmino(object.value) + }, + toAminoMsg(message: PeriodLock): PeriodLockAminoMsg { + return { + type: 'osmosis/lockup/period-lock', + value: PeriodLock.toAmino(message) + } + }, + fromProtoMsg(message: PeriodLockProtoMsg): PeriodLock { + return PeriodLock.decode(message.value) + }, + toProto(message: PeriodLock): Uint8Array { + return PeriodLock.encode(message).finish() + }, + toProtoMsg(message: PeriodLock): PeriodLockProtoMsg { + return { + typeUrl: '/osmosis.lockup.PeriodLock', + value: PeriodLock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PeriodLock.typeUrl, PeriodLock) +GlobalDecoderRegistry.registerAminoProtoMapping( + PeriodLock.aminoType, + PeriodLock.typeUrl +) +function createBaseQueryCondition(): QueryCondition { + return { + lockQueryType: 0, + denom: '', + 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) + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom) + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim() + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(34).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCondition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryCondition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.lockQueryType = reader.int32() as any + break + case 2: + message.denom = reader.string() + break + case 3: + message.duration = Duration.decode(reader, reader.uint32()) + break + case 4: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): QueryCondition { + const message = createBaseQueryCondition() + message.lockQueryType = object.lockQueryType ?? 0 + message.denom = object.denom ?? '' + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + message.timestamp = object.timestamp ?? undefined + return message + }, + fromAmino(object: QueryConditionAmino): QueryCondition { + const message = createBaseQueryCondition() + if ( + object.lock_query_type !== undefined && + object.lock_query_type !== null + ) { + message.lockQueryType = 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 === 0 ? undefined : message.lockQueryType + obj.denom = message.denom === '' ? undefined : message.denom + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined + return obj + }, + fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { + return QueryCondition.fromAmino(object.value) + }, + toAminoMsg(message: QueryCondition): QueryConditionAminoMsg { + return { + type: 'osmosis/lockup/query-condition', + value: QueryCondition.toAmino(message) + } + }, + fromProtoMsg(message: QueryConditionProtoMsg): QueryCondition { + return QueryCondition.decode(message.value) + }, + toProto(message: QueryCondition): Uint8Array { + return QueryCondition.encode(message).finish() + }, + toProtoMsg(message: QueryCondition): QueryConditionProtoMsg { + return { + typeUrl: '/osmosis.lockup.QueryCondition', + value: QueryCondition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(QueryCondition.typeUrl, QueryCondition) +GlobalDecoderRegistry.registerAminoProtoMapping( + QueryCondition.aminoType, + QueryCondition.typeUrl +) +function createBaseSyntheticLock(): SyntheticLock { + return { + underlyingLockId: BigInt(0), + synthDenom: '', + 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) + } + if (message.synthDenom !== '') { + writer.uint32(18).string(message.synthDenom) + } + if (message.endTime !== undefined) { + Timestamp.encode( + toTimestamp(message.endTime), + writer.uint32(26).fork() + ).ldelim() + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SyntheticLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSyntheticLock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.underlyingLockId = reader.uint64() + break + case 2: + message.synthDenom = reader.string() + break + case 3: + message.endTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 4: + message.duration = Duration.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SyntheticLock { + const message = createBaseSyntheticLock() + message.underlyingLockId = + object.underlyingLockId !== undefined && object.underlyingLockId !== null + ? BigInt(object.underlyingLockId.toString()) + : BigInt(0) + message.synthDenom = object.synthDenom ?? '' + message.endTime = object.endTime ?? undefined + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + return message + }, + fromAmino(object: SyntheticLockAmino): SyntheticLock { + 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 !== BigInt(0) + ? message.underlyingLockId.toString() + : undefined + obj.synth_denom = message.synthDenom === '' ? undefined : message.synthDenom + obj.end_time = message.endTime + ? Timestamp.toAmino(toTimestamp(message.endTime)) + : undefined + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined + return obj + }, + fromAminoMsg(object: SyntheticLockAminoMsg): SyntheticLock { + return SyntheticLock.fromAmino(object.value) + }, + toAminoMsg(message: SyntheticLock): SyntheticLockAminoMsg { + return { + type: 'osmosis/lockup/synthetic-lock', + value: SyntheticLock.toAmino(message) + } + }, + fromProtoMsg(message: SyntheticLockProtoMsg): SyntheticLock { + return SyntheticLock.decode(message.value) + }, + toProto(message: SyntheticLock): Uint8Array { + return SyntheticLock.encode(message).finish() + }, + toProtoMsg(message: SyntheticLock): SyntheticLockProtoMsg { + return { + typeUrl: '/osmosis.lockup.SyntheticLock', + value: SyntheticLock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SyntheticLock.typeUrl, SyntheticLock) +GlobalDecoderRegistry.registerAminoProtoMapping( + SyntheticLock.aminoType, + SyntheticLock.typeUrl +) diff --git a/src/proto/osmojs/osmosis/lockup/tx.amino.ts b/src/proto/osmojs/osmosis/lockup/tx.amino.ts new file mode 100644 index 0000000..7fd38c8 --- /dev/null +++ b/src/proto/osmojs/osmosis/lockup/tx.amino.ts @@ -0,0 +1,42 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgLockTokens, + MsgBeginUnlockingAll, + MsgBeginUnlocking, + MsgExtendLockup, + MsgForceUnlock, + MsgSetRewardReceiverAddress +} from './tx' +export const AminoConverter = { + '/osmosis.lockup.MsgLockTokens': { + aminoType: 'osmosis/lockup/lock-tokens', + toAmino: MsgLockTokens.toAmino, + fromAmino: MsgLockTokens.fromAmino + }, + '/osmosis.lockup.MsgBeginUnlockingAll': { + aminoType: 'osmosis/lockup/begin-unlock-tokens', + toAmino: MsgBeginUnlockingAll.toAmino, + fromAmino: MsgBeginUnlockingAll.fromAmino + }, + '/osmosis.lockup.MsgBeginUnlocking': { + aminoType: 'osmosis/lockup/begin-unlock-period-lock', + toAmino: MsgBeginUnlocking.toAmino, + fromAmino: MsgBeginUnlocking.fromAmino + }, + '/osmosis.lockup.MsgExtendLockup': { + aminoType: 'osmosis/lockup/extend-lockup', + toAmino: MsgExtendLockup.toAmino, + fromAmino: MsgExtendLockup.fromAmino + }, + '/osmosis.lockup.MsgForceUnlock': { + aminoType: 'osmosis/lockup/force-unlock-tokens', + toAmino: MsgForceUnlock.toAmino, + fromAmino: MsgForceUnlock.fromAmino + }, + '/osmosis.lockup.MsgSetRewardReceiverAddress': { + aminoType: 'osmosis/lockup/set-reward-receiver-address', + toAmino: MsgSetRewardReceiverAddress.toAmino, + fromAmino: MsgSetRewardReceiverAddress.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/lockup/tx.registry.ts b/src/proto/osmojs/osmosis/lockup/tx.registry.ts new file mode 100644 index 0000000..3b908d0 --- /dev/null +++ b/src/proto/osmojs/osmosis/lockup/tx.registry.ts @@ -0,0 +1,140 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { + MsgLockTokens, + MsgBeginUnlockingAll, + MsgBeginUnlocking, + MsgExtendLockup, + MsgForceUnlock, + MsgSetRewardReceiverAddress +} from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.lockup.MsgLockTokens', MsgLockTokens], + ['/osmosis.lockup.MsgBeginUnlockingAll', MsgBeginUnlockingAll], + ['/osmosis.lockup.MsgBeginUnlocking', MsgBeginUnlocking], + ['/osmosis.lockup.MsgExtendLockup', MsgExtendLockup], + ['/osmosis.lockup.MsgForceUnlock', MsgForceUnlock], + ['/osmosis.lockup.MsgSetRewardReceiverAddress', MsgSetRewardReceiverAddress] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.encode(value).finish() + } + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.encode(value).finish() + } + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.encode(value).finish() + } + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.encode(value).finish() + } + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.encode(value).finish() + } + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.encode(value).finish() + } + } + }, + withTypeUrl: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value + } + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value + } + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value + } + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value + } + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value + } + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value + } + } + }, + fromPartial: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.fromPartial(value) + } + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.fromPartial(value) + } + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.fromPartial(value) + } + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.fromPartial(value) + } + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.fromPartial(value) + } + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/lockup/tx.ts b/src/proto/osmojs/osmosis/lockup/tx.ts new file mode 100644 index 0000000..da8c3e6 --- /dev/null +++ b/src/proto/osmojs/osmosis/lockup/tx.ts @@ -0,0 +1,1822 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin' +import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from './lock' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { GlobalDecoderRegistry } from '../../registry' +export interface MsgLockTokens { + owner: string + duration: Duration + coins: Coin[] +} +export interface MsgLockTokensProtoMsg { + typeUrl: '/osmosis.lockup.MsgLockTokens' + value: Uint8Array +} +export interface MsgLockTokensAmino { + owner?: string + duration?: DurationAmino + coins?: CoinAmino[] +} +export interface MsgLockTokensAminoMsg { + type: 'osmosis/lockup/lock-tokens' + value: MsgLockTokensAmino +} +export interface MsgLockTokensSDKType { + owner: string + duration: DurationSDKType + coins: CoinSDKType[] +} +export interface MsgLockTokensResponse { + ID: bigint +} +export interface MsgLockTokensResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgLockTokensResponse' + value: Uint8Array +} +export interface MsgLockTokensResponseAmino { + ID?: string +} +export interface MsgLockTokensResponseAminoMsg { + type: 'osmosis/lockup/lock-tokens-response' + value: MsgLockTokensResponseAmino +} +export interface MsgLockTokensResponseSDKType { + ID: bigint +} +export interface MsgBeginUnlockingAll { + owner: string +} +export interface MsgBeginUnlockingAllProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll' + value: Uint8Array +} +export interface MsgBeginUnlockingAllAmino { + owner?: string +} +export interface MsgBeginUnlockingAllAminoMsg { + type: 'osmosis/lockup/begin-unlock-tokens' + value: MsgBeginUnlockingAllAmino +} +export interface MsgBeginUnlockingAllSDKType { + owner: string +} +export interface MsgBeginUnlockingAllResponse { + unlocks: PeriodLock[] +} +export interface MsgBeginUnlockingAllResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAllResponse' + value: Uint8Array +} +export interface MsgBeginUnlockingAllResponseAmino { + unlocks?: PeriodLockAmino[] +} +export interface MsgBeginUnlockingAllResponseAminoMsg { + type: 'osmosis/lockup/begin-unlocking-all-response' + value: MsgBeginUnlockingAllResponseAmino +} +export interface MsgBeginUnlockingAllResponseSDKType { + unlocks: PeriodLockSDKType[] +} +export interface MsgBeginUnlocking { + owner: string + ID: bigint + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[] +} +export interface MsgBeginUnlockingProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking' + value: Uint8Array +} +export interface MsgBeginUnlockingAmino { + owner?: string + ID?: string + /** Amount of unlocking coins. Unlock all if not set. */ + coins?: CoinAmino[] +} +export interface MsgBeginUnlockingAminoMsg { + type: 'osmosis/lockup/begin-unlock-period-lock' + value: MsgBeginUnlockingAmino +} +export interface MsgBeginUnlockingSDKType { + owner: string + ID: bigint + coins: CoinSDKType[] +} +export interface MsgBeginUnlockingResponse { + success: boolean + unlockingLockID: bigint +} +export interface MsgBeginUnlockingResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingResponse' + value: Uint8Array +} +export interface MsgBeginUnlockingResponseAmino { + success?: boolean + unlockingLockID?: string +} +export interface MsgBeginUnlockingResponseAminoMsg { + type: 'osmosis/lockup/begin-unlocking-response' + value: MsgBeginUnlockingResponseAmino +} +export interface MsgBeginUnlockingResponseSDKType { + success: boolean + unlockingLockID: bigint +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockup { + owner: string + ID: bigint + /** + * duration to be set. fails if lower than the current duration, or is + * unlocking + */ + duration: Duration +} +export interface MsgExtendLockupProtoMsg { + typeUrl: '/osmosis.lockup.MsgExtendLockup' + value: Uint8Array +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockupAmino { + owner?: string + ID?: string + /** + * duration to be set. fails if lower than the current duration, or is + * unlocking + */ + duration?: DurationAmino +} +export interface MsgExtendLockupAminoMsg { + type: 'osmosis/lockup/extend-lockup' + value: MsgExtendLockupAmino +} +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockupSDKType { + owner: string + ID: bigint + duration: DurationSDKType +} +export interface MsgExtendLockupResponse { + success: boolean +} +export interface MsgExtendLockupResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgExtendLockupResponse' + value: Uint8Array +} +export interface MsgExtendLockupResponseAmino { + success?: boolean +} +export interface MsgExtendLockupResponseAminoMsg { + type: 'osmosis/lockup/extend-lockup-response' + value: MsgExtendLockupResponseAmino +} +export interface MsgExtendLockupResponseSDKType { + success: boolean +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlock { + owner: string + ID: bigint + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[] +} +export interface MsgForceUnlockProtoMsg { + typeUrl: '/osmosis.lockup.MsgForceUnlock' + value: Uint8Array +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlockAmino { + owner?: string + ID?: string + /** Amount of unlocking coins. Unlock all if not set. */ + coins?: CoinAmino[] +} +export interface MsgForceUnlockAminoMsg { + type: 'osmosis/lockup/force-unlock-tokens' + value: MsgForceUnlockAmino +} +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlockSDKType { + owner: string + ID: bigint + coins: CoinSDKType[] +} +export interface MsgForceUnlockResponse { + success: boolean +} +export interface MsgForceUnlockResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgForceUnlockResponse' + value: Uint8Array +} +export interface MsgForceUnlockResponseAmino { + success?: boolean +} +export interface MsgForceUnlockResponseAminoMsg { + type: 'osmosis/lockup/force-unlock-response' + value: MsgForceUnlockResponseAmino +} +export interface MsgForceUnlockResponseSDKType { + success: boolean +} +export interface MsgSetRewardReceiverAddress { + owner: string + lockID: bigint + rewardReceiver: string +} +export interface MsgSetRewardReceiverAddressProtoMsg { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress' + value: Uint8Array +} +export interface MsgSetRewardReceiverAddressAmino { + owner?: string + lockID?: string + reward_receiver?: string +} +export interface MsgSetRewardReceiverAddressAminoMsg { + type: 'osmosis/lockup/set-reward-receiver-address' + value: MsgSetRewardReceiverAddressAmino +} +export interface MsgSetRewardReceiverAddressSDKType { + owner: string + lockID: bigint + reward_receiver: string +} +export interface MsgSetRewardReceiverAddressResponse { + success: boolean +} +export interface MsgSetRewardReceiverAddressResponseProtoMsg { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddressResponse' + value: Uint8Array +} +export interface MsgSetRewardReceiverAddressResponseAmino { + success?: boolean +} +export interface MsgSetRewardReceiverAddressResponseAminoMsg { + type: 'osmosis/lockup/set-reward-receiver-address-response' + value: MsgSetRewardReceiverAddressResponseAmino +} +export interface MsgSetRewardReceiverAddressResponseSDKType { + success: boolean +} +function createBaseMsgLockTokens(): MsgLockTokens { + return { + owner: '', + 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) + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim() + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLockTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgLockTokens() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.duration = Duration.decode(reader, reader.uint32()) + break + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgLockTokens { + const message = createBaseMsgLockTokens() + message.owner = object.owner ?? '' + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgLockTokensAmino): MsgLockTokens { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + return obj + }, + fromAminoMsg(object: MsgLockTokensAminoMsg): MsgLockTokens { + return MsgLockTokens.fromAmino(object.value) + }, + toAminoMsg(message: MsgLockTokens): MsgLockTokensAminoMsg { + return { + type: 'osmosis/lockup/lock-tokens', + value: MsgLockTokens.toAmino(message) + } + }, + fromProtoMsg(message: MsgLockTokensProtoMsg): MsgLockTokens { + return MsgLockTokens.decode(message.value) + }, + toProto(message: MsgLockTokens): Uint8Array { + return MsgLockTokens.encode(message).finish() + }, + toProtoMsg(message: MsgLockTokens): MsgLockTokensProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgLockTokens', + value: MsgLockTokens.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgLockTokens.typeUrl, MsgLockTokens) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockTokens.aminoType, + MsgLockTokens.typeUrl +) +function createBaseMsgLockTokensResponse(): MsgLockTokensResponse { + return { + ID: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgLockTokensResponse() + 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): MsgLockTokensResponse { + const message = createBaseMsgLockTokensResponse() + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgLockTokensResponseAmino): MsgLockTokensResponse { + const message = createBaseMsgLockTokensResponse() + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID) + } + return message + }, + toAmino(message: MsgLockTokensResponse): MsgLockTokensResponseAmino { + const obj: any = {} + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined + return obj + }, + fromAminoMsg(object: MsgLockTokensResponseAminoMsg): MsgLockTokensResponse { + return MsgLockTokensResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgLockTokensResponse): MsgLockTokensResponseAminoMsg { + return { + type: 'osmosis/lockup/lock-tokens-response', + value: MsgLockTokensResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgLockTokensResponseProtoMsg): MsgLockTokensResponse { + return MsgLockTokensResponse.decode(message.value) + }, + toProto(message: MsgLockTokensResponse): Uint8Array { + return MsgLockTokensResponse.encode(message).finish() + }, + toProtoMsg(message: MsgLockTokensResponse): MsgLockTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgLockTokensResponse', + value: MsgLockTokensResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgLockTokensResponse.typeUrl, + MsgLockTokensResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockTokensResponse.aminoType, + MsgLockTokensResponse.typeUrl +) +function createBaseMsgBeginUnlockingAll(): MsgBeginUnlockingAll { + return { + owner: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingAll { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginUnlockingAll() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgBeginUnlockingAll { + const message = createBaseMsgBeginUnlockingAll() + message.owner = object.owner ?? '' + return message + }, + fromAmino(object: MsgBeginUnlockingAllAmino): MsgBeginUnlockingAll { + const message = createBaseMsgBeginUnlockingAll() + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner + } + return message + }, + toAmino(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAmino { + const obj: any = {} + obj.owner = message.owner === '' ? undefined : message.owner + return obj + }, + fromAminoMsg(object: MsgBeginUnlockingAllAminoMsg): MsgBeginUnlockingAll { + return MsgBeginUnlockingAll.fromAmino(object.value) + }, + toAminoMsg(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAminoMsg { + return { + type: 'osmosis/lockup/begin-unlock-tokens', + value: MsgBeginUnlockingAll.toAmino(message) + } + }, + fromProtoMsg(message: MsgBeginUnlockingAllProtoMsg): MsgBeginUnlockingAll { + return MsgBeginUnlockingAll.decode(message.value) + }, + toProto(message: MsgBeginUnlockingAll): Uint8Array { + return MsgBeginUnlockingAll.encode(message).finish() + }, + toProtoMsg(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAll', + value: MsgBeginUnlockingAll.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgBeginUnlockingAll.typeUrl, + MsgBeginUnlockingAll +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingAll.aminoType, + MsgBeginUnlockingAll.typeUrl +) +function createBaseMsgBeginUnlockingAllResponse(): MsgBeginUnlockingAllResponse { + return { + unlocks: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingAllResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginUnlockingAllResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.unlocks.push(PeriodLock.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgBeginUnlockingAllResponse { + const message = createBaseMsgBeginUnlockingAllResponse() + message.unlocks = + object.unlocks?.map((e) => PeriodLock.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgBeginUnlockingAllResponseAmino + ): MsgBeginUnlockingAllResponse { + const message = createBaseMsgBeginUnlockingAllResponse() + message.unlocks = object.unlocks?.map((e) => PeriodLock.fromAmino(e)) || [] + return message + }, + toAmino( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseAmino { + const obj: any = {} + if (message.unlocks) { + obj.unlocks = message.unlocks.map((e) => + e ? PeriodLock.toAmino(e) : undefined + ) + } else { + obj.unlocks = message.unlocks + } + return obj + }, + fromAminoMsg( + object: MsgBeginUnlockingAllResponseAminoMsg + ): MsgBeginUnlockingAllResponse { + return MsgBeginUnlockingAllResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseAminoMsg { + return { + type: 'osmosis/lockup/begin-unlocking-all-response', + value: MsgBeginUnlockingAllResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgBeginUnlockingAllResponseProtoMsg + ): MsgBeginUnlockingAllResponse { + return MsgBeginUnlockingAllResponse.decode(message.value) + }, + toProto(message: MsgBeginUnlockingAllResponse): Uint8Array { + return MsgBeginUnlockingAllResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgBeginUnlockingAllResponse + ): MsgBeginUnlockingAllResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingAllResponse', + value: MsgBeginUnlockingAllResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgBeginUnlockingAllResponse.typeUrl, + MsgBeginUnlockingAllResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingAllResponse.aminoType, + MsgBeginUnlockingAllResponse.typeUrl +) +function createBaseMsgBeginUnlocking(): MsgBeginUnlocking { + return { + owner: '', + ID: BigInt(0), + coins: [] + } +} +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) + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginUnlocking { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginUnlocking() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.ID = reader.uint64() + break + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgBeginUnlocking { + const message = createBaseMsgBeginUnlocking() + message.owner = object.owner ?? '' + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgBeginUnlockingAmino): MsgBeginUnlocking { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + return obj + }, + fromAminoMsg(object: MsgBeginUnlockingAminoMsg): MsgBeginUnlocking { + return MsgBeginUnlocking.fromAmino(object.value) + }, + toAminoMsg(message: MsgBeginUnlocking): MsgBeginUnlockingAminoMsg { + return { + type: 'osmosis/lockup/begin-unlock-period-lock', + value: MsgBeginUnlocking.toAmino(message) + } + }, + fromProtoMsg(message: MsgBeginUnlockingProtoMsg): MsgBeginUnlocking { + return MsgBeginUnlocking.decode(message.value) + }, + toProto(message: MsgBeginUnlocking): Uint8Array { + return MsgBeginUnlocking.encode(message).finish() + }, + toProtoMsg(message: MsgBeginUnlocking): MsgBeginUnlockingProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlocking', + value: MsgBeginUnlocking.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgBeginUnlocking.typeUrl, MsgBeginUnlocking) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlocking.aminoType, + MsgBeginUnlocking.typeUrl +) +function createBaseMsgBeginUnlockingResponse(): MsgBeginUnlockingResponse { + return { + success: false, + unlockingLockID: BigInt(0) + } +} +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) + } + if (message.unlockingLockID !== BigInt(0)) { + writer.uint32(16).uint64(message.unlockingLockID) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgBeginUnlockingResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBeginUnlockingResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.success = reader.bool() + break + case 2: + message.unlockingLockID = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgBeginUnlockingResponse { + const message = createBaseMsgBeginUnlockingResponse() + message.success = object.success ?? false + message.unlockingLockID = + object.unlockingLockID !== undefined && object.unlockingLockID !== null + ? BigInt(object.unlockingLockID.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgBeginUnlockingResponseAmino): MsgBeginUnlockingResponse { + 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 = {} + obj.success = message.success === false ? undefined : message.success + obj.unlockingLockID = + message.unlockingLockID !== BigInt(0) + ? message.unlockingLockID.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgBeginUnlockingResponseAminoMsg + ): MsgBeginUnlockingResponse { + return MsgBeginUnlockingResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgBeginUnlockingResponse + ): MsgBeginUnlockingResponseAminoMsg { + return { + type: 'osmosis/lockup/begin-unlocking-response', + value: MsgBeginUnlockingResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgBeginUnlockingResponseProtoMsg + ): MsgBeginUnlockingResponse { + return MsgBeginUnlockingResponse.decode(message.value) + }, + toProto(message: MsgBeginUnlockingResponse): Uint8Array { + return MsgBeginUnlockingResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgBeginUnlockingResponse + ): MsgBeginUnlockingResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgBeginUnlockingResponse', + value: MsgBeginUnlockingResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgBeginUnlockingResponse.typeUrl, + MsgBeginUnlockingResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBeginUnlockingResponse.aminoType, + MsgBeginUnlockingResponse.typeUrl +) +function createBaseMsgExtendLockup(): MsgExtendLockup { + return { + owner: '', + ID: BigInt(0), + 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) + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID) + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExtendLockup { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExtendLockup() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.ID = reader.uint64() + break + case 3: + message.duration = Duration.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExtendLockup { + const message = createBaseMsgExtendLockup() + message.owner = object.owner ?? '' + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined + return message + }, + fromAmino(object: MsgExtendLockupAmino): MsgExtendLockup { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined + obj.duration = message.duration + ? Duration.toAmino(message.duration) + : undefined + return obj + }, + fromAminoMsg(object: MsgExtendLockupAminoMsg): MsgExtendLockup { + return MsgExtendLockup.fromAmino(object.value) + }, + toAminoMsg(message: MsgExtendLockup): MsgExtendLockupAminoMsg { + return { + type: 'osmosis/lockup/extend-lockup', + value: MsgExtendLockup.toAmino(message) + } + }, + fromProtoMsg(message: MsgExtendLockupProtoMsg): MsgExtendLockup { + return MsgExtendLockup.decode(message.value) + }, + toProto(message: MsgExtendLockup): Uint8Array { + return MsgExtendLockup.encode(message).finish() + }, + toProtoMsg(message: MsgExtendLockup): MsgExtendLockupProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockup', + value: MsgExtendLockup.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgExtendLockup.typeUrl, MsgExtendLockup) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExtendLockup.aminoType, + MsgExtendLockup.typeUrl +) +function createBaseMsgExtendLockupResponse(): MsgExtendLockupResponse { + return { + success: false + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgExtendLockupResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExtendLockupResponse() + 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 + ): MsgExtendLockupResponse { + const message = createBaseMsgExtendLockupResponse() + message.success = object.success ?? false + return message + }, + fromAmino(object: MsgExtendLockupResponseAmino): MsgExtendLockupResponse { + const message = createBaseMsgExtendLockupResponse() + if (object.success !== undefined && object.success !== null) { + message.success = object.success + } + return message + }, + toAmino(message: MsgExtendLockupResponse): MsgExtendLockupResponseAmino { + const obj: any = {} + obj.success = message.success === false ? undefined : message.success + return obj + }, + fromAminoMsg( + object: MsgExtendLockupResponseAminoMsg + ): MsgExtendLockupResponse { + return MsgExtendLockupResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExtendLockupResponse + ): MsgExtendLockupResponseAminoMsg { + return { + type: 'osmosis/lockup/extend-lockup-response', + value: MsgExtendLockupResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgExtendLockupResponseProtoMsg + ): MsgExtendLockupResponse { + return MsgExtendLockupResponse.decode(message.value) + }, + toProto(message: MsgExtendLockupResponse): Uint8Array { + return MsgExtendLockupResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgExtendLockupResponse + ): MsgExtendLockupResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgExtendLockupResponse', + value: MsgExtendLockupResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgExtendLockupResponse.typeUrl, + MsgExtendLockupResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgExtendLockupResponse.aminoType, + MsgExtendLockupResponse.typeUrl +) +function createBaseMsgForceUnlock(): MsgForceUnlock { + return { + owner: '', + ID: BigInt(0), + coins: [] + } +} +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) + } + if (message.ID !== BigInt(0)) { + writer.uint32(16).uint64(message.ID) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceUnlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgForceUnlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.ID = reader.uint64() + break + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgForceUnlock { + const message = createBaseMsgForceUnlock() + message.owner = object.owner ?? '' + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgForceUnlockAmino): MsgForceUnlock { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + return obj + }, + fromAminoMsg(object: MsgForceUnlockAminoMsg): MsgForceUnlock { + return MsgForceUnlock.fromAmino(object.value) + }, + toAminoMsg(message: MsgForceUnlock): MsgForceUnlockAminoMsg { + return { + type: 'osmosis/lockup/force-unlock-tokens', + value: MsgForceUnlock.toAmino(message) + } + }, + fromProtoMsg(message: MsgForceUnlockProtoMsg): MsgForceUnlock { + return MsgForceUnlock.decode(message.value) + }, + toProto(message: MsgForceUnlock): Uint8Array { + return MsgForceUnlock.encode(message).finish() + }, + toProtoMsg(message: MsgForceUnlock): MsgForceUnlockProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlock', + value: MsgForceUnlock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgForceUnlock.typeUrl, MsgForceUnlock) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceUnlock.aminoType, + MsgForceUnlock.typeUrl +) +function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { + return { + success: false + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgForceUnlockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgForceUnlockResponse() + 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): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse() + message.success = object.success ?? false + return message + }, + fromAmino(object: MsgForceUnlockResponseAmino): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse() + if (object.success !== undefined && object.success !== null) { + message.success = object.success + } + return message + }, + toAmino(message: MsgForceUnlockResponse): MsgForceUnlockResponseAmino { + const obj: any = {} + obj.success = message.success === false ? undefined : message.success + return obj + }, + fromAminoMsg(object: MsgForceUnlockResponseAminoMsg): MsgForceUnlockResponse { + return MsgForceUnlockResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgForceUnlockResponse): MsgForceUnlockResponseAminoMsg { + return { + type: 'osmosis/lockup/force-unlock-response', + value: MsgForceUnlockResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgForceUnlockResponseProtoMsg + ): MsgForceUnlockResponse { + return MsgForceUnlockResponse.decode(message.value) + }, + toProto(message: MsgForceUnlockResponse): Uint8Array { + return MsgForceUnlockResponse.encode(message).finish() + }, + toProtoMsg(message: MsgForceUnlockResponse): MsgForceUnlockResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgForceUnlockResponse', + value: MsgForceUnlockResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgForceUnlockResponse.typeUrl, + MsgForceUnlockResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceUnlockResponse.aminoType, + MsgForceUnlockResponse.typeUrl +) +function createBaseMsgSetRewardReceiverAddress(): MsgSetRewardReceiverAddress { + return { + owner: '', + lockID: BigInt(0), + rewardReceiver: '' + } +} +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) + } + if (message.lockID !== BigInt(0)) { + writer.uint32(16).uint64(message.lockID) + } + if (message.rewardReceiver !== '') { + writer.uint32(26).string(message.rewardReceiver) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRewardReceiverAddress { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetRewardReceiverAddress() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.owner = reader.string() + break + case 2: + message.lockID = reader.uint64() + break + case 3: + message.rewardReceiver = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSetRewardReceiverAddress { + const message = createBaseMsgSetRewardReceiverAddress() + message.owner = object.owner ?? '' + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0) + message.rewardReceiver = object.rewardReceiver ?? '' + return message + }, + fromAmino( + object: MsgSetRewardReceiverAddressAmino + ): MsgSetRewardReceiverAddress { + 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 = {} + obj.owner = message.owner === '' ? undefined : message.owner + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined + obj.reward_receiver = + message.rewardReceiver === '' ? undefined : message.rewardReceiver + return obj + }, + fromAminoMsg( + object: MsgSetRewardReceiverAddressAminoMsg + ): MsgSetRewardReceiverAddress { + return MsgSetRewardReceiverAddress.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetRewardReceiverAddress + ): MsgSetRewardReceiverAddressAminoMsg { + return { + type: 'osmosis/lockup/set-reward-receiver-address', + value: MsgSetRewardReceiverAddress.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetRewardReceiverAddressProtoMsg + ): MsgSetRewardReceiverAddress { + return MsgSetRewardReceiverAddress.decode(message.value) + }, + toProto(message: MsgSetRewardReceiverAddress): Uint8Array { + return MsgSetRewardReceiverAddress.encode(message).finish() + }, + toProtoMsg( + message: MsgSetRewardReceiverAddress + ): MsgSetRewardReceiverAddressProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddress', + value: MsgSetRewardReceiverAddress.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetRewardReceiverAddress.typeUrl, + MsgSetRewardReceiverAddress +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetRewardReceiverAddress.aminoType, + MsgSetRewardReceiverAddress.typeUrl +) +function createBaseMsgSetRewardReceiverAddressResponse(): MsgSetRewardReceiverAddressResponse { + return { + success: false + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRewardReceiverAddressResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetRewardReceiverAddressResponse() + 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 + ): MsgSetRewardReceiverAddressResponse { + const message = createBaseMsgSetRewardReceiverAddressResponse() + message.success = object.success ?? false + return message + }, + fromAmino( + object: MsgSetRewardReceiverAddressResponseAmino + ): MsgSetRewardReceiverAddressResponse { + const message = createBaseMsgSetRewardReceiverAddressResponse() + if (object.success !== undefined && object.success !== null) { + message.success = object.success + } + return message + }, + toAmino( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseAmino { + const obj: any = {} + obj.success = message.success === false ? undefined : message.success + return obj + }, + fromAminoMsg( + object: MsgSetRewardReceiverAddressResponseAminoMsg + ): MsgSetRewardReceiverAddressResponse { + return MsgSetRewardReceiverAddressResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseAminoMsg { + return { + type: 'osmosis/lockup/set-reward-receiver-address-response', + value: MsgSetRewardReceiverAddressResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetRewardReceiverAddressResponseProtoMsg + ): MsgSetRewardReceiverAddressResponse { + return MsgSetRewardReceiverAddressResponse.decode(message.value) + }, + toProto(message: MsgSetRewardReceiverAddressResponse): Uint8Array { + return MsgSetRewardReceiverAddressResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetRewardReceiverAddressResponse + ): MsgSetRewardReceiverAddressResponseProtoMsg { + return { + typeUrl: '/osmosis.lockup.MsgSetRewardReceiverAddressResponse', + value: MsgSetRewardReceiverAddressResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetRewardReceiverAddressResponse.typeUrl, + MsgSetRewardReceiverAddressResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetRewardReceiverAddressResponse.aminoType, + MsgSetRewardReceiverAddressResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/poolincentives/v1beta1/gov.ts b/src/proto/osmojs/osmosis/poolincentives/v1beta1/gov.ts new file mode 100644 index 0000000..2cbae2e --- /dev/null +++ b/src/proto/osmojs/osmosis/poolincentives/v1beta1/gov.ts @@ -0,0 +1,431 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { DistrRecord, DistrRecordAmino, DistrRecordSDKType } from './incentives' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * ReplacePoolIncentivesProposal is a gov Content type for updating the pool + * incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records + * override the existing DistrRecords set in the module. Each record has a + * specified gauge id and weight, and the incentives are distributed to each + * gauge according to weight/total_weight. The incentives are put in the fee + * pool and it is allocated to gauges and community pool by the DistrRecords + * configuration. Note that gaugeId=0 represents the community pool. + */ +export interface ReplacePoolIncentivesProposal { + $typeUrl?: '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal' + title: string + description: string + records: DistrRecord[] +} +export interface ReplacePoolIncentivesProposalProtoMsg { + typeUrl: '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal' + value: Uint8Array +} +/** + * ReplacePoolIncentivesProposal is a gov Content type for updating the pool + * incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records + * override the existing DistrRecords set in the module. Each record has a + * specified gauge id and weight, and the incentives are distributed to each + * gauge according to weight/total_weight. The incentives are put in the fee + * pool and it is allocated to gauges and community pool by the DistrRecords + * configuration. Note that gaugeId=0 represents the community pool. + */ +export interface ReplacePoolIncentivesProposalAmino { + title?: string + description?: string + records?: DistrRecordAmino[] +} +export interface ReplacePoolIncentivesProposalAminoMsg { + type: 'osmosis/ReplacePoolIncentivesProposal' + value: ReplacePoolIncentivesProposalAmino +} +/** + * ReplacePoolIncentivesProposal is a gov Content type for updating the pool + * incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records + * override the existing DistrRecords set in the module. Each record has a + * specified gauge id and weight, and the incentives are distributed to each + * gauge according to weight/total_weight. The incentives are put in the fee + * pool and it is allocated to gauges and community pool by the DistrRecords + * configuration. Note that gaugeId=0 represents the community pool. + */ +export interface ReplacePoolIncentivesProposalSDKType { + $typeUrl?: '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal' + title: string + description: string + records: DistrRecordSDKType[] +} +/** + * For example: if the existing DistrRecords were: + * [(Gauge 0, 5), (Gauge 1, 6), (Gauge 2, 6)] + * An UpdatePoolIncentivesProposal includes + * [(Gauge 1, 0), (Gauge 2, 4), (Gauge 3, 10)] + * This would delete Gauge 1, Edit Gauge 2, and Add Gauge 3 + * The result DistrRecords in state would be: + * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] + */ +export interface UpdatePoolIncentivesProposal { + $typeUrl?: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal' + title: string + description: string + records: DistrRecord[] +} +export interface UpdatePoolIncentivesProposalProtoMsg { + typeUrl: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal' + value: Uint8Array +} +/** + * For example: if the existing DistrRecords were: + * [(Gauge 0, 5), (Gauge 1, 6), (Gauge 2, 6)] + * An UpdatePoolIncentivesProposal includes + * [(Gauge 1, 0), (Gauge 2, 4), (Gauge 3, 10)] + * This would delete Gauge 1, Edit Gauge 2, and Add Gauge 3 + * The result DistrRecords in state would be: + * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] + */ +export interface UpdatePoolIncentivesProposalAmino { + title?: string + description?: string + records?: DistrRecordAmino[] +} +export interface UpdatePoolIncentivesProposalAminoMsg { + type: 'osmosis/UpdatePoolIncentivesProposal' + value: UpdatePoolIncentivesProposalAmino +} +/** + * For example: if the existing DistrRecords were: + * [(Gauge 0, 5), (Gauge 1, 6), (Gauge 2, 6)] + * An UpdatePoolIncentivesProposal includes + * [(Gauge 1, 0), (Gauge 2, 4), (Gauge 3, 10)] + * This would delete Gauge 1, Edit Gauge 2, and Add Gauge 3 + * The result DistrRecords in state would be: + * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] + */ +export interface UpdatePoolIncentivesProposalSDKType { + $typeUrl?: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal' + title: string + description: string + records: DistrRecordSDKType[] +} +function createBaseReplacePoolIncentivesProposal(): ReplacePoolIncentivesProposal { + return { + $typeUrl: '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal', + title: '', + description: '', + records: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.records) { + DistrRecord.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ReplacePoolIncentivesProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseReplacePoolIncentivesProposal() + 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.records.push(DistrRecord.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ReplacePoolIncentivesProposal { + const message = createBaseReplacePoolIncentivesProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.records = + object.records?.map((e) => DistrRecord.fromPartial(e)) || [] + return message + }, + fromAmino( + object: ReplacePoolIncentivesProposalAmino + ): ReplacePoolIncentivesProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.records) { + obj.records = message.records.map((e) => + e ? DistrRecord.toAmino(e) : undefined + ) + } else { + obj.records = message.records + } + return obj + }, + fromAminoMsg( + object: ReplacePoolIncentivesProposalAminoMsg + ): ReplacePoolIncentivesProposal { + return ReplacePoolIncentivesProposal.fromAmino(object.value) + }, + toAminoMsg( + message: ReplacePoolIncentivesProposal + ): ReplacePoolIncentivesProposalAminoMsg { + return { + type: 'osmosis/ReplacePoolIncentivesProposal', + value: ReplacePoolIncentivesProposal.toAmino(message) + } + }, + fromProtoMsg( + message: ReplacePoolIncentivesProposalProtoMsg + ): ReplacePoolIncentivesProposal { + return ReplacePoolIncentivesProposal.decode(message.value) + }, + toProto(message: ReplacePoolIncentivesProposal): Uint8Array { + return ReplacePoolIncentivesProposal.encode(message).finish() + }, + toProtoMsg( + message: ReplacePoolIncentivesProposal + ): ReplacePoolIncentivesProposalProtoMsg { + return { + typeUrl: '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal', + value: ReplacePoolIncentivesProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ReplacePoolIncentivesProposal.typeUrl, + ReplacePoolIncentivesProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ReplacePoolIncentivesProposal.aminoType, + ReplacePoolIncentivesProposal.typeUrl +) +function createBaseUpdatePoolIncentivesProposal(): UpdatePoolIncentivesProposal { + return { + $typeUrl: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal', + title: '', + description: '', + records: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.records) { + DistrRecord.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdatePoolIncentivesProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdatePoolIncentivesProposal() + 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.records.push(DistrRecord.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): UpdatePoolIncentivesProposal { + const message = createBaseUpdatePoolIncentivesProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.records = + object.records?.map((e) => DistrRecord.fromPartial(e)) || [] + return message + }, + fromAmino( + object: UpdatePoolIncentivesProposalAmino + ): UpdatePoolIncentivesProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.records) { + obj.records = message.records.map((e) => + e ? DistrRecord.toAmino(e) : undefined + ) + } else { + obj.records = message.records + } + return obj + }, + fromAminoMsg( + object: UpdatePoolIncentivesProposalAminoMsg + ): UpdatePoolIncentivesProposal { + return UpdatePoolIncentivesProposal.fromAmino(object.value) + }, + toAminoMsg( + message: UpdatePoolIncentivesProposal + ): UpdatePoolIncentivesProposalAminoMsg { + return { + type: 'osmosis/UpdatePoolIncentivesProposal', + value: UpdatePoolIncentivesProposal.toAmino(message) + } + }, + fromProtoMsg( + message: UpdatePoolIncentivesProposalProtoMsg + ): UpdatePoolIncentivesProposal { + return UpdatePoolIncentivesProposal.decode(message.value) + }, + toProto(message: UpdatePoolIncentivesProposal): Uint8Array { + return UpdatePoolIncentivesProposal.encode(message).finish() + }, + toProtoMsg( + message: UpdatePoolIncentivesProposal + ): UpdatePoolIncentivesProposalProtoMsg { + return { + typeUrl: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal', + value: UpdatePoolIncentivesProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + UpdatePoolIncentivesProposal.typeUrl, + UpdatePoolIncentivesProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdatePoolIncentivesProposal.aminoType, + UpdatePoolIncentivesProposal.typeUrl +) diff --git a/src/proto/osmojs/osmosis/poolincentives/v1beta1/incentives.ts b/src/proto/osmojs/osmosis/poolincentives/v1beta1/incentives.ts new file mode 100644 index 0000000..394203b --- /dev/null +++ b/src/proto/osmojs/osmosis/poolincentives/v1beta1/incentives.ts @@ -0,0 +1,1005 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + }, + 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 === '' ? undefined : 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 + }, + 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 = message.lockableDurations + } + 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 + }, + 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 === '' ? undefined : message.totalWeight + if (message.records) { + obj.records = message.records.map((e) => + e ? DistrRecord.toAmino(e) : undefined + ) + } else { + obj.records = message.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 + }, + 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 !== BigInt(0) ? message.gaugeId.toString() : undefined + obj.weight = message.weight === '' ? undefined : 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 + }, + 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 !== BigInt(0) ? message.poolId.toString() : undefined + obj.gauge_id = + message.gaugeId !== BigInt(0) ? 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 + }, + 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 = message.poolToGauge + } + 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 + }, + 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 = message.poolToGauge + } + 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 +) diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/genesis.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/genesis.ts new file mode 100644 index 0000000..8deb8fa --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/genesis.ts @@ -0,0 +1,1423 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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 { 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' + value: Uint8Array +} +/** Params holds parameters for the poolmanager module */ +export interface ParamsAmino { + 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' + value: ParamsAmino +} +/** 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 { + /** the next_pool_id */ + nextPoolId: bigint + /** params is the container of poolmanager parameters. */ + 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' + value: Uint8Array +} +/** GenesisState defines the poolmanager module's genesis state. */ +export interface GenesisStateAmino { + /** the next_pool_id */ + 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[] + /** KVStore state */ + taker_fees_tracker?: TakerFeesTrackerAmino + pool_volumes?: PoolVolumeAmino[] + denom_pair_taker_fee_store?: DenomPairTakerFeeAmino[] +} +export interface GenesisStateAminoMsg { + type: 'osmosis/poolmanager/genesis-state' + value: GenesisStateAmino +} +/** GenesisState defines the poolmanager module's genesis state. */ +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: [], + 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 { + 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.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 + } + } + return message + }, + 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 { + 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 = {} + if (message.poolCreationFee) { + obj.pool_creation_fee = message.poolCreationFee.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.pool_creation_fee = message.poolCreationFee + } + 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 = message.authorizedQuoteDenoms + } + return obj + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value) + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: 'osmosis/poolmanager/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.poolmanager.v1beta1.Params', + value: Params.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Params.typeUrl, Params) +GlobalDecoderRegistry.registerAminoProtoMapping( + Params.aminoType, + Params.typeUrl +) +function createBaseGenesisState(): GenesisState { + return { + nextPoolId: BigInt(0), + params: Params.fromPartial({}), + 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) + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim() + } + 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 { + 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.nextPoolId = reader.uint64() + break + case 2: + message.params = Params.decode(reader, reader.uint32()) + break + 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 + } + } + return message + }, + 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 { + 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 = {} + obj.next_pool_id = + message.nextPoolId !== BigInt(0) + ? message.nextPoolId.toString() + : undefined + obj.params = message.params ? Params.toAmino(message.params) : undefined + if (message.poolRoutes) { + obj.pool_routes = message.poolRoutes.map((e) => + e ? ModuleRoute.toAmino(e) : undefined + ) + } else { + obj.pool_routes = message.poolRoutes + } + 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 = message.poolVolumes + } + 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 = message.denomPairTakerFeeStore + } + return obj + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value) + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: 'osmosis/poolmanager/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.poolmanager.v1beta1.GenesisState', + value: GenesisState.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 = message.adminAddresses + } + obj.community_pool_denom_to_swap_non_whitelisted_assets_to = + message.communityPoolDenomToSwapNonWhitelistedAssetsTo === '' + ? undefined + : message.communityPoolDenomToSwapNonWhitelistedAssetsTo + if (message.reducedFeeWhitelist) { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist.map((e) => e) + } else { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist + } + 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 + }, + 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 === '' ? undefined : message.stakingRewards + obj.community_pool = + message.communityPool === '' ? undefined : 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 + }, + 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 = message.takerFeesToStakers + } + 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 = message.takerFeesToCommunityPool + } + obj.height_accounting_starts_from = + message.heightAccountingStartsFrom !== BigInt(0) + ? 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 + }, + 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 !== BigInt(0) ? message.poolId.toString() : undefined + if (message.poolVolume) { + obj.pool_volume = message.poolVolume.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.pool_volume = message.poolVolume + } + 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 +) diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/module_route.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/module_route.ts new file mode 100644 index 0000000..c88f0dd --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/module_route.ts @@ -0,0 +1,209 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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. */ + Balancer = 0, + /** + * Stableswap - Stableswap is the Solidly cfmm stable swap curve. Its pool model is defined + * in x/gamm. + */ + Stableswap = 1, + /** + * Concentrated - Concentrated is the pool model specific to concentrated liquidity. It is + * defined in x/concentrated-liquidity. + */ + Concentrated = 2, + /** + * CosmWasm - CosmWasm is the pool model specific to CosmWasm. It is defined in + * x/cosmwasmpool. + */ + CosmWasm = 3, + UNRECOGNIZED = -1 +} +export const PoolTypeSDKType = PoolType +export const PoolTypeAmino = PoolType +export function poolTypeFromJSON(object: any): PoolType { + switch (object) { + case 0: + case 'Balancer': + return PoolType.Balancer + case 1: + case 'Stableswap': + return PoolType.Stableswap + case 2: + case 'Concentrated': + return PoolType.Concentrated + case 3: + case 'CosmWasm': + return PoolType.CosmWasm + case -1: + case 'UNRECOGNIZED': + default: + return PoolType.UNRECOGNIZED + } +} +export function poolTypeToJSON(object: PoolType): string { + switch (object) { + case PoolType.Balancer: + return 'Balancer' + case PoolType.Stableswap: + return 'Stableswap' + case PoolType.Concentrated: + return 'Concentrated' + case PoolType.CosmWasm: + return 'CosmWasm' + case PoolType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRoute { + /** pool_type specifies the type of the pool */ + poolType: PoolType + poolId?: bigint +} +export interface ModuleRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.ModuleRoute' + value: Uint8Array +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRouteAmino { + /** pool_type specifies the type of the pool */ + pool_type?: PoolType + pool_id?: string +} +export interface ModuleRouteAminoMsg { + type: 'osmosis/poolmanager/module-route' + value: ModuleRouteAmino +} +/** + * ModuleRouter defines a route encapsulating pool type. + * It is used as the value of a mapping from pool id to the pool type, + * allowing the pool manager to know which module to route swaps to given the + * pool id. + */ +export interface ModuleRouteSDKType { + pool_type: PoolType + pool_id?: bigint +} +function createBaseModuleRoute(): ModuleRoute { + return { + poolType: 0, + poolId: undefined + } +} +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) + } + if (message.poolId !== undefined) { + writer.uint32(16).uint64(message.poolId) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseModuleRoute() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.poolType = reader.int32() as any + break + case 2: + message.poolId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ModuleRoute { + const message = createBaseModuleRoute() + message.poolType = object.poolType ?? 0 + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : undefined + return message + }, + fromAmino(object: ModuleRouteAmino): ModuleRoute { + const message = createBaseModuleRoute() + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = 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 === 0 ? undefined : message.poolType + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg(object: ModuleRouteAminoMsg): ModuleRoute { + return ModuleRoute.fromAmino(object.value) + }, + toAminoMsg(message: ModuleRoute): ModuleRouteAminoMsg { + return { + type: 'osmosis/poolmanager/module-route', + value: ModuleRoute.toAmino(message) + } + }, + fromProtoMsg(message: ModuleRouteProtoMsg): ModuleRoute { + return ModuleRoute.decode(message.value) + }, + toProto(message: ModuleRoute): Uint8Array { + return ModuleRoute.encode(message).finish() + }, + toProtoMsg(message: ModuleRoute): ModuleRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.ModuleRoute', + value: ModuleRoute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ModuleRoute.typeUrl, ModuleRoute) +GlobalDecoderRegistry.registerAminoProtoMapping( + ModuleRoute.aminoType, + ModuleRoute.typeUrl +) diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/swap_route.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/swap_route.ts new file mode 100644 index 0000000..812da8e --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/swap_route.ts @@ -0,0 +1,608 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +export interface SwapAmountInRoute { + poolId: bigint + tokenOutDenom: string +} +export interface SwapAmountInRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInRoute' + value: Uint8Array +} +export interface SwapAmountInRouteAmino { + pool_id?: string + token_out_denom?: string +} +export interface SwapAmountInRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-in-route' + value: SwapAmountInRouteAmino +} +export interface SwapAmountInRouteSDKType { + pool_id: bigint + token_out_denom: string +} +export interface SwapAmountOutRoute { + poolId: bigint + tokenInDenom: string +} +export interface SwapAmountOutRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutRoute' + value: Uint8Array +} +export interface SwapAmountOutRouteAmino { + pool_id?: string + token_in_denom?: string +} +export interface SwapAmountOutRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-out-route' + value: SwapAmountOutRouteAmino +} +export interface SwapAmountOutRouteSDKType { + pool_id: bigint + token_in_denom: string +} +export interface SwapAmountInSplitRoute { + pools: SwapAmountInRoute[] + tokenInAmount: string +} +export interface SwapAmountInSplitRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute' + value: Uint8Array +} +export interface SwapAmountInSplitRouteAmino { + pools?: SwapAmountInRouteAmino[] + token_in_amount?: string +} +export interface SwapAmountInSplitRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-in-split-route' + value: SwapAmountInSplitRouteAmino +} +export interface SwapAmountInSplitRouteSDKType { + pools: SwapAmountInRouteSDKType[] + token_in_amount: string +} +export interface SwapAmountOutSplitRoute { + pools: SwapAmountOutRoute[] + tokenOutAmount: string +} +export interface SwapAmountOutSplitRouteProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute' + value: Uint8Array +} +export interface SwapAmountOutSplitRouteAmino { + pools?: SwapAmountOutRouteAmino[] + token_out_amount?: string +} +export interface SwapAmountOutSplitRouteAminoMsg { + type: 'osmosis/poolmanager/swap-amount-out-split-route' + value: SwapAmountOutSplitRouteAmino +} +export interface SwapAmountOutSplitRouteSDKType { + pools: SwapAmountOutRouteSDKType[] + token_out_amount: string +} +function createBaseSwapAmountInRoute(): SwapAmountInRoute { + return { + poolId: BigInt(0), + tokenOutDenom: '' + } +} +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) + } + if (message.tokenOutDenom !== '') { + writer.uint32(18).string(message.tokenOutDenom) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SwapAmountInRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSwapAmountInRoute() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64() + break + case 2: + message.tokenOutDenom = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SwapAmountInRoute { + const message = createBaseSwapAmountInRoute() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenOutDenom = object.tokenOutDenom ?? '' + return message + }, + fromAmino(object: SwapAmountInRouteAmino): SwapAmountInRoute { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom + return obj + }, + fromAminoMsg(object: SwapAmountInRouteAminoMsg): SwapAmountInRoute { + return SwapAmountInRoute.fromAmino(object.value) + }, + toAminoMsg(message: SwapAmountInRoute): SwapAmountInRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-in-route', + value: SwapAmountInRoute.toAmino(message) + } + }, + fromProtoMsg(message: SwapAmountInRouteProtoMsg): SwapAmountInRoute { + return SwapAmountInRoute.decode(message.value) + }, + toProto(message: SwapAmountInRoute): Uint8Array { + return SwapAmountInRoute.encode(message).finish() + }, + toProtoMsg(message: SwapAmountInRoute): SwapAmountInRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInRoute', + value: SwapAmountInRoute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SwapAmountInRoute.typeUrl, SwapAmountInRoute) +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountInRoute.aminoType, + SwapAmountInRoute.typeUrl +) +function createBaseSwapAmountOutRoute(): SwapAmountOutRoute { + return { + poolId: BigInt(0), + tokenInDenom: '' + } +} +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) + } + if (message.tokenInDenom !== '') { + writer.uint32(18).string(message.tokenInDenom) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountOutRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSwapAmountOutRoute() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SwapAmountOutRoute { + const message = createBaseSwapAmountOutRoute() + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + message.tokenInDenom = object.tokenInDenom ?? '' + return message + }, + fromAmino(object: SwapAmountOutRouteAmino): SwapAmountOutRoute { + 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 = {} + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom + return obj + }, + fromAminoMsg(object: SwapAmountOutRouteAminoMsg): SwapAmountOutRoute { + return SwapAmountOutRoute.fromAmino(object.value) + }, + toAminoMsg(message: SwapAmountOutRoute): SwapAmountOutRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-out-route', + value: SwapAmountOutRoute.toAmino(message) + } + }, + fromProtoMsg(message: SwapAmountOutRouteProtoMsg): SwapAmountOutRoute { + return SwapAmountOutRoute.decode(message.value) + }, + toProto(message: SwapAmountOutRoute): Uint8Array { + return SwapAmountOutRoute.encode(message).finish() + }, + toProtoMsg(message: SwapAmountOutRoute): SwapAmountOutRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutRoute', + value: SwapAmountOutRoute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SwapAmountOutRoute.typeUrl, SwapAmountOutRoute) +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountOutRoute.aminoType, + SwapAmountOutRoute.typeUrl +) +function createBaseSwapAmountInSplitRoute(): SwapAmountInSplitRoute { + return { + pools: [], + tokenInAmount: '' + } +} +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() + } + if (message.tokenInAmount !== '') { + writer.uint32(18).string(message.tokenInAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountInSplitRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSwapAmountInSplitRoute() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pools.push(SwapAmountInRoute.decode(reader, reader.uint32())) + break + case 2: + message.tokenInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SwapAmountInSplitRoute { + const message = createBaseSwapAmountInSplitRoute() + message.pools = + object.pools?.map((e) => SwapAmountInRoute.fromPartial(e)) || [] + message.tokenInAmount = object.tokenInAmount ?? '' + return message + }, + fromAmino(object: SwapAmountInSplitRouteAmino): SwapAmountInSplitRoute { + 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 = {} + if (message.pools) { + obj.pools = message.pools.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ) + } else { + obj.pools = message.pools + } + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount + return obj + }, + fromAminoMsg(object: SwapAmountInSplitRouteAminoMsg): SwapAmountInSplitRoute { + return SwapAmountInSplitRoute.fromAmino(object.value) + }, + toAminoMsg(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-in-split-route', + value: SwapAmountInSplitRoute.toAmino(message) + } + }, + fromProtoMsg( + message: SwapAmountInSplitRouteProtoMsg + ): SwapAmountInSplitRoute { + return SwapAmountInSplitRoute.decode(message.value) + }, + toProto(message: SwapAmountInSplitRoute): Uint8Array { + return SwapAmountInSplitRoute.encode(message).finish() + }, + toProtoMsg(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute', + value: SwapAmountInSplitRoute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SwapAmountInSplitRoute.typeUrl, + SwapAmountInSplitRoute +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountInSplitRoute.aminoType, + SwapAmountInSplitRoute.typeUrl +) +function createBaseSwapAmountOutSplitRoute(): SwapAmountOutSplitRoute { + return { + pools: [], + tokenOutAmount: '' + } +} +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() + } + if (message.tokenOutAmount !== '') { + writer.uint32(18).string(message.tokenOutAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SwapAmountOutSplitRoute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSwapAmountOutSplitRoute() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pools.push(SwapAmountOutRoute.decode(reader, reader.uint32())) + break + case 2: + message.tokenOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SwapAmountOutSplitRoute { + const message = createBaseSwapAmountOutSplitRoute() + message.pools = + object.pools?.map((e) => SwapAmountOutRoute.fromPartial(e)) || [] + message.tokenOutAmount = object.tokenOutAmount ?? '' + return message + }, + fromAmino(object: SwapAmountOutSplitRouteAmino): SwapAmountOutSplitRoute { + 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 = {} + if (message.pools) { + obj.pools = message.pools.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ) + } else { + obj.pools = message.pools + } + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount + return obj + }, + fromAminoMsg( + object: SwapAmountOutSplitRouteAminoMsg + ): SwapAmountOutSplitRoute { + return SwapAmountOutSplitRoute.fromAmino(object.value) + }, + toAminoMsg( + message: SwapAmountOutSplitRoute + ): SwapAmountOutSplitRouteAminoMsg { + return { + type: 'osmosis/poolmanager/swap-amount-out-split-route', + value: SwapAmountOutSplitRoute.toAmino(message) + } + }, + fromProtoMsg( + message: SwapAmountOutSplitRouteProtoMsg + ): SwapAmountOutSplitRoute { + return SwapAmountOutSplitRoute.decode(message.value) + }, + toProto(message: SwapAmountOutSplitRoute): Uint8Array { + return SwapAmountOutSplitRoute.encode(message).finish() + }, + toProtoMsg( + message: SwapAmountOutSplitRoute + ): SwapAmountOutSplitRouteProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute', + value: SwapAmountOutSplitRoute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SwapAmountOutSplitRoute.typeUrl, + SwapAmountOutSplitRoute +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SwapAmountOutSplitRoute.aminoType, + SwapAmountOutSplitRoute.typeUrl +) diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.amino.ts new file mode 100644 index 0000000..89e8e1b --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -0,0 +1,36 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgSwapExactAmountIn, + MsgSwapExactAmountOut, + MsgSplitRouteSwapExactAmountIn, + MsgSplitRouteSwapExactAmountOut, + MsgSetDenomPairTakerFee +} from './tx' +export const AminoConverter = { + '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn': { + aminoType: 'osmosis/poolmanager/swap-exact-amount-in', + toAmino: MsgSwapExactAmountIn.toAmino, + fromAmino: MsgSwapExactAmountIn.fromAmino + }, + '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut': { + aminoType: 'osmosis/poolmanager/swap-exact-amount-out', + toAmino: MsgSwapExactAmountOut.toAmino, + fromAmino: MsgSwapExactAmountOut.fromAmino + }, + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn': { + aminoType: 'osmosis/poolmanager/split-amount-in', + toAmino: MsgSplitRouteSwapExactAmountIn.toAmino, + fromAmino: MsgSplitRouteSwapExactAmountIn.fromAmino + }, + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut': { + 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 + } +} diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.registry.ts new file mode 100644 index 0000000..0e5ccfb --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -0,0 +1,129 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(value).finish() + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(value).finish() + } + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.encode(value).finish() + } + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + 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: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value + } + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value + } + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value + } + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value + } + } + }, + fromPartial: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.fromPartial(value) + } + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.fromPartial(value) + } + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.fromPartial(value) + } + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value: MsgSplitRouteSwapExactAmountOut.fromPartial(value) + } + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee', + value: MsgSetDenomPairTakerFee.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.ts b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.ts new file mode 100644 index 0000000..eaeee22 --- /dev/null +++ b/src/proto/osmojs/osmosis/poolmanager/v1beta1/tx.ts @@ -0,0 +1,1879 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +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 { GlobalDecoderRegistry } from '../../../registry' +import { Decimal } from '@cosmjs/math' +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountIn { + sender: string + routes: SwapAmountInRoute[] + tokenIn: Coin + tokenOutMinAmount: string +} +export interface MsgSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn' + value: Uint8Array +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInAmino { + sender?: string + routes?: SwapAmountInRouteAmino[] + token_in?: CoinAmino + token_out_min_amount?: string +} +export interface MsgSwapExactAmountInAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-in' + value: MsgSwapExactAmountInAmino +} +/** ===================== MsgSwapExactAmountIn */ +export interface MsgSwapExactAmountInSDKType { + sender: string + routes: SwapAmountInRouteSDKType[] + token_in: CoinSDKType + token_out_min_amount: string +} +export interface MsgSwapExactAmountInResponse { + tokenOutAmount: string +} +export interface MsgSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse' + value: Uint8Array +} +export interface MsgSwapExactAmountInResponseAmino { + token_out_amount?: string +} +export interface MsgSwapExactAmountInResponseAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-in-response' + value: MsgSwapExactAmountInResponseAmino +} +export interface MsgSwapExactAmountInResponseSDKType { + token_out_amount: string +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountIn { + sender: string + routes: SwapAmountInSplitRoute[] + tokenInDenom: string + tokenOutMinAmount: string +} +export interface MsgSplitRouteSwapExactAmountInProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn' + value: Uint8Array +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountInAmino { + sender?: string + routes?: SwapAmountInSplitRouteAmino[] + token_in_denom?: string + token_out_min_amount?: string +} +export interface MsgSplitRouteSwapExactAmountInAminoMsg { + type: 'osmosis/poolmanager/split-amount-in' + value: MsgSplitRouteSwapExactAmountInAmino +} +/** ===================== MsgSplitRouteSwapExactAmountIn */ +export interface MsgSplitRouteSwapExactAmountInSDKType { + sender: string + routes: SwapAmountInSplitRouteSDKType[] + token_in_denom: string + token_out_min_amount: string +} +export interface MsgSplitRouteSwapExactAmountInResponse { + tokenOutAmount: string +} +export interface MsgSplitRouteSwapExactAmountInResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse' + value: Uint8Array +} +export interface MsgSplitRouteSwapExactAmountInResponseAmino { + token_out_amount?: string +} +export interface MsgSplitRouteSwapExactAmountInResponseAminoMsg { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-in-response' + value: MsgSplitRouteSwapExactAmountInResponseAmino +} +export interface MsgSplitRouteSwapExactAmountInResponseSDKType { + token_out_amount: string +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOut { + sender: string + routes: SwapAmountOutRoute[] + tokenInMaxAmount: string + tokenOut: Coin +} +export interface MsgSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut' + value: Uint8Array +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOutAmino { + sender?: string + routes?: SwapAmountOutRouteAmino[] + token_in_max_amount?: string + token_out?: CoinAmino +} +export interface MsgSwapExactAmountOutAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-out' + value: MsgSwapExactAmountOutAmino +} +/** ===================== MsgSwapExactAmountOut */ +export interface MsgSwapExactAmountOutSDKType { + sender: string + routes: SwapAmountOutRouteSDKType[] + token_in_max_amount: string + token_out: CoinSDKType +} +export interface MsgSwapExactAmountOutResponse { + tokenInAmount: string +} +export interface MsgSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse' + value: Uint8Array +} +export interface MsgSwapExactAmountOutResponseAmino { + token_in_amount?: string +} +export interface MsgSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/poolmanager/swap-exact-amount-out-response' + value: MsgSwapExactAmountOutResponseAmino +} +export interface MsgSwapExactAmountOutResponseSDKType { + token_in_amount: string +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOut { + sender: string + routes: SwapAmountOutSplitRoute[] + tokenOutDenom: string + tokenInMaxAmount: string +} +export interface MsgSplitRouteSwapExactAmountOutProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut' + value: Uint8Array +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOutAmino { + sender?: string + routes?: SwapAmountOutSplitRouteAmino[] + token_out_denom?: string + token_in_max_amount?: string +} +export interface MsgSplitRouteSwapExactAmountOutAminoMsg { + type: 'osmosis/poolmanager/split-amount-out' + value: MsgSplitRouteSwapExactAmountOutAmino +} +/** ===================== MsgSplitRouteSwapExactAmountOut */ +export interface MsgSplitRouteSwapExactAmountOutSDKType { + sender: string + routes: SwapAmountOutSplitRouteSDKType[] + token_out_denom: string + token_in_max_amount: string +} +export interface MsgSplitRouteSwapExactAmountOutResponse { + tokenInAmount: string +} +export interface MsgSplitRouteSwapExactAmountOutResponseProtoMsg { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse' + value: Uint8Array +} +export interface MsgSplitRouteSwapExactAmountOutResponseAmino { + token_in_amount?: string +} +export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-out-response' + value: MsgSplitRouteSwapExactAmountOutResponseAmino +} +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: 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) + } + for (const v of message.routes) { + SwapAmountInRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenIn !== undefined) { + Coin.encode(message.tokenIn, writer.uint32(26).fork()).ldelim() + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountIn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push(SwapAmountInRoute.decode(reader, reader.uint32())) + break + case 3: + message.tokenIn = Coin.decode(reader, reader.uint32()) + break + case 4: + message.tokenOutMinAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSwapExactAmountIn { + const message = createBaseMsgSwapExactAmountIn() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountInRoute.fromPartial(e)) || [] + message.tokenIn = + object.tokenIn !== undefined && object.tokenIn !== null + ? Coin.fromPartial(object.tokenIn) + : undefined + message.tokenOutMinAmount = object.tokenOutMinAmount ?? '' + return message + }, + fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount + return obj + }, + fromAminoMsg(object: MsgSwapExactAmountInAminoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.fromAmino(object.value) + }, + toAminoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-in', + value: MsgSwapExactAmountIn.toAmino(message) + } + }, + fromProtoMsg(message: MsgSwapExactAmountInProtoMsg): MsgSwapExactAmountIn { + return MsgSwapExactAmountIn.decode(message.value) + }, + toProto(message: MsgSwapExactAmountIn): Uint8Array { + return MsgSwapExactAmountIn.encode(message).finish() + }, + toProtoMsg(message: MsgSwapExactAmountIn): MsgSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn', + value: MsgSwapExactAmountIn.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountIn.typeUrl, + MsgSwapExactAmountIn +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountIn.aminoType, + MsgSwapExactAmountIn.typeUrl +) +function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountInResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountInResponse { + const message = createBaseMsgSwapExactAmountInResponse() + message.tokenOutAmount = object.tokenOutAmount ?? '' + return message + }, + fromAmino( + object: MsgSwapExactAmountInResponseAmino + ): MsgSwapExactAmountInResponse { + 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 = {} + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount + return obj + }, + fromAminoMsg( + object: MsgSwapExactAmountInResponseAminoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-in-response', + value: MsgSwapExactAmountInResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSwapExactAmountInResponseProtoMsg + ): MsgSwapExactAmountInResponse { + return MsgSwapExactAmountInResponse.decode(message.value) + }, + toProto(message: MsgSwapExactAmountInResponse): Uint8Array { + return MsgSwapExactAmountInResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSwapExactAmountInResponse + ): MsgSwapExactAmountInResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse', + value: MsgSwapExactAmountInResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountInResponse.typeUrl, + MsgSwapExactAmountInResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountInResponse.aminoType, + MsgSwapExactAmountInResponse.typeUrl +) +function createBaseMsgSplitRouteSwapExactAmountIn(): MsgSplitRouteSwapExactAmountIn { + return { + sender: '', + routes: [], + tokenInDenom: '', + tokenOutMinAmount: '' + } +} +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) + } + for (const v of message.routes) { + SwapAmountInSplitRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenInDenom !== '') { + writer.uint32(26).string(message.tokenInDenom) + } + if (message.tokenOutMinAmount !== '') { + writer.uint32(34).string(message.tokenOutMinAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountIn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSplitRouteSwapExactAmountIn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push( + SwapAmountInSplitRoute.decode(reader, reader.uint32()) + ) + break + case 3: + message.tokenInDenom = reader.string() + break + case 4: + message.tokenOutMinAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountIn { + const message = createBaseMsgSplitRouteSwapExactAmountIn() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountInSplitRoute.fromPartial(e)) || [] + message.tokenInDenom = object.tokenInDenom ?? '' + message.tokenOutMinAmount = object.tokenOutMinAmount ?? '' + return message + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountInAmino + ): MsgSplitRouteSwapExactAmountIn { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountInSplitRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_in_denom = + message.tokenInDenom === '' ? undefined : message.tokenInDenom + obj.token_out_min_amount = + message.tokenOutMinAmount === '' ? undefined : message.tokenOutMinAmount + return obj + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountInAminoMsg + ): MsgSplitRouteSwapExactAmountIn { + return MsgSplitRouteSwapExactAmountIn.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountIn + ): MsgSplitRouteSwapExactAmountInAminoMsg { + return { + type: 'osmosis/poolmanager/split-amount-in', + value: MsgSplitRouteSwapExactAmountIn.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountInProtoMsg + ): MsgSplitRouteSwapExactAmountIn { + return MsgSplitRouteSwapExactAmountIn.decode(message.value) + }, + toProto(message: MsgSplitRouteSwapExactAmountIn): Uint8Array { + return MsgSplitRouteSwapExactAmountIn.encode(message).finish() + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountIn + ): MsgSplitRouteSwapExactAmountInProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn', + value: MsgSplitRouteSwapExactAmountIn.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountIn.typeUrl, + MsgSplitRouteSwapExactAmountIn +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountIn.aminoType, + MsgSplitRouteSwapExactAmountIn.typeUrl +) +function createBaseMsgSplitRouteSwapExactAmountInResponse(): MsgSplitRouteSwapExactAmountInResponse { + return { + tokenOutAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountInResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSplitRouteSwapExactAmountInResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenOutAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountInResponse { + const message = createBaseMsgSplitRouteSwapExactAmountInResponse() + message.tokenOutAmount = object.tokenOutAmount ?? '' + return message + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountInResponseAmino + ): MsgSplitRouteSwapExactAmountInResponse { + 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 = {} + obj.token_out_amount = + message.tokenOutAmount === '' ? undefined : message.tokenOutAmount + return obj + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountInResponseAminoMsg + ): MsgSplitRouteSwapExactAmountInResponse { + return MsgSplitRouteSwapExactAmountInResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountInResponse + ): MsgSplitRouteSwapExactAmountInResponseAminoMsg { + return { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-in-response', + value: MsgSplitRouteSwapExactAmountInResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountInResponseProtoMsg + ): MsgSplitRouteSwapExactAmountInResponse { + return MsgSplitRouteSwapExactAmountInResponse.decode(message.value) + }, + toProto(message: MsgSplitRouteSwapExactAmountInResponse): Uint8Array { + return MsgSplitRouteSwapExactAmountInResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountInResponse + ): MsgSplitRouteSwapExactAmountInResponseProtoMsg { + return { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse', + value: MsgSplitRouteSwapExactAmountInResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountInResponse.typeUrl, + MsgSplitRouteSwapExactAmountInResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountInResponse.aminoType, + MsgSplitRouteSwapExactAmountInResponse.typeUrl +) +function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenInMaxAmount: '', + 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) + } + for (const v of message.routes) { + SwapAmountOutRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(26).string(message.tokenInMaxAmount) + } + if (message.tokenOut !== undefined) { + Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountOut() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push( + SwapAmountOutRoute.decode(reader, reader.uint32()) + ) + break + case 3: + message.tokenInMaxAmount = reader.string() + break + case 4: + message.tokenOut = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSwapExactAmountOut { + const message = createBaseMsgSwapExactAmountOut() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountOutRoute.fromPartial(e)) || [] + message.tokenInMaxAmount = object.tokenInMaxAmount ?? '' + message.tokenOut = + object.tokenOut !== undefined && object.tokenOut !== null + ? Coin.fromPartial(object.tokenOut) + : undefined + return message + }, + fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount + obj.token_out = message.tokenOut + ? Coin.toAmino(message.tokenOut) + : undefined + return obj + }, + fromAminoMsg(object: MsgSwapExactAmountOutAminoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.fromAmino(object.value) + }, + toAminoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-out', + value: MsgSwapExactAmountOut.toAmino(message) + } + }, + fromProtoMsg(message: MsgSwapExactAmountOutProtoMsg): MsgSwapExactAmountOut { + return MsgSwapExactAmountOut.decode(message.value) + }, + toProto(message: MsgSwapExactAmountOut): Uint8Array { + return MsgSwapExactAmountOut.encode(message).finish() + }, + toProtoMsg(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut', + value: MsgSwapExactAmountOut.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountOut.typeUrl, + MsgSwapExactAmountOut +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOut.aminoType, + MsgSwapExactAmountOut.typeUrl +) +function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSwapExactAmountOutResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSwapExactAmountOutResponse { + const message = createBaseMsgSwapExactAmountOutResponse() + message.tokenInAmount = object.tokenInAmount ?? '' + return message + }, + fromAmino( + object: MsgSwapExactAmountOutResponseAmino + ): MsgSwapExactAmountOutResponse { + 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 = {} + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount + return obj + }, + fromAminoMsg( + object: MsgSwapExactAmountOutResponseAminoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/poolmanager/swap-exact-amount-out-response', + value: MsgSwapExactAmountOutResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSwapExactAmountOutResponseProtoMsg + ): MsgSwapExactAmountOutResponse { + return MsgSwapExactAmountOutResponse.decode(message.value) + }, + toProto(message: MsgSwapExactAmountOutResponse): Uint8Array { + return MsgSwapExactAmountOutResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSwapExactAmountOutResponse + ): MsgSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse', + value: MsgSwapExactAmountOutResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSwapExactAmountOutResponse.typeUrl, + MsgSwapExactAmountOutResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSwapExactAmountOutResponse.aminoType, + MsgSwapExactAmountOutResponse.typeUrl +) +function createBaseMsgSplitRouteSwapExactAmountOut(): MsgSplitRouteSwapExactAmountOut { + return { + sender: '', + routes: [], + tokenOutDenom: '', + tokenInMaxAmount: '' + } +} +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) + } + for (const v of message.routes) { + SwapAmountOutSplitRoute.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.tokenOutDenom !== '') { + writer.uint32(26).string(message.tokenOutDenom) + } + if (message.tokenInMaxAmount !== '') { + writer.uint32(34).string(message.tokenInMaxAmount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountOut { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSplitRouteSwapExactAmountOut() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.routes.push( + SwapAmountOutSplitRoute.decode(reader, reader.uint32()) + ) + break + case 3: + message.tokenOutDenom = reader.string() + break + case 4: + message.tokenInMaxAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountOut { + const message = createBaseMsgSplitRouteSwapExactAmountOut() + message.sender = object.sender ?? '' + message.routes = + object.routes?.map((e) => SwapAmountOutSplitRoute.fromPartial(e)) || [] + message.tokenOutDenom = object.tokenOutDenom ?? '' + message.tokenInMaxAmount = object.tokenInMaxAmount ?? '' + return message + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountOutAmino + ): MsgSplitRouteSwapExactAmountOut { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.routes) { + obj.routes = message.routes.map((e) => + e ? SwapAmountOutSplitRoute.toAmino(e) : undefined + ) + } else { + obj.routes = message.routes + } + obj.token_out_denom = + message.tokenOutDenom === '' ? undefined : message.tokenOutDenom + obj.token_in_max_amount = + message.tokenInMaxAmount === '' ? undefined : message.tokenInMaxAmount + return obj + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountOutAminoMsg + ): MsgSplitRouteSwapExactAmountOut { + return MsgSplitRouteSwapExactAmountOut.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountOut + ): MsgSplitRouteSwapExactAmountOutAminoMsg { + return { + type: 'osmosis/poolmanager/split-amount-out', + value: MsgSplitRouteSwapExactAmountOut.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountOutProtoMsg + ): MsgSplitRouteSwapExactAmountOut { + return MsgSplitRouteSwapExactAmountOut.decode(message.value) + }, + toProto(message: MsgSplitRouteSwapExactAmountOut): Uint8Array { + return MsgSplitRouteSwapExactAmountOut.encode(message).finish() + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountOut + ): MsgSplitRouteSwapExactAmountOutProtoMsg { + return { + typeUrl: '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut', + value: MsgSplitRouteSwapExactAmountOut.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSplitRouteSwapExactAmountOut.typeUrl, + MsgSplitRouteSwapExactAmountOut +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSplitRouteSwapExactAmountOut.aminoType, + MsgSplitRouteSwapExactAmountOut.typeUrl +) +function createBaseMsgSplitRouteSwapExactAmountOutResponse(): MsgSplitRouteSwapExactAmountOutResponse { + return { + tokenInAmount: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSplitRouteSwapExactAmountOutResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tokenInAmount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSplitRouteSwapExactAmountOutResponse { + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse() + message.tokenInAmount = object.tokenInAmount ?? '' + return message + }, + fromAmino( + object: MsgSplitRouteSwapExactAmountOutResponseAmino + ): MsgSplitRouteSwapExactAmountOutResponse { + 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 = {} + obj.token_in_amount = + message.tokenInAmount === '' ? undefined : message.tokenInAmount + return obj + }, + fromAminoMsg( + object: MsgSplitRouteSwapExactAmountOutResponseAminoMsg + ): MsgSplitRouteSwapExactAmountOutResponse { + return MsgSplitRouteSwapExactAmountOutResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSplitRouteSwapExactAmountOutResponse + ): MsgSplitRouteSwapExactAmountOutResponseAminoMsg { + return { + type: 'osmosis/poolmanager/split-route-swap-exact-amount-out-response', + value: MsgSplitRouteSwapExactAmountOutResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSplitRouteSwapExactAmountOutResponseProtoMsg + ): MsgSplitRouteSwapExactAmountOutResponse { + return MsgSplitRouteSwapExactAmountOutResponse.decode(message.value) + }, + toProto(message: MsgSplitRouteSwapExactAmountOutResponse): Uint8Array { + return MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSplitRouteSwapExactAmountOutResponse + ): MsgSplitRouteSwapExactAmountOutResponseProtoMsg { + return { + typeUrl: + '/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse', + value: MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 = message.denomPairTakerFee + } + 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 + }, + 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 === false ? undefined : 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 + }, + 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 === '' ? undefined : message.denom0 + obj.denom1 = message.denom1 === '' ? undefined : message.denom1 + obj.taker_fee = message.takerFee === '' ? undefined : 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 +) diff --git a/src/proto/osmojs/osmosis/protorev/v1beta1/gov.ts b/src/proto/osmojs/osmosis/protorev/v1beta1/gov.ts new file mode 100644 index 0000000..c58d5a2 --- /dev/null +++ b/src/proto/osmojs/osmosis/protorev/v1beta1/gov.ts @@ -0,0 +1,387 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposal { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal' + title: string + description: string + enabled: boolean +} +export interface SetProtoRevEnabledProposalProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal' + value: Uint8Array +} +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposalAmino { + title?: string + description?: string + enabled?: boolean +} +export interface SetProtoRevEnabledProposalAminoMsg { + type: 'osmosis/SetProtoRevEnabledProposal' + value: SetProtoRevEnabledProposalAmino +} +/** + * SetProtoRevEnabledProposal is a gov Content type to update whether the + * protorev module is enabled + */ +export interface SetProtoRevEnabledProposalSDKType { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal' + title: string + description: string + enabled: boolean +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposal { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal' + title: string + description: string + account: string +} +export interface SetProtoRevAdminAccountProposalProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal' + value: Uint8Array +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposalAmino { + title?: string + description?: string + account?: string +} +export interface SetProtoRevAdminAccountProposalAminoMsg { + type: 'osmosis/SetProtoRevAdminAccountProposal' + value: SetProtoRevAdminAccountProposalAmino +} +/** + * SetProtoRevAdminAccountProposal is a gov Content type to set the admin + * account that will receive permissions to alter hot routes and set the + * developer address that will be receiving a share of profits from the module + */ +export interface SetProtoRevAdminAccountProposalSDKType { + $typeUrl?: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal' + title: string + description: string + account: string +} +function createBaseSetProtoRevEnabledProposal(): SetProtoRevEnabledProposal { + return { + $typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + title: '', + description: '', + enabled: false + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.enabled === true) { + writer.uint32(24).bool(message.enabled) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetProtoRevEnabledProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSetProtoRevEnabledProposal() + 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.enabled = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SetProtoRevEnabledProposal { + const message = createBaseSetProtoRevEnabledProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.enabled = object.enabled ?? false + return message + }, + fromAmino( + object: SetProtoRevEnabledProposalAmino + ): SetProtoRevEnabledProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.enabled = message.enabled === false ? undefined : message.enabled + return obj + }, + fromAminoMsg( + object: SetProtoRevEnabledProposalAminoMsg + ): SetProtoRevEnabledProposal { + return SetProtoRevEnabledProposal.fromAmino(object.value) + }, + toAminoMsg( + message: SetProtoRevEnabledProposal + ): SetProtoRevEnabledProposalAminoMsg { + return { + type: 'osmosis/SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.toAmino(message) + } + }, + fromProtoMsg( + message: SetProtoRevEnabledProposalProtoMsg + ): SetProtoRevEnabledProposal { + return SetProtoRevEnabledProposal.decode(message.value) + }, + toProto(message: SetProtoRevEnabledProposal): Uint8Array { + return SetProtoRevEnabledProposal.encode(message).finish() + }, + toProtoMsg( + message: SetProtoRevEnabledProposal + ): SetProtoRevEnabledProposalProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SetProtoRevEnabledProposal.typeUrl, + SetProtoRevEnabledProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SetProtoRevEnabledProposal.aminoType, + SetProtoRevEnabledProposal.typeUrl +) +function createBaseSetProtoRevAdminAccountProposal(): SetProtoRevAdminAccountProposal { + return { + $typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + title: '', + description: '', + account: '' + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + if (message.account !== '') { + writer.uint32(26).string(message.account) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetProtoRevAdminAccountProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSetProtoRevAdminAccountProposal() + 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.account = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SetProtoRevAdminAccountProposal { + const message = createBaseSetProtoRevAdminAccountProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.account = object.account ?? '' + return message + }, + fromAmino( + object: SetProtoRevAdminAccountProposalAmino + ): SetProtoRevAdminAccountProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + obj.account = message.account === '' ? undefined : message.account + return obj + }, + fromAminoMsg( + object: SetProtoRevAdminAccountProposalAminoMsg + ): SetProtoRevAdminAccountProposal { + return SetProtoRevAdminAccountProposal.fromAmino(object.value) + }, + toAminoMsg( + message: SetProtoRevAdminAccountProposal + ): SetProtoRevAdminAccountProposalAminoMsg { + return { + type: 'osmosis/SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.toAmino(message) + } + }, + fromProtoMsg( + message: SetProtoRevAdminAccountProposalProtoMsg + ): SetProtoRevAdminAccountProposal { + return SetProtoRevAdminAccountProposal.decode(message.value) + }, + toProto(message: SetProtoRevAdminAccountProposal): Uint8Array { + return SetProtoRevAdminAccountProposal.encode(message).finish() + }, + toProtoMsg( + message: SetProtoRevAdminAccountProposal + ): SetProtoRevAdminAccountProposalProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SetProtoRevAdminAccountProposal.typeUrl, + SetProtoRevAdminAccountProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SetProtoRevAdminAccountProposal.aminoType, + SetProtoRevAdminAccountProposal.typeUrl +) diff --git a/src/proto/osmojs/osmosis/protorev/v1beta1/protorev.ts b/src/proto/osmojs/osmosis/protorev/v1beta1/protorev.ts new file mode 100644 index 0000000..ced6625 --- /dev/null +++ b/src/proto/osmojs/osmosis/protorev/v1beta1/protorev.ts @@ -0,0 +1,2501 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { + TakerFeesTracker, + TakerFeesTrackerAmino, + TakerFeesTrackerSDKType +} from '../../poolmanager/v1beta1/genesis' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 */ + arbRoutes: Route[] + /** Token denomination of the first asset */ + tokenIn: string + /** Token denomination of the second asset */ + tokenOut: string +} +export interface TokenPairArbRoutesProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.TokenPairArbRoutes' + value: Uint8Array +} +/** 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[] + /** Token denomination of the first asset */ + token_in?: string + /** Token denomination of the second asset */ + token_out?: string +} +export interface TokenPairArbRoutesAminoMsg { + type: 'osmosis/protorev/token-pair-arb-routes' + value: TokenPairArbRoutesAmino +} +/** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ +export interface TokenPairArbRoutesSDKType { + arb_routes: RouteSDKType[] + token_in: string + token_out: string +} +/** Route is a hot route for a given pair of tokens */ +export interface Route { + /** + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left + * -> right) + */ + trades: Trade[] + /** + * The step size that will be used to find the optimal swap amount in the + * binary search + */ + stepSize: string +} +export interface RouteProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.Route' + value: Uint8Array +} +/** Route is a hot route for a given pair of tokens */ +export interface RouteAmino { + /** + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left + * -> right) + */ + trades?: TradeAmino[] + /** + * The step size that will be used to find the optimal swap amount in the + * binary search + */ + step_size?: string +} +export interface RouteAminoMsg { + type: 'osmosis/protorev/route' + value: RouteAmino +} +/** Route is a hot route for a given pair of tokens */ +export interface RouteSDKType { + trades: TradeSDKType[] + step_size: string +} +/** Trade is a single trade in a route */ +export interface Trade { + /** The pool id of the pool that is traded on */ + pool: bigint + /** The denom of the token that is traded */ + tokenIn: string + /** The denom of the token that is received */ + tokenOut: string +} +export interface TradeProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.Trade' + value: Uint8Array +} +/** Trade is a single trade in a route */ +export interface TradeAmino { + /** The pool id of the pool that is traded on */ + pool?: string + /** The denom of the token that is traded */ + token_in?: string + /** The denom of the token that is received */ + token_out?: string +} +export interface TradeAminoMsg { + type: 'osmosis/protorev/trade' + value: TradeAmino +} +/** Trade is a single trade in a route */ +export interface TradeSDKType { + pool: bigint + token_in: string + token_out: string +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatistics { + /** profits is the total profit from all trades on this route */ + profits: Coin[] + /** + * number_of_trades is the number of trades the module has executed using this + * route + */ + numberOfTrades: string + /** route is the route that was used (pool ids along the arbitrage route) */ + route: bigint[] +} +export interface RouteStatisticsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.RouteStatistics' + value: Uint8Array +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatisticsAmino { + /** profits is the total profit from all trades on this route */ + profits?: CoinAmino[] + /** + * number_of_trades is the number of trades the module has executed using this + * route + */ + number_of_trades?: string + /** route is the route that was used (pool ids along the arbitrage route) */ + route?: string[] +} +export interface RouteStatisticsAminoMsg { + type: 'osmosis/protorev/route-statistics' + value: RouteStatisticsAmino +} +/** + * RouteStatistics contains the number of trades the module has executed after a + * swap on a given route and the profits from the trades + */ +export interface RouteStatisticsSDKType { + profits: CoinSDKType[] + number_of_trades: string + route: bigint[] +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * 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 */ + stableWeight: bigint + /** The weight of a balancer pool */ + 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' + value: Uint8Array +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * 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 + /** The weight of a balancer pool */ + balancer_weight?: string + /** The weight of a concentrated pool */ + concentrated_weight?: string + /** The weight of a cosmwasm pool */ + cosmwasm_weight?: string +} +export interface PoolWeightsAminoMsg { + type: 'osmosis/protorev/pool-weights' + value: PoolWeightsAmino +} +/** + * PoolWeights contains the weights of all of the different pool types. This + * distinction is made and necessary because the execution time ranges + * 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 + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenom { + /** The denom i.e. name of the base denom (ex. uosmo) */ + denom: string + /** + * The step size of the binary search that is used to find the optimal swap + * amount + */ + stepSize: string +} +export interface BaseDenomProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenom' + value: Uint8Array +} +/** + * BaseDenom represents a single base denom that the module uses for its + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenomAmino { + /** The denom i.e. name of the base denom (ex. uosmo) */ + denom?: string + /** + * The step size of the binary search that is used to find the optimal swap + * amount + */ + step_size?: string +} +export interface BaseDenomAminoMsg { + type: 'osmosis/protorev/base-denom' + value: BaseDenomAmino +} +/** + * BaseDenom represents a single base denom that the module uses for its + * arbitrage trades. It contains the denom name alongside the step size of the + * binary search that is used to find the optimal swap amount + */ +export interface BaseDenomSDKType { + denom: string + step_size: string +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenoms { + baseDenoms: BaseDenom[] +} +export interface BaseDenomsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms' + value: Uint8Array +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenomsAmino { + base_denoms?: BaseDenomAmino[] +} +export interface BaseDenomsAminoMsg { + type: 'osmosis/protorev/base-denoms' + value: BaseDenomsAmino +} +/** + * BaseDenoms represents all of the base denoms that the module uses for its + * arbitrage trades. + */ +export interface BaseDenomsSDKType { + base_denoms: BaseDenomSDKType[] +} +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: [], + tokenIn: '', + tokenOut: '' + } +} +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() + } + if (message.tokenIn !== '') { + writer.uint32(18).string(message.tokenIn) + } + if (message.tokenOut !== '') { + writer.uint32(26).string(message.tokenOut) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TokenPairArbRoutes { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTokenPairArbRoutes() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.arbRoutes.push(Route.decode(reader, reader.uint32())) + break + case 2: + message.tokenIn = reader.string() + break + case 3: + message.tokenOut = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TokenPairArbRoutes { + const message = createBaseTokenPairArbRoutes() + message.arbRoutes = object.arbRoutes?.map((e) => Route.fromPartial(e)) || [] + message.tokenIn = object.tokenIn ?? '' + message.tokenOut = object.tokenOut ?? '' + return message + }, + fromAmino(object: TokenPairArbRoutesAmino): TokenPairArbRoutes { + 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 = {} + if (message.arbRoutes) { + obj.arb_routes = message.arbRoutes.map((e) => + e ? Route.toAmino(e) : undefined + ) + } else { + obj.arb_routes = message.arbRoutes + } + obj.token_in = message.tokenIn === '' ? undefined : message.tokenIn + obj.token_out = message.tokenOut === '' ? undefined : message.tokenOut + return obj + }, + fromAminoMsg(object: TokenPairArbRoutesAminoMsg): TokenPairArbRoutes { + return TokenPairArbRoutes.fromAmino(object.value) + }, + toAminoMsg(message: TokenPairArbRoutes): TokenPairArbRoutesAminoMsg { + return { + type: 'osmosis/protorev/token-pair-arb-routes', + value: TokenPairArbRoutes.toAmino(message) + } + }, + fromProtoMsg(message: TokenPairArbRoutesProtoMsg): TokenPairArbRoutes { + return TokenPairArbRoutes.decode(message.value) + }, + toProto(message: TokenPairArbRoutes): Uint8Array { + return TokenPairArbRoutes.encode(message).finish() + }, + toProtoMsg(message: TokenPairArbRoutes): TokenPairArbRoutesProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.TokenPairArbRoutes', + value: TokenPairArbRoutes.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TokenPairArbRoutes.typeUrl, TokenPairArbRoutes) +GlobalDecoderRegistry.registerAminoProtoMapping( + TokenPairArbRoutes.aminoType, + TokenPairArbRoutes.typeUrl +) +function createBaseRoute(): Route { + return { + trades: [], + stepSize: '' + } +} +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() + } + if (message.stepSize !== '') { + writer.uint32(18).string(message.stepSize) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Route { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRoute() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.trades.push(Trade.decode(reader, reader.uint32())) + break + case 2: + message.stepSize = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Route { + const message = createBaseRoute() + message.trades = object.trades?.map((e) => Trade.fromPartial(e)) || [] + message.stepSize = object.stepSize ?? '' + return message + }, + fromAmino(object: RouteAmino): Route { + 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 = {} + if (message.trades) { + obj.trades = message.trades.map((e) => (e ? Trade.toAmino(e) : undefined)) + } else { + obj.trades = message.trades + } + obj.step_size = message.stepSize === '' ? undefined : message.stepSize + return obj + }, + fromAminoMsg(object: RouteAminoMsg): Route { + return Route.fromAmino(object.value) + }, + toAminoMsg(message: Route): RouteAminoMsg { + return { + type: 'osmosis/protorev/route', + value: Route.toAmino(message) + } + }, + fromProtoMsg(message: RouteProtoMsg): Route { + return Route.decode(message.value) + }, + toProto(message: Route): Uint8Array { + return Route.encode(message).finish() + }, + toProtoMsg(message: Route): RouteProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.Route', + value: Route.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Route.typeUrl, Route) +GlobalDecoderRegistry.registerAminoProtoMapping(Route.aminoType, Route.typeUrl) +function createBaseTrade(): Trade { + return { + pool: BigInt(0), + tokenIn: '', + tokenOut: '' + } +} +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) + } + if (message.tokenIn !== '') { + writer.uint32(18).string(message.tokenIn) + } + if (message.tokenOut !== '') { + writer.uint32(26).string(message.tokenOut) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Trade { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTrade() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pool = reader.uint64() + break + case 2: + message.tokenIn = reader.string() + break + case 3: + message.tokenOut = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Trade { + const message = createBaseTrade() + message.pool = + object.pool !== undefined && object.pool !== null + ? BigInt(object.pool.toString()) + : BigInt(0) + message.tokenIn = object.tokenIn ?? '' + message.tokenOut = object.tokenOut ?? '' + return message + }, + fromAmino(object: TradeAmino): Trade { + 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 = {} + obj.pool = message.pool !== BigInt(0) ? message.pool.toString() : undefined + obj.token_in = message.tokenIn === '' ? undefined : message.tokenIn + obj.token_out = message.tokenOut === '' ? undefined : message.tokenOut + return obj + }, + fromAminoMsg(object: TradeAminoMsg): Trade { + return Trade.fromAmino(object.value) + }, + toAminoMsg(message: Trade): TradeAminoMsg { + return { + type: 'osmosis/protorev/trade', + value: Trade.toAmino(message) + } + }, + fromProtoMsg(message: TradeProtoMsg): Trade { + return Trade.decode(message.value) + }, + toProto(message: Trade): Uint8Array { + return Trade.encode(message).finish() + }, + toProtoMsg(message: Trade): TradeProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.Trade', + value: Trade.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Trade.typeUrl, Trade) +GlobalDecoderRegistry.registerAminoProtoMapping(Trade.aminoType, Trade.typeUrl) +function createBaseRouteStatistics(): RouteStatistics { + return { + profits: [], + numberOfTrades: '', + route: [] + } +} +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() + } + if (message.numberOfTrades !== '') { + writer.uint32(18).string(message.numberOfTrades) + } + writer.uint32(26).fork() + for (const v of message.route) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RouteStatistics { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRouteStatistics() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.profits.push(Coin.decode(reader, reader.uint32())) + break + case 2: + message.numberOfTrades = reader.string() + break + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.route.push(reader.uint64()) + } + } else { + message.route.push(reader.uint64()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RouteStatistics { + const message = createBaseRouteStatistics() + message.profits = object.profits?.map((e) => Coin.fromPartial(e)) || [] + message.numberOfTrades = object.numberOfTrades ?? '' + message.route = object.route?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino(object: RouteStatisticsAmino): RouteStatistics { + 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 = {} + if (message.profits) { + obj.profits = message.profits.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.profits = message.profits + } + obj.number_of_trades = + message.numberOfTrades === '' ? undefined : message.numberOfTrades + if (message.route) { + obj.route = message.route.map((e) => e.toString()) + } else { + obj.route = message.route + } + return obj + }, + fromAminoMsg(object: RouteStatisticsAminoMsg): RouteStatistics { + return RouteStatistics.fromAmino(object.value) + }, + toAminoMsg(message: RouteStatistics): RouteStatisticsAminoMsg { + return { + type: 'osmosis/protorev/route-statistics', + value: RouteStatistics.toAmino(message) + } + }, + fromProtoMsg(message: RouteStatisticsProtoMsg): RouteStatistics { + return RouteStatistics.decode(message.value) + }, + toProto(message: RouteStatistics): Uint8Array { + return RouteStatistics.encode(message).finish() + }, + toProtoMsg(message: RouteStatistics): RouteStatisticsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.RouteStatistics', + value: RouteStatistics.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RouteStatistics.typeUrl, RouteStatistics) +GlobalDecoderRegistry.registerAminoProtoMapping( + RouteStatistics.aminoType, + RouteStatistics.typeUrl +) +function createBasePoolWeights(): PoolWeights { + return { + stableWeight: BigInt(0), + balancerWeight: 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) + } + if (message.balancerWeight !== BigInt(0)) { + writer.uint32(16).uint64(message.balancerWeight) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePoolWeights() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.stableWeight = reader.uint64() + break + case 2: + message.balancerWeight = reader.uint64() + break + case 3: + message.concentratedWeight = reader.uint64() + break + case 4: + message.cosmwasmWeight = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 !== BigInt(0) + ? message.stableWeight.toString() + : undefined + obj.balancer_weight = + message.balancerWeight !== BigInt(0) + ? message.balancerWeight.toString() + : undefined + obj.concentrated_weight = + message.concentratedWeight !== BigInt(0) + ? message.concentratedWeight.toString() + : undefined + obj.cosmwasm_weight = + message.cosmwasmWeight !== BigInt(0) + ? message.cosmwasmWeight.toString() + : undefined + return obj + }, + fromAminoMsg(object: PoolWeightsAminoMsg): PoolWeights { + return PoolWeights.fromAmino(object.value) + }, + toAminoMsg(message: PoolWeights): PoolWeightsAminoMsg { + return { + type: 'osmosis/protorev/pool-weights', + value: PoolWeights.toAmino(message) + } + }, + fromProtoMsg(message: PoolWeightsProtoMsg): PoolWeights { + return PoolWeights.decode(message.value) + }, + toProto(message: PoolWeights): Uint8Array { + return PoolWeights.encode(message).finish() + }, + toProtoMsg(message: PoolWeights): PoolWeightsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.PoolWeights', + value: PoolWeights.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PoolWeights.typeUrl, PoolWeights) +GlobalDecoderRegistry.registerAminoProtoMapping( + PoolWeights.aminoType, + PoolWeights.typeUrl +) +function createBaseInfoByPoolType(): InfoByPoolType { + return { + stable: StablePoolInfo.fromPartial({}), + balancer: BalancerPoolInfo.fromPartial({}), + concentrated: ConcentratedPoolInfo.fromPartial({}), + cosmwasm: CosmwasmPoolInfo.fromPartial({}) + } +} +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.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() + } + } +} +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 + }, + 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 !== BigInt(0) ? 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 + }, + 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 !== BigInt(0) ? 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 + }, + 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 !== BigInt(0) ? message.weight.toString() : undefined + obj.max_ticks_crossed = + message.maxTicksCrossed !== BigInt(0) + ? 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 + }, + 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 = message.weightMaps + } + 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 + }, + 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 !== BigInt(0) ? message.weight.toString() : undefined + obj.contract_address = + message.contractAddress === '' ? undefined : 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 + }, + 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 === '' ? undefined : message.denom + obj.step_size = message.stepSize === '' ? undefined : 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 createBaseBaseDenoms(): BaseDenoms { + return { + baseDenoms: [] + } +} +export const BaseDenoms = { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms', + aminoType: 'osmosis/protorev/base-denoms', + is(o: any): o is BaseDenoms { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.baseDenoms) && + (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])))) + ) + }, + isSDK(o: any): o is BaseDenomsSDKType { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])))) + ) + }, + isAmino(o: any): o is BaseDenomsAmino { + return ( + o && + (o.$typeUrl === BaseDenoms.typeUrl || + (Array.isArray(o.base_denoms) && + (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])))) + ) + }, + encode( + message: BaseDenoms, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(10).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseDenoms { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBaseDenoms() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BaseDenoms { + const message = createBaseBaseDenoms() + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || [] + return message + }, + fromAmino(object: BaseDenomsAmino): BaseDenoms { + const message = createBaseBaseDenoms() + message.baseDenoms = + object.base_denoms?.map((e) => BaseDenom.fromAmino(e)) || [] + return message + }, + toAmino(message: BaseDenoms): BaseDenomsAmino { + const obj: any = {} + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ) + } else { + obj.base_denoms = message.baseDenoms + } + return obj + }, + fromAminoMsg(object: BaseDenomsAminoMsg): BaseDenoms { + return BaseDenoms.fromAmino(object.value) + }, + toAminoMsg(message: BaseDenoms): BaseDenomsAminoMsg { + return { + type: 'osmosis/protorev/base-denoms', + value: BaseDenoms.toAmino(message) + } + }, + fromProtoMsg(message: BaseDenomsProtoMsg): BaseDenoms { + return BaseDenoms.decode(message.value) + }, + toProto(message: BaseDenoms): Uint8Array { + return BaseDenoms.encode(message).finish() + }, + toProtoMsg(message: BaseDenoms): BaseDenomsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.BaseDenoms', + value: BaseDenoms.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BaseDenoms.typeUrl, BaseDenoms) +GlobalDecoderRegistry.registerAminoProtoMapping( + BaseDenoms.aminoType, + BaseDenoms.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 + }, + 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 + }, + 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 = message.cyclicArb + } + obj.height_accounting_starts_from = + message.heightAccountingStartsFrom !== BigInt(0) + ? 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 +) diff --git a/src/proto/osmojs/osmosis/protorev/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.amino.ts new file mode 100644 index 0000000..c58f08c --- /dev/null +++ b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.amino.ts @@ -0,0 +1,42 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgSetHotRoutes, + MsgSetDeveloperAccount, + MsgSetMaxPoolPointsPerTx, + MsgSetMaxPoolPointsPerBlock, + MsgSetInfoByPoolType, + MsgSetBaseDenoms +} from './tx' +export const AminoConverter = { + '/osmosis.protorev.v1beta1.MsgSetHotRoutes': { + aminoType: 'osmosis/MsgSetHotRoutes', + toAmino: MsgSetHotRoutes.toAmino, + fromAmino: MsgSetHotRoutes.fromAmino + }, + '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount': { + aminoType: 'osmosis/MsgSetDeveloperAccount', + toAmino: MsgSetDeveloperAccount.toAmino, + fromAmino: MsgSetDeveloperAccount.fromAmino + }, + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx': { + aminoType: 'osmosis/MsgSetMaxPoolPointsPerTx', + toAmino: MsgSetMaxPoolPointsPerTx.toAmino, + fromAmino: MsgSetMaxPoolPointsPerTx.fromAmino + }, + '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock': { + aminoType: 'osmosis/MsgSetPoolWeights', + toAmino: MsgSetMaxPoolPointsPerBlock.toAmino, + fromAmino: MsgSetMaxPoolPointsPerBlock.fromAmino + }, + '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType': { + aminoType: 'osmosis/MsgSetInfoByPoolType', + toAmino: MsgSetInfoByPoolType.toAmino, + fromAmino: MsgSetInfoByPoolType.fromAmino + }, + '/osmosis.protorev.v1beta1.MsgSetBaseDenoms': { + aminoType: 'osmosis/MsgSetBaseDenoms', + toAmino: MsgSetBaseDenoms.toAmino, + fromAmino: MsgSetBaseDenoms.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/protorev/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.registry.ts new file mode 100644 index 0000000..0e9690e --- /dev/null +++ b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.registry.ts @@ -0,0 +1,146 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.encode(value).finish() + } + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.encode(value).finish() + } + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.encode(value).finish() + } + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.encode(value).finish() + } + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.encode(value).finish() + } + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.encode(value).finish() + } + } + }, + withTypeUrl: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value + } + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value + } + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value + } + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value + } + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value + } + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value + } + } + }, + fromPartial: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.fromPartial(value) + } + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.fromPartial(value) + } + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.fromPartial(value) + } + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.fromPartial(value) + } + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.fromPartial(value) + } + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/protorev/v1beta1/tx.ts b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.ts new file mode 100644 index 0000000..fdac5fa --- /dev/null +++ b/src/proto/osmojs/osmosis/protorev/v1beta1/tx.ts @@ -0,0 +1,1678 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + TokenPairArbRoutes, + TokenPairArbRoutesAmino, + TokenPairArbRoutesSDKType, + InfoByPoolType, + InfoByPoolTypeAmino, + InfoByPoolTypeSDKType, + BaseDenom, + BaseDenomAmino, + BaseDenomSDKType +} from './protorev' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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. */ + admin: string + /** hot_routes is the list of hot routes to set. */ + hotRoutes: TokenPairArbRoutes[] +} +export interface MsgSetHotRoutesProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes' + value: Uint8Array +} +/** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ +export interface MsgSetHotRoutesAmino { + /** admin is the account that is authorized to set the hot routes. */ + admin?: string + /** hot_routes is the list of hot routes to set. */ + hot_routes?: TokenPairArbRoutesAmino[] +} +export interface MsgSetHotRoutesAminoMsg { + type: 'osmosis/MsgSetHotRoutes' + value: MsgSetHotRoutesAmino +} +/** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ +export interface MsgSetHotRoutesSDKType { + admin: string + hot_routes: TokenPairArbRoutesSDKType[] +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponse {} +export interface MsgSetHotRoutesResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse' + value: Uint8Array +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponseAmino {} +export interface MsgSetHotRoutesResponseAminoMsg { + type: 'osmosis/protorev/set-hot-routes-response' + value: MsgSetHotRoutesResponseAmino +} +/** MsgSetHotRoutesResponse defines the Msg/SetHotRoutes response type. */ +export interface MsgSetHotRoutesResponseSDKType {} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccount { + /** admin is the account that is authorized to set the developer account. */ + admin: string + /** + * developer_account is the account that will receive a portion of the profits + * from the protorev module. + */ + developerAccount: string +} +export interface MsgSetDeveloperAccountProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount' + value: Uint8Array +} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccountAmino { + /** admin is the account that is authorized to set the developer account. */ + admin?: string + /** + * developer_account is the account that will receive a portion of the profits + * from the protorev module. + */ + developer_account?: string +} +export interface MsgSetDeveloperAccountAminoMsg { + type: 'osmosis/MsgSetDeveloperAccount' + value: MsgSetDeveloperAccountAmino +} +/** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ +export interface MsgSetDeveloperAccountSDKType { + admin: string + developer_account: string +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponse {} +export interface MsgSetDeveloperAccountResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse' + value: Uint8Array +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponseAmino {} +export interface MsgSetDeveloperAccountResponseAminoMsg { + type: 'osmosis/protorev/set-developer-account-response' + value: MsgSetDeveloperAccountResponseAmino +} +/** + * MsgSetDeveloperAccountResponse defines the Msg/SetDeveloperAccount response + * type. + */ +export interface MsgSetDeveloperAccountResponseSDKType {} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolType { + /** admin is the account that is authorized to set the pool weights. */ + admin: string + /** info_by_pool_type contains information about the pool types. */ + infoByPoolType: InfoByPoolType +} +export interface MsgSetInfoByPoolTypeProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType' + value: Uint8Array +} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeAmino { + /** admin is the account that is authorized to set the pool weights. */ + admin?: string + /** info_by_pool_type contains information about the pool types. */ + info_by_pool_type?: InfoByPoolTypeAmino +} +export interface MsgSetInfoByPoolTypeAminoMsg { + type: 'osmosis/MsgSetInfoByPoolType' + value: MsgSetInfoByPoolTypeAmino +} +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeSDKType { + admin: string + info_by_pool_type: InfoByPoolTypeSDKType +} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponse {} +export interface MsgSetInfoByPoolTypeResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse' + value: Uint8Array +} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseAmino {} +export interface MsgSetInfoByPoolTypeResponseAminoMsg { + type: 'osmosis/protorev/set-info-by-pool-type-response' + value: MsgSetInfoByPoolTypeResponseAmino +} +/** 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. */ + admin: string + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction. + */ + maxPoolPointsPerTx: bigint +} +export interface MsgSetMaxPoolPointsPerTxProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx' + value: Uint8Array +} +/** 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 + /** + * max_pool_points_per_tx is the maximum number of pool points that can be + * consumed per transaction. + */ + max_pool_points_per_tx?: string +} +export interface MsgSetMaxPoolPointsPerTxAminoMsg { + type: 'osmosis/MsgSetMaxPoolPointsPerTx' + value: MsgSetMaxPoolPointsPerTxAmino +} +/** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ +export interface MsgSetMaxPoolPointsPerTxSDKType { + admin: string + max_pool_points_per_tx: bigint +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponse {} +export interface MsgSetMaxPoolPointsPerTxResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse' + value: Uint8Array +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponseAmino {} +export interface MsgSetMaxPoolPointsPerTxResponseAminoMsg { + type: 'osmosis/protorev/set-max-pool-points-per-tx-response' + value: MsgSetMaxPoolPointsPerTxResponseAmino +} +/** + * MsgSetMaxPoolPointsPerTxResponse defines the Msg/SetMaxPoolPointsPerTx + * response type. + */ +export interface MsgSetMaxPoolPointsPerTxResponseSDKType {} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlock { + /** + * admin is the account that is authorized to set the max pool points per + * block. + */ + admin: string + /** + * max_pool_points_per_block is the maximum number of pool points that can be + * consumed per block. + */ + maxPoolPointsPerBlock: bigint +} +export interface MsgSetMaxPoolPointsPerBlockProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock' + value: Uint8Array +} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlockAmino { + /** + * admin is the account that is authorized to set the max pool points per + * block. + */ + 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 +} +export interface MsgSetMaxPoolPointsPerBlockAminoMsg { + type: 'osmosis/MsgSetPoolWeights' + value: MsgSetMaxPoolPointsPerBlockAmino +} +/** + * MsgSetMaxPoolPointsPerBlock defines the Msg/SetMaxPoolPointsPerBlock request + * type. + */ +export interface MsgSetMaxPoolPointsPerBlockSDKType { + admin: string + max_pool_points_per_block: bigint +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponse {} +export interface MsgSetMaxPoolPointsPerBlockResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse' + value: Uint8Array +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponseAmino {} +export interface MsgSetMaxPoolPointsPerBlockResponseAminoMsg { + type: 'osmosis/protorev/set-max-pool-points-per-block-response' + value: MsgSetMaxPoolPointsPerBlockResponseAmino +} +/** + * MsgSetMaxPoolPointsPerBlockResponse defines the + * Msg/SetMaxPoolPointsPerBlock response type. + */ +export interface MsgSetMaxPoolPointsPerBlockResponseSDKType {} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenoms { + /** admin is the account that is authorized to set the base denoms. */ + admin: string + /** base_denoms is the list of base denoms to set. */ + baseDenoms: BaseDenom[] +} +export interface MsgSetBaseDenomsProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms' + value: Uint8Array +} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenomsAmino { + /** admin is the account that is authorized to set the base denoms. */ + admin?: string + /** base_denoms is the list of base denoms to set. */ + base_denoms?: BaseDenomAmino[] +} +export interface MsgSetBaseDenomsAminoMsg { + type: 'osmosis/MsgSetBaseDenoms' + value: MsgSetBaseDenomsAmino +} +/** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ +export interface MsgSetBaseDenomsSDKType { + admin: string + base_denoms: BaseDenomSDKType[] +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponse {} +export interface MsgSetBaseDenomsResponseProtoMsg { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse' + value: Uint8Array +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponseAmino {} +export interface MsgSetBaseDenomsResponseAminoMsg { + type: 'osmosis/protorev/set-base-denoms-response' + value: MsgSetBaseDenomsResponseAmino +} +/** MsgSetBaseDenomsResponse defines the Msg/SetBaseDenoms response type. */ +export interface MsgSetBaseDenomsResponseSDKType {} +function createBaseMsgSetHotRoutes(): MsgSetHotRoutes { + return { + admin: '', + hotRoutes: [] + } +} +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) + } + for (const v of message.hotRoutes) { + TokenPairArbRoutes.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetHotRoutes { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetHotRoutes() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.hotRoutes.push( + TokenPairArbRoutes.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetHotRoutes { + const message = createBaseMsgSetHotRoutes() + message.admin = object.admin ?? '' + message.hotRoutes = + object.hotRoutes?.map((e) => TokenPairArbRoutes.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgSetHotRoutesAmino): MsgSetHotRoutes { + 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 = {} + obj.admin = message.admin === '' ? undefined : message.admin + if (message.hotRoutes) { + obj.hot_routes = message.hotRoutes.map((e) => + e ? TokenPairArbRoutes.toAmino(e) : undefined + ) + } else { + obj.hot_routes = message.hotRoutes + } + return obj + }, + fromAminoMsg(object: MsgSetHotRoutesAminoMsg): MsgSetHotRoutes { + return MsgSetHotRoutes.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetHotRoutes): MsgSetHotRoutesAminoMsg { + return { + type: 'osmosis/MsgSetHotRoutes', + value: MsgSetHotRoutes.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetHotRoutesProtoMsg): MsgSetHotRoutes { + return MsgSetHotRoutes.decode(message.value) + }, + toProto(message: MsgSetHotRoutes): Uint8Array { + return MsgSetHotRoutes.encode(message).finish() + }, + toProtoMsg(message: MsgSetHotRoutes): MsgSetHotRoutesProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutes', + value: MsgSetHotRoutes.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetHotRoutesResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetHotRoutesResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgSetHotRoutesResponse { + const message = createBaseMsgSetHotRoutesResponse() + return message + }, + fromAmino(_: MsgSetHotRoutesResponseAmino): MsgSetHotRoutesResponse { + const message = createBaseMsgSetHotRoutesResponse() + return message + }, + toAmino(_: MsgSetHotRoutesResponse): MsgSetHotRoutesResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetHotRoutesResponseAminoMsg + ): MsgSetHotRoutesResponse { + return MsgSetHotRoutesResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetHotRoutesResponse + ): MsgSetHotRoutesResponseAminoMsg { + return { + type: 'osmosis/protorev/set-hot-routes-response', + value: MsgSetHotRoutesResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetHotRoutesResponseProtoMsg + ): MsgSetHotRoutesResponse { + return MsgSetHotRoutesResponse.decode(message.value) + }, + toProto(message: MsgSetHotRoutesResponse): Uint8Array { + return MsgSetHotRoutesResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetHotRoutesResponse + ): MsgSetHotRoutesResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse', + value: MsgSetHotRoutesResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetHotRoutesResponse.typeUrl, + MsgSetHotRoutesResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetHotRoutesResponse.aminoType, + MsgSetHotRoutesResponse.typeUrl +) +function createBaseMsgSetDeveloperAccount(): MsgSetDeveloperAccount { + return { + admin: '', + developerAccount: '' + } +} +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) + } + if (message.developerAccount !== '') { + writer.uint32(18).string(message.developerAccount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDeveloperAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetDeveloperAccount() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.developerAccount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetDeveloperAccount { + const message = createBaseMsgSetDeveloperAccount() + message.admin = object.admin ?? '' + message.developerAccount = object.developerAccount ?? '' + return message + }, + fromAmino(object: MsgSetDeveloperAccountAmino): MsgSetDeveloperAccount { + 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 = {} + obj.admin = message.admin === '' ? undefined : message.admin + obj.developer_account = + message.developerAccount === '' ? undefined : message.developerAccount + return obj + }, + fromAminoMsg(object: MsgSetDeveloperAccountAminoMsg): MsgSetDeveloperAccount { + return MsgSetDeveloperAccount.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountAminoMsg { + return { + type: 'osmosis/MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetDeveloperAccountProtoMsg + ): MsgSetDeveloperAccount { + return MsgSetDeveloperAccount.decode(message.value) + }, + toProto(message: MsgSetDeveloperAccount): Uint8Array { + return MsgSetDeveloperAccount.encode(message).finish() + }, + toProtoMsg(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccount', + value: MsgSetDeveloperAccount.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDeveloperAccountResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetDeveloperAccountResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetDeveloperAccountResponse { + const message = createBaseMsgSetDeveloperAccountResponse() + return message + }, + fromAmino( + _: MsgSetDeveloperAccountResponseAmino + ): MsgSetDeveloperAccountResponse { + const message = createBaseMsgSetDeveloperAccountResponse() + return message + }, + toAmino( + _: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetDeveloperAccountResponseAminoMsg + ): MsgSetDeveloperAccountResponse { + return MsgSetDeveloperAccountResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseAminoMsg { + return { + type: 'osmosis/protorev/set-developer-account-response', + value: MsgSetDeveloperAccountResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetDeveloperAccountResponseProtoMsg + ): MsgSetDeveloperAccountResponse { + return MsgSetDeveloperAccountResponse.decode(message.value) + }, + toProto(message: MsgSetDeveloperAccountResponse): Uint8Array { + return MsgSetDeveloperAccountResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetDeveloperAccountResponse + ): MsgSetDeveloperAccountResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse', + value: MsgSetDeveloperAccountResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetDeveloperAccountResponse.typeUrl, + MsgSetDeveloperAccountResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDeveloperAccountResponse.aminoType, + MsgSetDeveloperAccountResponse.typeUrl +) +function createBaseMsgSetInfoByPoolType(): MsgSetInfoByPoolType { + return { + admin: '', + infoByPoolType: InfoByPoolType.fromPartial({}) + } +} +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.infoByPoolType !== undefined) { + InfoByPoolType.encode( + message.infoByPoolType, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + 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 = createBaseMsgSetInfoByPoolType() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.infoByPoolType = InfoByPoolType.decode( + reader, + reader.uint32() + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType() + message.admin = object.admin ?? '' + message.infoByPoolType = + object.infoByPoolType !== undefined && object.infoByPoolType !== null + ? InfoByPoolType.fromPartial(object.infoByPoolType) + : undefined + return message + }, + 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: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAmino { + const obj: any = {} + obj.admin = message.admin === '' ? undefined : message.admin + obj.info_by_pool_type = message.infoByPoolType + ? InfoByPoolType.toAmino(message.infoByPoolType) + : undefined + return obj + }, + fromAminoMsg(object: MsgSetInfoByPoolTypeAminoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAminoMsg { + return { + type: 'osmosis/MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetInfoByPoolTypeProtoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.decode(message.value) + }, + toProto(message: MsgSetInfoByPoolType): Uint8Array { + return MsgSetInfoByPoolType.encode(message).finish() + }, + toProtoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetInfoByPoolType', + value: MsgSetInfoByPoolType.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetInfoByPoolType.typeUrl, + MsgSetInfoByPoolType +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetInfoByPoolType.aminoType, + MsgSetInfoByPoolType.typeUrl +) +function createBaseMsgSetInfoByPoolTypeResponse(): MsgSetInfoByPoolTypeResponse { + return {} +} +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 + ): MsgSetInfoByPoolTypeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetInfoByPoolTypeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse() + return message + }, + fromAmino( + _: MsgSetInfoByPoolTypeResponseAmino + ): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse() + return message + }, + toAmino(_: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetInfoByPoolTypeResponseAminoMsg + ): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetInfoByPoolTypeResponse + ): MsgSetInfoByPoolTypeResponseAminoMsg { + return { + type: 'osmosis/protorev/set-info-by-pool-type-response', + value: MsgSetInfoByPoolTypeResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetInfoByPoolTypeResponseProtoMsg + ): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.decode(message.value) + }, + toProto(message: MsgSetInfoByPoolTypeResponse): Uint8Array { + return MsgSetInfoByPoolTypeResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetInfoByPoolTypeResponse + ): MsgSetInfoByPoolTypeResponseProtoMsg { + return { + 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: '', + maxPoolPointsPerTx: BigInt(0) + } +} +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) + } + if (message.maxPoolPointsPerTx !== BigInt(0)) { + writer.uint32(16).uint64(message.maxPoolPointsPerTx) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetMaxPoolPointsPerTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.maxPoolPointsPerTx = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSetMaxPoolPointsPerTx { + const message = createBaseMsgSetMaxPoolPointsPerTx() + message.admin = object.admin ?? '' + message.maxPoolPointsPerTx = + object.maxPoolPointsPerTx !== undefined && + object.maxPoolPointsPerTx !== null + ? BigInt(object.maxPoolPointsPerTx.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgSetMaxPoolPointsPerTxAmino): MsgSetMaxPoolPointsPerTx { + 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 = {} + obj.admin = message.admin === '' ? undefined : message.admin + obj.max_pool_points_per_tx = + message.maxPoolPointsPerTx !== BigInt(0) + ? message.maxPoolPointsPerTx.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerTxAminoMsg + ): MsgSetMaxPoolPointsPerTx { + return MsgSetMaxPoolPointsPerTx.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerTx + ): MsgSetMaxPoolPointsPerTxAminoMsg { + return { + type: 'osmosis/MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerTxProtoMsg + ): MsgSetMaxPoolPointsPerTx { + return MsgSetMaxPoolPointsPerTx.decode(message.value) + }, + toProto(message: MsgSetMaxPoolPointsPerTx): Uint8Array { + return MsgSetMaxPoolPointsPerTx.encode(message).finish() + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerTx + ): MsgSetMaxPoolPointsPerTxProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx', + value: MsgSetMaxPoolPointsPerTx.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerTxResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetMaxPoolPointsPerTxResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetMaxPoolPointsPerTxResponse { + const message = createBaseMsgSetMaxPoolPointsPerTxResponse() + return message + }, + fromAmino( + _: MsgSetMaxPoolPointsPerTxResponseAmino + ): MsgSetMaxPoolPointsPerTxResponse { + const message = createBaseMsgSetMaxPoolPointsPerTxResponse() + return message + }, + toAmino( + _: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerTxResponseAminoMsg + ): MsgSetMaxPoolPointsPerTxResponse { + return MsgSetMaxPoolPointsPerTxResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseAminoMsg { + return { + type: 'osmosis/protorev/set-max-pool-points-per-tx-response', + value: MsgSetMaxPoolPointsPerTxResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerTxResponseProtoMsg + ): MsgSetMaxPoolPointsPerTxResponse { + return MsgSetMaxPoolPointsPerTxResponse.decode(message.value) + }, + toProto(message: MsgSetMaxPoolPointsPerTxResponse): Uint8Array { + return MsgSetMaxPoolPointsPerTxResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerTxResponse + ): MsgSetMaxPoolPointsPerTxResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse', + value: MsgSetMaxPoolPointsPerTxResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerTxResponse.typeUrl, + MsgSetMaxPoolPointsPerTxResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerTxResponse.aminoType, + MsgSetMaxPoolPointsPerTxResponse.typeUrl +) +function createBaseMsgSetMaxPoolPointsPerBlock(): MsgSetMaxPoolPointsPerBlock { + return { + admin: '', + maxPoolPointsPerBlock: BigInt(0) + } +} +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) + } + if (message.maxPoolPointsPerBlock !== BigInt(0)) { + writer.uint32(16).uint64(message.maxPoolPointsPerBlock) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetMaxPoolPointsPerBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.maxPoolPointsPerBlock = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSetMaxPoolPointsPerBlock { + const message = createBaseMsgSetMaxPoolPointsPerBlock() + message.admin = object.admin ?? '' + message.maxPoolPointsPerBlock = + object.maxPoolPointsPerBlock !== undefined && + object.maxPoolPointsPerBlock !== null + ? BigInt(object.maxPoolPointsPerBlock.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgSetMaxPoolPointsPerBlockAmino + ): MsgSetMaxPoolPointsPerBlock { + 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 = {} + obj.admin = message.admin === '' ? undefined : message.admin + obj.max_pool_points_per_block = + message.maxPoolPointsPerBlock !== BigInt(0) + ? message.maxPoolPointsPerBlock.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerBlockAminoMsg + ): MsgSetMaxPoolPointsPerBlock { + return MsgSetMaxPoolPointsPerBlock.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerBlock + ): MsgSetMaxPoolPointsPerBlockAminoMsg { + return { + type: 'osmosis/MsgSetPoolWeights', + value: MsgSetMaxPoolPointsPerBlock.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerBlockProtoMsg + ): MsgSetMaxPoolPointsPerBlock { + return MsgSetMaxPoolPointsPerBlock.decode(message.value) + }, + toProto(message: MsgSetMaxPoolPointsPerBlock): Uint8Array { + return MsgSetMaxPoolPointsPerBlock.encode(message).finish() + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerBlock + ): MsgSetMaxPoolPointsPerBlockProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock', + value: MsgSetMaxPoolPointsPerBlock.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetMaxPoolPointsPerBlockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetMaxPoolPointsPerBlockResponse { + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse() + return message + }, + fromAmino( + _: MsgSetMaxPoolPointsPerBlockResponseAmino + ): MsgSetMaxPoolPointsPerBlockResponse { + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse() + return message + }, + toAmino( + _: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetMaxPoolPointsPerBlockResponseAminoMsg + ): MsgSetMaxPoolPointsPerBlockResponse { + return MsgSetMaxPoolPointsPerBlockResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseAminoMsg { + return { + type: 'osmosis/protorev/set-max-pool-points-per-block-response', + value: MsgSetMaxPoolPointsPerBlockResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetMaxPoolPointsPerBlockResponseProtoMsg + ): MsgSetMaxPoolPointsPerBlockResponse { + return MsgSetMaxPoolPointsPerBlockResponse.decode(message.value) + }, + toProto(message: MsgSetMaxPoolPointsPerBlockResponse): Uint8Array { + return MsgSetMaxPoolPointsPerBlockResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetMaxPoolPointsPerBlockResponse + ): MsgSetMaxPoolPointsPerBlockResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse', + value: MsgSetMaxPoolPointsPerBlockResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetMaxPoolPointsPerBlockResponse.typeUrl, + MsgSetMaxPoolPointsPerBlockResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetMaxPoolPointsPerBlockResponse.aminoType, + MsgSetMaxPoolPointsPerBlockResponse.typeUrl +) +function createBaseMsgSetBaseDenoms(): MsgSetBaseDenoms { + return { + admin: '', + baseDenoms: [] + } +} +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) + } + for (const v of message.baseDenoms) { + BaseDenom.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBaseDenoms { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetBaseDenoms() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.admin = reader.string() + break + case 2: + message.baseDenoms.push(BaseDenom.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetBaseDenoms { + const message = createBaseMsgSetBaseDenoms() + message.admin = object.admin ?? '' + message.baseDenoms = + object.baseDenoms?.map((e) => BaseDenom.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgSetBaseDenomsAmino): MsgSetBaseDenoms { + 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 = {} + obj.admin = message.admin === '' ? undefined : message.admin + if (message.baseDenoms) { + obj.base_denoms = message.baseDenoms.map((e) => + e ? BaseDenom.toAmino(e) : undefined + ) + } else { + obj.base_denoms = message.baseDenoms + } + return obj + }, + fromAminoMsg(object: MsgSetBaseDenomsAminoMsg): MsgSetBaseDenoms { + return MsgSetBaseDenoms.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsAminoMsg { + return { + type: 'osmosis/MsgSetBaseDenoms', + value: MsgSetBaseDenoms.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetBaseDenomsProtoMsg): MsgSetBaseDenoms { + return MsgSetBaseDenoms.decode(message.value) + }, + toProto(message: MsgSetBaseDenoms): Uint8Array { + return MsgSetBaseDenoms.encode(message).finish() + }, + toProtoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenoms', + value: MsgSetBaseDenoms.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetBaseDenomsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetBaseDenomsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgSetBaseDenomsResponse { + const message = createBaseMsgSetBaseDenomsResponse() + return message + }, + fromAmino(_: MsgSetBaseDenomsResponseAmino): MsgSetBaseDenomsResponse { + const message = createBaseMsgSetBaseDenomsResponse() + return message + }, + toAmino(_: MsgSetBaseDenomsResponse): MsgSetBaseDenomsResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetBaseDenomsResponseAminoMsg + ): MsgSetBaseDenomsResponse { + return MsgSetBaseDenomsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetBaseDenomsResponse + ): MsgSetBaseDenomsResponseAminoMsg { + return { + type: 'osmosis/protorev/set-base-denoms-response', + value: MsgSetBaseDenomsResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetBaseDenomsResponseProtoMsg + ): MsgSetBaseDenomsResponse { + return MsgSetBaseDenomsResponse.decode(message.value) + }, + toProto(message: MsgSetBaseDenomsResponse): Uint8Array { + return MsgSetBaseDenomsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetBaseDenomsResponse + ): MsgSetBaseDenomsResponseProtoMsg { + return { + typeUrl: '/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse', + value: MsgSetBaseDenomsResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetBaseDenomsResponse.typeUrl, + MsgSetBaseDenomsResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetBaseDenomsResponse.aminoType, + MsgSetBaseDenomsResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.amino.ts new file mode 100644 index 0000000..ada5954 --- /dev/null +++ b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.amino.ts @@ -0,0 +1,24 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgAddAuthenticator, + MsgRemoveAuthenticator, + MsgSetActiveState +} from './tx' +export const AminoConverter = { + '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator': { + aminoType: 'osmosis/smartaccount/add-authenticator', + toAmino: MsgAddAuthenticator.toAmino, + fromAmino: MsgAddAuthenticator.fromAmino + }, + '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator': { + aminoType: 'osmosis/smartaccount/remove-authenticator', + toAmino: MsgRemoveAuthenticator.toAmino, + fromAmino: MsgRemoveAuthenticator.fromAmino + }, + '/osmosis.smartaccount.v1beta1.MsgSetActiveState': { + aminoType: 'osmosis/smartaccount/set-active-state', + toAmino: MsgSetActiveState.toAmino, + fromAmino: MsgSetActiveState.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.registry.ts new file mode 100644 index 0000000..7dd2f79 --- /dev/null +++ b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.registry.ts @@ -0,0 +1,83 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { + MsgAddAuthenticator, + MsgRemoveAuthenticator, + MsgSetActiveState +} from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', MsgAddAuthenticator], + [ + '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + MsgRemoveAuthenticator + ], + ['/osmosis.smartaccount.v1beta1.MsgSetActiveState', MsgSetActiveState] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.encode(value).finish() + } + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.encode(value).finish() + } + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.encode(value).finish() + } + } + }, + withTypeUrl: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value + } + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value + } + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value + } + } + }, + fromPartial: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.fromPartial(value) + } + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.fromPartial(value) + } + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.ts b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.ts new file mode 100644 index 0000000..2346d00 --- /dev/null +++ b/src/proto/osmojs/osmosis/smartaccount/v1beta1/tx.ts @@ -0,0 +1,1012 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { bytesFromBase64, base64FromBytes } from '../../../../helpers' +import { GlobalDecoderRegistry } from '../../../registry' +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticator { + sender: string + type: string + data: Uint8Array +} +export interface MsgAddAuthenticatorProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator' + value: Uint8Array +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorAmino { + sender?: string + type?: string + data?: string +} +export interface MsgAddAuthenticatorAminoMsg { + type: 'osmosis/smartaccount/add-authenticator' + value: MsgAddAuthenticatorAmino +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorSDKType { + sender: string + type: string + data: Uint8Array +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponse { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success: boolean +} +export interface MsgAddAuthenticatorResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse' + value: Uint8Array +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseAmino { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success?: boolean +} +export interface MsgAddAuthenticatorResponseAminoMsg { + type: 'osmosis/smartaccount/add-authenticator-response' + value: MsgAddAuthenticatorResponseAmino +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseSDKType { + success: boolean +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticator { + sender: string + id: bigint +} +export interface MsgRemoveAuthenticatorProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator' + value: Uint8Array +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorAmino { + sender?: string + id?: string +} +export interface MsgRemoveAuthenticatorAminoMsg { + type: 'osmosis/smartaccount/remove-authenticator' + value: MsgRemoveAuthenticatorAmino +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorSDKType { + sender: string + id: bigint +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponse { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success: boolean +} +export interface MsgRemoveAuthenticatorResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse' + value: Uint8Array +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseAmino { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success?: boolean +} +export interface MsgRemoveAuthenticatorResponseAminoMsg { + type: 'osmosis/smartaccount/remove-authenticator-response' + value: MsgRemoveAuthenticatorResponseAmino +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseSDKType { + success: boolean +} +export interface MsgSetActiveState { + sender: string + active: boolean +} +export interface MsgSetActiveStateProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState' + value: Uint8Array +} +export interface MsgSetActiveStateAmino { + sender?: string + active?: boolean +} +export interface MsgSetActiveStateAminoMsg { + type: 'osmosis/smartaccount/set-active-state' + value: MsgSetActiveStateAmino +} +export interface MsgSetActiveStateSDKType { + sender: string + active: boolean +} +export interface MsgSetActiveStateResponse {} +export interface MsgSetActiveStateResponseProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse' + value: Uint8Array +} +export interface MsgSetActiveStateResponseAmino {} +export interface MsgSetActiveStateResponseAminoMsg { + type: 'osmosis/smartaccount/set-active-state-response' + value: MsgSetActiveStateResponseAmino +} +export interface MsgSetActiveStateResponseSDKType {} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtension { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selectedAuthenticators: bigint[] +} +export interface TxExtensionProtoMsg { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension' + value: Uint8Array +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionAmino { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selected_authenticators?: string[] +} +export interface TxExtensionAminoMsg { + type: 'osmosis/smartaccount/tx-extension' + value: TxExtensionAmino +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionSDKType { + selected_authenticators: bigint[] +} +function createBaseMsgAddAuthenticator(): MsgAddAuthenticator { + return { + sender: '', + type: '', + data: new Uint8Array() + } +} +export const MsgAddAuthenticator = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + aminoType: 'osmosis/smartaccount/add-authenticator', + is(o: any): o is MsgAddAuthenticator { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + isSDK(o: any): o is MsgAddAuthenticatorSDKType { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + isAmino(o: any): o is MsgAddAuthenticatorAmino { + return ( + o && + (o.$typeUrl === MsgAddAuthenticator.typeUrl || + (typeof o.sender === 'string' && + typeof o.type === 'string' && + (o.data instanceof Uint8Array || typeof o.data === 'string'))) + ) + }, + encode( + message: MsgAddAuthenticator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender) + } + if (message.type !== '') { + writer.uint32(18).string(message.type) + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddAuthenticator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddAuthenticator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.type = reader.string() + break + case 3: + message.data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator() + message.sender = object.sender ?? '' + message.type = object.type ?? '' + message.data = object.data ?? new Uint8Array() + return message + }, + fromAmino(object: MsgAddAuthenticatorAmino): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator() + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data) + } + return message + }, + toAmino(message: MsgAddAuthenticator): MsgAddAuthenticatorAmino { + const obj: any = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.type = message.type === '' ? undefined : message.type + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg(object: MsgAddAuthenticatorAminoMsg): MsgAddAuthenticator { + return MsgAddAuthenticator.fromAmino(object.value) + }, + toAminoMsg(message: MsgAddAuthenticator): MsgAddAuthenticatorAminoMsg { + return { + type: 'osmosis/smartaccount/add-authenticator', + value: MsgAddAuthenticator.toAmino(message) + } + }, + fromProtoMsg(message: MsgAddAuthenticatorProtoMsg): MsgAddAuthenticator { + return MsgAddAuthenticator.decode(message.value) + }, + toProto(message: MsgAddAuthenticator): Uint8Array { + return MsgAddAuthenticator.encode(message).finish() + }, + toProtoMsg(message: MsgAddAuthenticator): MsgAddAuthenticatorProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticator', + value: MsgAddAuthenticator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgAddAuthenticator.typeUrl, MsgAddAuthenticator) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddAuthenticator.aminoType, + MsgAddAuthenticator.typeUrl +) +function createBaseMsgAddAuthenticatorResponse(): MsgAddAuthenticatorResponse { + return { + success: false + } +} +export const MsgAddAuthenticatorResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse', + aminoType: 'osmosis/smartaccount/add-authenticator-response', + is(o: any): o is MsgAddAuthenticatorResponse { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + isSDK(o: any): o is MsgAddAuthenticatorResponseSDKType { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + isAmino(o: any): o is MsgAddAuthenticatorResponseAmino { + return ( + o && + (o.$typeUrl === MsgAddAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + encode( + message: MsgAddAuthenticatorResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddAuthenticatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddAuthenticatorResponse() + 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 + ): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse() + message.success = object.success ?? false + return message + }, + fromAmino( + object: MsgAddAuthenticatorResponseAmino + ): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse() + if (object.success !== undefined && object.success !== null) { + message.success = object.success + } + return message + }, + toAmino( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseAmino { + const obj: any = {} + obj.success = message.success === false ? undefined : message.success + return obj + }, + fromAminoMsg( + object: MsgAddAuthenticatorResponseAminoMsg + ): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseAminoMsg { + return { + type: 'osmosis/smartaccount/add-authenticator-response', + value: MsgAddAuthenticatorResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddAuthenticatorResponseProtoMsg + ): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.decode(message.value) + }, + toProto(message: MsgAddAuthenticatorResponse): Uint8Array { + return MsgAddAuthenticatorResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgAddAuthenticatorResponse + ): MsgAddAuthenticatorResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse', + value: MsgAddAuthenticatorResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgAddAuthenticatorResponse.typeUrl, + MsgAddAuthenticatorResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddAuthenticatorResponse.aminoType, + MsgAddAuthenticatorResponse.typeUrl +) +function createBaseMsgRemoveAuthenticator(): MsgRemoveAuthenticator { + return { + sender: '', + id: BigInt(0) + } +} +export const MsgRemoveAuthenticator = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + aminoType: 'osmosis/smartaccount/remove-authenticator', + is(o: any): o is MsgRemoveAuthenticator { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ) + }, + isSDK(o: any): o is MsgRemoveAuthenticatorSDKType { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ) + }, + isAmino(o: any): o is MsgRemoveAuthenticatorAmino { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticator.typeUrl || + (typeof o.sender === 'string' && typeof o.id === 'bigint')) + ) + }, + encode( + message: MsgRemoveAuthenticator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender) + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRemoveAuthenticator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRemoveAuthenticator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.id = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator() + message.sender = object.sender ?? '' + message.id = + object.id !== undefined && object.id !== null + ? BigInt(object.id.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgRemoveAuthenticatorAmino): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator() + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id) + } + return message + }, + toAmino(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorAmino { + const obj: any = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined + return obj + }, + fromAminoMsg(object: MsgRemoveAuthenticatorAminoMsg): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.fromAmino(object.value) + }, + toAminoMsg(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorAminoMsg { + return { + type: 'osmosis/smartaccount/remove-authenticator', + value: MsgRemoveAuthenticator.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRemoveAuthenticatorProtoMsg + ): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.decode(message.value) + }, + toProto(message: MsgRemoveAuthenticator): Uint8Array { + return MsgRemoveAuthenticator.encode(message).finish() + }, + toProtoMsg(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator', + value: MsgRemoveAuthenticator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRemoveAuthenticator.typeUrl, + MsgRemoveAuthenticator +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveAuthenticator.aminoType, + MsgRemoveAuthenticator.typeUrl +) +function createBaseMsgRemoveAuthenticatorResponse(): MsgRemoveAuthenticatorResponse { + return { + success: false + } +} +export const MsgRemoveAuthenticatorResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse', + aminoType: 'osmosis/smartaccount/remove-authenticator-response', + is(o: any): o is MsgRemoveAuthenticatorResponse { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + isSDK(o: any): o is MsgRemoveAuthenticatorResponseSDKType { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + isAmino(o: any): o is MsgRemoveAuthenticatorResponseAmino { + return ( + o && + (o.$typeUrl === MsgRemoveAuthenticatorResponse.typeUrl || + typeof o.success === 'boolean') + ) + }, + encode( + message: MsgRemoveAuthenticatorResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRemoveAuthenticatorResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRemoveAuthenticatorResponse() + 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 + ): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse() + message.success = object.success ?? false + return message + }, + fromAmino( + object: MsgRemoveAuthenticatorResponseAmino + ): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse() + if (object.success !== undefined && object.success !== null) { + message.success = object.success + } + return message + }, + toAmino( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseAmino { + const obj: any = {} + obj.success = message.success === false ? undefined : message.success + return obj + }, + fromAminoMsg( + object: MsgRemoveAuthenticatorResponseAminoMsg + ): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseAminoMsg { + return { + type: 'osmosis/smartaccount/remove-authenticator-response', + value: MsgRemoveAuthenticatorResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRemoveAuthenticatorResponseProtoMsg + ): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.decode(message.value) + }, + toProto(message: MsgRemoveAuthenticatorResponse): Uint8Array { + return MsgRemoveAuthenticatorResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRemoveAuthenticatorResponse + ): MsgRemoveAuthenticatorResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse', + value: MsgRemoveAuthenticatorResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRemoveAuthenticatorResponse.typeUrl, + MsgRemoveAuthenticatorResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRemoveAuthenticatorResponse.aminoType, + MsgRemoveAuthenticatorResponse.typeUrl +) +function createBaseMsgSetActiveState(): MsgSetActiveState { + return { + sender: '', + active: false + } +} +export const MsgSetActiveState = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + aminoType: 'osmosis/smartaccount/set-active-state', + is(o: any): o is MsgSetActiveState { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ) + }, + isSDK(o: any): o is MsgSetActiveStateSDKType { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ) + }, + isAmino(o: any): o is MsgSetActiveStateAmino { + return ( + o && + (o.$typeUrl === MsgSetActiveState.typeUrl || + (typeof o.sender === 'string' && typeof o.active === 'boolean')) + ) + }, + encode( + message: MsgSetActiveState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== '') { + writer.uint32(10).string(message.sender) + } + if (message.active === true) { + writer.uint32(16).bool(message.active) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetActiveState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetActiveState() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.active = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetActiveState { + const message = createBaseMsgSetActiveState() + message.sender = object.sender ?? '' + message.active = object.active ?? false + return message + }, + fromAmino(object: MsgSetActiveStateAmino): MsgSetActiveState { + const message = createBaseMsgSetActiveState() + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active + } + return message + }, + toAmino(message: MsgSetActiveState): MsgSetActiveStateAmino { + const obj: any = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.active = message.active === false ? undefined : message.active + return obj + }, + fromAminoMsg(object: MsgSetActiveStateAminoMsg): MsgSetActiveState { + return MsgSetActiveState.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetActiveState): MsgSetActiveStateAminoMsg { + return { + type: 'osmosis/smartaccount/set-active-state', + value: MsgSetActiveState.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetActiveStateProtoMsg): MsgSetActiveState { + return MsgSetActiveState.decode(message.value) + }, + toProto(message: MsgSetActiveState): Uint8Array { + return MsgSetActiveState.encode(message).finish() + }, + toProtoMsg(message: MsgSetActiveState): MsgSetActiveStateProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveState', + value: MsgSetActiveState.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgSetActiveState.typeUrl, MsgSetActiveState) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetActiveState.aminoType, + MsgSetActiveState.typeUrl +) +function createBaseMsgSetActiveStateResponse(): MsgSetActiveStateResponse { + return {} +} +export const MsgSetActiveStateResponse = { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse', + aminoType: 'osmosis/smartaccount/set-active-state-response', + is(o: any): o is MsgSetActiveStateResponse { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl + }, + isSDK(o: any): o is MsgSetActiveStateResponseSDKType { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl + }, + isAmino(o: any): o is MsgSetActiveStateResponseAmino { + return o && o.$typeUrl === MsgSetActiveStateResponse.typeUrl + }, + encode( + _: MsgSetActiveStateResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetActiveStateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetActiveStateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse() + return message + }, + fromAmino(_: MsgSetActiveStateResponseAmino): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse() + return message + }, + toAmino(_: MsgSetActiveStateResponse): MsgSetActiveStateResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetActiveStateResponseAminoMsg + ): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetActiveStateResponse + ): MsgSetActiveStateResponseAminoMsg { + return { + type: 'osmosis/smartaccount/set-active-state-response', + value: MsgSetActiveStateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetActiveStateResponseProtoMsg + ): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.decode(message.value) + }, + toProto(message: MsgSetActiveStateResponse): Uint8Array { + return MsgSetActiveStateResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetActiveStateResponse + ): MsgSetActiveStateResponseProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse', + value: MsgSetActiveStateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetActiveStateResponse.typeUrl, + MsgSetActiveStateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetActiveStateResponse.aminoType, + MsgSetActiveStateResponse.typeUrl +) +function createBaseTxExtension(): TxExtension { + return { + selectedAuthenticators: [] + } +} +export const TxExtension = { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension', + aminoType: 'osmosis/smartaccount/tx-extension', + is(o: any): o is TxExtension { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selectedAuthenticators) && + (!o.selectedAuthenticators.length || + typeof o.selectedAuthenticators[0] === 'bigint'))) + ) + }, + isSDK(o: any): o is TxExtensionSDKType { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selected_authenticators) && + (!o.selected_authenticators.length || + typeof o.selected_authenticators[0] === 'bigint'))) + ) + }, + isAmino(o: any): o is TxExtensionAmino { + return ( + o && + (o.$typeUrl === TxExtension.typeUrl || + (Array.isArray(o.selected_authenticators) && + (!o.selected_authenticators.length || + typeof o.selected_authenticators[0] === 'bigint'))) + ) + }, + encode( + message: TxExtension, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + writer.uint32(10).fork() + for (const v of message.selectedAuthenticators) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxExtension { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxExtension() + 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.selectedAuthenticators.push(reader.uint64()) + } + } else { + message.selectedAuthenticators.push(reader.uint64()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TxExtension { + const message = createBaseTxExtension() + message.selectedAuthenticators = + object.selectedAuthenticators?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino(object: TxExtensionAmino): TxExtension { + const message = createBaseTxExtension() + message.selectedAuthenticators = + object.selected_authenticators?.map((e) => BigInt(e)) || [] + return message + }, + toAmino(message: TxExtension): TxExtensionAmino { + const obj: any = {} + if (message.selectedAuthenticators) { + obj.selected_authenticators = message.selectedAuthenticators.map((e) => + e.toString() + ) + } else { + obj.selected_authenticators = message.selectedAuthenticators + } + return obj + }, + fromAminoMsg(object: TxExtensionAminoMsg): TxExtension { + return TxExtension.fromAmino(object.value) + }, + toAminoMsg(message: TxExtension): TxExtensionAminoMsg { + return { + type: 'osmosis/smartaccount/tx-extension', + value: TxExtension.toAmino(message) + } + }, + fromProtoMsg(message: TxExtensionProtoMsg): TxExtension { + return TxExtension.decode(message.value) + }, + toProto(message: TxExtension): Uint8Array { + return TxExtension.encode(message).finish() + }, + toProtoMsg(message: TxExtension): TxExtensionProtoMsg { + return { + typeUrl: '/osmosis.smartaccount.v1beta1.TxExtension', + value: TxExtension.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TxExtension.typeUrl, TxExtension) +GlobalDecoderRegistry.registerAminoProtoMapping( + TxExtension.aminoType, + TxExtension.typeUrl +) diff --git a/src/proto/osmojs/osmosis/superfluid/superfluid.ts b/src/proto/osmojs/osmosis/superfluid/superfluid.ts new file mode 100644 index 0000000..4df0e43 --- /dev/null +++ b/src/proto/osmojs/osmosis/superfluid/superfluid.ts @@ -0,0 +1,1425 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin' +import { + SyntheticLock, + SyntheticLockAmino, + SyntheticLockSDKType +} from '../lockup/lock' +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 + * a native token, lp share of a pool, or concentrated share of a pool + */ +export enum SuperfluidAssetType { + SuperfluidAssetTypeNative = 0, + SuperfluidAssetTypeLPShare = 1, + SuperfluidAssetTypeConcentratedShare = 2, + UNRECOGNIZED = -1 +} +export const SuperfluidAssetTypeSDKType = SuperfluidAssetType +export const SuperfluidAssetTypeAmino = SuperfluidAssetType +export function superfluidAssetTypeFromJSON(object: any): SuperfluidAssetType { + switch (object) { + case 0: + case 'SuperfluidAssetTypeNative': + return SuperfluidAssetType.SuperfluidAssetTypeNative + case 1: + case 'SuperfluidAssetTypeLPShare': + return SuperfluidAssetType.SuperfluidAssetTypeLPShare + case 2: + case 'SuperfluidAssetTypeConcentratedShare': + return SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare + case -1: + case 'UNRECOGNIZED': + default: + return SuperfluidAssetType.UNRECOGNIZED + } +} +export function superfluidAssetTypeToJSON(object: SuperfluidAssetType): string { + switch (object) { + case SuperfluidAssetType.SuperfluidAssetTypeNative: + return 'SuperfluidAssetTypeNative' + case SuperfluidAssetType.SuperfluidAssetTypeLPShare: + return 'SuperfluidAssetTypeLPShare' + case SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare: + return 'SuperfluidAssetTypeConcentratedShare' + case SuperfluidAssetType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAsset { + denom: string + /** + * AssetType indicates whether the superfluid asset is a native token or an lp + * share + */ + assetType: SuperfluidAssetType +} +export interface SuperfluidAssetProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidAsset' + value: Uint8Array +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAssetAmino { + denom?: string + /** + * AssetType indicates whether the superfluid asset is a native token or an lp + * share + */ + asset_type?: SuperfluidAssetType +} +export interface SuperfluidAssetAminoMsg { + type: 'osmosis/superfluid-asset' + value: SuperfluidAssetAmino +} +/** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ +export interface SuperfluidAssetSDKType { + denom: string + asset_type: SuperfluidAssetType +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccount { + /** Denom indicates the denom of the superfluid asset. */ + denom: string + valAddr: string + /** perpetual gauge for rewards distribution */ + gaugeId: bigint +} +export interface SuperfluidIntermediaryAccountProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidIntermediaryAccount' + value: Uint8Array +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccountAmino { + /** Denom indicates the denom of the superfluid asset. */ + denom?: string + val_addr?: string + /** perpetual gauge for rewards distribution */ + gauge_id?: string +} +export interface SuperfluidIntermediaryAccountAminoMsg { + type: 'osmosis/superfluid-intermediary-account' + value: SuperfluidIntermediaryAccountAmino +} +/** + * SuperfluidIntermediaryAccount takes the role of intermediary between LP token + * and OSMO tokens for superfluid staking. The intermediary account is the + * actual account responsible for delegation, not the validator account itself. + */ +export interface SuperfluidIntermediaryAccountSDKType { + denom: string + val_addr: string + gauge_id: bigint +} +/** + * 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 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 + /** superfluid asset denom, can be LP token or native token */ + denom: string + multiplier: string +} +export interface OsmoEquivalentMultiplierRecordProtoMsg { + typeUrl: '/osmosis.superfluid.OsmoEquivalentMultiplierRecord' + value: Uint8Array +} +/** + * 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 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 + /** superfluid asset denom, can be LP token or native token */ + denom?: string + multiplier?: string +} +export interface OsmoEquivalentMultiplierRecordAminoMsg { + type: 'osmosis/osmo-equivalent-multiplier-record' + value: OsmoEquivalentMultiplierRecordAmino +} +/** + * 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 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 + denom: string + multiplier: string +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecord { + delegatorAddress: string + validatorAddress: string + delegationAmount: Coin + equivalentStakedAmount?: Coin +} +export interface SuperfluidDelegationRecordProtoMsg { + typeUrl: '/osmosis.superfluid.SuperfluidDelegationRecord' + value: Uint8Array +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecordAmino { + delegator_address?: string + validator_address?: string + delegation_amount?: CoinAmino + equivalent_staked_amount?: CoinAmino +} +export interface SuperfluidDelegationRecordAminoMsg { + type: 'osmosis/superfluid-delegation-record' + value: SuperfluidDelegationRecordAmino +} +/** + * SuperfluidDelegationRecord is a struct used to indicate superfluid + * delegations of an account in the state machine in a user friendly form. + */ +export interface SuperfluidDelegationRecordSDKType { + delegator_address: string + validator_address: string + delegation_amount: CoinSDKType + equivalent_staked_amount?: CoinSDKType +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnection { + lockId: bigint + intermediaryAccount: string +} +export interface LockIdIntermediaryAccountConnectionProtoMsg { + typeUrl: '/osmosis.superfluid.LockIdIntermediaryAccountConnection' + value: Uint8Array +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnectionAmino { + lock_id?: string + intermediary_account?: string +} +export interface LockIdIntermediaryAccountConnectionAminoMsg { + type: 'osmosis/lock-id-intermediary-account-connection' + value: LockIdIntermediaryAccountConnectionAmino +} +/** + * LockIdIntermediaryAccountConnection is a struct used to indicate the + * relationship between the underlying lock id and superfluid delegation done + * via lp shares. + */ +export interface LockIdIntermediaryAccountConnectionSDKType { + lock_id: bigint + intermediary_account: string +} +export interface UnpoolWhitelistedPools { + ids: bigint[] +} +export interface UnpoolWhitelistedPoolsProtoMsg { + typeUrl: '/osmosis.superfluid.UnpoolWhitelistedPools' + value: Uint8Array +} +export interface UnpoolWhitelistedPoolsAmino { + ids?: string[] +} +export interface UnpoolWhitelistedPoolsAminoMsg { + type: 'osmosis/unpool-whitelisted-pools' + value: UnpoolWhitelistedPoolsAmino +} +export interface UnpoolWhitelistedPoolsSDKType { + ids: bigint[] +} +export interface ConcentratedPoolUserPositionRecord { + validatorAddress: string + positionId: bigint + lockId: bigint + syntheticLock: SyntheticLock + delegationAmount: Coin + equivalentStakedAmount?: Coin +} +export interface ConcentratedPoolUserPositionRecordProtoMsg { + typeUrl: '/osmosis.superfluid.ConcentratedPoolUserPositionRecord' + value: Uint8Array +} +export interface ConcentratedPoolUserPositionRecordAmino { + validator_address?: string + position_id?: string + lock_id?: string + synthetic_lock?: SyntheticLockAmino + delegation_amount?: CoinAmino + equivalent_staked_amount?: CoinAmino +} +export interface ConcentratedPoolUserPositionRecordAminoMsg { + type: 'osmosis/concentrated-pool-user-position-record' + value: ConcentratedPoolUserPositionRecordAmino +} +export interface ConcentratedPoolUserPositionRecordSDKType { + validator_address: string + position_id: bigint + lock_id: bigint + synthetic_lock: SyntheticLockSDKType + delegation_amount: CoinSDKType + equivalent_staked_amount?: CoinSDKType +} +function createBaseSuperfluidAsset(): SuperfluidAsset { + return { + denom: '', + assetType: 0 + } +} +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) + } + if (message.assetType !== 0) { + writer.uint32(16).int32(message.assetType) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SuperfluidAsset { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSuperfluidAsset() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.assetType = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SuperfluidAsset { + const message = createBaseSuperfluidAsset() + message.denom = object.denom ?? '' + message.assetType = object.assetType ?? 0 + return message + }, + fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { + 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 = object.asset_type + } + return message + }, + toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { + const obj: any = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.asset_type = message.assetType === 0 ? undefined : message.assetType + return obj + }, + fromAminoMsg(object: SuperfluidAssetAminoMsg): SuperfluidAsset { + return SuperfluidAsset.fromAmino(object.value) + }, + toAminoMsg(message: SuperfluidAsset): SuperfluidAssetAminoMsg { + return { + type: 'osmosis/superfluid-asset', + value: SuperfluidAsset.toAmino(message) + } + }, + fromProtoMsg(message: SuperfluidAssetProtoMsg): SuperfluidAsset { + return SuperfluidAsset.decode(message.value) + }, + toProto(message: SuperfluidAsset): Uint8Array { + return SuperfluidAsset.encode(message).finish() + }, + toProtoMsg(message: SuperfluidAsset): SuperfluidAssetProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidAsset', + value: SuperfluidAsset.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SuperfluidAsset.typeUrl, SuperfluidAsset) +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidAsset.aminoType, + SuperfluidAsset.typeUrl +) +function createBaseSuperfluidIntermediaryAccount(): SuperfluidIntermediaryAccount { + return { + denom: '', + valAddr: '', + gaugeId: BigInt(0) + } +} +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) + } + if (message.valAddr !== '') { + writer.uint32(18).string(message.valAddr) + } + if (message.gaugeId !== BigInt(0)) { + writer.uint32(24).uint64(message.gaugeId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SuperfluidIntermediaryAccount { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSuperfluidIntermediaryAccount() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.valAddr = reader.string() + break + case 3: + message.gaugeId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SuperfluidIntermediaryAccount { + const message = createBaseSuperfluidIntermediaryAccount() + message.denom = object.denom ?? '' + message.valAddr = object.valAddr ?? '' + message.gaugeId = + object.gaugeId !== undefined && object.gaugeId !== null + ? BigInt(object.gaugeId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: SuperfluidIntermediaryAccountAmino + ): SuperfluidIntermediaryAccount { + 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 = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr + obj.gauge_id = + message.gaugeId !== BigInt(0) ? message.gaugeId.toString() : undefined + return obj + }, + fromAminoMsg( + object: SuperfluidIntermediaryAccountAminoMsg + ): SuperfluidIntermediaryAccount { + return SuperfluidIntermediaryAccount.fromAmino(object.value) + }, + toAminoMsg( + message: SuperfluidIntermediaryAccount + ): SuperfluidIntermediaryAccountAminoMsg { + return { + type: 'osmosis/superfluid-intermediary-account', + value: SuperfluidIntermediaryAccount.toAmino(message) + } + }, + fromProtoMsg( + message: SuperfluidIntermediaryAccountProtoMsg + ): SuperfluidIntermediaryAccount { + return SuperfluidIntermediaryAccount.decode(message.value) + }, + toProto(message: SuperfluidIntermediaryAccount): Uint8Array { + return SuperfluidIntermediaryAccount.encode(message).finish() + }, + toProtoMsg( + message: SuperfluidIntermediaryAccount + ): SuperfluidIntermediaryAccountProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidIntermediaryAccount', + value: SuperfluidIntermediaryAccount.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SuperfluidIntermediaryAccount.typeUrl, + SuperfluidIntermediaryAccount +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidIntermediaryAccount.aminoType, + SuperfluidIntermediaryAccount.typeUrl +) +function createBaseOsmoEquivalentMultiplierRecord(): OsmoEquivalentMultiplierRecord { + return { + epochNumber: BigInt(0), + denom: '', + multiplier: '' + } +} +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) + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom) + } + if (message.multiplier !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.multiplier, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): OsmoEquivalentMultiplierRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOsmoEquivalentMultiplierRecord() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64() + break + case 2: + message.denom = reader.string() + break + case 3: + message.multiplier = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): OsmoEquivalentMultiplierRecord { + const message = createBaseOsmoEquivalentMultiplierRecord() + message.epochNumber = + object.epochNumber !== undefined && object.epochNumber !== null + ? BigInt(object.epochNumber.toString()) + : BigInt(0) + message.denom = object.denom ?? '' + message.multiplier = object.multiplier ?? '' + return message + }, + fromAmino( + object: OsmoEquivalentMultiplierRecordAmino + ): OsmoEquivalentMultiplierRecord { + 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 = {} + obj.epoch_number = + message.epochNumber !== BigInt(0) + ? message.epochNumber.toString() + : undefined + obj.denom = message.denom === '' ? undefined : message.denom + obj.multiplier = message.multiplier === '' ? undefined : message.multiplier + return obj + }, + fromAminoMsg( + object: OsmoEquivalentMultiplierRecordAminoMsg + ): OsmoEquivalentMultiplierRecord { + return OsmoEquivalentMultiplierRecord.fromAmino(object.value) + }, + toAminoMsg( + message: OsmoEquivalentMultiplierRecord + ): OsmoEquivalentMultiplierRecordAminoMsg { + return { + type: 'osmosis/osmo-equivalent-multiplier-record', + value: OsmoEquivalentMultiplierRecord.toAmino(message) + } + }, + fromProtoMsg( + message: OsmoEquivalentMultiplierRecordProtoMsg + ): OsmoEquivalentMultiplierRecord { + return OsmoEquivalentMultiplierRecord.decode(message.value) + }, + toProto(message: OsmoEquivalentMultiplierRecord): Uint8Array { + return OsmoEquivalentMultiplierRecord.encode(message).finish() + }, + toProtoMsg( + message: OsmoEquivalentMultiplierRecord + ): OsmoEquivalentMultiplierRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.OsmoEquivalentMultiplierRecord', + value: OsmoEquivalentMultiplierRecord.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + OsmoEquivalentMultiplierRecord.typeUrl, + OsmoEquivalentMultiplierRecord +) +GlobalDecoderRegistry.registerAminoProtoMapping( + OsmoEquivalentMultiplierRecord.aminoType, + OsmoEquivalentMultiplierRecord.typeUrl +) +function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { + return { + delegatorAddress: '', + validatorAddress: '', + 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) + } + if (message.validatorAddress !== '') { + writer.uint32(18).string(message.validatorAddress) + } + if (message.delegationAmount !== undefined) { + Coin.encode(message.delegationAmount, writer.uint32(26).fork()).ldelim() + } + if (message.equivalentStakedAmount !== undefined) { + Coin.encode( + message.equivalentStakedAmount, + writer.uint32(34).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SuperfluidDelegationRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSuperfluidDelegationRecord() + 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.delegationAmount = Coin.decode(reader, reader.uint32()) + break + case 4: + message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SuperfluidDelegationRecord { + const message = createBaseSuperfluidDelegationRecord() + message.delegatorAddress = object.delegatorAddress ?? '' + message.validatorAddress = object.validatorAddress ?? '' + message.delegationAmount = + object.delegationAmount !== undefined && object.delegationAmount !== null + ? Coin.fromPartial(object.delegationAmount) + : undefined + message.equivalentStakedAmount = + object.equivalentStakedAmount !== undefined && + object.equivalentStakedAmount !== null + ? Coin.fromPartial(object.equivalentStakedAmount) + : undefined + return message + }, + fromAmino( + object: SuperfluidDelegationRecordAmino + ): SuperfluidDelegationRecord { + 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 = {} + obj.delegator_address = + message.delegatorAddress === '' ? undefined : message.delegatorAddress + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.delegation_amount = message.delegationAmount + ? Coin.toAmino(message.delegationAmount) + : undefined + obj.equivalent_staked_amount = message.equivalentStakedAmount + ? Coin.toAmino(message.equivalentStakedAmount) + : undefined + return obj + }, + fromAminoMsg( + object: SuperfluidDelegationRecordAminoMsg + ): SuperfluidDelegationRecord { + return SuperfluidDelegationRecord.fromAmino(object.value) + }, + toAminoMsg( + message: SuperfluidDelegationRecord + ): SuperfluidDelegationRecordAminoMsg { + return { + type: 'osmosis/superfluid-delegation-record', + value: SuperfluidDelegationRecord.toAmino(message) + } + }, + fromProtoMsg( + message: SuperfluidDelegationRecordProtoMsg + ): SuperfluidDelegationRecord { + return SuperfluidDelegationRecord.decode(message.value) + }, + toProto(message: SuperfluidDelegationRecord): Uint8Array { + return SuperfluidDelegationRecord.encode(message).finish() + }, + toProtoMsg( + message: SuperfluidDelegationRecord + ): SuperfluidDelegationRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.SuperfluidDelegationRecord', + value: SuperfluidDelegationRecord.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SuperfluidDelegationRecord.typeUrl, + SuperfluidDelegationRecord +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SuperfluidDelegationRecord.aminoType, + SuperfluidDelegationRecord.typeUrl +) +function createBaseLockIdIntermediaryAccountConnection(): LockIdIntermediaryAccountConnection { + return { + lockId: BigInt(0), + intermediaryAccount: '' + } +} +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) + } + if (message.intermediaryAccount !== '') { + writer.uint32(18).string(message.intermediaryAccount) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): LockIdIntermediaryAccountConnection { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLockIdIntermediaryAccountConnection() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64() + break + case 2: + message.intermediaryAccount = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): LockIdIntermediaryAccountConnection { + const message = createBaseLockIdIntermediaryAccountConnection() + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + message.intermediaryAccount = object.intermediaryAccount ?? '' + return message + }, + fromAmino( + object: LockIdIntermediaryAccountConnectionAmino + ): LockIdIntermediaryAccountConnection { + 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 = {} + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + obj.intermediary_account = + message.intermediaryAccount === '' + ? undefined + : message.intermediaryAccount + return obj + }, + fromAminoMsg( + object: LockIdIntermediaryAccountConnectionAminoMsg + ): LockIdIntermediaryAccountConnection { + return LockIdIntermediaryAccountConnection.fromAmino(object.value) + }, + toAminoMsg( + message: LockIdIntermediaryAccountConnection + ): LockIdIntermediaryAccountConnectionAminoMsg { + return { + type: 'osmosis/lock-id-intermediary-account-connection', + value: LockIdIntermediaryAccountConnection.toAmino(message) + } + }, + fromProtoMsg( + message: LockIdIntermediaryAccountConnectionProtoMsg + ): LockIdIntermediaryAccountConnection { + return LockIdIntermediaryAccountConnection.decode(message.value) + }, + toProto(message: LockIdIntermediaryAccountConnection): Uint8Array { + return LockIdIntermediaryAccountConnection.encode(message).finish() + }, + toProtoMsg( + message: LockIdIntermediaryAccountConnection + ): LockIdIntermediaryAccountConnectionProtoMsg { + return { + typeUrl: '/osmosis.superfluid.LockIdIntermediaryAccountConnection', + value: LockIdIntermediaryAccountConnection.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + LockIdIntermediaryAccountConnection.typeUrl, + LockIdIntermediaryAccountConnection +) +GlobalDecoderRegistry.registerAminoProtoMapping( + LockIdIntermediaryAccountConnection.aminoType, + LockIdIntermediaryAccountConnection.typeUrl +) +function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { + return { + ids: [] + } +} +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) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UnpoolWhitelistedPools { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUnpoolWhitelistedPools() + 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.ids.push(reader.uint64()) + } + } else { + message.ids.push(reader.uint64()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): UnpoolWhitelistedPools { + const message = createBaseUnpoolWhitelistedPools() + message.ids = object.ids?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino(object: UnpoolWhitelistedPoolsAmino): UnpoolWhitelistedPools { + const message = createBaseUnpoolWhitelistedPools() + message.ids = object.ids?.map((e) => BigInt(e)) || [] + return message + }, + toAmino(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAmino { + const obj: any = {} + if (message.ids) { + obj.ids = message.ids.map((e) => e.toString()) + } else { + obj.ids = message.ids + } + return obj + }, + fromAminoMsg(object: UnpoolWhitelistedPoolsAminoMsg): UnpoolWhitelistedPools { + return UnpoolWhitelistedPools.fromAmino(object.value) + }, + toAminoMsg(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAminoMsg { + return { + type: 'osmosis/unpool-whitelisted-pools', + value: UnpoolWhitelistedPools.toAmino(message) + } + }, + fromProtoMsg( + message: UnpoolWhitelistedPoolsProtoMsg + ): UnpoolWhitelistedPools { + return UnpoolWhitelistedPools.decode(message.value) + }, + toProto(message: UnpoolWhitelistedPools): Uint8Array { + return UnpoolWhitelistedPools.encode(message).finish() + }, + toProtoMsg(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsProtoMsg { + return { + typeUrl: '/osmosis.superfluid.UnpoolWhitelistedPools', + value: UnpoolWhitelistedPools.encode(message).finish() + } + } +} +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: 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) + } + if (message.positionId !== BigInt(0)) { + writer.uint32(16).uint64(message.positionId) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(24).uint64(message.lockId) + } + if (message.syntheticLock !== undefined) { + SyntheticLock.encode( + message.syntheticLock, + writer.uint32(34).fork() + ).ldelim() + } + if (message.delegationAmount !== undefined) { + Coin.encode(message.delegationAmount, writer.uint32(42).fork()).ldelim() + } + if (message.equivalentStakedAmount !== undefined) { + Coin.encode( + message.equivalentStakedAmount, + writer.uint32(50).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ConcentratedPoolUserPositionRecord { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConcentratedPoolUserPositionRecord() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string() + break + case 2: + message.positionId = reader.uint64() + break + case 3: + message.lockId = reader.uint64() + break + case 4: + message.syntheticLock = SyntheticLock.decode(reader, reader.uint32()) + break + case 5: + message.delegationAmount = Coin.decode(reader, reader.uint32()) + break + case 6: + message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ConcentratedPoolUserPositionRecord { + const message = createBaseConcentratedPoolUserPositionRecord() + message.validatorAddress = object.validatorAddress ?? '' + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + message.syntheticLock = + object.syntheticLock !== undefined && object.syntheticLock !== null + ? SyntheticLock.fromPartial(object.syntheticLock) + : undefined + message.delegationAmount = + object.delegationAmount !== undefined && object.delegationAmount !== null + ? Coin.fromPartial(object.delegationAmount) + : undefined + message.equivalentStakedAmount = + object.equivalentStakedAmount !== undefined && + object.equivalentStakedAmount !== null + ? Coin.fromPartial(object.equivalentStakedAmount) + : undefined + return message + }, + fromAmino( + object: ConcentratedPoolUserPositionRecordAmino + ): ConcentratedPoolUserPositionRecord { + 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 = {} + obj.validator_address = + message.validatorAddress === '' ? undefined : message.validatorAddress + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + obj.synthetic_lock = message.syntheticLock + ? SyntheticLock.toAmino(message.syntheticLock) + : undefined + obj.delegation_amount = message.delegationAmount + ? Coin.toAmino(message.delegationAmount) + : undefined + obj.equivalent_staked_amount = message.equivalentStakedAmount + ? Coin.toAmino(message.equivalentStakedAmount) + : undefined + return obj + }, + fromAminoMsg( + object: ConcentratedPoolUserPositionRecordAminoMsg + ): ConcentratedPoolUserPositionRecord { + return ConcentratedPoolUserPositionRecord.fromAmino(object.value) + }, + toAminoMsg( + message: ConcentratedPoolUserPositionRecord + ): ConcentratedPoolUserPositionRecordAminoMsg { + return { + type: 'osmosis/concentrated-pool-user-position-record', + value: ConcentratedPoolUserPositionRecord.toAmino(message) + } + }, + fromProtoMsg( + message: ConcentratedPoolUserPositionRecordProtoMsg + ): ConcentratedPoolUserPositionRecord { + return ConcentratedPoolUserPositionRecord.decode(message.value) + }, + toProto(message: ConcentratedPoolUserPositionRecord): Uint8Array { + return ConcentratedPoolUserPositionRecord.encode(message).finish() + }, + toProtoMsg( + message: ConcentratedPoolUserPositionRecord + ): ConcentratedPoolUserPositionRecordProtoMsg { + return { + typeUrl: '/osmosis.superfluid.ConcentratedPoolUserPositionRecord', + value: ConcentratedPoolUserPositionRecord.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ConcentratedPoolUserPositionRecord.typeUrl, + ConcentratedPoolUserPositionRecord +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ConcentratedPoolUserPositionRecord.aminoType, + ConcentratedPoolUserPositionRecord.typeUrl +) diff --git a/src/proto/osmojs/osmosis/superfluid/tx.amino.ts b/src/proto/osmojs/osmosis/superfluid/tx.amino.ts new file mode 100644 index 0000000..6aa5784 --- /dev/null +++ b/src/proto/osmojs/osmosis/superfluid/tx.amino.ts @@ -0,0 +1,68 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgSuperfluidDelegate, + MsgSuperfluidUndelegate, + MsgSuperfluidUnbondLock, + MsgSuperfluidUndelegateAndUnbondLock, + MsgLockAndSuperfluidDelegate, + MsgCreateFullRangePositionAndSuperfluidDelegate, + MsgUnPoolWhitelistedPool, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, + MsgAddToConcentratedLiquiditySuperfluidPosition, + MsgUnbondConvertAndStake +} from './tx' +export const AminoConverter = { + '/osmosis.superfluid.MsgSuperfluidDelegate': { + aminoType: 'osmosis/superfluid-delegate', + toAmino: MsgSuperfluidDelegate.toAmino, + fromAmino: MsgSuperfluidDelegate.fromAmino + }, + '/osmosis.superfluid.MsgSuperfluidUndelegate': { + aminoType: 'osmosis/superfluid-undelegate', + toAmino: MsgSuperfluidUndelegate.toAmino, + fromAmino: MsgSuperfluidUndelegate.fromAmino + }, + '/osmosis.superfluid.MsgSuperfluidUnbondLock': { + aminoType: 'osmosis/superfluid-unbond-lock', + toAmino: MsgSuperfluidUnbondLock.toAmino, + fromAmino: MsgSuperfluidUnbondLock.fromAmino + }, + '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock': { + aminoType: 'osmosis/superfluid-undelegate-and-unbond-lock', + toAmino: MsgSuperfluidUndelegateAndUnbondLock.toAmino, + fromAmino: MsgSuperfluidUndelegateAndUnbondLock.fromAmino + }, + '/osmosis.superfluid.MsgLockAndSuperfluidDelegate': { + aminoType: 'osmosis/lock-and-superfluid-delegate', + toAmino: MsgLockAndSuperfluidDelegate.toAmino, + fromAmino: MsgLockAndSuperfluidDelegate.fromAmino + }, + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate': { + aminoType: 'osmosis/full-range-and-sf-delegate', + toAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino, + fromAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino + }, + '/osmosis.superfluid.MsgUnPoolWhitelistedPool': { + aminoType: 'osmosis/unpool-whitelisted-pool', + toAmino: MsgUnPoolWhitelistedPool.toAmino, + fromAmino: MsgUnPoolWhitelistedPool.fromAmino + }, + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition': + { + aminoType: 'osmosis/unlock-and-migrate', + toAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino, + fromAmino: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino + }, + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition': { + 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 + } +} diff --git a/src/proto/osmojs/osmosis/superfluid/tx.registry.ts b/src/proto/osmojs/osmosis/superfluid/tx.registry.ts new file mode 100644 index 0000000..eb1a21a --- /dev/null +++ b/src/proto/osmojs/osmosis/superfluid/tx.registry.ts @@ -0,0 +1,278 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.encode(value).finish() + } + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.encode(value).finish() + } + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.encode(value).finish() + } + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.encode(value).finish() + } + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.encode(value).finish() + } + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.encode(value).finish() + } + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.encode(value).finish() + } + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + value + ).finish() + } + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.encode(value).finish() + } + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value: MsgUnbondConvertAndStake.encode(value).finish() + } + } + }, + withTypeUrl: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value + } + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value + } + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value + } + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value + } + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value + } + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value + } + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value + } + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value + } + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value + } + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value + } + } + }, + fromPartial: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.fromPartial(value) + } + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.fromPartial(value) + } + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.fromPartial(value) + } + }, + superfluidUndelegateAndUnbondLock( + value: MsgSuperfluidUndelegateAndUnbondLock + ) { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.fromPartial(value) + } + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.fromPartial(value) + } + }, + createFullRangePositionAndSuperfluidDelegate( + value: MsgCreateFullRangePositionAndSuperfluidDelegate + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.fromPartial(value) + } + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.fromPartial(value) + } + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition( + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromPartial( + value + ) + } + }, + addToConcentratedLiquiditySuperfluidPosition( + value: MsgAddToConcentratedLiquiditySuperfluidPosition + ) { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.fromPartial(value) + } + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: '/osmosis.superfluid.MsgUnbondConvertAndStake', + value: MsgUnbondConvertAndStake.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/superfluid/tx.ts b/src/proto/osmojs/osmosis/superfluid/tx.ts new file mode 100644 index 0000000..e8cd04f --- /dev/null +++ b/src/proto/osmojs/osmosis/superfluid/tx.ts @@ -0,0 +1,3570 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../cosmos/base/v1beta1/coin' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { GlobalDecoderRegistry } from '../../registry' +import { Decimal } from '@cosmjs/math' +import { toTimestamp, fromTimestamp } from '../../../helpers' +export interface MsgSuperfluidDelegate { + sender: string + lockId: bigint + valAddr: string +} +export interface MsgSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate' + value: Uint8Array +} +export interface MsgSuperfluidDelegateAmino { + sender?: string + lock_id?: string + val_addr?: string +} +export interface MsgSuperfluidDelegateAminoMsg { + type: 'osmosis/superfluid-delegate' + value: MsgSuperfluidDelegateAmino +} +export interface MsgSuperfluidDelegateSDKType { + sender: string + lock_id: bigint + val_addr: string +} +export interface MsgSuperfluidDelegateResponse {} +export interface MsgSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegateResponse' + value: Uint8Array +} +export interface MsgSuperfluidDelegateResponseAmino {} +export interface MsgSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/superfluid-delegate-response' + value: MsgSuperfluidDelegateResponseAmino +} +export interface MsgSuperfluidDelegateResponseSDKType {} +export interface MsgSuperfluidUndelegate { + sender: string + lockId: bigint +} +export interface MsgSuperfluidUndelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate' + value: Uint8Array +} +export interface MsgSuperfluidUndelegateAmino { + sender?: string + lock_id?: string +} +export interface MsgSuperfluidUndelegateAminoMsg { + type: 'osmosis/superfluid-undelegate' + value: MsgSuperfluidUndelegateAmino +} +export interface MsgSuperfluidUndelegateSDKType { + sender: string + lock_id: bigint +} +export interface MsgSuperfluidUndelegateResponse {} +export interface MsgSuperfluidUndelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateResponse' + value: Uint8Array +} +export interface MsgSuperfluidUndelegateResponseAmino {} +export interface MsgSuperfluidUndelegateResponseAminoMsg { + type: 'osmosis/superfluid-undelegate-response' + value: MsgSuperfluidUndelegateResponseAmino +} +export interface MsgSuperfluidUndelegateResponseSDKType {} +export interface MsgSuperfluidUnbondLock { + sender: string + lockId: bigint +} +export interface MsgSuperfluidUnbondLockProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock' + value: Uint8Array +} +export interface MsgSuperfluidUnbondLockAmino { + sender?: string + lock_id?: string +} +export interface MsgSuperfluidUnbondLockAminoMsg { + type: 'osmosis/superfluid-unbond-lock' + value: MsgSuperfluidUnbondLockAmino +} +export interface MsgSuperfluidUnbondLockSDKType { + sender: string + lock_id: bigint +} +export interface MsgSuperfluidUnbondLockResponse {} +export interface MsgSuperfluidUnbondLockResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLockResponse' + value: Uint8Array +} +export interface MsgSuperfluidUnbondLockResponseAmino {} +export interface MsgSuperfluidUnbondLockResponseAminoMsg { + type: 'osmosis/superfluid-unbond-lock-response' + value: MsgSuperfluidUnbondLockResponseAmino +} +export interface MsgSuperfluidUnbondLockResponseSDKType {} +export interface MsgSuperfluidUndelegateAndUnbondLock { + sender: string + lockId: bigint + /** Amount of unlocking coin. */ + coin: Coin +} +export interface MsgSuperfluidUndelegateAndUnbondLockProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock' + value: Uint8Array +} +export interface MsgSuperfluidUndelegateAndUnbondLockAmino { + sender?: string + lock_id?: string + /** Amount of unlocking coin. */ + coin?: CoinAmino +} +export interface MsgSuperfluidUndelegateAndUnbondLockAminoMsg { + type: 'osmosis/superfluid-undelegate-and-unbond-lock' + value: MsgSuperfluidUndelegateAndUnbondLockAmino +} +export interface MsgSuperfluidUndelegateAndUnbondLockSDKType { + sender: string + lock_id: bigint + coin: CoinSDKType +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponse { + /** + * lock id of the new lock created for the remaining amount. + * returns the original lockid if the unlocked amount is equal to the + * original lock's amount. + */ + lockId: bigint +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse' + value: Uint8Array +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + /** + * lock id of the new lock created for the remaining amount. + * returns the original lockid if the unlocked amount is equal to the + * original lock's amount. + */ + lock_id?: string +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { + type: 'osmosis/superfluid-undelegate-and-unbond-lock-response' + value: MsgSuperfluidUndelegateAndUnbondLockResponseAmino +} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseSDKType { + lock_id: bigint +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegate { + sender: string + coins: Coin[] + valAddr: string +} +export interface MsgLockAndSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate' + value: Uint8Array +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegateAmino { + sender?: string + coins?: CoinAmino[] + val_addr?: string +} +export interface MsgLockAndSuperfluidDelegateAminoMsg { + type: 'osmosis/lock-and-superfluid-delegate' + value: MsgLockAndSuperfluidDelegateAmino +} +/** + * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, + * and then does a superfluid lock from the newly created lockup, to the + * specified validator addr. + */ +export interface MsgLockAndSuperfluidDelegateSDKType { + sender: string + coins: CoinSDKType[] + val_addr: string +} +export interface MsgLockAndSuperfluidDelegateResponse { + ID: bigint +} +export interface MsgLockAndSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse' + value: Uint8Array +} +export interface MsgLockAndSuperfluidDelegateResponseAmino { + ID?: string +} +export interface MsgLockAndSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/lock-and-superfluid-delegate-response' + value: MsgLockAndSuperfluidDelegateResponseAmino +} +export interface MsgLockAndSuperfluidDelegateResponseSDKType { + ID: bigint +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegate { + sender: string + coins: Coin[] + valAddr: string + poolId: bigint +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { + typeUrl: '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate' + value: Uint8Array +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegateAmino { + sender?: string + coins?: CoinAmino[] + val_addr?: string + pool_id?: string +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { + type: 'osmosis/full-range-and-sf-delegate' + value: MsgCreateFullRangePositionAndSuperfluidDelegateAmino +} +/** + * MsgCreateFullRangePositionAndSuperfluidDelegate creates a full range position + * in a concentrated liquidity pool, then superfluid delegates. + */ +export interface MsgCreateFullRangePositionAndSuperfluidDelegateSDKType { + sender: string + coins: CoinSDKType[] + val_addr: string + pool_id: bigint +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + lockID: bigint + positionID: bigint +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse' + value: Uint8Array +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { + lockID?: string + positionID?: string +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { + type: 'osmosis/create-full-range-position-and-superfluid-delegate-response' + value: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino +} +export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseSDKType { + lockID: bigint + positionID: bigint +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPool { + sender: string + poolId: bigint +} +export interface MsgUnPoolWhitelistedPoolProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool' + value: Uint8Array +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPoolAmino { + sender?: string + pool_id?: string +} +export interface MsgUnPoolWhitelistedPoolAminoMsg { + type: 'osmosis/unpool-whitelisted-pool' + value: MsgUnPoolWhitelistedPoolAmino +} +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPoolSDKType { + sender: string + pool_id: bigint +} +export interface MsgUnPoolWhitelistedPoolResponse { + exitedLockIds: bigint[] +} +export interface MsgUnPoolWhitelistedPoolResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse' + value: Uint8Array +} +export interface MsgUnPoolWhitelistedPoolResponseAmino { + exited_lock_ids?: string[] +} +export interface MsgUnPoolWhitelistedPoolResponseAminoMsg { + type: 'osmosis/un-pool-whitelisted-pool-response' + value: MsgUnPoolWhitelistedPoolResponseAmino +} +export interface MsgUnPoolWhitelistedPoolResponseSDKType { + exited_lock_ids: bigint[] +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + sender: string + lockId: bigint + sharesToMigrate: Coin + /** token_out_mins indicates minimum token to exit Balancer pool with. */ + tokenOutMins: Coin[] +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition' + value: Uint8Array +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { + sender?: string + lock_id?: string + shares_to_migrate?: CoinAmino + /** token_out_mins indicates minimum token to exit Balancer pool with. */ + token_out_mins?: CoinAmino[] +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { + type: 'osmosis/unlock-and-migrate' + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino +} +/** + * ===================== + * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + */ +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionSDKType { + sender: string + lock_id: bigint + shares_to_migrate: CoinSDKType + token_out_mins: CoinSDKType[] +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + amount0: string + amount1: string + liquidityCreated: string + joinTime: Date +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse' + value: Uint8Array +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { + 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' + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino +} +export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseSDKType { + amount0: string + amount1: string + liquidity_created: string + join_time: Date +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPosition { + positionId: bigint + sender: string + tokenDesired0: Coin + tokenDesired1: Coin +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { + typeUrl: '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition' + value: Uint8Array +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPositionAmino { + position_id?: string + sender?: string + token_desired0?: CoinAmino + token_desired1?: CoinAmino +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { + type: 'osmosis/add-to-cl-superfluid-position' + value: MsgAddToConcentratedLiquiditySuperfluidPositionAmino +} +/** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ +export interface MsgAddToConcentratedLiquiditySuperfluidPositionSDKType { + position_id: bigint + sender: string + token_desired0: CoinSDKType + token_desired1: CoinSDKType +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + positionId: bigint + 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. + */ + newLiquidity: string + lockId: bigint +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg { + typeUrl: '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse' + value: Uint8Array +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { + 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 +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { + type: 'osmosis/add-to-concentrated-liquidity-superfluid-position-response' + value: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino +} +export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType { + position_id: bigint + amount0: string + amount1: string + 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: '', + lockId: BigInt(0), + valAddr: '' + } +} +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) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId) + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidDelegate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.lockId = reader.uint64() + break + case 3: + message.valAddr = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSuperfluidDelegate { + const message = createBaseMsgSuperfluidDelegate() + message.sender = object.sender ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + message.valAddr = object.valAddr ?? '' + return message + }, + fromAmino(object: MsgSuperfluidDelegateAmino): MsgSuperfluidDelegate { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr + return obj + }, + fromAminoMsg(object: MsgSuperfluidDelegateAminoMsg): MsgSuperfluidDelegate { + return MsgSuperfluidDelegate.fromAmino(object.value) + }, + toAminoMsg(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/superfluid-delegate', + value: MsgSuperfluidDelegate.toAmino(message) + } + }, + fromProtoMsg(message: MsgSuperfluidDelegateProtoMsg): MsgSuperfluidDelegate { + return MsgSuperfluidDelegate.decode(message.value) + }, + toProto(message: MsgSuperfluidDelegate): Uint8Array { + return MsgSuperfluidDelegate.encode(message).finish() + }, + toProtoMsg(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegate', + value: MsgSuperfluidDelegate.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidDelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSuperfluidDelegateResponse { + const message = createBaseMsgSuperfluidDelegateResponse() + return message + }, + fromAmino( + _: MsgSuperfluidDelegateResponseAmino + ): MsgSuperfluidDelegateResponse { + const message = createBaseMsgSuperfluidDelegateResponse() + return message + }, + toAmino( + _: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSuperfluidDelegateResponseAminoMsg + ): MsgSuperfluidDelegateResponse { + return MsgSuperfluidDelegateResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/superfluid-delegate-response', + value: MsgSuperfluidDelegateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidDelegateResponseProtoMsg + ): MsgSuperfluidDelegateResponse { + return MsgSuperfluidDelegateResponse.decode(message.value) + }, + toProto(message: MsgSuperfluidDelegateResponse): Uint8Array { + return MsgSuperfluidDelegateResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidDelegateResponse + ): MsgSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidDelegateResponse', + value: MsgSuperfluidDelegateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSuperfluidDelegateResponse.typeUrl, + MsgSuperfluidDelegateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidDelegateResponse.aminoType, + MsgSuperfluidDelegateResponse.typeUrl +) +function createBaseMsgSuperfluidUndelegate(): MsgSuperfluidUndelegate { + return { + sender: '', + lockId: BigInt(0) + } +} +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) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUndelegate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.lockId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSuperfluidUndelegate { + const message = createBaseMsgSuperfluidUndelegate() + message.sender = object.sender ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgSuperfluidUndelegateAmino): MsgSuperfluidUndelegate { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAminoMsg + ): MsgSuperfluidUndelegate { + return MsgSuperfluidUndelegate.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUndelegate + ): MsgSuperfluidUndelegateAminoMsg { + return { + type: 'osmosis/superfluid-undelegate', + value: MsgSuperfluidUndelegate.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateProtoMsg + ): MsgSuperfluidUndelegate { + return MsgSuperfluidUndelegate.decode(message.value) + }, + toProto(message: MsgSuperfluidUndelegate): Uint8Array { + return MsgSuperfluidUndelegate.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUndelegate + ): MsgSuperfluidUndelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegate', + value: MsgSuperfluidUndelegate.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUndelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSuperfluidUndelegateResponse { + const message = createBaseMsgSuperfluidUndelegateResponse() + return message + }, + fromAmino( + _: MsgSuperfluidUndelegateResponseAmino + ): MsgSuperfluidUndelegateResponse { + const message = createBaseMsgSuperfluidUndelegateResponse() + return message + }, + toAmino( + _: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateResponseAminoMsg + ): MsgSuperfluidUndelegateResponse { + return MsgSuperfluidUndelegateResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-response', + value: MsgSuperfluidUndelegateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateResponseProtoMsg + ): MsgSuperfluidUndelegateResponse { + return MsgSuperfluidUndelegateResponse.decode(message.value) + }, + toProto(message: MsgSuperfluidUndelegateResponse): Uint8Array { + return MsgSuperfluidUndelegateResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUndelegateResponse + ): MsgSuperfluidUndelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateResponse', + value: MsgSuperfluidUndelegateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateResponse.typeUrl, + MsgSuperfluidUndelegateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateResponse.aminoType, + MsgSuperfluidUndelegateResponse.typeUrl +) +function createBaseMsgSuperfluidUnbondLock(): MsgSuperfluidUnbondLock { + return { + sender: '', + lockId: BigInt(0) + } +} +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) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUnbondLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUnbondLock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.lockId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSuperfluidUnbondLock { + const message = createBaseMsgSuperfluidUnbondLock() + message.sender = object.sender ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgSuperfluidUnbondLockAmino): MsgSuperfluidUnbondLock { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUnbondLockAminoMsg + ): MsgSuperfluidUnbondLock { + return MsgSuperfluidUnbondLock.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUnbondLock + ): MsgSuperfluidUnbondLockAminoMsg { + return { + type: 'osmosis/superfluid-unbond-lock', + value: MsgSuperfluidUnbondLock.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUnbondLockProtoMsg + ): MsgSuperfluidUnbondLock { + return MsgSuperfluidUnbondLock.decode(message.value) + }, + toProto(message: MsgSuperfluidUnbondLock): Uint8Array { + return MsgSuperfluidUnbondLock.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUnbondLock + ): MsgSuperfluidUnbondLockProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLock', + value: MsgSuperfluidUnbondLock.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUnbondLockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUnbondLockResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSuperfluidUnbondLockResponse { + const message = createBaseMsgSuperfluidUnbondLockResponse() + return message + }, + fromAmino( + _: MsgSuperfluidUnbondLockResponseAmino + ): MsgSuperfluidUnbondLockResponse { + const message = createBaseMsgSuperfluidUnbondLockResponse() + return message + }, + toAmino( + _: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUnbondLockResponseAminoMsg + ): MsgSuperfluidUnbondLockResponse { + return MsgSuperfluidUnbondLockResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseAminoMsg { + return { + type: 'osmosis/superfluid-unbond-lock-response', + value: MsgSuperfluidUnbondLockResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUnbondLockResponseProtoMsg + ): MsgSuperfluidUnbondLockResponse { + return MsgSuperfluidUnbondLockResponse.decode(message.value) + }, + toProto(message: MsgSuperfluidUnbondLockResponse): Uint8Array { + return MsgSuperfluidUnbondLockResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUnbondLockResponse + ): MsgSuperfluidUnbondLockResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUnbondLockResponse', + value: MsgSuperfluidUnbondLockResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSuperfluidUnbondLockResponse.typeUrl, + MsgSuperfluidUnbondLockResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUnbondLockResponse.aminoType, + MsgSuperfluidUnbondLockResponse.typeUrl +) +function createBaseMsgSuperfluidUndelegateAndUnbondLock(): MsgSuperfluidUndelegateAndUnbondLock { + return { + sender: '', + lockId: BigInt(0), + 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) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).uint64(message.lockId) + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateAndUnbondLock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.lockId = reader.uint64() + break + case 3: + message.coin = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSuperfluidUndelegateAndUnbondLock { + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock() + message.sender = object.sender ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined + return message + }, + fromAmino( + object: MsgSuperfluidUndelegateAndUnbondLockAmino + ): MsgSuperfluidUndelegateAndUnbondLock { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAndUnbondLockAminoMsg + ): MsgSuperfluidUndelegateAndUnbondLock { + return MsgSuperfluidUndelegateAndUnbondLock.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUndelegateAndUnbondLock + ): MsgSuperfluidUndelegateAndUnbondLockAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-and-unbond-lock', + value: MsgSuperfluidUndelegateAndUnbondLock.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockProtoMsg + ): MsgSuperfluidUndelegateAndUnbondLock { + return MsgSuperfluidUndelegateAndUnbondLock.decode(message.value) + }, + toProto(message: MsgSuperfluidUndelegateAndUnbondLock): Uint8Array { + return MsgSuperfluidUndelegateAndUnbondLock.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLock + ): MsgSuperfluidUndelegateAndUnbondLockProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock', + value: MsgSuperfluidUndelegateAndUnbondLock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateAndUnbondLock.typeUrl, + MsgSuperfluidUndelegateAndUnbondLock +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateAndUnbondLock.aminoType, + MsgSuperfluidUndelegateAndUnbondLock.typeUrl +) +function createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(): MsgSuperfluidUndelegateAndUnbondLockResponse { + return { + lockId: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 = {} + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + return MsgSuperfluidUndelegateAndUnbondLockResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponse + ): MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { + return { + type: 'osmosis/superfluid-undelegate-and-unbond-lock-response', + value: MsgSuperfluidUndelegateAndUnbondLockResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg + ): MsgSuperfluidUndelegateAndUnbondLockResponse { + return MsgSuperfluidUndelegateAndUnbondLockResponse.decode(message.value) + }, + toProto(message: MsgSuperfluidUndelegateAndUnbondLockResponse): Uint8Array { + return MsgSuperfluidUndelegateAndUnbondLockResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSuperfluidUndelegateAndUnbondLockResponse + ): MsgSuperfluidUndelegateAndUnbondLockResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse', + value: + MsgSuperfluidUndelegateAndUnbondLockResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl, + MsgSuperfluidUndelegateAndUnbondLockResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSuperfluidUndelegateAndUnbondLockResponse.aminoType, + MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl +) +function createBaseMsgLockAndSuperfluidDelegate(): MsgLockAndSuperfluidDelegate { + return { + sender: '', + coins: [], + valAddr: '' + } +} +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) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockAndSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgLockAndSuperfluidDelegate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + case 3: + message.valAddr = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgLockAndSuperfluidDelegate { + const message = createBaseMsgLockAndSuperfluidDelegate() + message.sender = object.sender ?? '' + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + message.valAddr = object.valAddr ?? '' + return message + }, + fromAmino( + object: MsgLockAndSuperfluidDelegateAmino + ): MsgLockAndSuperfluidDelegate { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr + return obj + }, + fromAminoMsg( + object: MsgLockAndSuperfluidDelegateAminoMsg + ): MsgLockAndSuperfluidDelegate { + return MsgLockAndSuperfluidDelegate.fromAmino(object.value) + }, + toAminoMsg( + message: MsgLockAndSuperfluidDelegate + ): MsgLockAndSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/lock-and-superfluid-delegate', + value: MsgLockAndSuperfluidDelegate.toAmino(message) + } + }, + fromProtoMsg( + message: MsgLockAndSuperfluidDelegateProtoMsg + ): MsgLockAndSuperfluidDelegate { + return MsgLockAndSuperfluidDelegate.decode(message.value) + }, + toProto(message: MsgLockAndSuperfluidDelegate): Uint8Array { + return MsgLockAndSuperfluidDelegate.encode(message).finish() + }, + toProtoMsg( + message: MsgLockAndSuperfluidDelegate + ): MsgLockAndSuperfluidDelegateProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegate', + value: MsgLockAndSuperfluidDelegate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgLockAndSuperfluidDelegate.typeUrl, + MsgLockAndSuperfluidDelegate +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockAndSuperfluidDelegate.aminoType, + MsgLockAndSuperfluidDelegate.typeUrl +) +function createBaseMsgLockAndSuperfluidDelegateResponse(): MsgLockAndSuperfluidDelegateResponse { + return { + ID: BigInt(0) + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgLockAndSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgLockAndSuperfluidDelegateResponse() + 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 + ): MsgLockAndSuperfluidDelegateResponse { + const message = createBaseMsgLockAndSuperfluidDelegateResponse() + message.ID = + object.ID !== undefined && object.ID !== null + ? BigInt(object.ID.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgLockAndSuperfluidDelegateResponseAmino + ): MsgLockAndSuperfluidDelegateResponse { + const message = createBaseMsgLockAndSuperfluidDelegateResponse() + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID) + } + return message + }, + toAmino( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseAmino { + const obj: any = {} + obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgLockAndSuperfluidDelegateResponseAminoMsg + ): MsgLockAndSuperfluidDelegateResponse { + return MsgLockAndSuperfluidDelegateResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/lock-and-superfluid-delegate-response', + value: MsgLockAndSuperfluidDelegateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgLockAndSuperfluidDelegateResponseProtoMsg + ): MsgLockAndSuperfluidDelegateResponse { + return MsgLockAndSuperfluidDelegateResponse.decode(message.value) + }, + toProto(message: MsgLockAndSuperfluidDelegateResponse): Uint8Array { + return MsgLockAndSuperfluidDelegateResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgLockAndSuperfluidDelegateResponse + ): MsgLockAndSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse', + value: MsgLockAndSuperfluidDelegateResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgLockAndSuperfluidDelegateResponse.typeUrl, + MsgLockAndSuperfluidDelegateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgLockAndSuperfluidDelegateResponse.aminoType, + MsgLockAndSuperfluidDelegateResponse.typeUrl +) +function createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(): MsgCreateFullRangePositionAndSuperfluidDelegate { + return { + sender: '', + coins: [], + valAddr: '', + poolId: BigInt(0) + } +} +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) + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.valAddr !== '') { + writer.uint32(26).string(message.valAddr) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(32).uint64(message.poolId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())) + break + case 3: + message.valAddr = reader.string() + break + case 4: + message.poolId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate() + message.sender = object.sender ?? '' + message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || [] + message.valAddr = object.valAddr ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgCreateFullRangePositionAndSuperfluidDelegateAmino + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)) + } else { + obj.coins = message.coins + } + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + return MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { + return { + type: 'osmosis/full-range-and-sf-delegate', + value: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegate { + return MsgCreateFullRangePositionAndSuperfluidDelegate.decode(message.value) + }, + toProto( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): Uint8Array { + return MsgCreateFullRangePositionAndSuperfluidDelegate.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegate + ): MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate', + value: + MsgCreateFullRangePositionAndSuperfluidDelegate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl, + MsgCreateFullRangePositionAndSuperfluidDelegate +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateFullRangePositionAndSuperfluidDelegate.aminoType, + MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl +) +function createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return { + lockID: BigInt(0), + positionID: BigInt(0) + } +} +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) + } + if (message.positionID !== BigInt(0)) { + writer.uint32(16).uint64(message.positionID) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = + createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.lockID = reader.uint64() + break + case 2: + message.positionID = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + const message = + createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse() + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0) + message.positionID = + object.positionID !== undefined && object.positionID !== null + ? BigInt(object.positionID.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + 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 = {} + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined + obj.positionID = + message.positionID !== BigInt(0) + ? message.positionID.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { + return { + type: 'osmosis/create-full-range-position-and-superfluid-delegate-response', + value: + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.decode( + message.value + ) + }, + toProto( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): Uint8Array { + return MsgCreateFullRangePositionAndSuperfluidDelegateResponse.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse + ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse', + value: + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.encode( + message + ).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl, + MsgCreateFullRangePositionAndSuperfluidDelegateResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.aminoType, + MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl +) +function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { + return { + sender: '', + poolId: BigInt(0) + } +} +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) + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnPoolWhitelistedPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUnPoolWhitelistedPool() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.poolId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgUnPoolWhitelistedPool { + const message = createBaseMsgUnPoolWhitelistedPool() + message.sender = object.sender ?? '' + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgUnPoolWhitelistedPoolAmino): MsgUnPoolWhitelistedPool { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.pool_id = + message.poolId !== BigInt(0) ? message.poolId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgUnPoolWhitelistedPoolAminoMsg + ): MsgUnPoolWhitelistedPool { + return MsgUnPoolWhitelistedPool.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUnPoolWhitelistedPool + ): MsgUnPoolWhitelistedPoolAminoMsg { + return { + type: 'osmosis/unpool-whitelisted-pool', + value: MsgUnPoolWhitelistedPool.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUnPoolWhitelistedPoolProtoMsg + ): MsgUnPoolWhitelistedPool { + return MsgUnPoolWhitelistedPool.decode(message.value) + }, + toProto(message: MsgUnPoolWhitelistedPool): Uint8Array { + return MsgUnPoolWhitelistedPool.encode(message).finish() + }, + toProtoMsg( + message: MsgUnPoolWhitelistedPool + ): MsgUnPoolWhitelistedPoolProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPool', + value: MsgUnPoolWhitelistedPool.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUnPoolWhitelistedPool.typeUrl, + MsgUnPoolWhitelistedPool +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnPoolWhitelistedPool.aminoType, + MsgUnPoolWhitelistedPool.typeUrl +) +function createBaseMsgUnPoolWhitelistedPoolResponse(): MsgUnPoolWhitelistedPoolResponse { + return { + exitedLockIds: [] + } +} +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) { + writer.uint64(v) + } + writer.ldelim() + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnPoolWhitelistedPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUnPoolWhitelistedPoolResponse() + 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.exitedLockIds.push(reader.uint64()) + } + } else { + message.exitedLockIds.push(reader.uint64()) + } + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgUnPoolWhitelistedPoolResponse { + const message = createBaseMsgUnPoolWhitelistedPoolResponse() + message.exitedLockIds = + object.exitedLockIds?.map((e) => BigInt(e.toString())) || [] + return message + }, + fromAmino( + object: MsgUnPoolWhitelistedPoolResponseAmino + ): MsgUnPoolWhitelistedPoolResponse { + const message = createBaseMsgUnPoolWhitelistedPoolResponse() + message.exitedLockIds = object.exited_lock_ids?.map((e) => BigInt(e)) || [] + return message + }, + toAmino( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseAmino { + const obj: any = {} + if (message.exitedLockIds) { + obj.exited_lock_ids = message.exitedLockIds.map((e) => e.toString()) + } else { + obj.exited_lock_ids = message.exitedLockIds + } + return obj + }, + fromAminoMsg( + object: MsgUnPoolWhitelistedPoolResponseAminoMsg + ): MsgUnPoolWhitelistedPoolResponse { + return MsgUnPoolWhitelistedPoolResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseAminoMsg { + return { + type: 'osmosis/un-pool-whitelisted-pool-response', + value: MsgUnPoolWhitelistedPoolResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUnPoolWhitelistedPoolResponseProtoMsg + ): MsgUnPoolWhitelistedPoolResponse { + return MsgUnPoolWhitelistedPoolResponse.decode(message.value) + }, + toProto(message: MsgUnPoolWhitelistedPoolResponse): Uint8Array { + return MsgUnPoolWhitelistedPoolResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUnPoolWhitelistedPoolResponse + ): MsgUnPoolWhitelistedPoolResponseProtoMsg { + return { + typeUrl: '/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse', + value: MsgUnPoolWhitelistedPoolResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUnPoolWhitelistedPoolResponse.typeUrl, + MsgUnPoolWhitelistedPoolResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnPoolWhitelistedPoolResponse.aminoType, + MsgUnPoolWhitelistedPoolResponse.typeUrl +) +function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return { + sender: '', + lockId: BigInt(0), + 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) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(16).int64(message.lockId) + } + if (message.sharesToMigrate !== undefined) { + Coin.encode(message.sharesToMigrate, writer.uint32(26).fork()).ldelim() + } + for (const v of message.tokenOutMins) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.lockId = reader.int64() + break + case 3: + message.sharesToMigrate = Coin.decode(reader, reader.uint32()) + break + case 4: + message.tokenOutMins.push(Coin.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition() + message.sender = object.sender ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + message.sharesToMigrate = + object.sharesToMigrate !== undefined && object.sharesToMigrate !== null + ? Coin.fromPartial(object.sharesToMigrate) + : undefined + message.tokenOutMins = + object.tokenOutMins?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + obj.shares_to_migrate = message.sharesToMigrate + ? Coin.toAmino(message.sharesToMigrate) + : undefined + if (message.tokenOutMins) { + obj.token_out_mins = message.tokenOutMins.map((e) => + e ? Coin.toAmino(e) : undefined + ) + } else { + obj.token_out_mins = message.tokenOutMins + } + return obj + }, + fromAminoMsg( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { + return { + type: 'osmosis/unlock-and-migrate', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino( + message + ) + } + }, + fromProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.decode( + message.value + ) + }, + toProto( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): Uint8Array { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode( + message + ).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.aminoType, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl +) +function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return { + amount0: '', + amount1: '', + liquidityCreated: '', + 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) + } + if (message.amount1 !== '') { + writer.uint32(18).string(message.amount1) + } + if (message.liquidityCreated !== '') { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.liquidityCreated, 18).atomics) + } + if (message.joinTime !== undefined) { + Timestamp.encode( + toTimestamp(message.joinTime), + writer.uint32(34).fork() + ).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.amount0 = reader.string() + break + case 2: + message.amount1 = reader.string() + break + case 3: + message.liquidityCreated = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 4: + message.joinTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + const message = + createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse() + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + message.liquidityCreated = object.liquidityCreated ?? '' + message.joinTime = object.joinTime ?? undefined + return message + }, + fromAmino( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + 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 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + obj.liquidity_created = + message.liquidityCreated === '' ? undefined : message.liquidityCreated + obj.join_time = message.joinTime + ? Timestamp.toAmino(toTimestamp(message.joinTime)) + : undefined + return obj + }, + fromAminoMsg( + object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { + return { + type: 'osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.toAmino( + message + ) + } + }, + fromProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.decode( + message.value + ) + }, + toProto( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): Uint8Array { + return MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse + ): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse', + value: + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.encode( + message + ).finish() + } + } + } +GlobalDecoderRegistry.register( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.aminoType, + MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl +) +function createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(): MsgAddToConcentratedLiquiditySuperfluidPosition { + return { + positionId: BigInt(0), + sender: '', + 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) + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + if (message.tokenDesired0 !== undefined) { + Coin.encode(message.tokenDesired0, writer.uint32(26).fork()).ldelim() + } + if (message.tokenDesired1 !== undefined) { + Coin.encode(message.tokenDesired1, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.sender = reader.string() + break + case 3: + message.tokenDesired0 = Coin.decode(reader, reader.uint32()) + break + case 4: + message.tokenDesired1 = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.sender = object.sender ?? '' + message.tokenDesired0 = + object.tokenDesired0 !== undefined && object.tokenDesired0 !== null + ? Coin.fromPartial(object.tokenDesired0) + : undefined + message.tokenDesired1 = + object.tokenDesired1 !== undefined && object.tokenDesired1 !== null + ? Coin.fromPartial(object.tokenDesired1) + : undefined + return message + }, + fromAmino( + object: MsgAddToConcentratedLiquiditySuperfluidPositionAmino + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.sender = message.sender === '' ? undefined : message.sender + obj.token_desired0 = message.tokenDesired0 + ? Coin.toAmino(message.tokenDesired0) + : undefined + obj.token_desired1 = message.tokenDesired1 + ? Coin.toAmino(message.tokenDesired1) + : undefined + return obj + }, + fromAminoMsg( + object: MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + return MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { + return { + type: 'osmosis/add-to-cl-superfluid-position', + value: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPosition { + return MsgAddToConcentratedLiquiditySuperfluidPosition.decode(message.value) + }, + toProto( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): Uint8Array { + return MsgAddToConcentratedLiquiditySuperfluidPosition.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPosition + ): MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition', + value: + MsgAddToConcentratedLiquiditySuperfluidPosition.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl, + MsgAddToConcentratedLiquiditySuperfluidPosition +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgAddToConcentratedLiquiditySuperfluidPosition.aminoType, + MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl +) +function createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return { + positionId: BigInt(0), + amount0: '', + amount1: '', + newLiquidity: '', + lockId: BigInt(0) + } +} +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) + } + if (message.amount0 !== '') { + writer.uint32(18).string(message.amount0) + } + if (message.amount1 !== '') { + writer.uint32(26).string(message.amount1) + } + if (message.newLiquidity !== '') { + writer + .uint32(42) + .string(Decimal.fromUserInput(message.newLiquidity, 18).atomics) + } + if (message.lockId !== BigInt(0)) { + writer.uint32(32).uint64(message.lockId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = + createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64() + break + case 2: + message.amount0 = reader.string() + break + case 3: + message.amount1 = reader.string() + break + case 5: + message.newLiquidity = Decimal.fromAtomics( + reader.string(), + 18 + ).toString() + break + case 4: + message.lockId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + const message = + createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse() + message.positionId = + object.positionId !== undefined && object.positionId !== null + ? BigInt(object.positionId.toString()) + : BigInt(0) + message.amount0 = object.amount0 ?? '' + message.amount1 = object.amount1 ?? '' + message.newLiquidity = object.newLiquidity ?? '' + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? BigInt(object.lockId.toString()) + : BigInt(0) + return message + }, + fromAmino( + object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + 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 = {} + obj.position_id = + message.positionId !== BigInt(0) + ? message.positionId.toString() + : undefined + obj.amount0 = message.amount0 === '' ? undefined : message.amount0 + obj.amount1 = message.amount1 === '' ? undefined : message.amount1 + obj.new_liquidity = + message.newLiquidity === '' ? undefined : message.newLiquidity + obj.lock_id = + message.lockId !== BigInt(0) ? message.lockId.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.fromAmino( + object.value + ) + }, + toAminoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { + return { + type: 'osmosis/add-to-concentrated-liquidity-superfluid-position-response', + value: + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode( + message.value + ) + }, + toProto( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): Uint8Array { + return MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode( + message + ).finish() + }, + toProtoMsg( + message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse + ): MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg { + return { + typeUrl: + '/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse', + value: + MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode( + message + ).finish() + } + } +} +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 + }, + 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 !== BigInt(0) ? message.lockId.toString() : undefined + obj.sender = message.sender === '' ? undefined : message.sender + obj.val_addr = message.valAddr === '' ? undefined : message.valAddr + obj.min_amt_to_stake = + message.minAmtToStake === '' ? undefined : 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 + }, + 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 === '' ? undefined : 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 +) diff --git a/src/proto/osmojs/osmosis/superfluid/v1beta1/gov.ts b/src/proto/osmojs/osmosis/superfluid/v1beta1/gov.ts new file mode 100644 index 0000000..3a09bed --- /dev/null +++ b/src/proto/osmojs/osmosis/superfluid/v1beta1/gov.ts @@ -0,0 +1,630 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + SuperfluidAsset, + SuperfluidAssetAmino, + SuperfluidAssetSDKType +} from '../superfluid' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal' + title: string + description: string + assets: SuperfluidAsset[] +} +export interface SetSuperfluidAssetsProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal' + value: Uint8Array +} +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposalAmino { + title?: string + description?: string + assets?: SuperfluidAssetAmino[] +} +export interface SetSuperfluidAssetsProposalAminoMsg { + type: 'osmosis/set-superfluid-assets-proposal' + value: SetSuperfluidAssetsProposalAmino +} +/** + * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid + * assets + */ +export interface SetSuperfluidAssetsProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal' + title: string + description: string + assets: SuperfluidAssetSDKType[] +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal' + title: string + description: string + superfluidAssetDenoms: string[] +} +export interface RemoveSuperfluidAssetsProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal' + value: Uint8Array +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposalAmino { + title?: string + description?: string + superfluid_asset_denoms?: string[] +} +export interface RemoveSuperfluidAssetsProposalAminoMsg { + type: 'osmosis/del-superfluid-assets-proposal' + value: RemoveSuperfluidAssetsProposalAmino +} +/** + * RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid + * assets by denom + */ +export interface RemoveSuperfluidAssetsProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal' + title: string + description: string + superfluid_asset_denoms: string[] +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposal { + $typeUrl?: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal' + title: string + description: string + ids: bigint[] + isOverwrite: boolean +} +export interface UpdateUnpoolWhiteListProposalProtoMsg { + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal' + value: Uint8Array +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposalAmino { + title?: string + description?: string + ids?: string[] + is_overwrite?: boolean +} +export interface UpdateUnpoolWhiteListProposalAminoMsg { + type: 'osmosis/update-unpool-whitelist' + value: UpdateUnpoolWhiteListProposalAmino +} +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposalSDKType { + $typeUrl?: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal' + title: string + description: string + ids: bigint[] + is_overwrite: boolean +} +function createBaseSetSuperfluidAssetsProposal(): SetSuperfluidAssetsProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + title: '', + description: '', + assets: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.assets) { + SuperfluidAsset.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): SetSuperfluidAssetsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSetSuperfluidAssetsProposal() + 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.assets.push(SuperfluidAsset.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): SetSuperfluidAssetsProposal { + const message = createBaseSetSuperfluidAssetsProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.assets = + object.assets?.map((e) => SuperfluidAsset.fromPartial(e)) || [] + return message + }, + fromAmino( + object: SetSuperfluidAssetsProposalAmino + ): SetSuperfluidAssetsProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.assets) { + obj.assets = message.assets.map((e) => + e ? SuperfluidAsset.toAmino(e) : undefined + ) + } else { + obj.assets = message.assets + } + return obj + }, + fromAminoMsg( + object: SetSuperfluidAssetsProposalAminoMsg + ): SetSuperfluidAssetsProposal { + return SetSuperfluidAssetsProposal.fromAmino(object.value) + }, + toAminoMsg( + message: SetSuperfluidAssetsProposal + ): SetSuperfluidAssetsProposalAminoMsg { + return { + type: 'osmosis/set-superfluid-assets-proposal', + value: SetSuperfluidAssetsProposal.toAmino(message) + } + }, + fromProtoMsg( + message: SetSuperfluidAssetsProposalProtoMsg + ): SetSuperfluidAssetsProposal { + return SetSuperfluidAssetsProposal.decode(message.value) + }, + toProto(message: SetSuperfluidAssetsProposal): Uint8Array { + return SetSuperfluidAssetsProposal.encode(message).finish() + }, + toProtoMsg( + message: SetSuperfluidAssetsProposal + ): SetSuperfluidAssetsProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + value: SetSuperfluidAssetsProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + SetSuperfluidAssetsProposal.typeUrl, + SetSuperfluidAssetsProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + SetSuperfluidAssetsProposal.aminoType, + SetSuperfluidAssetsProposal.typeUrl +) +function createBaseRemoveSuperfluidAssetsProposal(): RemoveSuperfluidAssetsProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + title: '', + description: '', + superfluidAssetDenoms: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.superfluidAssetDenoms) { + writer.uint32(26).string(v!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RemoveSuperfluidAssetsProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRemoveSuperfluidAssetsProposal() + 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.superfluidAssetDenoms.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): RemoveSuperfluidAssetsProposal { + const message = createBaseRemoveSuperfluidAssetsProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.superfluidAssetDenoms = + object.superfluidAssetDenoms?.map((e) => e) || [] + return message + }, + fromAmino( + object: RemoveSuperfluidAssetsProposalAmino + ): RemoveSuperfluidAssetsProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.superfluidAssetDenoms) { + obj.superfluid_asset_denoms = message.superfluidAssetDenoms.map((e) => e) + } else { + obj.superfluid_asset_denoms = message.superfluidAssetDenoms + } + return obj + }, + fromAminoMsg( + object: RemoveSuperfluidAssetsProposalAminoMsg + ): RemoveSuperfluidAssetsProposal { + return RemoveSuperfluidAssetsProposal.fromAmino(object.value) + }, + toAminoMsg( + message: RemoveSuperfluidAssetsProposal + ): RemoveSuperfluidAssetsProposalAminoMsg { + return { + type: 'osmosis/del-superfluid-assets-proposal', + value: RemoveSuperfluidAssetsProposal.toAmino(message) + } + }, + fromProtoMsg( + message: RemoveSuperfluidAssetsProposalProtoMsg + ): RemoveSuperfluidAssetsProposal { + return RemoveSuperfluidAssetsProposal.decode(message.value) + }, + toProto(message: RemoveSuperfluidAssetsProposal): Uint8Array { + return RemoveSuperfluidAssetsProposal.encode(message).finish() + }, + toProtoMsg( + message: RemoveSuperfluidAssetsProposal + ): RemoveSuperfluidAssetsProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + value: RemoveSuperfluidAssetsProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RemoveSuperfluidAssetsProposal.typeUrl, + RemoveSuperfluidAssetsProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + RemoveSuperfluidAssetsProposal.aminoType, + RemoveSuperfluidAssetsProposal.typeUrl +) +function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposal { + return { + $typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + title: '', + description: '', + ids: [], + isOverwrite: false + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + writer.uint32(26).fork() + for (const v of message.ids) { + writer.uint64(v) + } + writer.ldelim() + if (message.isOverwrite === true) { + writer.uint32(32).bool(message.isOverwrite) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateUnpoolWhiteListProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdateUnpoolWhiteListProposal() + 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: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.ids.push(reader.uint64()) + } + } else { + message.ids.push(reader.uint64()) + } + break + case 4: + message.isOverwrite = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): UpdateUnpoolWhiteListProposal { + const message = createBaseUpdateUnpoolWhiteListProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.ids = object.ids?.map((e) => BigInt(e.toString())) || [] + message.isOverwrite = object.isOverwrite ?? false + return message + }, + fromAmino( + object: UpdateUnpoolWhiteListProposalAmino + ): UpdateUnpoolWhiteListProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.ids) { + obj.ids = message.ids.map((e) => e.toString()) + } else { + obj.ids = message.ids + } + obj.is_overwrite = + message.isOverwrite === false ? undefined : message.isOverwrite + return obj + }, + fromAminoMsg( + object: UpdateUnpoolWhiteListProposalAminoMsg + ): UpdateUnpoolWhiteListProposal { + return UpdateUnpoolWhiteListProposal.fromAmino(object.value) + }, + toAminoMsg( + message: UpdateUnpoolWhiteListProposal + ): UpdateUnpoolWhiteListProposalAminoMsg { + return { + type: 'osmosis/update-unpool-whitelist', + value: UpdateUnpoolWhiteListProposal.toAmino(message) + } + }, + fromProtoMsg( + message: UpdateUnpoolWhiteListProposalProtoMsg + ): UpdateUnpoolWhiteListProposal { + return UpdateUnpoolWhiteListProposal.decode(message.value) + }, + toProto(message: UpdateUnpoolWhiteListProposal): Uint8Array { + return UpdateUnpoolWhiteListProposal.encode(message).finish() + }, + toProtoMsg( + message: UpdateUnpoolWhiteListProposal + ): UpdateUnpoolWhiteListProposalProtoMsg { + return { + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + value: UpdateUnpoolWhiteListProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + UpdateUnpoolWhiteListProposal.typeUrl, + UpdateUnpoolWhiteListProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateUnpoolWhiteListProposal.aminoType, + UpdateUnpoolWhiteListProposal.typeUrl +) diff --git a/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.amino.ts new file mode 100644 index 0000000..4ccb891 --- /dev/null +++ b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgCreateDenom, + MsgMint, + MsgBurn, + MsgChangeAdmin, + MsgSetDenomMetadata, + MsgSetBeforeSendHook, + MsgForceTransfer +} from './tx' +export const AminoConverter = { + '/osmosis.tokenfactory.v1beta1.MsgCreateDenom': { + aminoType: 'osmosis/tokenfactory/create-denom', + toAmino: MsgCreateDenom.toAmino, + fromAmino: MsgCreateDenom.fromAmino + }, + '/osmosis.tokenfactory.v1beta1.MsgMint': { + aminoType: 'osmosis/tokenfactory/mint', + toAmino: MsgMint.toAmino, + fromAmino: MsgMint.fromAmino + }, + '/osmosis.tokenfactory.v1beta1.MsgBurn': { + aminoType: 'osmosis/tokenfactory/burn', + toAmino: MsgBurn.toAmino, + fromAmino: MsgBurn.fromAmino + }, + '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin': { + aminoType: 'osmosis/tokenfactory/change-admin', + toAmino: MsgChangeAdmin.toAmino, + fromAmino: MsgChangeAdmin.fromAmino + }, + '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata': { + aminoType: 'osmosis/tokenfactory/set-denom-metadata', + 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, + fromAmino: MsgForceTransfer.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.registry.ts new file mode 100644 index 0000000..da3d24a --- /dev/null +++ b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -0,0 +1,160 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.encode(value).finish() + } + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.encode(value).finish() + } + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.encode(value).finish() + } + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.encode(value).finish() + } + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + 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', + value: MsgForceTransfer.encode(value).finish() + } + } + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value + } + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value + } + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value + } + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value + } + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value + } + }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook', + value + } + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value + } + } + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.fromPartial(value) + } + }, + mint(value: MsgMint) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.fromPartial(value) + } + }, + burn(value: MsgBurn) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.fromPartial(value) + } + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.fromPartial(value) + } + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + 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', + value: MsgForceTransfer.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.ts b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.ts new file mode 100644 index 0000000..0acdf56 --- /dev/null +++ b/src/proto/osmojs/osmosis/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,1954 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { + Metadata, + MetadataAmino, + MetadataSDKType +} from '../../../cosmos/bank/v1beta1/bank' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenom { + sender: string + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom: string +} +export interface MsgCreateDenomProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom' + value: Uint8Array +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomAmino { + sender?: string + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom?: string +} +export interface MsgCreateDenomAminoMsg { + type: 'osmosis/tokenfactory/create-denom' + value: MsgCreateDenomAmino +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomSDKType { + sender: string + subdenom: string +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponse { + newTokenDenom: string +} +export interface MsgCreateDenomResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse' + value: Uint8Array +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseAmino { + new_token_denom?: string +} +export interface MsgCreateDenomResponseAminoMsg { + type: 'osmosis/tokenfactory/create-denom-response' + value: MsgCreateDenomResponseAmino +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseSDKType { + new_token_denom: string +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * 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 + amount: Coin + mintToAddress: string +} +export interface MsgMintProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint' + value: Uint8Array +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * 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 + amount?: CoinAmino + mintToAddress: string +} +export interface MsgMintAminoMsg { + type: 'osmosis/tokenfactory/mint' + value: MsgMintAmino +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * 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 + amount: CoinSDKType + mintToAddress: string +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMintResponse' + value: Uint8Array +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: 'osmosis/tokenfactory/mint-response' + value: MsgMintResponseAmino +} +export interface MsgMintResponseSDKType {} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * 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 + amount: Coin + burnFromAddress: string +} +export interface MsgBurnProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn' + value: Uint8Array +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * 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 + amount?: CoinAmino + burnFromAddress: string +} +export interface MsgBurnAminoMsg { + type: 'osmosis/tokenfactory/burn' + value: MsgBurnAmino +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * 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 + amount: CoinSDKType + burnFromAddress: string +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurnResponse' + value: Uint8Array +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: 'osmosis/tokenfactory/burn-response' + value: MsgBurnResponseAmino +} +export interface MsgBurnResponseSDKType {} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdmin { + sender: string + denom: string + newAdmin: string +} +export interface MsgChangeAdminProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin' + value: Uint8Array +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminAmino { + sender?: string + denom?: string + new_admin?: string +} +export interface MsgChangeAdminAminoMsg { + type: 'osmosis/tokenfactory/change-admin' + value: MsgChangeAdminAmino +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminSDKType { + sender: string + denom: string + new_admin: string +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse' + value: Uint8Array +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: 'osmosis/tokenfactory/change-admin-response' + value: MsgChangeAdminResponseAmino +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * 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 + */ +export interface MsgSetDenomMetadata { + sender: string + metadata: Metadata +} +export interface MsgSetDenomMetadataProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata' + value: Uint8Array +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataAmino { + sender?: string + metadata?: MetadataAmino +} +export interface MsgSetDenomMetadataAminoMsg { + type: 'osmosis/tokenfactory/set-denom-metadata' + value: MsgSetDenomMetadataAmino +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataSDKType { + sender: string + metadata: MetadataSDKType +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse' + value: Uint8Array +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseAmino {} +export interface MsgSetDenomMetadataResponseAminoMsg { + type: 'osmosis/tokenfactory/set-denom-metadata-response' + value: MsgSetDenomMetadataResponseAmino +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseSDKType {} +export interface MsgForceTransfer { + sender: string + amount: Coin + transferFromAddress: string + transferToAddress: string +} +export interface MsgForceTransferProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer' + value: Uint8Array +} +export interface MsgForceTransferAmino { + sender?: string + amount?: CoinAmino + transferFromAddress?: string + transferToAddress?: string +} +export interface MsgForceTransferAminoMsg { + type: 'osmosis/tokenfactory/force-transfer' + value: MsgForceTransferAmino +} +export interface MsgForceTransferSDKType { + sender: string + amount: CoinSDKType + transferFromAddress: string + transferToAddress: string +} +export interface MsgForceTransferResponse {} +export interface MsgForceTransferResponseProtoMsg { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse' + value: Uint8Array +} +export interface MsgForceTransferResponseAmino {} +export interface MsgForceTransferResponseAminoMsg { + type: 'osmosis/tokenfactory/force-transfer-response' + value: MsgForceTransferResponseAmino +} +export interface MsgForceTransferResponseSDKType {} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: '', + subdenom: '' + } +} +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) + } + if (message.subdenom !== '') { + writer.uint32(18).string(message.subdenom) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDenom { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateDenom() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.subdenom = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateDenom { + const message = createBaseMsgCreateDenom() + message.sender = object.sender ?? '' + message.subdenom = object.subdenom ?? '' + return message + }, + fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.subdenom = message.subdenom === '' ? undefined : message.subdenom + return obj + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateDenom): MsgCreateDenomAminoMsg { + return { + type: 'osmosis/tokenfactory/create-denom', + value: MsgCreateDenom.toAmino(message) + } + }, + fromProtoMsg(message: MsgCreateDenomProtoMsg): MsgCreateDenom { + return MsgCreateDenom.decode(message.value) + }, + toProto(message: MsgCreateDenom): Uint8Array { + return MsgCreateDenom.encode(message).finish() + }, + toProtoMsg(message: MsgCreateDenom): MsgCreateDenomProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenom', + value: MsgCreateDenom.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgCreateDenom.typeUrl, MsgCreateDenom) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateDenom.aminoType, + MsgCreateDenom.typeUrl +) +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgCreateDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCreateDenomResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.newTokenDenom = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse() + message.newTokenDenom = object.newTokenDenom ?? '' + return message + }, + fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { + 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 = {} + obj.new_token_denom = + message.newTokenDenom === '' ? undefined : message.newTokenDenom + return obj + }, + fromAminoMsg(object: MsgCreateDenomResponseAminoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/create-denom-response', + value: MsgCreateDenomResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgCreateDenomResponseProtoMsg + ): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value) + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish() + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse', + value: MsgCreateDenomResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgCreateDenomResponse.typeUrl, + MsgCreateDenomResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgCreateDenomResponse.aminoType, + MsgCreateDenomResponse.typeUrl +) +function createBaseMsgMint(): MsgMint { + return { + sender: '', + 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) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim() + } + if (message.mintToAddress !== '') { + writer.uint32(26).string(message.mintToAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMint { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMint() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.amount = Coin.decode(reader, reader.uint32()) + break + case 3: + message.mintToAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgMint { + const message = createBaseMsgMint() + message.sender = object.sender ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + message.mintToAddress = object.mintToAddress ?? '' + return message + }, + fromAmino(object: MsgMintAmino): MsgMint { + 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 === '' ? undefined : message.sender + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined + obj.mintToAddress = message.mintToAddress ?? '' + return obj + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value) + }, + toAminoMsg(message: MsgMint): MsgMintAminoMsg { + return { + type: 'osmosis/tokenfactory/mint', + value: MsgMint.toAmino(message) + } + }, + fromProtoMsg(message: MsgMintProtoMsg): MsgMint { + return MsgMint.decode(message.value) + }, + toProto(message: MsgMint): Uint8Array { + return MsgMint.encode(message).finish() + }, + toProtoMsg(message: MsgMint): MsgMintProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMint', + value: MsgMint.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMintResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgMintResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgMintResponse { + const message = createBaseMsgMintResponse() + return message + }, + fromAmino(_: MsgMintResponseAmino): MsgMintResponse { + const message = createBaseMsgMintResponse() + return message + }, + toAmino(_: MsgMintResponse): MsgMintResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgMintResponseAminoMsg): MsgMintResponse { + return MsgMintResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgMintResponse): MsgMintResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/mint-response', + value: MsgMintResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgMintResponseProtoMsg): MsgMintResponse { + return MsgMintResponse.decode(message.value) + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish() + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgMintResponse', + value: MsgMintResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgMintResponse.typeUrl, MsgMintResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgMintResponse.aminoType, + MsgMintResponse.typeUrl +) +function createBaseMsgBurn(): MsgBurn { + return { + sender: '', + 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) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim() + } + if (message.burnFromAddress !== '') { + writer.uint32(26).string(message.burnFromAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurn { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBurn() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.amount = Coin.decode(reader, reader.uint32()) + break + case 3: + message.burnFromAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgBurn { + const message = createBaseMsgBurn() + message.sender = object.sender ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + message.burnFromAddress = object.burnFromAddress ?? '' + return message + }, + fromAmino(object: MsgBurnAmino): MsgBurn { + 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 === '' ? undefined : message.sender + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined + obj.burnFromAddress = message.burnFromAddress ?? '' + return obj + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value) + }, + toAminoMsg(message: MsgBurn): MsgBurnAminoMsg { + return { + type: 'osmosis/tokenfactory/burn', + value: MsgBurn.toAmino(message) + } + }, + fromProtoMsg(message: MsgBurnProtoMsg): MsgBurn { + return MsgBurn.decode(message.value) + }, + toProto(message: MsgBurn): Uint8Array { + return MsgBurn.encode(message).finish() + }, + toProtoMsg(message: MsgBurn): MsgBurnProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurn', + value: MsgBurn.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgBurnResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgBurnResponse { + const message = createBaseMsgBurnResponse() + return message + }, + fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { + const message = createBaseMsgBurnResponse() + return message + }, + toAmino(_: MsgBurnResponse): MsgBurnResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgBurnResponseAminoMsg): MsgBurnResponse { + return MsgBurnResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgBurnResponse): MsgBurnResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/burn-response', + value: MsgBurnResponse.toAmino(message) + } + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg): MsgBurnResponse { + return MsgBurnResponse.decode(message.value) + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish() + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgBurnResponse', + value: MsgBurnResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgBurnResponse.typeUrl, MsgBurnResponse) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgBurnResponse.aminoType, + MsgBurnResponse.typeUrl +) +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: '', + denom: '', + newAdmin: '' + } +} +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) + } + if (message.denom !== '') { + writer.uint32(18).string(message.denom) + } + if (message.newAdmin !== '') { + writer.uint32(26).string(message.newAdmin) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeAdmin { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChangeAdmin() + 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.newAdmin = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin() + message.sender = object.sender ?? '' + message.denom = object.denom ?? '' + message.newAdmin = object.newAdmin ?? '' + return message + }, + fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.denom = message.denom === '' ? undefined : message.denom + obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin + return obj + }, + fromAminoMsg(object: MsgChangeAdminAminoMsg): MsgChangeAdmin { + return MsgChangeAdmin.fromAmino(object.value) + }, + toAminoMsg(message: MsgChangeAdmin): MsgChangeAdminAminoMsg { + return { + type: 'osmosis/tokenfactory/change-admin', + value: MsgChangeAdmin.toAmino(message) + } + }, + fromProtoMsg(message: MsgChangeAdminProtoMsg): MsgChangeAdmin { + return MsgChangeAdmin.decode(message.value) + }, + toProto(message: MsgChangeAdmin): Uint8Array { + return MsgChangeAdmin.encode(message).finish() + }, + toProtoMsg(message: MsgChangeAdmin): MsgChangeAdminProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdmin', + value: MsgChangeAdmin.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgChangeAdminResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgChangeAdminResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse() + return message + }, + fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse() + return message + }, + toAmino(_: MsgChangeAdminResponse): MsgChangeAdminResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgChangeAdminResponseAminoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.fromAmino(object.value) + }, + toAminoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/change-admin-response', + value: MsgChangeAdminResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgChangeAdminResponseProtoMsg + ): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value) + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish() + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse', + value: MsgChangeAdminResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : message.sender + obj.denom = message.denom === '' ? undefined : 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 + }, + 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: '', + metadata: Metadata.fromPartial({}) + } +} +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) + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomMetadata { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetDenomMetadata() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.metadata = Metadata.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata() + message.sender = object.sender ?? '' + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? Metadata.fromPartial(object.metadata) + : undefined + return message + }, + fromAmino(object: MsgSetDenomMetadataAmino): MsgSetDenomMetadata { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.metadata = message.metadata + ? Metadata.toAmino(message.metadata) + : undefined + return obj + }, + fromAminoMsg(object: MsgSetDenomMetadataAminoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataAminoMsg { + return { + type: 'osmosis/tokenfactory/set-denom-metadata', + value: MsgSetDenomMetadata.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetDenomMetadataProtoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.decode(message.value) + }, + toProto(message: MsgSetDenomMetadata): Uint8Array { + return MsgSetDenomMetadata.encode(message).finish() + }, + toProtoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata', + value: MsgSetDenomMetadata.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetDenomMetadataResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetDenomMetadataResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse() + return message + }, + fromAmino(_: MsgSetDenomMetadataResponseAmino): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse() + return message + }, + toAmino(_: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetDenomMetadataResponseAminoMsg + ): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetDenomMetadataResponse + ): MsgSetDenomMetadataResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/set-denom-metadata-response', + value: MsgSetDenomMetadataResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetDenomMetadataResponseProtoMsg + ): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.decode(message.value) + }, + toProto(message: MsgSetDenomMetadataResponse): Uint8Array { + return MsgSetDenomMetadataResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetDenomMetadataResponse + ): MsgSetDenomMetadataResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse', + value: MsgSetDenomMetadataResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetDenomMetadataResponse.typeUrl, + MsgSetDenomMetadataResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetDenomMetadataResponse.aminoType, + MsgSetDenomMetadataResponse.typeUrl +) +function createBaseMsgForceTransfer(): MsgForceTransfer { + return { + sender: '', + 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) + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim() + } + if (message.transferFromAddress !== '') { + writer.uint32(26).string(message.transferFromAddress) + } + if (message.transferToAddress !== '') { + writer.uint32(34).string(message.transferToAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceTransfer { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgForceTransfer() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.sender = reader.string() + break + case 2: + message.amount = Coin.decode(reader, reader.uint32()) + break + case 3: + message.transferFromAddress = reader.string() + break + case 4: + message.transferToAddress = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgForceTransfer { + const message = createBaseMsgForceTransfer() + message.sender = object.sender ?? '' + message.amount = + object.amount !== undefined && object.amount !== null + ? Coin.fromPartial(object.amount) + : undefined + message.transferFromAddress = object.transferFromAddress ?? '' + message.transferToAddress = object.transferToAddress ?? '' + return message + }, + fromAmino(object: MsgForceTransferAmino): MsgForceTransfer { + 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 = {} + obj.sender = message.sender === '' ? undefined : message.sender + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined + obj.transferFromAddress = + message.transferFromAddress === '' + ? undefined + : message.transferFromAddress + obj.transferToAddress = + message.transferToAddress === '' ? undefined : message.transferToAddress + return obj + }, + fromAminoMsg(object: MsgForceTransferAminoMsg): MsgForceTransfer { + return MsgForceTransfer.fromAmino(object.value) + }, + toAminoMsg(message: MsgForceTransfer): MsgForceTransferAminoMsg { + return { + type: 'osmosis/tokenfactory/force-transfer', + value: MsgForceTransfer.toAmino(message) + } + }, + fromProtoMsg(message: MsgForceTransferProtoMsg): MsgForceTransfer { + return MsgForceTransfer.decode(message.value) + }, + toProto(message: MsgForceTransfer): Uint8Array { + return MsgForceTransfer.encode(message).finish() + }, + toProtoMsg(message: MsgForceTransfer): MsgForceTransferProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransfer', + value: MsgForceTransfer.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgForceTransferResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgForceTransferResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse() + return message + }, + fromAmino(_: MsgForceTransferResponseAmino): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse() + return message + }, + toAmino(_: MsgForceTransferResponse): MsgForceTransferResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgForceTransferResponseAminoMsg + ): MsgForceTransferResponse { + return MsgForceTransferResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgForceTransferResponse + ): MsgForceTransferResponseAminoMsg { + return { + type: 'osmosis/tokenfactory/force-transfer-response', + value: MsgForceTransferResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgForceTransferResponseProtoMsg + ): MsgForceTransferResponse { + return MsgForceTransferResponse.decode(message.value) + }, + toProto(message: MsgForceTransferResponse): Uint8Array { + return MsgForceTransferResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgForceTransferResponse + ): MsgForceTransferResponseProtoMsg { + return { + typeUrl: '/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse', + value: MsgForceTransferResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgForceTransferResponse.typeUrl, + MsgForceTransferResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgForceTransferResponse.aminoType, + MsgForceTransferResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/txfees/v1beta1/feetoken.ts b/src/proto/osmojs/osmosis/txfees/v1beta1/feetoken.ts new file mode 100644 index 0000000..8c1f0ca --- /dev/null +++ b/src/proto/osmojs/osmosis/txfees/v1beta1/feetoken.ts @@ -0,0 +1,160 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +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. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeToken { + denom: string + poolID: bigint +} +export interface FeeTokenProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.FeeToken' + value: Uint8Array +} +/** + * 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. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeTokenAmino { + denom?: string + poolID?: string +} +export interface FeeTokenAminoMsg { + type: 'osmosis/txfees/fee-token' + value: FeeTokenAmino +} +/** + * 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. + * Its price in osmo is derived through looking at the provided pool ID. + * The pool ID must have osmo as one of its assets. + */ +export interface FeeTokenSDKType { + denom: string + poolID: bigint +} +function createBaseFeeToken(): FeeToken { + return { + denom: '', + poolID: BigInt(0) + } +} +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) + } + if (message.poolID !== BigInt(0)) { + writer.uint32(16).uint64(message.poolID) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): FeeToken { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseFeeToken() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.denom = reader.string() + break + case 2: + message.poolID = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): FeeToken { + const message = createBaseFeeToken() + message.denom = object.denom ?? '' + message.poolID = + object.poolID !== undefined && object.poolID !== null + ? BigInt(object.poolID.toString()) + : BigInt(0) + return message + }, + fromAmino(object: FeeTokenAmino): FeeToken { + 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 = {} + obj.denom = message.denom === '' ? undefined : message.denom + obj.poolID = + message.poolID !== BigInt(0) ? message.poolID.toString() : undefined + return obj + }, + fromAminoMsg(object: FeeTokenAminoMsg): FeeToken { + return FeeToken.fromAmino(object.value) + }, + toAminoMsg(message: FeeToken): FeeTokenAminoMsg { + return { + type: 'osmosis/txfees/fee-token', + value: FeeToken.toAmino(message) + } + }, + fromProtoMsg(message: FeeTokenProtoMsg): FeeToken { + return FeeToken.decode(message.value) + }, + toProto(message: FeeToken): Uint8Array { + return FeeToken.encode(message).finish() + }, + toProtoMsg(message: FeeToken): FeeTokenProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.FeeToken', + value: FeeToken.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(FeeToken.typeUrl, FeeToken) +GlobalDecoderRegistry.registerAminoProtoMapping( + FeeToken.aminoType, + FeeToken.typeUrl +) diff --git a/src/proto/osmojs/osmosis/txfees/v1beta1/gov.ts b/src/proto/osmojs/osmosis/txfees/v1beta1/gov.ts new file mode 100644 index 0000000..4ebbf85 --- /dev/null +++ b/src/proto/osmojs/osmosis/txfees/v1beta1/gov.ts @@ -0,0 +1,202 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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 + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposal { + $typeUrl?: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal' + title: string + description: string + feetokens: FeeToken[] +} +export interface UpdateFeeTokenProposalProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal' + value: Uint8Array +} +/** + * 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 + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposalAmino { + title?: string + description?: string + feetokens?: FeeTokenAmino[] +} +export interface UpdateFeeTokenProposalAminoMsg { + type: 'osmosis/UpdateFeeTokenProposal' + value: UpdateFeeTokenProposalAmino +} +/** + * 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 + * price calculator. It can be used to add new denoms to the whitelist. It can + * also be used to update the Pool to associate with the denom. If Pool ID is + * set to 0, it will remove the denom from the whitelisted set. + */ +export interface UpdateFeeTokenProposalSDKType { + $typeUrl?: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal' + title: string + description: string + feetokens: FeeTokenSDKType[] +} +function createBaseUpdateFeeTokenProposal(): UpdateFeeTokenProposal { + return { + $typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + title: '', + description: '', + feetokens: [] + } +} +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) + } + if (message.description !== '') { + writer.uint32(18).string(message.description) + } + for (const v of message.feetokens) { + FeeToken.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): UpdateFeeTokenProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseUpdateFeeTokenProposal() + 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.feetokens.push(FeeToken.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): UpdateFeeTokenProposal { + const message = createBaseUpdateFeeTokenProposal() + message.title = object.title ?? '' + message.description = object.description ?? '' + message.feetokens = + object.feetokens?.map((e) => FeeToken.fromPartial(e)) || [] + return message + }, + fromAmino(object: UpdateFeeTokenProposalAmino): UpdateFeeTokenProposal { + 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 = {} + obj.title = message.title === '' ? undefined : message.title + obj.description = + message.description === '' ? undefined : message.description + if (message.feetokens) { + obj.feetokens = message.feetokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ) + } else { + obj.feetokens = message.feetokens + } + return obj + }, + fromAminoMsg(object: UpdateFeeTokenProposalAminoMsg): UpdateFeeTokenProposal { + return UpdateFeeTokenProposal.fromAmino(object.value) + }, + toAminoMsg(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAminoMsg { + return { + type: 'osmosis/UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.toAmino(message) + } + }, + fromProtoMsg( + message: UpdateFeeTokenProposalProtoMsg + ): UpdateFeeTokenProposal { + return UpdateFeeTokenProposal.decode(message.value) + }, + toProto(message: UpdateFeeTokenProposal): Uint8Array { + return UpdateFeeTokenProposal.encode(message).finish() + }, + toProtoMsg(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + UpdateFeeTokenProposal.typeUrl, + UpdateFeeTokenProposal +) +GlobalDecoderRegistry.registerAminoProtoMapping( + UpdateFeeTokenProposal.aminoType, + UpdateFeeTokenProposal.typeUrl +) diff --git a/src/proto/osmojs/osmosis/txfees/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.amino.ts new file mode 100644 index 0000000..f216cbb --- /dev/null +++ b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.amino.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { MsgSetFeeTokens } from './tx' +export const AminoConverter = { + '/osmosis.txfees.v1beta1.MsgSetFeeTokens': { + aminoType: 'osmosis/set-fee-tokens', + toAmino: MsgSetFeeTokens.toAmino, + fromAmino: MsgSetFeeTokens.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/txfees/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.registry.ts new file mode 100644 index 0000000..8ce64a7 --- /dev/null +++ b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.registry.ts @@ -0,0 +1,38 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +import { MsgSetFeeTokens } from './tx' +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ['/osmosis.txfees.v1beta1.MsgSetFeeTokens', MsgSetFeeTokens] +] +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod) + }) +} +export const MessageComposer = { + encoded: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.encode(value).finish() + } + } + }, + withTypeUrl: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value + } + } + }, + fromPartial: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/txfees/v1beta1/tx.ts b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.ts new file mode 100644 index 0000000..54561e5 --- /dev/null +++ b/src/proto/osmojs/osmosis/txfees/v1beta1/tx.ts @@ -0,0 +1,254 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from './feetoken' +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { GlobalDecoderRegistry } from '../../../registry' +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokens { + feeTokens: FeeToken[] + sender: string +} +export interface MsgSetFeeTokensProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens' + value: Uint8Array +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensAmino { + fee_tokens?: FeeTokenAmino[] + sender?: string +} +export interface MsgSetFeeTokensAminoMsg { + type: 'osmosis/set-fee-tokens' + value: MsgSetFeeTokensAmino +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensSDKType { + fee_tokens: FeeTokenSDKType[] + sender: string +} +export interface MsgSetFeeTokensResponse {} +export interface MsgSetFeeTokensResponseProtoMsg { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse' + value: Uint8Array +} +export interface MsgSetFeeTokensResponseAmino {} +export interface MsgSetFeeTokensResponseAminoMsg { + type: 'osmosis/txfees/set-fee-tokens-response' + value: MsgSetFeeTokensResponseAmino +} +export interface MsgSetFeeTokensResponseSDKType {} +function createBaseMsgSetFeeTokens(): MsgSetFeeTokens { + return { + feeTokens: [], + sender: '' + } +} +export const MsgSetFeeTokens = { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + aminoType: 'osmosis/set-fee-tokens', + is(o: any): o is MsgSetFeeTokens { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.feeTokens) && + (!o.feeTokens.length || FeeToken.is(o.feeTokens[0])) && + typeof o.sender === 'string')) + ) + }, + isSDK(o: any): o is MsgSetFeeTokensSDKType { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isSDK(o.fee_tokens[0])) && + typeof o.sender === 'string')) + ) + }, + isAmino(o: any): o is MsgSetFeeTokensAmino { + return ( + o && + (o.$typeUrl === MsgSetFeeTokens.typeUrl || + (Array.isArray(o.fee_tokens) && + (!o.fee_tokens.length || FeeToken.isAmino(o.fee_tokens[0])) && + typeof o.sender === 'string')) + ) + }, + encode( + message: MsgSetFeeTokens, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.feeTokens) { + FeeToken.encode(v!, writer.uint32(10).fork()).ldelim() + } + if (message.sender !== '') { + writer.uint32(18).string(message.sender) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetFeeTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetFeeTokens() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.feeTokens.push(FeeToken.decode(reader, reader.uint32())) + break + case 2: + message.sender = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens() + message.feeTokens = + object.feeTokens?.map((e) => FeeToken.fromPartial(e)) || [] + message.sender = object.sender ?? '' + return message + }, + fromAmino(object: MsgSetFeeTokensAmino): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens() + message.feeTokens = + object.fee_tokens?.map((e) => FeeToken.fromAmino(e)) || [] + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender + } + return message + }, + toAmino(message: MsgSetFeeTokens): MsgSetFeeTokensAmino { + const obj: any = {} + if (message.feeTokens) { + obj.fee_tokens = message.feeTokens.map((e) => + e ? FeeToken.toAmino(e) : undefined + ) + } else { + obj.fee_tokens = message.feeTokens + } + obj.sender = message.sender === '' ? undefined : message.sender + return obj + }, + fromAminoMsg(object: MsgSetFeeTokensAminoMsg): MsgSetFeeTokens { + return MsgSetFeeTokens.fromAmino(object.value) + }, + toAminoMsg(message: MsgSetFeeTokens): MsgSetFeeTokensAminoMsg { + return { + type: 'osmosis/set-fee-tokens', + value: MsgSetFeeTokens.toAmino(message) + } + }, + fromProtoMsg(message: MsgSetFeeTokensProtoMsg): MsgSetFeeTokens { + return MsgSetFeeTokens.decode(message.value) + }, + toProto(message: MsgSetFeeTokens): Uint8Array { + return MsgSetFeeTokens.encode(message).finish() + }, + toProtoMsg(message: MsgSetFeeTokens): MsgSetFeeTokensProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokens', + value: MsgSetFeeTokens.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(MsgSetFeeTokens.typeUrl, MsgSetFeeTokens) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetFeeTokens.aminoType, + MsgSetFeeTokens.typeUrl +) +function createBaseMsgSetFeeTokensResponse(): MsgSetFeeTokensResponse { + return {} +} +export const MsgSetFeeTokensResponse = { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse', + aminoType: 'osmosis/txfees/set-fee-tokens-response', + is(o: any): o is MsgSetFeeTokensResponse { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl + }, + isSDK(o: any): o is MsgSetFeeTokensResponseSDKType { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl + }, + isAmino(o: any): o is MsgSetFeeTokensResponseAmino { + return o && o.$typeUrl === MsgSetFeeTokensResponse.typeUrl + }, + encode( + _: MsgSetFeeTokensResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetFeeTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetFeeTokensResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse() + return message + }, + fromAmino(_: MsgSetFeeTokensResponseAmino): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse() + return message + }, + toAmino(_: MsgSetFeeTokensResponse): MsgSetFeeTokensResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetFeeTokensResponseAminoMsg + ): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetFeeTokensResponse + ): MsgSetFeeTokensResponseAminoMsg { + return { + type: 'osmosis/txfees/set-fee-tokens-response', + value: MsgSetFeeTokensResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetFeeTokensResponseProtoMsg + ): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.decode(message.value) + }, + toProto(message: MsgSetFeeTokensResponse): Uint8Array { + return MsgSetFeeTokensResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetFeeTokensResponse + ): MsgSetFeeTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse', + value: MsgSetFeeTokensResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetFeeTokensResponse.typeUrl, + MsgSetFeeTokensResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetFeeTokensResponse.aminoType, + MsgSetFeeTokensResponse.typeUrl +) diff --git a/src/proto/osmojs/osmosis/valsetpref/v1beta1/state.ts b/src/proto/osmojs/osmosis/valsetpref/v1beta1/state.ts new file mode 100644 index 0000000..759636a --- /dev/null +++ b/src/proto/osmojs/osmosis/valsetpref/v1beta1/state.ts @@ -0,0 +1,347 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../../binary' +import { Decimal } from '@cosmjs/math' +import { GlobalDecoderRegistry } from '../../../registry' +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreference { + /** + * val_oper_address holds the validator address the user wants to delegate + * funds to. + */ + valOperAddress: string + /** weight is decimal between 0 and 1, and they all sum to 1. */ + weight: string +} +export interface ValidatorPreferenceProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorPreference' + value: Uint8Array +} +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreferenceAmino { + /** + * val_oper_address holds the validator address the user wants to delegate + * funds to. + */ + val_oper_address?: string + /** weight is decimal between 0 and 1, and they all sum to 1. */ + weight?: string +} +export interface ValidatorPreferenceAminoMsg { + type: 'osmosis/valsetpref/validator-preference' + value: ValidatorPreferenceAmino +} +/** + * ValidatorPreference defines the message structure for + * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in + * state. If a user does not have a validator set preference list set, and has + * staked, make their preference list default to their current staking + * distribution. + */ +export interface ValidatorPreferenceSDKType { + val_oper_address: string + weight: string +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferences { + /** preference holds {valAddr, weight} for the user who created it. */ + preferences: ValidatorPreference[] +} +export interface ValidatorSetPreferencesProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorSetPreferences' + value: Uint8Array +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferencesAmino { + /** preference holds {valAddr, weight} for the user who created it. */ + preferences?: ValidatorPreferenceAmino[] +} +export interface ValidatorSetPreferencesAminoMsg { + type: 'osmosis/valsetpref/validator-set-preferences' + value: ValidatorSetPreferencesAmino +} +/** + * ValidatorSetPreferences defines a delegator's validator set preference. + * It contains a list of (validator, percent_allocation) pairs. + * The percent allocation are arranged in decimal notation from 0 to 1 and must + * add up to 1. + */ +export interface ValidatorSetPreferencesSDKType { + preferences: ValidatorPreferenceSDKType[] +} +function createBaseValidatorPreference(): ValidatorPreference { + return { + valOperAddress: '', + weight: '' + } +} +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) + } + if (message.weight !== '') { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.weight, 18).atomics) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorPreference { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorPreference() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.valOperAddress = reader.string() + break + case 2: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorPreference { + const message = createBaseValidatorPreference() + message.valOperAddress = object.valOperAddress ?? '' + message.weight = object.weight ?? '' + return message + }, + fromAmino(object: ValidatorPreferenceAmino): ValidatorPreference { + 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 = {} + obj.val_oper_address = + message.valOperAddress === '' ? undefined : message.valOperAddress + obj.weight = message.weight === '' ? undefined : message.weight + return obj + }, + fromAminoMsg(object: ValidatorPreferenceAminoMsg): ValidatorPreference { + return ValidatorPreference.fromAmino(object.value) + }, + toAminoMsg(message: ValidatorPreference): ValidatorPreferenceAminoMsg { + return { + type: 'osmosis/valsetpref/validator-preference', + value: ValidatorPreference.toAmino(message) + } + }, + fromProtoMsg(message: ValidatorPreferenceProtoMsg): ValidatorPreference { + return ValidatorPreference.decode(message.value) + }, + toProto(message: ValidatorPreference): Uint8Array { + return ValidatorPreference.encode(message).finish() + }, + toProtoMsg(message: ValidatorPreference): ValidatorPreferenceProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorPreference', + value: ValidatorPreference.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValidatorPreference.typeUrl, ValidatorPreference) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorPreference.aminoType, + ValidatorPreference.typeUrl +) +function createBaseValidatorSetPreferences(): ValidatorSetPreferences { + return { + preferences: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ValidatorSetPreferences { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSetPreferences() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ValidatorSetPreferences { + const message = createBaseValidatorSetPreferences() + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || [] + return message + }, + fromAmino(object: ValidatorSetPreferencesAmino): ValidatorSetPreferences { + const message = createBaseValidatorSetPreferences() + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromAmino(e)) || [] + return message + }, + toAmino(message: ValidatorSetPreferences): ValidatorSetPreferencesAmino { + const obj: any = {} + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ) + } else { + obj.preferences = message.preferences + } + return obj + }, + fromAminoMsg( + object: ValidatorSetPreferencesAminoMsg + ): ValidatorSetPreferences { + return ValidatorSetPreferences.fromAmino(object.value) + }, + toAminoMsg( + message: ValidatorSetPreferences + ): ValidatorSetPreferencesAminoMsg { + return { + type: 'osmosis/valsetpref/validator-set-preferences', + value: ValidatorSetPreferences.toAmino(message) + } + }, + fromProtoMsg( + message: ValidatorSetPreferencesProtoMsg + ): ValidatorSetPreferences { + return ValidatorSetPreferences.decode(message.value) + }, + toProto(message: ValidatorSetPreferences): Uint8Array { + return ValidatorSetPreferences.encode(message).finish() + }, + toProtoMsg( + message: ValidatorSetPreferences + ): ValidatorSetPreferencesProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.ValidatorSetPreferences', + value: ValidatorSetPreferences.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ValidatorSetPreferences.typeUrl, + ValidatorSetPreferences +) +GlobalDecoderRegistry.registerAminoProtoMapping( + ValidatorSetPreferences.aminoType, + ValidatorSetPreferences.typeUrl +) diff --git a/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.amino.ts b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.amino.ts new file mode 100644 index 0000000..4f55605 --- /dev/null +++ b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.amino.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + MsgSetValidatorSetPreference, + MsgDelegateToValidatorSet, + MsgUndelegateFromValidatorSet, + MsgUndelegateFromRebalancedValidatorSet, + MsgRedelegateValidatorSet, + MsgWithdrawDelegationRewards, + MsgDelegateBondedTokens +} from './tx' +export const AminoConverter = { + '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference': { + aminoType: 'osmosis/MsgSetValidatorSetPreference', + toAmino: MsgSetValidatorSetPreference.toAmino, + fromAmino: MsgSetValidatorSetPreference.fromAmino + }, + '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet': { + aminoType: 'osmosis/MsgDelegateToValidatorSet', + toAmino: MsgDelegateToValidatorSet.toAmino, + fromAmino: MsgDelegateToValidatorSet.fromAmino + }, + '/osmosis.valsetpref.v1beta1.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/MsgRedelegateValidatorSet', + toAmino: MsgRedelegateValidatorSet.toAmino, + fromAmino: MsgRedelegateValidatorSet.fromAmino + }, + '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards': { + aminoType: 'osmosis/MsgWithdrawDelegationRewards', + toAmino: MsgWithdrawDelegationRewards.toAmino, + fromAmino: MsgWithdrawDelegationRewards.fromAmino + }, + '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens': { + aminoType: 'osmosis/valsetpref/delegate-bonded-tokens', + toAmino: MsgDelegateBondedTokens.toAmino, + fromAmino: MsgDelegateBondedTokens.fromAmino + } +} diff --git a/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.registry.ts b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.registry.ts new file mode 100644 index 0000000..4a380f4 --- /dev/null +++ b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.registry.ts @@ -0,0 +1,190 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { GeneratedType, Registry } from '@cosmjs/proto-signing' +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) + }) +} +export const MessageComposer = { + encoded: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.encode(value).finish() + } + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.encode(value).finish() + } + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + 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', + value: MsgRedelegateValidatorSet.encode(value).finish() + } + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.encode(value).finish() + } + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.encode(value).finish() + } + } + }, + withTypeUrl: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value + } + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value + } + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value + } + }, + undelegateFromRebalancedValidatorSet( + value: MsgUndelegateFromRebalancedValidatorSet + ) { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet', + value + } + }, + redelegateValidatorSet(value: MsgRedelegateValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value + } + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value + } + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value + } + } + }, + fromPartial: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.fromPartial(value) + } + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.fromPartial(value) + } + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + 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', + value: MsgRedelegateValidatorSet.fromPartial(value) + } + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.fromPartial(value) + } + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.fromPartial(value) + } + } + } +} diff --git a/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.ts b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.ts new file mode 100644 index 0000000..200ecf0 --- /dev/null +++ b/src/proto/osmojs/osmosis/valsetpref/v1beta1/tx.ts @@ -0,0 +1,1966 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + ValidatorPreference, + ValidatorPreferenceAmino, + ValidatorPreferenceSDKType +} from './state' +import { Coin, CoinAmino, CoinSDKType } from '../../../cosmos/base/v1beta1/coin' +import { BinaryReader, BinaryWriter } from '../../../../binary' +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. */ + delegator: string + /** list of {valAddr, weight} to delegate to */ + preferences: ValidatorPreference[] +} +export interface MsgSetValidatorSetPreferenceProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference' + value: Uint8Array +} +/** 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 + /** list of {valAddr, weight} to delegate to */ + preferences?: ValidatorPreferenceAmino[] +} +export interface MsgSetValidatorSetPreferenceAminoMsg { + type: 'osmosis/MsgSetValidatorSetPreference' + value: MsgSetValidatorSetPreferenceAmino +} +/** MsgCreateValidatorSetPreference is a list that holds validator-set. */ +export interface MsgSetValidatorSetPreferenceSDKType { + delegator: string + preferences: ValidatorPreferenceSDKType[] +} +export interface MsgSetValidatorSetPreferenceResponse {} +export interface MsgSetValidatorSetPreferenceResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse' + value: Uint8Array +} +export interface MsgSetValidatorSetPreferenceResponseAmino {} +export interface MsgSetValidatorSetPreferenceResponseAminoMsg { + type: 'osmosis/valsetpref/set-validator-set-preference-response' + value: MsgSetValidatorSetPreferenceResponseAmino +} +export interface MsgSetValidatorSetPreferenceResponseSDKType {} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSet { + /** delegator is the user who is trying to delegate. */ + 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 + * -> 0.2} our staking logic would attempt to delegate 5osmo to A , 3osmo to + * B, 2osmo to C. + */ + coin: Coin +} +export interface MsgDelegateToValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet' + value: Uint8Array +} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSetAmino { + /** delegator is the user who is trying to delegate. */ + 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 + * -> 0.2} our staking logic would attempt to delegate 5osmo to A , 3osmo to + * B, 2osmo to C. + */ + coin?: CoinAmino +} +export interface MsgDelegateToValidatorSetAminoMsg { + type: 'osmosis/MsgDelegateToValidatorSet' + value: MsgDelegateToValidatorSetAmino +} +/** + * MsgDelegateToValidatorSet allows users to delegate to an existing + * validator-set + */ +export interface MsgDelegateToValidatorSetSDKType { + delegator: string + coin: CoinSDKType +} +export interface MsgDelegateToValidatorSetResponse {} +export interface MsgDelegateToValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse' + value: Uint8Array +} +export interface MsgDelegateToValidatorSetResponseAmino {} +export interface MsgDelegateToValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/delegate-to-validator-set-response' + value: MsgDelegateToValidatorSetResponseAmino +} +export interface MsgDelegateToValidatorSetResponseSDKType {} +export interface MsgUndelegateFromValidatorSet { + /** delegator is the user who is trying to undelegate. */ + delegator: string + /** + * the amount the user wants to undelegate + * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, + * ValC + * -> 0.2} our undelegate logic would attempt to undelegate 5osmo from A , + * 3osmo from B, 2osmo from C + */ + coin: Coin +} +export interface MsgUndelegateFromValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet' + value: Uint8Array +} +export interface MsgUndelegateFromValidatorSetAmino { + /** delegator is the user who is trying to undelegate. */ + delegator?: string + /** + * the amount the user wants to undelegate + * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, + * ValC + * -> 0.2} our undelegate logic would attempt to undelegate 5osmo from A , + * 3osmo from B, 2osmo from C + */ + coin?: CoinAmino +} +export interface MsgUndelegateFromValidatorSetAminoMsg { + type: 'osmosis/MsgUndelegateFromValidatorSet' + value: MsgUndelegateFromValidatorSetAmino +} +export interface MsgUndelegateFromValidatorSetSDKType { + delegator: string + coin: CoinSDKType +} +export interface MsgUndelegateFromValidatorSetResponse {} +export interface MsgUndelegateFromValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse' + value: Uint8Array +} +export interface MsgUndelegateFromValidatorSetResponseAmino {} +export interface MsgUndelegateFromValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/undelegate-from-validator-set-response' + 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 + /** list of {valAddr, weight} to delegate to */ + preferences: ValidatorPreference[] +} +export interface MsgRedelegateValidatorSetProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet' + value: Uint8Array +} +export interface MsgRedelegateValidatorSetAmino { + /** delegator is the user who is trying to create a validator-set. */ + delegator?: string + /** list of {valAddr, weight} to delegate to */ + preferences?: ValidatorPreferenceAmino[] +} +export interface MsgRedelegateValidatorSetAminoMsg { + type: 'osmosis/MsgRedelegateValidatorSet' + value: MsgRedelegateValidatorSetAmino +} +export interface MsgRedelegateValidatorSetSDKType { + delegator: string + preferences: ValidatorPreferenceSDKType[] +} +export interface MsgRedelegateValidatorSetResponse {} +export interface MsgRedelegateValidatorSetResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse' + value: Uint8Array +} +export interface MsgRedelegateValidatorSetResponseAmino {} +export interface MsgRedelegateValidatorSetResponseAminoMsg { + type: 'osmosis/valsetpref/redelegate-validator-set-response' + value: MsgRedelegateValidatorSetResponseAmino +} +export interface MsgRedelegateValidatorSetResponseSDKType {} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewards { + /** delegator is the user who is trying to claim staking rewards. */ + delegator: string +} +export interface MsgWithdrawDelegationRewardsProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards' + value: Uint8Array +} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewardsAmino { + /** delegator is the user who is trying to claim staking rewards. */ + delegator?: string +} +export interface MsgWithdrawDelegationRewardsAminoMsg { + type: 'osmosis/MsgWithdrawDelegationRewards' + value: MsgWithdrawDelegationRewardsAmino +} +/** + * MsgWithdrawDelegationRewards allows user to claim staking rewards from the + * validator set. + */ +export interface MsgWithdrawDelegationRewardsSDKType { + delegator: string +} +export interface MsgWithdrawDelegationRewardsResponse {} +export interface MsgWithdrawDelegationRewardsResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse' + value: Uint8Array +} +export interface MsgWithdrawDelegationRewardsResponseAmino {} +export interface MsgWithdrawDelegationRewardsResponseAminoMsg { + type: 'osmosis/valsetpref/withdraw-delegation-rewards-response' + value: MsgWithdrawDelegationRewardsResponseAmino +} +export interface MsgWithdrawDelegationRewardsResponseSDKType {} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokens { + /** delegator is the user who is trying to force unbond osmo and delegate. */ + delegator: string + /** lockup id of osmo in the pool */ + lockID: bigint +} +export interface MsgDelegateBondedTokensProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens' + value: Uint8Array +} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokensAmino { + /** delegator is the user who is trying to force unbond osmo and delegate. */ + delegator?: string + /** lockup id of osmo in the pool */ + lockID?: string +} +export interface MsgDelegateBondedTokensAminoMsg { + type: 'osmosis/valsetpref/delegate-bonded-tokens' + value: MsgDelegateBondedTokensAmino +} +/** + * MsgDelegateBondedTokens breaks bonded lockup (by ID) of osmo, of + * length <= 2 weeks and takes all that osmo and delegates according to + * delegator's current validator set preference. + */ +export interface MsgDelegateBondedTokensSDKType { + delegator: string + lockID: bigint +} +export interface MsgDelegateBondedTokensResponse {} +export interface MsgDelegateBondedTokensResponseProtoMsg { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse' + value: Uint8Array +} +export interface MsgDelegateBondedTokensResponseAmino {} +export interface MsgDelegateBondedTokensResponseAminoMsg { + type: 'osmosis/valsetpref/delegate-bonded-tokens-response' + value: MsgDelegateBondedTokensResponseAmino +} +export interface MsgDelegateBondedTokensResponseSDKType {} +function createBaseMsgSetValidatorSetPreference(): MsgSetValidatorSetPreference { + return { + delegator: '', + preferences: [] + } +} +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) + } + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetValidatorSetPreference { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetValidatorSetPreference() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegator = reader.string() + break + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSetValidatorSetPreference { + const message = createBaseMsgSetValidatorSetPreference() + message.delegator = object.delegator ?? '' + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || [] + return message + }, + fromAmino( + object: MsgSetValidatorSetPreferenceAmino + ): MsgSetValidatorSetPreference { + 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 = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ) + } else { + obj.preferences = message.preferences + } + return obj + }, + fromAminoMsg( + object: MsgSetValidatorSetPreferenceAminoMsg + ): MsgSetValidatorSetPreference { + return MsgSetValidatorSetPreference.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetValidatorSetPreference + ): MsgSetValidatorSetPreferenceAminoMsg { + return { + type: 'osmosis/MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetValidatorSetPreferenceProtoMsg + ): MsgSetValidatorSetPreference { + return MsgSetValidatorSetPreference.decode(message.value) + }, + toProto(message: MsgSetValidatorSetPreference): Uint8Array { + return MsgSetValidatorSetPreference.encode(message).finish() + }, + toProtoMsg( + message: MsgSetValidatorSetPreference + ): MsgSetValidatorSetPreferenceProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference', + value: MsgSetValidatorSetPreference.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetValidatorSetPreferenceResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSetValidatorSetPreferenceResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgSetValidatorSetPreferenceResponse { + const message = createBaseMsgSetValidatorSetPreferenceResponse() + return message + }, + fromAmino( + _: MsgSetValidatorSetPreferenceResponseAmino + ): MsgSetValidatorSetPreferenceResponse { + const message = createBaseMsgSetValidatorSetPreferenceResponse() + return message + }, + toAmino( + _: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgSetValidatorSetPreferenceResponseAminoMsg + ): MsgSetValidatorSetPreferenceResponse { + return MsgSetValidatorSetPreferenceResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseAminoMsg { + return { + type: 'osmosis/valsetpref/set-validator-set-preference-response', + value: MsgSetValidatorSetPreferenceResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgSetValidatorSetPreferenceResponseProtoMsg + ): MsgSetValidatorSetPreferenceResponse { + return MsgSetValidatorSetPreferenceResponse.decode(message.value) + }, + toProto(message: MsgSetValidatorSetPreferenceResponse): Uint8Array { + return MsgSetValidatorSetPreferenceResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSetValidatorSetPreferenceResponse + ): MsgSetValidatorSetPreferenceResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse', + value: MsgSetValidatorSetPreferenceResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgSetValidatorSetPreferenceResponse.typeUrl, + MsgSetValidatorSetPreferenceResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgSetValidatorSetPreferenceResponse.aminoType, + MsgSetValidatorSetPreferenceResponse.typeUrl +) +function createBaseMsgDelegateToValidatorSet(): MsgDelegateToValidatorSet { + return { + delegator: '', + 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) + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateToValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateToValidatorSet() + 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 + ): MsgDelegateToValidatorSet { + const message = createBaseMsgDelegateToValidatorSet() + message.delegator = object.delegator ?? '' + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined + return message + }, + fromAmino(object: MsgDelegateToValidatorSetAmino): MsgDelegateToValidatorSet { + 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 = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined + return obj + }, + fromAminoMsg( + object: MsgDelegateToValidatorSetAminoMsg + ): MsgDelegateToValidatorSet { + return MsgDelegateToValidatorSet.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDelegateToValidatorSet + ): MsgDelegateToValidatorSetAminoMsg { + return { + type: 'osmosis/MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.toAmino(message) + } + }, + fromProtoMsg( + message: MsgDelegateToValidatorSetProtoMsg + ): MsgDelegateToValidatorSet { + return MsgDelegateToValidatorSet.decode(message.value) + }, + toProto(message: MsgDelegateToValidatorSet): Uint8Array { + return MsgDelegateToValidatorSet.encode(message).finish() + }, + toProtoMsg( + message: MsgDelegateToValidatorSet + ): MsgDelegateToValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet', + value: MsgDelegateToValidatorSet.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateToValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateToValidatorSetResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgDelegateToValidatorSetResponse { + const message = createBaseMsgDelegateToValidatorSetResponse() + return message + }, + fromAmino( + _: MsgDelegateToValidatorSetResponseAmino + ): MsgDelegateToValidatorSetResponse { + const message = createBaseMsgDelegateToValidatorSetResponse() + return message + }, + toAmino( + _: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgDelegateToValidatorSetResponseAminoMsg + ): MsgDelegateToValidatorSetResponse { + return MsgDelegateToValidatorSetResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-to-validator-set-response', + value: MsgDelegateToValidatorSetResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgDelegateToValidatorSetResponseProtoMsg + ): MsgDelegateToValidatorSetResponse { + return MsgDelegateToValidatorSetResponse.decode(message.value) + }, + toProto(message: MsgDelegateToValidatorSetResponse): Uint8Array { + return MsgDelegateToValidatorSetResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgDelegateToValidatorSetResponse + ): MsgDelegateToValidatorSetResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse', + value: MsgDelegateToValidatorSetResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgDelegateToValidatorSetResponse.typeUrl, + MsgDelegateToValidatorSetResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateToValidatorSetResponse.aminoType, + MsgDelegateToValidatorSetResponse.typeUrl +) +function createBaseMsgUndelegateFromValidatorSet(): MsgUndelegateFromValidatorSet { + return { + delegator: '', + 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) + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegateFromValidatorSet() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegator = reader.string() + break + case 3: + message.coin = Coin.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgUndelegateFromValidatorSet { + const message = createBaseMsgUndelegateFromValidatorSet() + message.delegator = object.delegator ?? '' + message.coin = + object.coin !== undefined && object.coin !== null + ? Coin.fromPartial(object.coin) + : undefined + return message + }, + fromAmino( + object: MsgUndelegateFromValidatorSetAmino + ): MsgUndelegateFromValidatorSet { + 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 = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined + return obj + }, + fromAminoMsg( + object: MsgUndelegateFromValidatorSetAminoMsg + ): MsgUndelegateFromValidatorSet { + return MsgUndelegateFromValidatorSet.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUndelegateFromValidatorSet + ): MsgUndelegateFromValidatorSetAminoMsg { + return { + type: 'osmosis/MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUndelegateFromValidatorSetProtoMsg + ): MsgUndelegateFromValidatorSet { + return MsgUndelegateFromValidatorSet.decode(message.value) + }, + toProto(message: MsgUndelegateFromValidatorSet): Uint8Array { + return MsgUndelegateFromValidatorSet.encode(message).finish() + }, + toProtoMsg( + message: MsgUndelegateFromValidatorSet + ): MsgUndelegateFromValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet', + value: MsgUndelegateFromValidatorSet.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUndelegateFromValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUndelegateFromValidatorSetResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgUndelegateFromValidatorSetResponse { + const message = createBaseMsgUndelegateFromValidatorSetResponse() + return message + }, + fromAmino( + _: MsgUndelegateFromValidatorSetResponseAmino + ): MsgUndelegateFromValidatorSetResponse { + const message = createBaseMsgUndelegateFromValidatorSetResponse() + return message + }, + toAmino( + _: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgUndelegateFromValidatorSetResponseAminoMsg + ): MsgUndelegateFromValidatorSetResponse { + return MsgUndelegateFromValidatorSetResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/undelegate-from-validator-set-response', + value: MsgUndelegateFromValidatorSetResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgUndelegateFromValidatorSetResponseProtoMsg + ): MsgUndelegateFromValidatorSetResponse { + return MsgUndelegateFromValidatorSetResponse.decode(message.value) + }, + toProto(message: MsgUndelegateFromValidatorSetResponse): Uint8Array { + return MsgUndelegateFromValidatorSetResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUndelegateFromValidatorSetResponse + ): MsgUndelegateFromValidatorSetResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse', + value: MsgUndelegateFromValidatorSetResponse.encode(message).finish() + } + } +} +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 + }, + 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 === '' ? undefined : 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 + }, + 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: '', + preferences: [] + } +} +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) + } + for (const v of message.preferences) { + ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRedelegateValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRedelegateValidatorSet() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegator = reader.string() + break + case 2: + message.preferences.push( + ValidatorPreference.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgRedelegateValidatorSet { + const message = createBaseMsgRedelegateValidatorSet() + message.delegator = object.delegator ?? '' + message.preferences = + object.preferences?.map((e) => ValidatorPreference.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgRedelegateValidatorSetAmino): MsgRedelegateValidatorSet { + 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 = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + if (message.preferences) { + obj.preferences = message.preferences.map((e) => + e ? ValidatorPreference.toAmino(e) : undefined + ) + } else { + obj.preferences = message.preferences + } + return obj + }, + fromAminoMsg( + object: MsgRedelegateValidatorSetAminoMsg + ): MsgRedelegateValidatorSet { + return MsgRedelegateValidatorSet.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRedelegateValidatorSet + ): MsgRedelegateValidatorSetAminoMsg { + return { + type: 'osmosis/MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRedelegateValidatorSetProtoMsg + ): MsgRedelegateValidatorSet { + return MsgRedelegateValidatorSet.decode(message.value) + }, + toProto(message: MsgRedelegateValidatorSet): Uint8Array { + return MsgRedelegateValidatorSet.encode(message).finish() + }, + toProtoMsg( + message: MsgRedelegateValidatorSet + ): MsgRedelegateValidatorSetProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet', + value: MsgRedelegateValidatorSet.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRedelegateValidatorSetResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRedelegateValidatorSetResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgRedelegateValidatorSetResponse { + const message = createBaseMsgRedelegateValidatorSetResponse() + return message + }, + fromAmino( + _: MsgRedelegateValidatorSetResponseAmino + ): MsgRedelegateValidatorSetResponse { + const message = createBaseMsgRedelegateValidatorSetResponse() + return message + }, + toAmino( + _: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgRedelegateValidatorSetResponseAminoMsg + ): MsgRedelegateValidatorSetResponse { + return MsgRedelegateValidatorSetResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseAminoMsg { + return { + type: 'osmosis/valsetpref/redelegate-validator-set-response', + value: MsgRedelegateValidatorSetResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgRedelegateValidatorSetResponseProtoMsg + ): MsgRedelegateValidatorSetResponse { + return MsgRedelegateValidatorSetResponse.decode(message.value) + }, + toProto(message: MsgRedelegateValidatorSetResponse): Uint8Array { + return MsgRedelegateValidatorSetResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgRedelegateValidatorSetResponse + ): MsgRedelegateValidatorSetResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse', + value: MsgRedelegateValidatorSetResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgRedelegateValidatorSetResponse.typeUrl, + MsgRedelegateValidatorSetResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgRedelegateValidatorSetResponse.aminoType, + MsgRedelegateValidatorSetResponse.typeUrl +) +function createBaseMsgWithdrawDelegationRewards(): MsgWithdrawDelegationRewards { + return { + delegator: '' + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawDelegationRewards { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegationRewards() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegator = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgWithdrawDelegationRewards { + const message = createBaseMsgWithdrawDelegationRewards() + message.delegator = object.delegator ?? '' + return message + }, + fromAmino( + object: MsgWithdrawDelegationRewardsAmino + ): MsgWithdrawDelegationRewards { + const message = createBaseMsgWithdrawDelegationRewards() + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator + } + return message + }, + toAmino( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsAmino { + const obj: any = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + return obj + }, + fromAminoMsg( + object: MsgWithdrawDelegationRewardsAminoMsg + ): MsgWithdrawDelegationRewards { + return MsgWithdrawDelegationRewards.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsAminoMsg { + return { + type: 'osmosis/MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawDelegationRewardsProtoMsg + ): MsgWithdrawDelegationRewards { + return MsgWithdrawDelegationRewards.decode(message.value) + }, + toProto(message: MsgWithdrawDelegationRewards): Uint8Array { + return MsgWithdrawDelegationRewards.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawDelegationRewards + ): MsgWithdrawDelegationRewardsProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards', + value: MsgWithdrawDelegationRewards.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgWithdrawDelegationRewardsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgWithdrawDelegationRewardsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgWithdrawDelegationRewardsResponse { + const message = createBaseMsgWithdrawDelegationRewardsResponse() + return message + }, + fromAmino( + _: MsgWithdrawDelegationRewardsResponseAmino + ): MsgWithdrawDelegationRewardsResponse { + const message = createBaseMsgWithdrawDelegationRewardsResponse() + return message + }, + toAmino( + _: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgWithdrawDelegationRewardsResponseAminoMsg + ): MsgWithdrawDelegationRewardsResponse { + return MsgWithdrawDelegationRewardsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseAminoMsg { + return { + type: 'osmosis/valsetpref/withdraw-delegation-rewards-response', + value: MsgWithdrawDelegationRewardsResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgWithdrawDelegationRewardsResponseProtoMsg + ): MsgWithdrawDelegationRewardsResponse { + return MsgWithdrawDelegationRewardsResponse.decode(message.value) + }, + toProto(message: MsgWithdrawDelegationRewardsResponse): Uint8Array { + return MsgWithdrawDelegationRewardsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgWithdrawDelegationRewardsResponse + ): MsgWithdrawDelegationRewardsResponseProtoMsg { + return { + typeUrl: + '/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse', + value: MsgWithdrawDelegationRewardsResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgWithdrawDelegationRewardsResponse.typeUrl, + MsgWithdrawDelegationRewardsResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgWithdrawDelegationRewardsResponse.aminoType, + MsgWithdrawDelegationRewardsResponse.typeUrl +) +function createBaseMsgDelegateBondedTokens(): MsgDelegateBondedTokens { + return { + delegator: '', + lockID: BigInt(0) + } +} +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) + } + if (message.lockID !== BigInt(0)) { + writer.uint32(16).uint64(message.lockID) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateBondedTokens { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateBondedTokens() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.delegator = reader.string() + break + case 2: + message.lockID = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgDelegateBondedTokens { + const message = createBaseMsgDelegateBondedTokens() + message.delegator = object.delegator ?? '' + message.lockID = + object.lockID !== undefined && object.lockID !== null + ? BigInt(object.lockID.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgDelegateBondedTokensAmino): MsgDelegateBondedTokens { + 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 = {} + obj.delegator = message.delegator === '' ? undefined : message.delegator + obj.lockID = + message.lockID !== BigInt(0) ? message.lockID.toString() : undefined + return obj + }, + fromAminoMsg( + object: MsgDelegateBondedTokensAminoMsg + ): MsgDelegateBondedTokens { + return MsgDelegateBondedTokens.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDelegateBondedTokens + ): MsgDelegateBondedTokensAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-bonded-tokens', + value: MsgDelegateBondedTokens.toAmino(message) + } + }, + fromProtoMsg( + message: MsgDelegateBondedTokensProtoMsg + ): MsgDelegateBondedTokens { + return MsgDelegateBondedTokens.decode(message.value) + }, + toProto(message: MsgDelegateBondedTokens): Uint8Array { + return MsgDelegateBondedTokens.encode(message).finish() + }, + toProtoMsg( + message: MsgDelegateBondedTokens + ): MsgDelegateBondedTokensProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens', + value: MsgDelegateBondedTokens.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgDelegateBondedTokensResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDelegateBondedTokensResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgDelegateBondedTokensResponse { + const message = createBaseMsgDelegateBondedTokensResponse() + return message + }, + fromAmino( + _: MsgDelegateBondedTokensResponseAmino + ): MsgDelegateBondedTokensResponse { + const message = createBaseMsgDelegateBondedTokensResponse() + return message + }, + toAmino( + _: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgDelegateBondedTokensResponseAminoMsg + ): MsgDelegateBondedTokensResponse { + return MsgDelegateBondedTokensResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseAminoMsg { + return { + type: 'osmosis/valsetpref/delegate-bonded-tokens-response', + value: MsgDelegateBondedTokensResponse.toAmino(message) + } + }, + fromProtoMsg( + message: MsgDelegateBondedTokensResponseProtoMsg + ): MsgDelegateBondedTokensResponse { + return MsgDelegateBondedTokensResponse.decode(message.value) + }, + toProto(message: MsgDelegateBondedTokensResponse): Uint8Array { + return MsgDelegateBondedTokensResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgDelegateBondedTokensResponse + ): MsgDelegateBondedTokensResponseProtoMsg { + return { + typeUrl: '/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse', + value: MsgDelegateBondedTokensResponse.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + MsgDelegateBondedTokensResponse.typeUrl, + MsgDelegateBondedTokensResponse +) +GlobalDecoderRegistry.registerAminoProtoMapping( + MsgDelegateBondedTokensResponse.aminoType, + MsgDelegateBondedTokensResponse.typeUrl +) diff --git a/src/proto/osmojs/registry.ts b/src/proto/osmojs/registry.ts new file mode 100644 index 0000000..1e0f730 --- /dev/null +++ b/src/proto/osmojs/registry.ts @@ -0,0 +1,216 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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 'cosmjs-types/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: string) { + 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: TelescopeGeneratedCodec + 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: TelescopeGeneratedCodec + 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/src/proto/osmojs/tendermint/abci/types.ts b/src/proto/osmojs/tendermint/abci/types.ts new file mode 100644 index 0000000..078093a --- /dev/null +++ b/src/proto/osmojs/tendermint/abci/types.ts @@ -0,0 +1,8185 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Timestamp } from 'cosmjs-types/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 { PublicKey, PublicKeyAmino, PublicKeySDKType } from '../crypto/keys' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { GlobalDecoderRegistry } from '../../registry' +import { + toTimestamp, + fromTimestamp, + bytesFromBase64, + base64FromBytes, + isSet +} from '../../../helpers' +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1 +} +export const CheckTxTypeSDKType = CheckTxType +export const CheckTxTypeAmino = CheckTxType +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case 'NEW': + return CheckTxType.NEW + case 1: + case 'RECHECK': + return CheckTxType.RECHECK + case -1: + case 'UNRECOGNIZED': + default: + return CheckTxType.UNRECOGNIZED + } +} +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return 'NEW' + case CheckTxType.RECHECK: + return 'RECHECK' + case CheckTxType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1 +} +export const ResponseOfferSnapshot_ResultSDKType = ResponseOfferSnapshot_Result +export const ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result +export function responseOfferSnapshot_ResultFromJSON( + object: any +): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case 'UNKNOWN': + return ResponseOfferSnapshot_Result.UNKNOWN + case 1: + case 'ACCEPT': + return ResponseOfferSnapshot_Result.ACCEPT + case 2: + case 'ABORT': + return ResponseOfferSnapshot_Result.ABORT + case 3: + case 'REJECT': + return ResponseOfferSnapshot_Result.REJECT + case 4: + case 'REJECT_FORMAT': + return ResponseOfferSnapshot_Result.REJECT_FORMAT + case 5: + case 'REJECT_SENDER': + return ResponseOfferSnapshot_Result.REJECT_SENDER + case -1: + case 'UNRECOGNIZED': + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED + } +} +export function responseOfferSnapshot_ResultToJSON( + object: ResponseOfferSnapshot_Result +): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return 'UNKNOWN' + case ResponseOfferSnapshot_Result.ACCEPT: + return 'ACCEPT' + case ResponseOfferSnapshot_Result.ABORT: + return 'ABORT' + case ResponseOfferSnapshot_Result.REJECT: + return 'REJECT' + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return 'REJECT_FORMAT' + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return 'REJECT_SENDER' + case ResponseOfferSnapshot_Result.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1 +} +export const ResponseApplySnapshotChunk_ResultSDKType = + ResponseApplySnapshotChunk_Result +export const ResponseApplySnapshotChunk_ResultAmino = + ResponseApplySnapshotChunk_Result +export function responseApplySnapshotChunk_ResultFromJSON( + object: any +): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case 'UNKNOWN': + return ResponseApplySnapshotChunk_Result.UNKNOWN + case 1: + case 'ACCEPT': + return ResponseApplySnapshotChunk_Result.ACCEPT + case 2: + case 'ABORT': + return ResponseApplySnapshotChunk_Result.ABORT + case 3: + case 'RETRY': + return ResponseApplySnapshotChunk_Result.RETRY + case 4: + case 'RETRY_SNAPSHOT': + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT + case 5: + case 'REJECT_SNAPSHOT': + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT + case -1: + case 'UNRECOGNIZED': + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED + } +} +export function responseApplySnapshotChunk_ResultToJSON( + object: ResponseApplySnapshotChunk_Result +): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return 'UNKNOWN' + case ResponseApplySnapshotChunk_Result.ACCEPT: + return 'ACCEPT' + case ResponseApplySnapshotChunk_Result.ABORT: + return 'ABORT' + case ResponseApplySnapshotChunk_Result.RETRY: + return 'RETRY' + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return 'RETRY_SNAPSHOT' + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return 'REJECT_SNAPSHOT' + case ResponseApplySnapshotChunk_Result.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +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 MisbehaviorTypeSDKType = MisbehaviorType +export const MisbehaviorTypeAmino = MisbehaviorType +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { + switch (object) { + case 0: + case 'UNKNOWN': + return MisbehaviorType.UNKNOWN + case 1: + case 'DUPLICATE_VOTE': + return MisbehaviorType.DUPLICATE_VOTE + case 2: + case 'LIGHT_CLIENT_ATTACK': + return MisbehaviorType.LIGHT_CLIENT_ATTACK + case -1: + case 'UNRECOGNIZED': + default: + return MisbehaviorType.UNRECOGNIZED + } +} +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { + switch (object) { + case MisbehaviorType.UNKNOWN: + return 'UNKNOWN' + case MisbehaviorType.DUPLICATE_VOTE: + return 'DUPLICATE_VOTE' + case MisbehaviorType.LIGHT_CLIENT_ATTACK: + return 'LIGHT_CLIENT_ATTACK' + case MisbehaviorType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +export interface Request { + echo?: RequestEcho + flush?: RequestFlush + info?: RequestInfo + initChain?: RequestInitChain + query?: RequestQuery + beginBlock?: RequestBeginBlock + checkTx?: RequestCheckTx + deliverTx?: RequestDeliverTx + endBlock?: RequestEndBlock + commit?: RequestCommit + listSnapshots?: RequestListSnapshots + offerSnapshot?: RequestOfferSnapshot + loadSnapshotChunk?: RequestLoadSnapshotChunk + applySnapshotChunk?: RequestApplySnapshotChunk + prepareProposal?: RequestPrepareProposal + processProposal?: RequestProcessProposal +} +export interface RequestProtoMsg { + typeUrl: '/tendermint.abci.Request' + value: Uint8Array +} +export interface RequestAmino { + echo?: RequestEchoAmino + flush?: RequestFlushAmino + info?: RequestInfoAmino + init_chain?: RequestInitChainAmino + query?: RequestQueryAmino + begin_block?: RequestBeginBlockAmino + check_tx?: RequestCheckTxAmino + deliver_tx?: RequestDeliverTxAmino + end_block?: RequestEndBlockAmino + commit?: RequestCommitAmino + list_snapshots?: RequestListSnapshotsAmino + offer_snapshot?: RequestOfferSnapshotAmino + load_snapshot_chunk?: RequestLoadSnapshotChunkAmino + apply_snapshot_chunk?: RequestApplySnapshotChunkAmino + prepare_proposal?: RequestPrepareProposalAmino + process_proposal?: RequestProcessProposalAmino +} +export interface RequestAminoMsg { + type: '/tendermint.abci.Request' + value: RequestAmino +} +export interface RequestSDKType { + echo?: RequestEchoSDKType + flush?: RequestFlushSDKType + info?: RequestInfoSDKType + init_chain?: RequestInitChainSDKType + query?: RequestQuerySDKType + begin_block?: RequestBeginBlockSDKType + check_tx?: RequestCheckTxSDKType + deliver_tx?: RequestDeliverTxSDKType + end_block?: RequestEndBlockSDKType + commit?: RequestCommitSDKType + list_snapshots?: RequestListSnapshotsSDKType + offer_snapshot?: RequestOfferSnapshotSDKType + load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType + apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType + prepare_proposal?: RequestPrepareProposalSDKType + process_proposal?: RequestProcessProposalSDKType +} +export interface RequestEcho { + message: string +} +export interface RequestEchoProtoMsg { + typeUrl: '/tendermint.abci.RequestEcho' + value: Uint8Array +} +export interface RequestEchoAmino { + message?: string +} +export interface RequestEchoAminoMsg { + type: '/tendermint.abci.RequestEcho' + value: RequestEchoAmino +} +export interface RequestEchoSDKType { + message: string +} +export interface RequestFlush {} +export interface RequestFlushProtoMsg { + typeUrl: '/tendermint.abci.RequestFlush' + value: Uint8Array +} +export interface RequestFlushAmino {} +export interface RequestFlushAminoMsg { + type: '/tendermint.abci.RequestFlush' + value: RequestFlushAmino +} +export interface RequestFlushSDKType {} +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 + abci_version?: string +} +export interface RequestInfoAminoMsg { + type: '/tendermint.abci.RequestInfo' + value: RequestInfoAmino +} +export interface RequestInfoSDKType { + version: string + block_version: bigint + p2p_version: bigint + abci_version: string +} +export interface RequestInitChain { + time: Date + chainId: string + consensusParams?: ConsensusParams + validators: ValidatorUpdate[] + appStateBytes: Uint8Array + initialHeight: bigint +} +export interface RequestInitChainProtoMsg { + typeUrl: '/tendermint.abci.RequestInitChain' + value: Uint8Array +} +export interface RequestInitChainAmino { + time?: string + chain_id?: string + consensus_params?: ConsensusParamsAmino + validators?: ValidatorUpdateAmino[] + app_state_bytes?: string + initial_height?: string +} +export interface RequestInitChainAminoMsg { + type: '/tendermint.abci.RequestInitChain' + value: RequestInitChainAmino +} +export interface RequestInitChainSDKType { + time: Date + chain_id: string + consensus_params?: ConsensusParamsSDKType + validators: ValidatorUpdateSDKType[] + app_state_bytes: Uint8Array + initial_height: bigint +} +export interface RequestQuery { + data: Uint8Array + path: string + height: bigint + prove: boolean +} +export interface RequestQueryProtoMsg { + typeUrl: '/tendermint.abci.RequestQuery' + value: Uint8Array +} +export interface RequestQueryAmino { + data?: string + path?: string + height?: string + prove?: boolean +} +export interface RequestQueryAminoMsg { + type: '/tendermint.abci.RequestQuery' + value: RequestQueryAmino +} +export interface RequestQuerySDKType { + data: Uint8Array + path: string + height: bigint + prove: boolean +} +export interface RequestBeginBlock { + hash: Uint8Array + header: Header + lastCommitInfo: CommitInfo + byzantineValidators: Misbehavior[] +} +export interface RequestBeginBlockProtoMsg { + typeUrl: '/tendermint.abci.RequestBeginBlock' + value: Uint8Array +} +export interface RequestBeginBlockAmino { + hash?: string + header?: HeaderAmino + last_commit_info?: CommitInfoAmino + byzantine_validators?: MisbehaviorAmino[] +} +export interface RequestBeginBlockAminoMsg { + type: '/tendermint.abci.RequestBeginBlock' + value: RequestBeginBlockAmino +} +export interface RequestBeginBlockSDKType { + hash: Uint8Array + header: HeaderSDKType + last_commit_info: CommitInfoSDKType + byzantine_validators: MisbehaviorSDKType[] +} +export interface RequestCheckTx { + tx: Uint8Array + type: CheckTxType +} +export interface RequestCheckTxProtoMsg { + typeUrl: '/tendermint.abci.RequestCheckTx' + value: Uint8Array +} +export interface RequestCheckTxAmino { + tx?: string + type?: CheckTxType +} +export interface RequestCheckTxAminoMsg { + type: '/tendermint.abci.RequestCheckTx' + value: RequestCheckTxAmino +} +export interface RequestCheckTxSDKType { + tx: Uint8Array + type: CheckTxType +} +export interface RequestDeliverTx { + tx: Uint8Array +} +export interface RequestDeliverTxProtoMsg { + typeUrl: '/tendermint.abci.RequestDeliverTx' + value: Uint8Array +} +export interface RequestDeliverTxAmino { + tx?: string +} +export interface RequestDeliverTxAminoMsg { + type: '/tendermint.abci.RequestDeliverTx' + value: RequestDeliverTxAmino +} +export interface RequestDeliverTxSDKType { + tx: Uint8Array +} +export interface RequestEndBlock { + height: bigint +} +export interface RequestEndBlockProtoMsg { + typeUrl: '/tendermint.abci.RequestEndBlock' + value: Uint8Array +} +export interface RequestEndBlockAmino { + height?: string +} +export interface RequestEndBlockAminoMsg { + type: '/tendermint.abci.RequestEndBlock' + value: RequestEndBlockAmino +} +export interface RequestEndBlockSDKType { + height: bigint +} +export interface RequestCommit {} +export interface RequestCommitProtoMsg { + typeUrl: '/tendermint.abci.RequestCommit' + value: Uint8Array +} +export interface RequestCommitAmino {} +export interface RequestCommitAminoMsg { + type: '/tendermint.abci.RequestCommit' + value: RequestCommitAmino +} +export interface RequestCommitSDKType {} +/** lists available snapshots */ +export interface RequestListSnapshots {} +export interface RequestListSnapshotsProtoMsg { + typeUrl: '/tendermint.abci.RequestListSnapshots' + value: Uint8Array +} +/** lists available snapshots */ +export interface RequestListSnapshotsAmino {} +export interface RequestListSnapshotsAminoMsg { + type: '/tendermint.abci.RequestListSnapshots' + value: RequestListSnapshotsAmino +} +/** lists available snapshots */ +export interface RequestListSnapshotsSDKType {} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array +} +export interface RequestOfferSnapshotProtoMsg { + typeUrl: '/tendermint.abci.RequestOfferSnapshot' + value: Uint8Array +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotAmino { + /** snapshot offered by peers */ + snapshot?: SnapshotAmino + /** light client-verified app hash for snapshot height */ + app_hash?: string +} +export interface RequestOfferSnapshotAminoMsg { + type: '/tendermint.abci.RequestOfferSnapshot' + value: RequestOfferSnapshotAmino +} +/** offers a snapshot to the application */ +export interface RequestOfferSnapshotSDKType { + snapshot?: SnapshotSDKType + app_hash: Uint8Array +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: bigint + format: number + chunk: number +} +export interface RequestLoadSnapshotChunkProtoMsg { + typeUrl: '/tendermint.abci.RequestLoadSnapshotChunk' + value: Uint8Array +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkAmino { + height?: string + format?: number + chunk?: number +} +export interface RequestLoadSnapshotChunkAminoMsg { + type: '/tendermint.abci.RequestLoadSnapshotChunk' + value: RequestLoadSnapshotChunkAmino +} +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunkSDKType { + height: bigint + format: number + chunk: number +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number + chunk: Uint8Array + sender: string +} +export interface RequestApplySnapshotChunkProtoMsg { + typeUrl: '/tendermint.abci.RequestApplySnapshotChunk' + value: Uint8Array +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkAmino { + index?: number + chunk?: string + sender?: string +} +export interface RequestApplySnapshotChunkAminoMsg { + type: '/tendermint.abci.RequestApplySnapshotChunk' + value: RequestApplySnapshotChunkAmino +} +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunkSDKType { + index: number + 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 + initChain?: ResponseInitChain + query?: ResponseQuery + beginBlock?: ResponseBeginBlock + checkTx?: ResponseCheckTx + deliverTx?: ResponseDeliverTx + endBlock?: ResponseEndBlock + commit?: ResponseCommit + listSnapshots?: ResponseListSnapshots + offerSnapshot?: ResponseOfferSnapshot + loadSnapshotChunk?: ResponseLoadSnapshotChunk + applySnapshotChunk?: ResponseApplySnapshotChunk + prepareProposal?: ResponsePrepareProposal + processProposal?: ResponseProcessProposal +} +export interface ResponseProtoMsg { + typeUrl: '/tendermint.abci.Response' + value: Uint8Array +} +export interface ResponseAmino { + exception?: ResponseExceptionAmino + echo?: ResponseEchoAmino + flush?: ResponseFlushAmino + info?: ResponseInfoAmino + init_chain?: ResponseInitChainAmino + query?: ResponseQueryAmino + begin_block?: ResponseBeginBlockAmino + check_tx?: ResponseCheckTxAmino + deliver_tx?: ResponseDeliverTxAmino + end_block?: ResponseEndBlockAmino + commit?: ResponseCommitAmino + list_snapshots?: ResponseListSnapshotsAmino + offer_snapshot?: ResponseOfferSnapshotAmino + load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino + apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino + prepare_proposal?: ResponsePrepareProposalAmino + process_proposal?: ResponseProcessProposalAmino +} +export interface ResponseAminoMsg { + type: '/tendermint.abci.Response' + value: ResponseAmino +} +export interface ResponseSDKType { + exception?: ResponseExceptionSDKType + echo?: ResponseEchoSDKType + flush?: ResponseFlushSDKType + info?: ResponseInfoSDKType + init_chain?: ResponseInitChainSDKType + query?: ResponseQuerySDKType + begin_block?: ResponseBeginBlockSDKType + check_tx?: ResponseCheckTxSDKType + deliver_tx?: ResponseDeliverTxSDKType + end_block?: ResponseEndBlockSDKType + commit?: ResponseCommitSDKType + list_snapshots?: ResponseListSnapshotsSDKType + offer_snapshot?: ResponseOfferSnapshotSDKType + load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType + apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType + prepare_proposal?: ResponsePrepareProposalSDKType + process_proposal?: ResponseProcessProposalSDKType +} +/** nondeterministic */ +export interface ResponseException { + error: string +} +export interface ResponseExceptionProtoMsg { + typeUrl: '/tendermint.abci.ResponseException' + value: Uint8Array +} +/** nondeterministic */ +export interface ResponseExceptionAmino { + error?: string +} +export interface ResponseExceptionAminoMsg { + type: '/tendermint.abci.ResponseException' + value: ResponseExceptionAmino +} +/** nondeterministic */ +export interface ResponseExceptionSDKType { + error: string +} +export interface ResponseEcho { + message: string +} +export interface ResponseEchoProtoMsg { + typeUrl: '/tendermint.abci.ResponseEcho' + value: Uint8Array +} +export interface ResponseEchoAmino { + message?: string +} +export interface ResponseEchoAminoMsg { + type: '/tendermint.abci.ResponseEcho' + value: ResponseEchoAmino +} +export interface ResponseEchoSDKType { + message: string +} +export interface ResponseFlush {} +export interface ResponseFlushProtoMsg { + typeUrl: '/tendermint.abci.ResponseFlush' + value: Uint8Array +} +export interface ResponseFlushAmino {} +export interface ResponseFlushAminoMsg { + type: '/tendermint.abci.ResponseFlush' + value: ResponseFlushAmino +} +export interface ResponseFlushSDKType {} +export interface ResponseInfo { + data: string + version: string + appVersion: bigint + lastBlockHeight: bigint + lastBlockAppHash: Uint8Array +} +export interface ResponseInfoProtoMsg { + typeUrl: '/tendermint.abci.ResponseInfo' + value: Uint8Array +} +export interface ResponseInfoAmino { + data?: string + version?: string + app_version?: string + last_block_height?: string + last_block_app_hash?: string +} +export interface ResponseInfoAminoMsg { + type: '/tendermint.abci.ResponseInfo' + value: ResponseInfoAmino +} +export interface ResponseInfoSDKType { + data: string + version: string + app_version: bigint + last_block_height: bigint + last_block_app_hash: Uint8Array +} +export interface ResponseInitChain { + consensusParams?: ConsensusParams + validators: ValidatorUpdate[] + appHash: Uint8Array +} +export interface ResponseInitChainProtoMsg { + typeUrl: '/tendermint.abci.ResponseInitChain' + value: Uint8Array +} +export interface ResponseInitChainAmino { + consensus_params?: ConsensusParamsAmino + validators?: ValidatorUpdateAmino[] + app_hash?: string +} +export interface ResponseInitChainAminoMsg { + type: '/tendermint.abci.ResponseInitChain' + value: ResponseInitChainAmino +} +export interface ResponseInitChainSDKType { + consensus_params?: ConsensusParamsSDKType + validators: ValidatorUpdateSDKType[] + app_hash: Uint8Array +} +export interface ResponseQuery { + code: number + /** bytes data = 2; // use "value" instead. */ + log: string + /** nondeterministic */ + info: string + index: bigint + key: Uint8Array + value: Uint8Array + proofOps?: ProofOps + height: bigint + codespace: string +} +export interface ResponseQueryProtoMsg { + typeUrl: '/tendermint.abci.ResponseQuery' + value: Uint8Array +} +export interface ResponseQueryAmino { + code?: number + /** bytes data = 2; // use "value" instead. */ + log?: string + /** nondeterministic */ + info?: string + index?: string + key?: string + value?: string + proof_ops?: ProofOpsAmino + height?: string + codespace?: string +} +export interface ResponseQueryAminoMsg { + type: '/tendermint.abci.ResponseQuery' + value: ResponseQueryAmino +} +export interface ResponseQuerySDKType { + code: number + log: string + info: string + index: bigint + key: Uint8Array + value: Uint8Array + proof_ops?: ProofOpsSDKType + height: bigint + codespace: string +} +export interface ResponseBeginBlock { + events: Event[] +} +export interface ResponseBeginBlockProtoMsg { + typeUrl: '/tendermint.abci.ResponseBeginBlock' + value: Uint8Array +} +export interface ResponseBeginBlockAmino { + events?: EventAmino[] +} +export interface ResponseBeginBlockAminoMsg { + type: '/tendermint.abci.ResponseBeginBlock' + value: ResponseBeginBlockAmino +} +export interface ResponseBeginBlockSDKType { + events: EventSDKType[] +} +export interface ResponseCheckTx { + code: number + data: Uint8Array + /** nondeterministic */ + log: string + /** nondeterministic */ + info: string + gasWanted: bigint + 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?: string + /** nondeterministic */ + log?: string + /** nondeterministic */ + 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' + value: ResponseCheckTxAmino +} +export interface ResponseCheckTxSDKType { + code: number + data: Uint8Array + log: string + info: string + gas_wanted: bigint + gas_used: bigint + events: EventSDKType[] + codespace: string + sender: string + priority: bigint + mempool_error: string +} +export interface ResponseDeliverTx { + code: number + data: Uint8Array + /** nondeterministic */ + log: string + /** nondeterministic */ + info: string + gasWanted: bigint + gasUsed: bigint + events: Event[] + codespace: string +} +export interface ResponseDeliverTxProtoMsg { + typeUrl: '/tendermint.abci.ResponseDeliverTx' + value: Uint8Array +} +export interface ResponseDeliverTxAmino { + code?: number + data?: string + /** nondeterministic */ + log?: string + /** nondeterministic */ + info?: string + gas_wanted?: string + gas_used?: string + events?: EventAmino[] + codespace?: string +} +export interface ResponseDeliverTxAminoMsg { + type: '/tendermint.abci.ResponseDeliverTx' + value: ResponseDeliverTxAmino +} +export interface ResponseDeliverTxSDKType { + code: number + data: Uint8Array + log: string + info: string + gas_wanted: bigint + gas_used: bigint + events: EventSDKType[] + codespace: string +} +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[] + consensusParamUpdates?: ConsensusParams + events: Event[] +} +export interface ResponseEndBlockProtoMsg { + typeUrl: '/tendermint.abci.ResponseEndBlock' + value: Uint8Array +} +export interface ResponseEndBlockAmino { + validator_updates?: ValidatorUpdateAmino[] + consensus_param_updates?: ConsensusParamsAmino + events?: EventAmino[] +} +export interface ResponseEndBlockAminoMsg { + type: '/tendermint.abci.ResponseEndBlock' + value: ResponseEndBlockAmino +} +export interface ResponseEndBlockSDKType { + validator_updates: ValidatorUpdateSDKType[] + consensus_param_updates?: ConsensusParamsSDKType + events: EventSDKType[] +} +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array + retainHeight: bigint +} +export interface ResponseCommitProtoMsg { + typeUrl: '/tendermint.abci.ResponseCommit' + value: Uint8Array +} +export interface ResponseCommitAmino { + /** reserve 1 */ + data?: string + retain_height?: string +} +export interface ResponseCommitAminoMsg { + type: '/tendermint.abci.ResponseCommit' + value: ResponseCommitAmino +} +export interface ResponseCommitSDKType { + data: Uint8Array + retain_height: bigint +} +export interface ResponseListSnapshots { + snapshots: Snapshot[] +} +export interface ResponseListSnapshotsProtoMsg { + typeUrl: '/tendermint.abci.ResponseListSnapshots' + value: Uint8Array +} +export interface ResponseListSnapshotsAmino { + snapshots?: SnapshotAmino[] +} +export interface ResponseListSnapshotsAminoMsg { + type: '/tendermint.abci.ResponseListSnapshots' + value: ResponseListSnapshotsAmino +} +export interface ResponseListSnapshotsSDKType { + snapshots: SnapshotSDKType[] +} +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result +} +export interface ResponseOfferSnapshotProtoMsg { + typeUrl: '/tendermint.abci.ResponseOfferSnapshot' + value: Uint8Array +} +export interface ResponseOfferSnapshotAmino { + result?: ResponseOfferSnapshot_Result +} +export interface ResponseOfferSnapshotAminoMsg { + type: '/tendermint.abci.ResponseOfferSnapshot' + value: ResponseOfferSnapshotAmino +} +export interface ResponseOfferSnapshotSDKType { + result: ResponseOfferSnapshot_Result +} +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array +} +export interface ResponseLoadSnapshotChunkProtoMsg { + typeUrl: '/tendermint.abci.ResponseLoadSnapshotChunk' + value: Uint8Array +} +export interface ResponseLoadSnapshotChunkAmino { + chunk?: string +} +export interface ResponseLoadSnapshotChunkAminoMsg { + type: '/tendermint.abci.ResponseLoadSnapshotChunk' + value: ResponseLoadSnapshotChunkAmino +} +export interface ResponseLoadSnapshotChunkSDKType { + chunk: Uint8Array +} +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result + /** Chunks to refetch and reapply */ + refetchChunks: number[] + /** Chunk senders to reject and ban */ + rejectSenders: string[] +} +export interface ResponseApplySnapshotChunkProtoMsg { + typeUrl: '/tendermint.abci.ResponseApplySnapshotChunk' + value: Uint8Array +} +export interface ResponseApplySnapshotChunkAmino { + result?: ResponseApplySnapshotChunk_Result + /** Chunks to refetch and reapply */ + refetch_chunks?: number[] + /** Chunk senders to reject and ban */ + reject_senders?: string[] +} +export interface ResponseApplySnapshotChunkAminoMsg { + type: '/tendermint.abci.ResponseApplySnapshotChunk' + value: ResponseApplySnapshotChunkAmino +} +export interface ResponseApplySnapshotChunkSDKType { + result: ResponseApplySnapshotChunk_Result + refetch_chunks: number[] + reject_senders: string[] +} +export interface ResponsePrepareProposal { + txs: Uint8Array[] +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: '/tendermint.abci.ResponsePrepareProposal' + value: Uint8Array +} +export interface ResponsePrepareProposalAmino { + txs?: string[] +} +export interface ResponsePrepareProposalAminoMsg { + type: '/tendermint.abci.ResponsePrepareProposal' + value: ResponsePrepareProposalAmino +} +export interface ResponsePrepareProposalSDKType { + txs: Uint8Array[] +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: '/tendermint.abci.ResponseProcessProposal' + value: Uint8Array +} +export interface ResponseProcessProposalAmino { + status?: ResponseProcessProposal_ProposalStatus +} +export interface ResponseProcessProposalAminoMsg { + type: '/tendermint.abci.ResponseProcessProposal' + value: ResponseProcessProposalAmino +} +export interface ResponseProcessProposalSDKType { + status: ResponseProcessProposal_ProposalStatus +} +export interface CommitInfo { + round: number + votes: VoteInfo[] +} +export interface CommitInfoProtoMsg { + typeUrl: '/tendermint.abci.CommitInfo' + value: Uint8Array +} +export interface CommitInfoAmino { + round?: number + votes?: VoteInfoAmino[] +} +export interface CommitInfoAminoMsg { + type: '/tendermint.abci.CommitInfo' + value: CommitInfoAmino +} +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. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string + attributes: EventAttribute[] +} +export interface EventProtoMsg { + typeUrl: '/tendermint.abci.Event' + value: Uint8Array +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventAmino { + type?: string + attributes?: EventAttributeAmino[] +} +export interface EventAminoMsg { + type: '/tendermint.abci.Event' + value: EventAmino +} +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface EventSDKType { + type: string + attributes: EventAttributeSDKType[] +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: string + value: string + /** nondeterministic */ + index: boolean +} +export interface EventAttributeProtoMsg { + typeUrl: '/tendermint.abci.EventAttribute' + value: Uint8Array +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeAmino { + key?: string + value?: string + /** nondeterministic */ + index?: boolean +} +export interface EventAttributeAminoMsg { + type: '/tendermint.abci.EventAttribute' + value: EventAttributeAmino +} +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttributeSDKType { + key: string + value: string + index: boolean +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: bigint + index: number + tx: Uint8Array + result: ResponseDeliverTx +} +export interface TxResultProtoMsg { + typeUrl: '/tendermint.abci.TxResult' + value: Uint8Array +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultAmino { + height?: string + index?: number + tx?: string + result?: ResponseDeliverTxAmino +} +export interface TxResultAminoMsg { + type: '/tendermint.abci.TxResult' + value: TxResultAmino +} +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResultSDKType { + height: bigint + index: number + tx: Uint8Array + result: ResponseDeliverTxSDKType +} +/** Validator */ +export interface Validator { + /** + * The first 20 bytes of SHA256(public key) + * PubKey pub_key = 2 [(gogoproto.nullable)=false]; + */ + address: Uint8Array + /** The voting power */ + power: bigint +} +export interface ValidatorProtoMsg { + typeUrl: '/tendermint.abci.Validator' + value: Uint8Array +} +/** Validator */ +export interface ValidatorAmino { + /** + * The first 20 bytes of SHA256(public key) + * PubKey pub_key = 2 [(gogoproto.nullable)=false]; + */ + address?: string + /** The voting power */ + power?: string +} +export interface ValidatorAminoMsg { + type: '/tendermint.abci.Validator' + value: ValidatorAmino +} +/** Validator */ +export interface ValidatorSDKType { + address: Uint8Array + power: bigint +} +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey: PublicKey + power: bigint +} +export interface ValidatorUpdateProtoMsg { + typeUrl: '/tendermint.abci.ValidatorUpdate' + value: Uint8Array +} +/** ValidatorUpdate */ +export interface ValidatorUpdateAmino { + pub_key?: PublicKeyAmino + power?: string +} +export interface ValidatorUpdateAminoMsg { + type: '/tendermint.abci.ValidatorUpdate' + value: ValidatorUpdateAmino +} +/** ValidatorUpdate */ +export interface ValidatorUpdateSDKType { + pub_key: PublicKeySDKType + power: bigint +} +/** VoteInfo */ +export interface VoteInfo { + validator: Validator + signedLastBlock: boolean +} +export interface VoteInfoProtoMsg { + typeUrl: '/tendermint.abci.VoteInfo' + value: Uint8Array +} +/** VoteInfo */ +export interface VoteInfoAmino { + validator?: ValidatorAmino + signed_last_block?: boolean +} +export interface VoteInfoAminoMsg { + type: '/tendermint.abci.VoteInfo' + value: VoteInfoAmino +} +/** VoteInfo */ +export interface VoteInfoSDKType { + validator: ValidatorSDKType + signed_last_block: boolean +} +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 */ + height: bigint + /** The corresponding time where the offense occurred */ + time: Date + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: bigint +} +export interface MisbehaviorProtoMsg { + typeUrl: '/tendermint.abci.Misbehavior' + value: Uint8Array +} +export interface MisbehaviorAmino { + type?: MisbehaviorType + /** The offending validator */ + validator?: ValidatorAmino + /** The height when the offense occurred */ + height?: string + /** The corresponding time where the offense occurred */ + 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 +} +export interface MisbehaviorAminoMsg { + type: '/tendermint.abci.Misbehavior' + value: MisbehaviorAmino +} +export interface MisbehaviorSDKType { + type: MisbehaviorType + validator: ValidatorSDKType + height: bigint + time: Date + total_voting_power: bigint +} +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: bigint + /** The application-specific snapshot format */ + format: number + /** Number of chunks in the snapshot */ + chunks: number + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array + /** Arbitrary application metadata */ + metadata: Uint8Array +} +export interface SnapshotProtoMsg { + typeUrl: '/tendermint.abci.Snapshot' + value: Uint8Array +} +export interface SnapshotAmino { + /** The height at which the snapshot was taken */ + height?: string + /** The application-specific snapshot format */ + format?: number + /** Number of chunks in the snapshot */ + chunks?: number + /** Arbitrary snapshot hash, equal only if identical */ + hash?: string + /** Arbitrary application metadata */ + metadata?: string +} +export interface SnapshotAminoMsg { + type: '/tendermint.abci.Snapshot' + value: SnapshotAmino +} +export interface SnapshotSDKType { + height: bigint + format: number + chunks: number + hash: Uint8Array + metadata: Uint8Array +} +function createBaseRequest(): Request { + return { + 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 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() + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim() + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim() + } + if (message.initChain !== undefined) { + RequestInitChain.encode( + message.initChain, + writer.uint32(42).fork() + ).ldelim() + } + if (message.query !== undefined) { + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim() + } + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode( + message.beginBlock, + writer.uint32(58).fork() + ).ldelim() + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim() + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode( + message.deliverTx, + writer.uint32(74).fork() + ).ldelim() + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode( + message.endBlock, + writer.uint32(82).fork() + ).ldelim() + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim() + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode( + message.listSnapshots, + writer.uint32(98).fork() + ).ldelim() + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode( + message.offerSnapshot, + writer.uint32(106).fork() + ).ldelim() + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode( + message.loadSnapshotChunk, + writer.uint32(114).fork() + ).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequest() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()) + break + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()) + break + case 3: + message.info = RequestInfo.decode(reader, reader.uint32()) + break + case 5: + message.initChain = RequestInitChain.decode(reader, reader.uint32()) + break + case 6: + message.query = RequestQuery.decode(reader, reader.uint32()) + break + case 7: + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()) + break + case 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()) + break + case 9: + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()) + break + case 10: + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()) + break + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()) + break + case 12: + message.listSnapshots = RequestListSnapshots.decode( + reader, + reader.uint32() + ) + break + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode( + reader, + reader.uint32() + ) + break + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode( + reader, + reader.uint32() + ) + break + 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 + } + } + return message + }, + 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.initChain = + object.initChain !== undefined && object.initChain !== null + ? RequestInitChain.fromPartial(object.initChain) + : undefined + message.query = + object.query !== undefined && object.query !== null + ? RequestQuery.fromPartial(object.query) + : undefined + message.beginBlock = + object.beginBlock !== undefined && object.beginBlock !== null + ? RequestBeginBlock.fromPartial(object.beginBlock) + : undefined + message.checkTx = + object.checkTx !== undefined && object.checkTx !== null + ? RequestCheckTx.fromPartial(object.checkTx) + : undefined + message.deliverTx = + object.deliverTx !== undefined && object.deliverTx !== null + ? RequestDeliverTx.fromPartial(object.deliverTx) + : undefined + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null + ? RequestEndBlock.fromPartial(object.endBlock) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? RequestCommit.fromPartial(object.commit) + : undefined + message.listSnapshots = + object.listSnapshots !== undefined && object.listSnapshots !== null + ? RequestListSnapshots.fromPartial(object.listSnapshots) + : undefined + message.offerSnapshot = + object.offerSnapshot !== undefined && object.offerSnapshot !== null + ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined + message.loadSnapshotChunk = + object.loadSnapshotChunk !== undefined && + object.loadSnapshotChunk !== null + ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined + message.applySnapshotChunk = + object.applySnapshotChunk !== undefined && + object.applySnapshotChunk !== null + ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined + 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 { + 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.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 + obj.check_tx = message.checkTx + ? RequestCheckTx.toAmino(message.checkTx) + : undefined + obj.deliver_tx = message.deliverTx + ? RequestDeliverTx.toAmino(message.deliverTx) + : undefined + obj.end_block = message.endBlock + ? RequestEndBlock.toAmino(message.endBlock) + : undefined + obj.commit = message.commit + ? RequestCommit.toAmino(message.commit) + : undefined + obj.list_snapshots = message.listSnapshots + ? RequestListSnapshots.toAmino(message.listSnapshots) + : undefined + 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 { + return Request.fromAmino(object.value) + }, + fromProtoMsg(message: RequestProtoMsg): Request { + return Request.decode(message.value) + }, + toProto(message: Request): Uint8Array { + return Request.encode(message).finish() + }, + toProtoMsg(message: Request): RequestProtoMsg { + return { + typeUrl: '/tendermint.abci.Request', + value: Request.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Request.typeUrl, Request) +function createBaseRequestEcho(): RequestEcho { + return { + message: '' + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestEcho() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.message = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestEcho { + const message = createBaseRequestEcho() + message.message = object.message ?? '' + return message + }, + fromAmino(object: RequestEchoAmino): RequestEcho { + const message = createBaseRequestEcho() + if (object.message !== undefined && object.message !== null) { + message.message = object.message + } + return message + }, + toAmino(message: RequestEcho): RequestEchoAmino { + const obj: any = {} + obj.message = message.message === '' ? undefined : message.message + return obj + }, + fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { + return RequestEcho.fromAmino(object.value) + }, + fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { + return RequestEcho.decode(message.value) + }, + toProto(message: RequestEcho): Uint8Array { + return RequestEcho.encode(message).finish() + }, + toProtoMsg(message: RequestEcho): RequestEchoProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestEcho', + value: RequestEcho.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestFlush() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): RequestFlush { + const message = createBaseRequestFlush() + return message + }, + fromAmino(_: RequestFlushAmino): RequestFlush { + const message = createBaseRequestFlush() + return message + }, + toAmino(_: RequestFlush): RequestFlushAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { + return RequestFlush.fromAmino(object.value) + }, + fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { + return RequestFlush.decode(message.value) + }, + toProto(message: RequestFlush): Uint8Array { + return RequestFlush.encode(message).finish() + }, + toProtoMsg(message: RequestFlush): RequestFlushProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestFlush', + value: RequestFlush.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestFlush.typeUrl, RequestFlush) +function createBaseRequestInfo(): RequestInfo { + return { + version: '', + blockVersion: 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) + } + if (message.blockVersion !== BigInt(0)) { + writer.uint32(16).uint64(message.blockVersion) + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.version = reader.string() + break + case 2: + message.blockVersion = reader.uint64() + break + case 3: + message.p2pVersion = reader.uint64() + break + case 4: + message.abciVersion = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + 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 === '' ? undefined : message.version + obj.block_version = + message.blockVersion !== BigInt(0) + ? message.blockVersion.toString() + : undefined + obj.p2p_version = + message.p2pVersion !== BigInt(0) + ? message.p2pVersion.toString() + : undefined + obj.abci_version = + message.abciVersion === '' ? undefined : message.abciVersion + return obj + }, + fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { + return RequestInfo.fromAmino(object.value) + }, + fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { + return RequestInfo.decode(message.value) + }, + toProto(message: RequestInfo): Uint8Array { + return RequestInfo.encode(message).finish() + }, + toProtoMsg(message: RequestInfo): RequestInfoProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestInfo', + value: RequestInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestInfo.typeUrl, RequestInfo) +function createBaseRequestInitChain(): RequestInitChain { + return { + time: new Date(), + chainId: '', + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: BigInt(0) + } +} +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() + } + if (message.chainId !== '') { + writer.uint32(18).string(message.chainId) + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode( + message.consensusParams, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim() + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes) + } + if (message.initialHeight !== BigInt(0)) { + writer.uint32(48).int64(message.initialHeight) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestInitChain() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 2: + message.chainId = reader.string() + break + case 3: + message.consensusParams = ConsensusParams.decode( + reader, + reader.uint32() + ) + break + case 4: + message.validators.push( + ValidatorUpdate.decode(reader, reader.uint32()) + ) + break + case 5: + message.appStateBytes = reader.bytes() + break + case 6: + message.initialHeight = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestInitChain { + const message = createBaseRequestInitChain() + message.time = object.time ?? undefined + message.chainId = object.chainId ?? '' + message.consensusParams = + object.consensusParams !== undefined && object.consensusParams !== null + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined + message.validators = + object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [] + message.appStateBytes = object.appStateBytes ?? new Uint8Array() + message.initialHeight = + object.initialHeight !== undefined && object.initialHeight !== null + ? BigInt(object.initialHeight.toString()) + : BigInt(0) + return message + }, + fromAmino(object: RequestInitChainAmino): RequestInitChain { + 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 + ? Timestamp.toAmino(toTimestamp(message.time)) + : undefined + obj.chain_id = message.chainId === '' ? undefined : message.chainId + obj.consensus_params = message.consensusParams + ? ConsensusParams.toAmino(message.consensusParams) + : undefined + if (message.validators) { + obj.validators = message.validators.map((e) => + e ? ValidatorUpdate.toAmino(e) : undefined + ) + } else { + obj.validators = message.validators + } + obj.app_state_bytes = message.appStateBytes + ? base64FromBytes(message.appStateBytes) + : undefined + obj.initial_height = + message.initialHeight !== BigInt(0) + ? message.initialHeight.toString() + : undefined + return obj + }, + fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { + return RequestInitChain.fromAmino(object.value) + }, + fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { + return RequestInitChain.decode(message.value) + }, + toProto(message: RequestInitChain): Uint8Array { + return RequestInitChain.encode(message).finish() + }, + toProtoMsg(message: RequestInitChain): RequestInitChainProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestInitChain', + value: RequestInitChain.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestInitChain.typeUrl, RequestInitChain) +function createBaseRequestQuery(): RequestQuery { + return { + data: new Uint8Array(), + path: '', + height: BigInt(0), + prove: false + } +} +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) + } + if (message.path !== '') { + writer.uint32(18).string(message.path) + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height) + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestQuery { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestQuery() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.data = reader.bytes() + break + case 2: + message.path = reader.string() + break + case 3: + message.height = reader.int64() + break + case 4: + message.prove = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestQuery { + const message = createBaseRequestQuery() + message.data = object.data ?? new Uint8Array() + message.path = object.path ?? '' + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.prove = object.prove ?? false + return message + }, + fromAmino(object: RequestQueryAmino): RequestQuery { + 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 ? base64FromBytes(message.data) : undefined + obj.path = message.path === '' ? undefined : message.path + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.prove = message.prove === false ? undefined : message.prove + return obj + }, + fromAminoMsg(object: RequestQueryAminoMsg): RequestQuery { + return RequestQuery.fromAmino(object.value) + }, + fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { + return RequestQuery.decode(message.value) + }, + toProto(message: RequestQuery): Uint8Array { + return RequestQuery.encode(message).finish() + }, + toProtoMsg(message: RequestQuery): RequestQueryProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestQuery', + value: RequestQuery.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestQuery.typeUrl, RequestQuery) +function createBaseRequestBeginBlock(): RequestBeginBlock { + return { + hash: new Uint8Array(), + header: Header.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) + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(18).fork()).ldelim() + } + if (message.lastCommitInfo !== undefined) { + CommitInfo.encode( + message.lastCommitInfo, + writer.uint32(26).fork() + ).ldelim() + } + for (const v of message.byzantineValidators) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestBeginBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes() + break + case 2: + message.header = Header.decode(reader, reader.uint32()) + break + case 3: + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()) + break + case 4: + message.byzantineValidators.push( + Misbehavior.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 + ? CommitInfo.fromPartial(object.lastCommitInfo) + : undefined + message.byzantineValidators = + object.byzantineValidators?.map((e) => Misbehavior.fromPartial(e)) || [] + return message + }, + fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { + 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 ? base64FromBytes(message.hash) : undefined + obj.header = message.header ? Header.toAmino(message.header) : undefined + obj.last_commit_info = message.lastCommitInfo + ? CommitInfo.toAmino(message.lastCommitInfo) + : undefined + if (message.byzantineValidators) { + obj.byzantine_validators = message.byzantineValidators.map((e) => + e ? Misbehavior.toAmino(e) : undefined + ) + } else { + obj.byzantine_validators = message.byzantineValidators + } + return obj + }, + fromAminoMsg(object: RequestBeginBlockAminoMsg): RequestBeginBlock { + return RequestBeginBlock.fromAmino(object.value) + }, + fromProtoMsg(message: RequestBeginBlockProtoMsg): RequestBeginBlock { + return RequestBeginBlock.decode(message.value) + }, + toProto(message: RequestBeginBlock): Uint8Array { + return RequestBeginBlock.encode(message).finish() + }, + toProtoMsg(message: RequestBeginBlock): RequestBeginBlockProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestBeginBlock', + value: RequestBeginBlock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestBeginBlock.typeUrl, RequestBeginBlock) +function createBaseRequestCheckTx(): RequestCheckTx { + return { + tx: new Uint8Array(), + type: 0 + } +} +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) + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestCheckTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes() + break + case 2: + message.type = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestCheckTx { + const message = createBaseRequestCheckTx() + message.tx = object.tx ?? new Uint8Array() + message.type = object.type ?? 0 + return message + }, + fromAmino(object: RequestCheckTxAmino): RequestCheckTx { + const message = createBaseRequestCheckTx() + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx) + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type + } + return message + }, + toAmino(message: RequestCheckTx): RequestCheckTxAmino { + const obj: any = {} + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined + obj.type = message.type === 0 ? undefined : message.type + return obj + }, + fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { + return RequestCheckTx.fromAmino(object.value) + }, + fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { + return RequestCheckTx.decode(message.value) + }, + toProto(message: RequestCheckTx): Uint8Array { + return RequestCheckTx.encode(message).finish() + }, + toProtoMsg(message: RequestCheckTx): RequestCheckTxProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestCheckTx', + value: RequestCheckTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestCheckTx.typeUrl, RequestCheckTx) +function createBaseRequestDeliverTx(): RequestDeliverTx { + return { + tx: new Uint8Array() + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestDeliverTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestDeliverTx { + const message = createBaseRequestDeliverTx() + message.tx = object.tx ?? new Uint8Array() + return message + }, + fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { + 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 ? base64FromBytes(message.tx) : undefined + return obj + }, + fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { + return RequestDeliverTx.fromAmino(object.value) + }, + fromProtoMsg(message: RequestDeliverTxProtoMsg): RequestDeliverTx { + return RequestDeliverTx.decode(message.value) + }, + toProto(message: RequestDeliverTx): Uint8Array { + return RequestDeliverTx.encode(message).finish() + }, + toProtoMsg(message: RequestDeliverTx): RequestDeliverTxProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestDeliverTx', + value: RequestDeliverTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(RequestDeliverTx.typeUrl, RequestDeliverTx) +function createBaseRequestEndBlock(): RequestEndBlock { + return { + height: BigInt(0) + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestEndBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 { + const message = createBaseRequestEndBlock() + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height) + } + return message + }, + toAmino(message: RequestEndBlock): RequestEndBlockAmino { + const obj: any = {} + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + return obj + }, + fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { + return RequestEndBlock.fromAmino(object.value) + }, + fromProtoMsg(message: RequestEndBlockProtoMsg): RequestEndBlock { + return RequestEndBlock.decode(message.value) + }, + toProto(message: RequestEndBlock): Uint8Array { + return RequestEndBlock.encode(message).finish() + }, + toProtoMsg(message: RequestEndBlock): RequestEndBlockProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestEndBlock', + value: RequestEndBlock.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestCommit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): RequestCommit { + const message = createBaseRequestCommit() + return message + }, + fromAmino(_: RequestCommitAmino): RequestCommit { + const message = createBaseRequestCommit() + return message + }, + toAmino(_: RequestCommit): RequestCommitAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { + return RequestCommit.fromAmino(object.value) + }, + fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { + return RequestCommit.decode(message.value) + }, + toProto(message: RequestCommit): Uint8Array { + return RequestCommit.encode(message).finish() + }, + toProtoMsg(message: RequestCommit): RequestCommitProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestCommit', + value: RequestCommit.encode(message).finish() + } + } +} +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 + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RequestListSnapshots { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestListSnapshots() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): RequestListSnapshots { + const message = createBaseRequestListSnapshots() + return message + }, + fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { + const message = createBaseRequestListSnapshots() + return message + }, + toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { + return RequestListSnapshots.fromAmino(object.value) + }, + fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { + return RequestListSnapshots.decode(message.value) + }, + toProto(message: RequestListSnapshots): Uint8Array { + return RequestListSnapshots.encode(message).finish() + }, + toProtoMsg(message: RequestListSnapshots): RequestListSnapshotsProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestListSnapshots', + value: RequestListSnapshots.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RequestListSnapshots.typeUrl, + RequestListSnapshots +) +function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { + return { + 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() + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RequestOfferSnapshot { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestOfferSnapshot() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()) + break + case 2: + message.appHash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): RequestOfferSnapshot { + const message = createBaseRequestOfferSnapshot() + message.snapshot = + object.snapshot !== undefined && object.snapshot !== null + ? Snapshot.fromPartial(object.snapshot) + : undefined + message.appHash = object.appHash ?? new Uint8Array() + return message + }, + fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { + 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 + ? base64FromBytes(message.appHash) + : undefined + return obj + }, + fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.fromAmino(object.value) + }, + fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { + return RequestOfferSnapshot.decode(message.value) + }, + toProto(message: RequestOfferSnapshot): Uint8Array { + return RequestOfferSnapshot.encode(message).finish() + }, + toProtoMsg(message: RequestOfferSnapshot): RequestOfferSnapshotProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestOfferSnapshot', + value: RequestOfferSnapshot.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RequestOfferSnapshot.typeUrl, + RequestOfferSnapshot +) +function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { + return { + height: BigInt(0), + format: 0, + chunk: 0 + } +} +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) + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format) + } + if (message.chunk !== 0) { + writer.uint32(24).uint32(message.chunk) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RequestLoadSnapshotChunk { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestLoadSnapshotChunk() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() + break + case 2: + message.format = reader.uint32() + break + case 3: + message.chunk = reader.uint32() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): RequestLoadSnapshotChunk { + const message = createBaseRequestLoadSnapshotChunk() + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.format = object.format ?? 0 + message.chunk = object.chunk ?? 0 + return message + }, + fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { + 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 = {} + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.format = message.format === 0 ? undefined : message.format + obj.chunk = message.chunk === 0 ? undefined : message.chunk + return obj + }, + fromAminoMsg( + object: RequestLoadSnapshotChunkAminoMsg + ): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.fromAmino(object.value) + }, + fromProtoMsg( + message: RequestLoadSnapshotChunkProtoMsg + ): RequestLoadSnapshotChunk { + return RequestLoadSnapshotChunk.decode(message.value) + }, + toProto(message: RequestLoadSnapshotChunk): Uint8Array { + return RequestLoadSnapshotChunk.encode(message).finish() + }, + toProtoMsg( + message: RequestLoadSnapshotChunk + ): RequestLoadSnapshotChunkProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestLoadSnapshotChunk', + value: RequestLoadSnapshotChunk.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RequestLoadSnapshotChunk.typeUrl, + RequestLoadSnapshotChunk +) +function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { + return { + index: 0, + chunk: new Uint8Array(), + sender: '' + } +} +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) + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk) + } + if (message.sender !== '') { + writer.uint32(26).string(message.sender) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): RequestApplySnapshotChunk { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRequestApplySnapshotChunk() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.index = reader.uint32() + break + case 2: + message.chunk = reader.bytes() + break + case 3: + message.sender = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): RequestApplySnapshotChunk { + const message = createBaseRequestApplySnapshotChunk() + message.index = object.index ?? 0 + message.chunk = object.chunk ?? new Uint8Array() + message.sender = object.sender ?? '' + return message + }, + fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { + 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 === 0 ? undefined : message.index + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined + obj.sender = message.sender === '' ? undefined : message.sender + return obj + }, + fromAminoMsg( + object: RequestApplySnapshotChunkAminoMsg + ): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.fromAmino(object.value) + }, + fromProtoMsg( + message: RequestApplySnapshotChunkProtoMsg + ): RequestApplySnapshotChunk { + return RequestApplySnapshotChunk.decode(message.value) + }, + toProto(message: RequestApplySnapshotChunk): Uint8Array { + return RequestApplySnapshotChunk.encode(message).finish() + }, + toProtoMsg( + message: RequestApplySnapshotChunk + ): RequestApplySnapshotChunkProtoMsg { + return { + typeUrl: '/tendermint.abci.RequestApplySnapshotChunk', + value: RequestApplySnapshotChunk.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + RequestApplySnapshotChunk.typeUrl, + 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', + 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) + const 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 !== BigInt(0) + ? message.maxTxBytes.toString() + : undefined + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e)) + } else { + obj.txs = message.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 = message.misbehavior + } + obj.height = + message.height !== BigInt(0) ? 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) + const 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 = message.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 = message.misbehavior + } + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined + obj.height = + message.height !== BigInt(0) ? 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() + } + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim() + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim() + } + if (message.initChain !== undefined) { + ResponseInitChain.encode( + message.initChain, + writer.uint32(50).fork() + ).ldelim() + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim() + } + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode( + message.beginBlock, + writer.uint32(66).fork() + ).ldelim() + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim() + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode( + message.deliverTx, + writer.uint32(82).fork() + ).ldelim() + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode( + message.endBlock, + writer.uint32(90).fork() + ).ldelim() + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim() + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode( + message.listSnapshots, + writer.uint32(106).fork() + ).ldelim() + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode( + message.offerSnapshot, + writer.uint32(114).fork() + ).ldelim() + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode( + message.loadSnapshotChunk, + writer.uint32(122).fork() + ).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()) + break + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()) + break + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()) + break + case 4: + message.info = ResponseInfo.decode(reader, reader.uint32()) + break + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()) + break + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()) + break + case 8: + message.beginBlock = ResponseBeginBlock.decode( + reader, + reader.uint32() + ) + break + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()) + break + case 10: + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()) + break + case 11: + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()) + break + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()) + break + case 13: + message.listSnapshots = ResponseListSnapshots.decode( + reader, + reader.uint32() + ) + break + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode( + reader, + reader.uint32() + ) + break + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode( + reader, + reader.uint32() + ) + break + 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 + } + } + return message + }, + 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.initChain = + object.initChain !== undefined && object.initChain !== null + ? ResponseInitChain.fromPartial(object.initChain) + : undefined + message.query = + object.query !== undefined && object.query !== null + ? ResponseQuery.fromPartial(object.query) + : undefined + message.beginBlock = + object.beginBlock !== undefined && object.beginBlock !== null + ? ResponseBeginBlock.fromPartial(object.beginBlock) + : undefined + message.checkTx = + object.checkTx !== undefined && object.checkTx !== null + ? ResponseCheckTx.fromPartial(object.checkTx) + : undefined + message.deliverTx = + object.deliverTx !== undefined && object.deliverTx !== null + ? ResponseDeliverTx.fromPartial(object.deliverTx) + : undefined + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null + ? ResponseEndBlock.fromPartial(object.endBlock) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? ResponseCommit.fromPartial(object.commit) + : undefined + message.listSnapshots = + object.listSnapshots !== undefined && object.listSnapshots !== null + ? ResponseListSnapshots.fromPartial(object.listSnapshots) + : undefined + message.offerSnapshot = + object.offerSnapshot !== undefined && object.offerSnapshot !== null + ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) + : undefined + message.loadSnapshotChunk = + object.loadSnapshotChunk !== undefined && + object.loadSnapshotChunk !== null + ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) + : undefined + message.applySnapshotChunk = + object.applySnapshotChunk !== undefined && + object.applySnapshotChunk !== null + ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) + : undefined + 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 { + 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 = {} + obj.exception = message.exception + ? ResponseException.toAmino(message.exception) + : undefined + 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.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 + obj.check_tx = message.checkTx + ? ResponseCheckTx.toAmino(message.checkTx) + : undefined + obj.deliver_tx = message.deliverTx + ? ResponseDeliverTx.toAmino(message.deliverTx) + : undefined + obj.end_block = message.endBlock + ? ResponseEndBlock.toAmino(message.endBlock) + : undefined + obj.commit = message.commit + ? ResponseCommit.toAmino(message.commit) + : undefined + obj.list_snapshots = message.listSnapshots + ? ResponseListSnapshots.toAmino(message.listSnapshots) + : undefined + 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 { + return Response.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseProtoMsg): Response { + return Response.decode(message.value) + }, + toProto(message: Response): Uint8Array { + return Response.encode(message).finish() + }, + toProtoMsg(message: Response): ResponseProtoMsg { + return { + typeUrl: '/tendermint.abci.Response', + value: Response.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Response.typeUrl, Response) +function createBaseResponseException(): ResponseException { + return { + error: '' + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseException() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.error = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseException { + const message = createBaseResponseException() + message.error = object.error ?? '' + return message + }, + fromAmino(object: ResponseExceptionAmino): ResponseException { + const message = createBaseResponseException() + if (object.error !== undefined && object.error !== null) { + message.error = object.error + } + return message + }, + toAmino(message: ResponseException): ResponseExceptionAmino { + const obj: any = {} + obj.error = message.error === '' ? undefined : message.error + return obj + }, + fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { + return ResponseException.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { + return ResponseException.decode(message.value) + }, + toProto(message: ResponseException): Uint8Array { + return ResponseException.encode(message).finish() + }, + toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseException', + value: ResponseException.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseException.typeUrl, ResponseException) +function createBaseResponseEcho(): ResponseEcho { + return { + message: '' + } +} +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) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseEcho() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.message = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseEcho { + const message = createBaseResponseEcho() + message.message = object.message ?? '' + return message + }, + fromAmino(object: ResponseEchoAmino): ResponseEcho { + const message = createBaseResponseEcho() + if (object.message !== undefined && object.message !== null) { + message.message = object.message + } + return message + }, + toAmino(message: ResponseEcho): ResponseEchoAmino { + const obj: any = {} + obj.message = message.message === '' ? undefined : message.message + return obj + }, + fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { + return ResponseEcho.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { + return ResponseEcho.decode(message.value) + }, + toProto(message: ResponseEcho): Uint8Array { + return ResponseEcho.encode(message).finish() + }, + toProtoMsg(message: ResponseEcho): ResponseEchoProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseEcho', + value: ResponseEcho.encode(message).finish() + } + } +} +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 + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseFlush() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): ResponseFlush { + const message = createBaseResponseFlush() + return message + }, + fromAmino(_: ResponseFlushAmino): ResponseFlush { + const message = createBaseResponseFlush() + return message + }, + toAmino(_: ResponseFlush): ResponseFlushAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { + return ResponseFlush.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { + return ResponseFlush.decode(message.value) + }, + toProto(message: ResponseFlush): Uint8Array { + return ResponseFlush.encode(message).finish() + }, + toProtoMsg(message: ResponseFlush): ResponseFlushProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseFlush', + value: ResponseFlush.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseFlush.typeUrl, ResponseFlush) +function createBaseResponseInfo(): ResponseInfo { + return { + data: '', + version: '', + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), + lastBlockAppHash: new Uint8Array() + } +} +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) + } + if (message.version !== '') { + writer.uint32(18).string(message.version) + } + if (message.appVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.appVersion) + } + if (message.lastBlockHeight !== BigInt(0)) { + writer.uint32(32).int64(message.lastBlockHeight) + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.data = reader.string() + break + case 2: + message.version = reader.string() + break + case 3: + message.appVersion = reader.uint64() + break + case 4: + message.lastBlockHeight = reader.int64() + break + case 5: + message.lastBlockAppHash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseInfo { + const message = createBaseResponseInfo() + message.data = object.data ?? '' + message.version = object.version ?? '' + message.appVersion = + object.appVersion !== undefined && object.appVersion !== null + ? BigInt(object.appVersion.toString()) + : BigInt(0) + message.lastBlockHeight = + object.lastBlockHeight !== undefined && object.lastBlockHeight !== null + ? BigInt(object.lastBlockHeight.toString()) + : BigInt(0) + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array() + return message + }, + fromAmino(object: ResponseInfoAmino): ResponseInfo { + 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 = {} + obj.data = message.data === '' ? undefined : message.data + obj.version = message.version === '' ? undefined : message.version + obj.app_version = + message.appVersion !== BigInt(0) + ? message.appVersion.toString() + : undefined + obj.last_block_height = + message.lastBlockHeight !== BigInt(0) + ? message.lastBlockHeight.toString() + : undefined + obj.last_block_app_hash = message.lastBlockAppHash + ? base64FromBytes(message.lastBlockAppHash) + : undefined + return obj + }, + fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { + return ResponseInfo.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { + return ResponseInfo.decode(message.value) + }, + toProto(message: ResponseInfo): Uint8Array { + return ResponseInfo.encode(message).finish() + }, + toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseInfo', + value: ResponseInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseInfo.typeUrl, ResponseInfo) +function createBaseResponseInitChain(): ResponseInitChain { + return { + 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() + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseInitChain() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.consensusParams = ConsensusParams.decode( + reader, + reader.uint32() + ) + break + case 2: + message.validators.push( + ValidatorUpdate.decode(reader, reader.uint32()) + ) + break + case 3: + message.appHash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseInitChain { + const message = createBaseResponseInitChain() + message.consensusParams = + object.consensusParams !== undefined && object.consensusParams !== null + ? ConsensusParams.fromPartial(object.consensusParams) + : undefined + message.validators = + object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [] + message.appHash = object.appHash ?? new Uint8Array() + return message + }, + fromAmino(object: ResponseInitChainAmino): ResponseInitChain { + 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 = {} + obj.consensus_params = message.consensusParams + ? ConsensusParams.toAmino(message.consensusParams) + : undefined + if (message.validators) { + obj.validators = message.validators.map((e) => + e ? ValidatorUpdate.toAmino(e) : undefined + ) + } else { + obj.validators = message.validators + } + obj.app_hash = message.appHash + ? base64FromBytes(message.appHash) + : undefined + return obj + }, + fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { + return ResponseInitChain.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { + return ResponseInitChain.decode(message.value) + }, + toProto(message: ResponseInitChain): Uint8Array { + return ResponseInitChain.encode(message).finish() + }, + toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseInitChain', + value: ResponseInitChain.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseInitChain.typeUrl, ResponseInitChain) +function createBaseResponseQuery(): ResponseQuery { + return { + code: 0, + log: '', + info: '', + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + 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) + } + if (message.log !== '') { + writer.uint32(26).string(message.log) + } + if (message.info !== '') { + writer.uint32(34).string(message.info) + } + if (message.index !== BigInt(0)) { + writer.uint32(40).int64(message.index) + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key) + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value) + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim() + } + if (message.height !== BigInt(0)) { + writer.uint32(72).int64(message.height) + } + if (message.codespace !== '') { + writer.uint32(82).string(message.codespace) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseQuery() + 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 + case 5: + message.index = reader.int64() + break + case 6: + message.key = reader.bytes() + break + case 7: + message.value = reader.bytes() + break + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()) + break + case 9: + message.height = reader.int64() + break + case 10: + message.codespace = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseQuery { + const message = createBaseResponseQuery() + message.code = object.code ?? 0 + message.log = object.log ?? '' + message.info = object.info ?? '' + message.index = + object.index !== undefined && object.index !== null + ? BigInt(object.index.toString()) + : BigInt(0) + message.key = object.key ?? new Uint8Array() + message.value = object.value ?? new Uint8Array() + message.proofOps = + object.proofOps !== undefined && object.proofOps !== null + ? ProofOps.fromPartial(object.proofOps) + : undefined + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.codespace = object.codespace ?? '' + return message + }, + fromAmino(object: ResponseQueryAmino): ResponseQuery { + 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 = {} + obj.code = message.code === 0 ? undefined : message.code + obj.log = message.log === '' ? undefined : message.log + obj.info = message.info === '' ? undefined : message.info + obj.index = + message.index !== BigInt(0) ? message.index.toString() : undefined + 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 !== BigInt(0) ? message.height.toString() : undefined + obj.codespace = message.codespace === '' ? undefined : message.codespace + return obj + }, + fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { + return ResponseQuery.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { + return ResponseQuery.decode(message.value) + }, + toProto(message: ResponseQuery): Uint8Array { + return ResponseQuery.encode(message).finish() + }, + toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseQuery', + value: ResponseQuery.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseQuery.typeUrl, ResponseQuery) +function createBaseResponseBeginBlock(): ResponseBeginBlock { + return { + events: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ResponseBeginBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseBeginBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseBeginBlock { + const message = createBaseResponseBeginBlock() + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message + }, + fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { + const message = createBaseResponseBeginBlock() + message.events = object.events?.map((e) => Event.fromAmino(e)) || [] + return message + }, + toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { + const obj: any = {} + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toAmino(e) : undefined)) + } else { + obj.events = message.events + } + return obj + }, + fromAminoMsg(object: ResponseBeginBlockAminoMsg): ResponseBeginBlock { + return ResponseBeginBlock.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseBeginBlockProtoMsg): ResponseBeginBlock { + return ResponseBeginBlock.decode(message.value) + }, + toProto(message: ResponseBeginBlock): Uint8Array { + return ResponseBeginBlock.encode(message).finish() + }, + toProtoMsg(message: ResponseBeginBlock): ResponseBeginBlockProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseBeginBlock', + value: ResponseBeginBlock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseBeginBlock.typeUrl, ResponseBeginBlock) +function createBaseResponseCheckTx(): ResponseCheckTx { + return { + code: 0, + data: new Uint8Array(), + log: '', + info: '', + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + 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) + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data) + } + if (message.log !== '') { + writer.uint32(26).string(message.log) + } + if (message.info !== '') { + writer.uint32(34).string(message.info) + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(40).int64(message.gasWanted) + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(48).int64(message.gasUsed) + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim() + } + 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 { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseCheckTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.code = reader.uint32() + break + case 2: + message.data = reader.bytes() + break + case 3: + message.log = reader.string() + break + case 4: + message.info = reader.string() + break + case 5: + message.gasWanted = reader.int64() + break + case 6: + message.gasUsed = reader.int64() + break + case 7: + message.events.push(Event.decode(reader, reader.uint32())) + break + 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 + } + } + return message + }, + fromPartial(object: Partial): ResponseCheckTx { + const message = createBaseResponseCheckTx() + message.code = object.code ?? 0 + message.data = object.data ?? new Uint8Array() + message.log = object.log ?? '' + message.info = object.info ?? '' + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? BigInt(object.gasWanted.toString()) + : BigInt(0) + 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 + }, + toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { + const obj: any = {} + obj.code = message.code === 0 ? undefined : message.code + obj.data = message.data ? base64FromBytes(message.data) : undefined + obj.log = message.log === '' ? undefined : message.log + obj.info = message.info === '' ? undefined : message.info + obj.gas_wanted = + message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined + obj.gas_used = + message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toAmino(e) : undefined)) + } else { + obj.events = message.events + } + obj.codespace = message.codespace === '' ? undefined : message.codespace + obj.sender = message.sender === '' ? undefined : message.sender + obj.priority = + message.priority !== BigInt(0) ? message.priority.toString() : undefined + obj.mempool_error = + message.mempoolError === '' ? undefined : message.mempoolError + return obj + }, + fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { + return ResponseCheckTx.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { + return ResponseCheckTx.decode(message.value) + }, + toProto(message: ResponseCheckTx): Uint8Array { + return ResponseCheckTx.encode(message).finish() + }, + toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseCheckTx', + value: ResponseCheckTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseCheckTx.typeUrl, ResponseCheckTx) +function createBaseResponseDeliverTx(): ResponseDeliverTx { + return { + code: 0, + data: new Uint8Array(), + log: '', + info: '', + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: '' + } +} +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) + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data) + } + if (message.log !== '') { + writer.uint32(26).string(message.log) + } + if (message.info !== '') { + writer.uint32(34).string(message.info) + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(40).int64(message.gasWanted) + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(48).int64(message.gasUsed) + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim() + } + if (message.codespace !== '') { + writer.uint32(66).string(message.codespace) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseDeliverTx() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.code = reader.uint32() + break + case 2: + message.data = reader.bytes() + break + case 3: + message.log = reader.string() + break + case 4: + message.info = reader.string() + break + case 5: + message.gasWanted = reader.int64() + break + case 6: + message.gasUsed = reader.int64() + break + case 7: + message.events.push(Event.decode(reader, reader.uint32())) + break + case 8: + message.codespace = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseDeliverTx { + const message = createBaseResponseDeliverTx() + message.code = object.code ?? 0 + message.data = object.data ?? new Uint8Array() + message.log = object.log ?? '' + message.info = object.info ?? '' + message.gasWanted = + object.gasWanted !== undefined && object.gasWanted !== null + ? BigInt(object.gasWanted.toString()) + : BigInt(0) + 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 ?? '' + return message + }, + fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { + 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 === 0 ? undefined : message.code + obj.data = message.data ? base64FromBytes(message.data) : undefined + obj.log = message.log === '' ? undefined : message.log + obj.info = message.info === '' ? undefined : message.info + obj.gas_wanted = + message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined + obj.gas_used = + message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toAmino(e) : undefined)) + } else { + obj.events = message.events + } + obj.codespace = message.codespace === '' ? undefined : message.codespace + return obj + }, + fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { + return ResponseDeliverTx.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseDeliverTxProtoMsg): ResponseDeliverTx { + return ResponseDeliverTx.decode(message.value) + }, + toProto(message: ResponseDeliverTx): Uint8Array { + return ResponseDeliverTx.encode(message).finish() + }, + toProtoMsg(message: ResponseDeliverTx): ResponseDeliverTxProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseDeliverTx', + value: ResponseDeliverTx.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseDeliverTx.typeUrl, ResponseDeliverTx) +function createBaseResponseEndBlock(): ResponseEndBlock { + return { + validatorUpdates: [], + 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() + } + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode( + message.consensusParamUpdates, + writer.uint32(18).fork() + ).ldelim() + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseEndBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push( + ValidatorUpdate.decode(reader, reader.uint32()) + ) + break + case 2: + message.consensusParamUpdates = ConsensusParams.decode( + reader, + reader.uint32() + ) + break + case 3: + message.events.push(Event.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseEndBlock { + const message = createBaseResponseEndBlock() + message.validatorUpdates = + object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || [] + message.consensusParamUpdates = + object.consensusParamUpdates !== undefined && + object.consensusParamUpdates !== null + ? ConsensusParams.fromPartial(object.consensusParamUpdates) + : undefined + message.events = object.events?.map((e) => Event.fromPartial(e)) || [] + return message + }, + fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { + 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 = {} + if (message.validatorUpdates) { + obj.validator_updates = message.validatorUpdates.map((e) => + e ? ValidatorUpdate.toAmino(e) : undefined + ) + } else { + obj.validator_updates = message.validatorUpdates + } + obj.consensus_param_updates = message.consensusParamUpdates + ? ConsensusParams.toAmino(message.consensusParamUpdates) + : undefined + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toAmino(e) : undefined)) + } else { + obj.events = message.events + } + return obj + }, + fromAminoMsg(object: ResponseEndBlockAminoMsg): ResponseEndBlock { + return ResponseEndBlock.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseEndBlockProtoMsg): ResponseEndBlock { + return ResponseEndBlock.decode(message.value) + }, + toProto(message: ResponseEndBlock): Uint8Array { + return ResponseEndBlock.encode(message).finish() + }, + toProtoMsg(message: ResponseEndBlock): ResponseEndBlockProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseEndBlock', + value: ResponseEndBlock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseEndBlock.typeUrl, ResponseEndBlock) +function createBaseResponseCommit(): ResponseCommit { + return { + data: new Uint8Array(), + retainHeight: BigInt(0) + } +} +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) + } + if (message.retainHeight !== BigInt(0)) { + writer.uint32(24).int64(message.retainHeight) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseCommit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 2: + message.data = reader.bytes() + break + case 3: + message.retainHeight = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseCommit { + const message = createBaseResponseCommit() + message.data = object.data ?? new Uint8Array() + message.retainHeight = + object.retainHeight !== undefined && object.retainHeight !== null + ? BigInt(object.retainHeight.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ResponseCommitAmino): ResponseCommit { + 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 ? base64FromBytes(message.data) : undefined + obj.retain_height = + message.retainHeight !== BigInt(0) + ? message.retainHeight.toString() + : undefined + return obj + }, + fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { + return ResponseCommit.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { + return ResponseCommit.decode(message.value) + }, + toProto(message: ResponseCommit): Uint8Array { + return ResponseCommit.encode(message).finish() + }, + toProtoMsg(message: ResponseCommit): ResponseCommitProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseCommit', + value: ResponseCommit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ResponseCommit.typeUrl, ResponseCommit) +function createBaseResponseListSnapshots(): ResponseListSnapshots { + return { + snapshots: [] + } +} +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() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ResponseListSnapshots { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseListSnapshots() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ResponseListSnapshots { + const message = createBaseResponseListSnapshots() + message.snapshots = + object.snapshots?.map((e) => Snapshot.fromPartial(e)) || [] + return message + }, + fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { + const message = createBaseResponseListSnapshots() + message.snapshots = + object.snapshots?.map((e) => Snapshot.fromAmino(e)) || [] + return message + }, + toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { + const obj: any = {} + if (message.snapshots) { + obj.snapshots = message.snapshots.map((e) => + e ? Snapshot.toAmino(e) : undefined + ) + } else { + obj.snapshots = message.snapshots + } + return obj + }, + fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { + return ResponseListSnapshots.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { + return ResponseListSnapshots.decode(message.value) + }, + toProto(message: ResponseListSnapshots): Uint8Array { + return ResponseListSnapshots.encode(message).finish() + }, + toProtoMsg(message: ResponseListSnapshots): ResponseListSnapshotsProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseListSnapshots', + value: ResponseListSnapshots.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ResponseListSnapshots.typeUrl, + ResponseListSnapshots +) +function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { + return { + result: 0 + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ResponseOfferSnapshot { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseOfferSnapshot() + 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): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot() + message.result = object.result ?? 0 + return message + }, + fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { + const message = createBaseResponseOfferSnapshot() + if (object.result !== undefined && object.result !== null) { + message.result = object.result + } + return message + }, + toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { + const obj: any = {} + obj.result = message.result === 0 ? undefined : message.result + return obj + }, + fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.fromAmino(object.value) + }, + fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { + return ResponseOfferSnapshot.decode(message.value) + }, + toProto(message: ResponseOfferSnapshot): Uint8Array { + return ResponseOfferSnapshot.encode(message).finish() + }, + toProtoMsg(message: ResponseOfferSnapshot): ResponseOfferSnapshotProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseOfferSnapshot', + value: ResponseOfferSnapshot.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ResponseOfferSnapshot.typeUrl, + ResponseOfferSnapshot +) +function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { + return { + chunk: new Uint8Array() + } +} +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) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ResponseLoadSnapshotChunk { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseLoadSnapshotChunk() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ResponseLoadSnapshotChunk { + const message = createBaseResponseLoadSnapshotChunk() + message.chunk = object.chunk ?? new Uint8Array() + return message + }, + fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { + 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 ? base64FromBytes(message.chunk) : undefined + return obj + }, + fromAminoMsg( + object: ResponseLoadSnapshotChunkAminoMsg + ): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.fromAmino(object.value) + }, + fromProtoMsg( + message: ResponseLoadSnapshotChunkProtoMsg + ): ResponseLoadSnapshotChunk { + return ResponseLoadSnapshotChunk.decode(message.value) + }, + toProto(message: ResponseLoadSnapshotChunk): Uint8Array { + return ResponseLoadSnapshotChunk.encode(message).finish() + }, + toProtoMsg( + message: ResponseLoadSnapshotChunk + ): ResponseLoadSnapshotChunkProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseLoadSnapshotChunk', + value: ResponseLoadSnapshotChunk.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ResponseLoadSnapshotChunk.typeUrl, + ResponseLoadSnapshotChunk +) +function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { + return { + result: 0, + refetchChunks: [], + rejectSenders: [] + } +} +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) + } + writer.uint32(18).fork() + for (const v of message.refetchChunks) { + writer.uint32(v) + } + writer.ldelim() + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ResponseApplySnapshotChunk { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseApplySnapshotChunk() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any + break + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()) + } + } else { + message.refetchChunks.push(reader.uint32()) + } + break + case 3: + message.rejectSenders.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk() + message.result = object.result ?? 0 + message.refetchChunks = object.refetchChunks?.map((e) => e) || [] + message.rejectSenders = object.rejectSenders?.map((e) => e) || [] + return message + }, + fromAmino( + object: ResponseApplySnapshotChunkAmino + ): ResponseApplySnapshotChunk { + const message = createBaseResponseApplySnapshotChunk() + if (object.result !== undefined && object.result !== null) { + message.result = 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 === 0 ? undefined : message.result + if (message.refetchChunks) { + obj.refetch_chunks = message.refetchChunks.map((e) => e) + } else { + obj.refetch_chunks = message.refetchChunks + } + if (message.rejectSenders) { + obj.reject_senders = message.rejectSenders.map((e) => e) + } else { + obj.reject_senders = message.rejectSenders + } + return obj + }, + fromAminoMsg( + object: ResponseApplySnapshotChunkAminoMsg + ): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.fromAmino(object.value) + }, + fromProtoMsg( + message: ResponseApplySnapshotChunkProtoMsg + ): ResponseApplySnapshotChunk { + return ResponseApplySnapshotChunk.decode(message.value) + }, + toProto(message: ResponseApplySnapshotChunk): Uint8Array { + return ResponseApplySnapshotChunk.encode(message).finish() + }, + toProtoMsg( + message: ResponseApplySnapshotChunk + ): ResponseApplySnapshotChunkProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseApplySnapshotChunk', + value: ResponseApplySnapshotChunk.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ResponseApplySnapshotChunk.typeUrl, + ResponseApplySnapshotChunk +) +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { + return { + txs: [] + } +} +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) + const 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 + } + } + 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 = message.txs + } + 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 + ): ResponseProcessProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseResponseProcessProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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 = object.status + } + return message + }, + toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { + const obj: any = {} + obj.status = message.status === 0 ? undefined : message.status + return obj + }, + fromAminoMsg( + object: ResponseProcessProposalAminoMsg + ): ResponseProcessProposal { + return ResponseProcessProposal.fromAmino(object.value) + }, + fromProtoMsg( + message: ResponseProcessProposalProtoMsg + ): ResponseProcessProposal { + return ResponseProcessProposal.decode(message.value) + }, + toProto(message: ResponseProcessProposal): Uint8Array { + return ResponseProcessProposal.encode(message).finish() + }, + toProtoMsg( + message: ResponseProcessProposal + ): ResponseProcessProposalProtoMsg { + return { + typeUrl: '/tendermint.abci.ResponseProcessProposal', + value: ResponseProcessProposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register( + ResponseProcessProposal.typeUrl, + ResponseProcessProposal +) +function createBaseCommitInfo(): CommitInfo { + return { + round: 0, + votes: [] + } +} +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) + } + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.round = reader.int32() + break + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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.round = message.round === 0 ? undefined : message.round + if (message.votes) { + obj.votes = message.votes.map((e) => + e ? VoteInfo.toAmino(e) : undefined + ) + } else { + obj.votes = message.votes + } + return obj + }, + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value) + }, + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value) + }, + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish() + }, + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { + return { + typeUrl: '/tendermint.abci.CommitInfo', + value: CommitInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CommitInfo.typeUrl, CommitInfo) +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { + return { + round: 0, + votes: [] + } +} +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) { + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ExtendedCommitInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExtendedCommitInfo() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.round = reader.int32() + break + case 2: + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo() + message.round = object.round ?? 0 + message.votes = + object.votes?.map((e) => ExtendedVoteInfo.fromPartial(e)) || [] + return message + }, + 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: ExtendedCommitInfo): ExtendedCommitInfoAmino { + const obj: any = {} + obj.round = message.round === 0 ? undefined : message.round + if (message.votes) { + obj.votes = message.votes.map((e) => + e ? ExtendedVoteInfo.toAmino(e) : undefined + ) + } else { + obj.votes = message.votes + } + return obj + }, + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value) + }, + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value) + }, + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish() + }, + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { + return { + typeUrl: '/tendermint.abci.ExtendedCommitInfo', + value: ExtendedCommitInfo.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ExtendedCommitInfo.typeUrl, ExtendedCommitInfo) +function createBaseEvent(): Event { + return { + type: '', + attributes: [] + } +} +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) + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvent() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.string() + break + case 2: + message.attributes.push( + EventAttribute.decode(reader, reader.uint32()) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Event { + const message = createBaseEvent() + message.type = object.type ?? '' + message.attributes = + object.attributes?.map((e) => EventAttribute.fromPartial(e)) || [] + return message + }, + fromAmino(object: EventAmino): Event { + 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 = {} + obj.type = message.type === '' ? undefined : message.type + if (message.attributes) { + obj.attributes = message.attributes.map((e) => + e ? EventAttribute.toAmino(e) : undefined + ) + } else { + obj.attributes = message.attributes + } + return obj + }, + fromAminoMsg(object: EventAminoMsg): Event { + return Event.fromAmino(object.value) + }, + fromProtoMsg(message: EventProtoMsg): Event { + return Event.decode(message.value) + }, + toProto(message: Event): Uint8Array { + return Event.encode(message).finish() + }, + toProtoMsg(message: Event): EventProtoMsg { + return { + typeUrl: '/tendermint.abci.Event', + value: Event.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Event.typeUrl, Event) +function createBaseEventAttribute(): EventAttribute { + return { + 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 !== '') { + writer.uint32(10).string(message.key) + } + if (message.value !== '') { + writer.uint32(18).string(message.value) + } + if (message.index === true) { + writer.uint32(24).bool(message.index) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventAttribute() + 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 + case 3: + message.index = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): EventAttribute { + const message = createBaseEventAttribute() + message.key = object.key ?? '' + message.value = object.value ?? '' + message.index = object.index ?? false + return message + }, + fromAmino(object: EventAttributeAmino): EventAttribute { + 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 = {} + obj.key = message.key === '' ? undefined : message.key + obj.value = message.value === '' ? undefined : message.value + obj.index = message.index === false ? undefined : message.index + return obj + }, + fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { + return EventAttribute.fromAmino(object.value) + }, + fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { + return EventAttribute.decode(message.value) + }, + toProto(message: EventAttribute): Uint8Array { + return EventAttribute.encode(message).finish() + }, + toProtoMsg(message: EventAttribute): EventAttributeProtoMsg { + return { + typeUrl: '/tendermint.abci.EventAttribute', + value: EventAttribute.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(EventAttribute.typeUrl, EventAttribute) +function createBaseTxResult(): TxResult { + return { + height: BigInt(0), + index: 0, + tx: new Uint8Array(), + result: ResponseDeliverTx.fromPartial({}) + } +} +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) + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index) + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx) + } + if (message.result !== undefined) { + ResponseDeliverTx.encode( + message.result, + writer.uint32(34).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxResult() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.int64() + break + case 2: + message.index = reader.uint32() + break + case 3: + message.tx = reader.bytes() + break + case 4: + message.result = ResponseDeliverTx.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TxResult { + const message = createBaseTxResult() + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.index = object.index ?? 0 + message.tx = object.tx ?? new Uint8Array() + message.result = + object.result !== undefined && object.result !== null + ? ResponseDeliverTx.fromPartial(object.result) + : undefined + return message + }, + fromAmino(object: TxResultAmino): TxResult { + 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 !== BigInt(0) ? message.height.toString() : undefined + obj.index = message.index === 0 ? undefined : message.index + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined + obj.result = message.result + ? ResponseDeliverTx.toAmino(message.result) + : undefined + return obj + }, + fromAminoMsg(object: TxResultAminoMsg): TxResult { + return TxResult.fromAmino(object.value) + }, + fromProtoMsg(message: TxResultProtoMsg): TxResult { + return TxResult.decode(message.value) + }, + toProto(message: TxResult): Uint8Array { + return TxResult.encode(message).finish() + }, + toProtoMsg(message: TxResult): TxResultProtoMsg { + return { + typeUrl: '/tendermint.abci.TxResult', + value: TxResult.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TxResult.typeUrl, TxResult) +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + power: BigInt(0) + } +} +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) + } + if (message.power !== BigInt(0)) { + writer.uint32(24).int64(message.power) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.bytes() + break + case 3: + message.power = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator() + message.address = object.address ?? new Uint8Array() + message.power = + object.power !== undefined && object.power !== null + ? BigInt(object.power.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ValidatorAmino): Validator { + 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 ? base64FromBytes(message.address) : undefined + obj.power = + message.power !== BigInt(0) ? message.power.toString() : undefined + return obj + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value) + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value) + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish() + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: '/tendermint.abci.Validator', + value: Validator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Validator.typeUrl, Validator) +function createBaseValidatorUpdate(): ValidatorUpdate { + return { + pubKey: PublicKey.fromPartial({}), + power: BigInt(0) + } +} +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() + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorUpdate() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break + case 2: + message.power = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorUpdate { + const message = createBaseValidatorUpdate() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.power = + object.power !== undefined && object.power !== null + ? BigInt(object.power.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { + 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 = {} + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined + obj.power = + message.power !== BigInt(0) ? message.power.toString() : undefined + return obj + }, + fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { + return ValidatorUpdate.fromAmino(object.value) + }, + fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { + return ValidatorUpdate.decode(message.value) + }, + toProto(message: ValidatorUpdate): Uint8Array { + return ValidatorUpdate.encode(message).finish() + }, + toProtoMsg(message: ValidatorUpdate): ValidatorUpdateProtoMsg { + return { + typeUrl: '/tendermint.abci.ValidatorUpdate', + value: ValidatorUpdate.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValidatorUpdate.typeUrl, ValidatorUpdate) +function createBaseVoteInfo(): VoteInfo { + return { + validator: Validator.fromPartial({}), + signedLastBlock: false + } +} +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() + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVoteInfo() + 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 + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): VoteInfo { + const message = createBaseVoteInfo() + message.validator = + object.validator !== undefined && object.validator !== null + ? Validator.fromPartial(object.validator) + : undefined + message.signedLastBlock = object.signedLastBlock ?? false + return message + }, + fromAmino(object: VoteInfoAmino): VoteInfo { + 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 = {} + obj.validator = message.validator + ? Validator.toAmino(message.validator) + : undefined + obj.signed_last_block = + message.signedLastBlock === false ? undefined : message.signedLastBlock + return obj + }, + fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { + return VoteInfo.fromAmino(object.value) + }, + fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { + return VoteInfo.decode(message.value) + }, + toProto(message: VoteInfo): Uint8Array { + return VoteInfo.encode(message).finish() + }, + toProtoMsg(message: VoteInfo): VoteInfoProtoMsg { + return { + typeUrl: '/tendermint.abci.VoteInfo', + value: VoteInfo.encode(message).finish() + } + } +} +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) + const 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 === false ? undefined : 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: new Date(), + totalVotingPower: BigInt(0) + } +} +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) + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim() + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height) + } + if (message.time !== undefined) { + Timestamp.encode( + toTimestamp(message.time), + writer.uint32(34).fork() + ).ldelim() + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(40).int64(message.totalVotingPower) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMisbehavior() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any + break + case 2: + message.validator = Validator.decode(reader, reader.uint32()) + break + case 3: + message.height = reader.int64() + break + case 4: + message.time = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 5: + message.totalVotingPower = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + 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) + message.time = object.time ?? undefined + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? BigInt(object.totalVotingPower.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior() + if (object.type !== undefined && object.type !== null) { + message.type = 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: Misbehavior): MisbehaviorAmino { + const obj: any = {} + obj.type = message.type === 0 ? undefined : message.type + obj.validator = message.validator + ? Validator.toAmino(message.validator) + : undefined + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.time = message.time + ? Timestamp.toAmino(toTimestamp(message.time)) + : undefined + obj.total_voting_power = + message.totalVotingPower !== BigInt(0) + ? message.totalVotingPower.toString() + : undefined + return obj + }, + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value) + }, + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value) + }, + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish() + }, + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { + return { + typeUrl: '/tendermint.abci.Misbehavior', + value: Misbehavior.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Misbehavior.typeUrl, Misbehavior) +function createBaseSnapshot(): Snapshot { + return { + height: BigInt(0), + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: new Uint8Array() + } +} +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) + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format) + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks) + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash) + } + if (message.metadata.length !== 0) { + writer.uint32(42).bytes(message.metadata) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + const end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSnapshot() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() + break + case 2: + message.format = reader.uint32() + break + case 3: + message.chunks = reader.uint32() + break + case 4: + message.hash = reader.bytes() + break + case 5: + message.metadata = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Snapshot { + const message = createBaseSnapshot() + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.format = object.format ?? 0 + message.chunks = object.chunks ?? 0 + message.hash = object.hash ?? new Uint8Array() + message.metadata = object.metadata ?? new Uint8Array() + return message + }, + fromAmino(object: SnapshotAmino): Snapshot { + 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 !== BigInt(0) ? message.height.toString() : undefined + obj.format = message.format === 0 ? undefined : message.format + obj.chunks = message.chunks === 0 ? undefined : message.chunks + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined + obj.metadata = message.metadata + ? base64FromBytes(message.metadata) + : undefined + return obj + }, + fromAminoMsg(object: SnapshotAminoMsg): Snapshot { + return Snapshot.fromAmino(object.value) + }, + fromProtoMsg(message: SnapshotProtoMsg): Snapshot { + return Snapshot.decode(message.value) + }, + toProto(message: Snapshot): Uint8Array { + return Snapshot.encode(message).finish() + }, + toProtoMsg(message: Snapshot): SnapshotProtoMsg { + return { + typeUrl: '/tendermint.abci.Snapshot', + value: Snapshot.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Snapshot.typeUrl, Snapshot) diff --git a/src/proto/osmojs/tendermint/crypto/keys.ts b/src/proto/osmojs/tendermint/crypto/keys.ts new file mode 100644 index 0000000..89926ca --- /dev/null +++ b/src/proto/osmojs/tendermint/crypto/keys.ts @@ -0,0 +1,121 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary' +import { bytesFromBase64, base64FromBytes } from '../../../helpers' +import { GlobalDecoderRegistry } from '../../registry' +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKey { + ed25519?: Uint8Array + secp256k1?: Uint8Array +} +export interface PublicKeyProtoMsg { + typeUrl: '/tendermint.crypto.PublicKey' + value: Uint8Array +} +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKeyAmino { + ed25519?: string + secp256k1?: string +} +export interface PublicKeyAminoMsg { + type: '/tendermint.crypto.PublicKey' + value: PublicKeyAmino +} +/** PublicKey defines the keys available for use with Validators */ +export interface PublicKeySDKType { + ed25519?: Uint8Array + secp256k1?: Uint8Array +} +function createBasePublicKey(): PublicKey { + return { + ed25519: undefined, + secp256k1: undefined + } +} +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) + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePublicKey() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes() + break + case 2: + message.secp256k1 = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PublicKey { + const message = createBasePublicKey() + message.ed25519 = object.ed25519 ?? undefined + message.secp256k1 = object.secp256k1 ?? undefined + return message + }, + fromAmino(object: PublicKeyAmino): PublicKey { + 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 ? base64FromBytes(message.ed25519) : undefined + obj.secp256k1 = message.secp256k1 + ? base64FromBytes(message.secp256k1) + : undefined + return obj + }, + fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { + return PublicKey.fromAmino(object.value) + }, + fromProtoMsg(message: PublicKeyProtoMsg): PublicKey { + return PublicKey.decode(message.value) + }, + toProto(message: PublicKey): Uint8Array { + return PublicKey.encode(message).finish() + }, + toProtoMsg(message: PublicKey): PublicKeyProtoMsg { + return { + typeUrl: '/tendermint.crypto.PublicKey', + value: PublicKey.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PublicKey.typeUrl, PublicKey) diff --git a/src/proto/osmojs/tendermint/crypto/proof.ts b/src/proto/osmojs/tendermint/crypto/proof.ts new file mode 100644 index 0000000..57a5420 --- /dev/null +++ b/src/proto/osmojs/tendermint/crypto/proof.ts @@ -0,0 +1,732 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary' +import { bytesFromBase64, base64FromBytes } from '../../../helpers' +import { GlobalDecoderRegistry } from '../../registry' +export interface Proof { + total: bigint + index: bigint + leafHash: Uint8Array + aunts: Uint8Array[] +} +export interface ProofProtoMsg { + typeUrl: '/tendermint.crypto.Proof' + value: Uint8Array +} +export interface ProofAmino { + total?: string + index?: string + leaf_hash?: string + aunts?: string[] +} +export interface ProofAminoMsg { + type: '/tendermint.crypto.Proof' + value: ProofAmino +} +export interface ProofSDKType { + total: bigint + index: bigint + leaf_hash: Uint8Array + aunts: Uint8Array[] +} +export interface ValueOp { + /** Encoded in ProofOp.Key. */ + key: Uint8Array + /** To encode in ProofOp.Data */ + proof?: Proof +} +export interface ValueOpProtoMsg { + typeUrl: '/tendermint.crypto.ValueOp' + value: Uint8Array +} +export interface ValueOpAmino { + /** Encoded in ProofOp.Key. */ + key?: string + /** To encode in ProofOp.Data */ + proof?: ProofAmino +} +export interface ValueOpAminoMsg { + type: '/tendermint.crypto.ValueOp' + value: ValueOpAmino +} +export interface ValueOpSDKType { + key: Uint8Array + proof?: ProofSDKType +} +export interface DominoOp { + key: string + input: string + output: string +} +export interface DominoOpProtoMsg { + typeUrl: '/tendermint.crypto.DominoOp' + value: Uint8Array +} +export interface DominoOpAmino { + key?: string + input?: string + output?: string +} +export interface DominoOpAminoMsg { + type: '/tendermint.crypto.DominoOp' + value: DominoOpAmino +} +export interface DominoOpSDKType { + key: string + input: string + output: string +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string + key: Uint8Array + data: Uint8Array +} +export interface ProofOpProtoMsg { + typeUrl: '/tendermint.crypto.ProofOp' + value: Uint8Array +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpAmino { + type?: string + key?: string + data?: string +} +export interface ProofOpAminoMsg { + type: '/tendermint.crypto.ProofOp' + value: ProofOpAmino +} +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOpSDKType { + type: string + key: Uint8Array + data: Uint8Array +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOps { + ops: ProofOp[] +} +export interface ProofOpsProtoMsg { + typeUrl: '/tendermint.crypto.ProofOps' + value: Uint8Array +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsAmino { + ops?: ProofOpAmino[] +} +export interface ProofOpsAminoMsg { + type: '/tendermint.crypto.ProofOps' + value: ProofOpsAmino +} +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOpsSDKType { + ops: ProofOpSDKType[] +} +function createBaseProof(): Proof { + return { + total: BigInt(0), + index: BigInt(0), + leafHash: new Uint8Array(), + aunts: [] + } +} +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) + } + if (message.index !== BigInt(0)) { + writer.uint32(16).int64(message.index) + } + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash) + } + for (const v of message.aunts) { + writer.uint32(34).bytes(v!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.total = reader.int64() + break + case 2: + message.index = reader.int64() + break + case 3: + message.leafHash = reader.bytes() + break + case 4: + message.aunts.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Proof { + const message = createBaseProof() + message.total = + object.total !== undefined && object.total !== null + ? BigInt(object.total.toString()) + : BigInt(0) + message.index = + object.index !== undefined && object.index !== null + ? BigInt(object.index.toString()) + : BigInt(0) + message.leafHash = object.leafHash ?? new Uint8Array() + message.aunts = object.aunts?.map((e) => e) || [] + return message + }, + fromAmino(object: ProofAmino): Proof { + 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 !== BigInt(0) ? message.total.toString() : undefined + obj.index = + message.index !== BigInt(0) ? message.index.toString() : undefined + obj.leaf_hash = message.leafHash + ? base64FromBytes(message.leafHash) + : undefined + if (message.aunts) { + obj.aunts = message.aunts.map((e) => base64FromBytes(e)) + } else { + obj.aunts = message.aunts + } + return obj + }, + fromAminoMsg(object: ProofAminoMsg): Proof { + return Proof.fromAmino(object.value) + }, + fromProtoMsg(message: ProofProtoMsg): Proof { + return Proof.decode(message.value) + }, + toProto(message: Proof): Uint8Array { + return Proof.encode(message).finish() + }, + toProtoMsg(message: Proof): ProofProtoMsg { + return { + typeUrl: '/tendermint.crypto.Proof', + value: Proof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Proof.typeUrl, Proof) +function createBaseValueOp(): ValueOp { + return { + key: new Uint8Array(), + 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) + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValueOp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.bytes() + break + case 2: + message.proof = Proof.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValueOp { + const message = createBaseValueOp() + message.key = object.key ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message + }, + fromAmino(object: ValueOpAmino): ValueOp { + 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 ? base64FromBytes(message.key) : undefined + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined + return obj + }, + fromAminoMsg(object: ValueOpAminoMsg): ValueOp { + return ValueOp.fromAmino(object.value) + }, + fromProtoMsg(message: ValueOpProtoMsg): ValueOp { + return ValueOp.decode(message.value) + }, + toProto(message: ValueOp): Uint8Array { + return ValueOp.encode(message).finish() + }, + toProtoMsg(message: ValueOp): ValueOpProtoMsg { + return { + typeUrl: '/tendermint.crypto.ValueOp', + value: ValueOp.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValueOp.typeUrl, ValueOp) +function createBaseDominoOp(): DominoOp { + return { + key: '', + input: '', + output: '' + } +} +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) + } + if (message.input !== '') { + writer.uint32(18).string(message.input) + } + if (message.output !== '') { + writer.uint32(26).string(message.output) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDominoOp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.key = reader.string() + break + case 2: + message.input = reader.string() + break + case 3: + message.output = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): DominoOp { + const message = createBaseDominoOp() + message.key = object.key ?? '' + message.input = object.input ?? '' + message.output = object.output ?? '' + return message + }, + fromAmino(object: DominoOpAmino): DominoOp { + 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 = {} + obj.key = message.key === '' ? undefined : message.key + obj.input = message.input === '' ? undefined : message.input + obj.output = message.output === '' ? undefined : message.output + return obj + }, + fromAminoMsg(object: DominoOpAminoMsg): DominoOp { + return DominoOp.fromAmino(object.value) + }, + fromProtoMsg(message: DominoOpProtoMsg): DominoOp { + return DominoOp.decode(message.value) + }, + toProto(message: DominoOp): Uint8Array { + return DominoOp.encode(message).finish() + }, + toProtoMsg(message: DominoOp): DominoOpProtoMsg { + return { + typeUrl: '/tendermint.crypto.DominoOp', + value: DominoOp.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(DominoOp.typeUrl, DominoOp) +function createBaseProofOp(): ProofOp { + return { + type: '', + key: new Uint8Array(), + data: new Uint8Array() + } +} +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) + } + if (message.key.length !== 0) { + writer.uint32(18).bytes(message.key) + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofOp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.string() + break + case 2: + message.key = reader.bytes() + break + case 3: + message.data = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ProofOp { + const message = createBaseProofOp() + message.type = object.type ?? '' + message.key = object.key ?? new Uint8Array() + message.data = object.data ?? new Uint8Array() + return message + }, + fromAmino(object: ProofOpAmino): ProofOp { + 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 === '' ? undefined : message.type + obj.key = message.key ? base64FromBytes(message.key) : undefined + obj.data = message.data ? base64FromBytes(message.data) : undefined + return obj + }, + fromAminoMsg(object: ProofOpAminoMsg): ProofOp { + return ProofOp.fromAmino(object.value) + }, + fromProtoMsg(message: ProofOpProtoMsg): ProofOp { + return ProofOp.decode(message.value) + }, + toProto(message: ProofOp): Uint8Array { + return ProofOp.encode(message).finish() + }, + toProtoMsg(message: ProofOp): ProofOpProtoMsg { + return { + typeUrl: '/tendermint.crypto.ProofOp', + value: ProofOp.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ProofOp.typeUrl, ProofOp) +function createBaseProofOps(): ProofOps { + return { + ops: [] + } +} +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() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProofOps() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ProofOps { + const message = createBaseProofOps() + message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || [] + return message + }, + fromAmino(object: ProofOpsAmino): ProofOps { + const message = createBaseProofOps() + message.ops = object.ops?.map((e) => ProofOp.fromAmino(e)) || [] + return message + }, + toAmino(message: ProofOps): ProofOpsAmino { + const obj: any = {} + if (message.ops) { + obj.ops = message.ops.map((e) => (e ? ProofOp.toAmino(e) : undefined)) + } else { + obj.ops = message.ops + } + return obj + }, + fromAminoMsg(object: ProofOpsAminoMsg): ProofOps { + return ProofOps.fromAmino(object.value) + }, + fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { + return ProofOps.decode(message.value) + }, + toProto(message: ProofOps): Uint8Array { + return ProofOps.encode(message).finish() + }, + toProtoMsg(message: ProofOps): ProofOpsProtoMsg { + return { + typeUrl: '/tendermint.crypto.ProofOps', + value: ProofOps.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ProofOps.typeUrl, ProofOps) diff --git a/src/proto/osmojs/tendermint/types/params.ts b/src/proto/osmojs/tendermint/types/params.ts new file mode 100644 index 0000000..f2ae1d9 --- /dev/null +++ b/src/proto/osmojs/tendermint/types/params.ts @@ -0,0 +1,916 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { + Duration, + DurationAmino, + DurationSDKType +} from 'cosmjs-types/google/protobuf/duration' +import { BinaryReader, BinaryWriter } from '../../../binary' +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 +} +export interface ConsensusParamsProtoMsg { + typeUrl: '/tendermint.types.ConsensusParams' + value: Uint8Array +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsAmino { + block?: BlockParamsAmino + evidence?: EvidenceParamsAmino + validator?: ValidatorParamsAmino + version?: VersionParamsAmino +} +export interface ConsensusParamsAminoMsg { + type: '/tendermint.types.ConsensusParams' + value: ConsensusParamsAmino +} +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParamsSDKType { + block?: BlockParamsSDKType + evidence?: EvidenceParamsSDKType + validator?: ValidatorParamsSDKType + version?: VersionParamsSDKType +} +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: bigint + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: bigint +} +export interface BlockParamsProtoMsg { + typeUrl: '/tendermint.types.BlockParams' + value: Uint8Array +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsAmino { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + max_bytes?: string + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + max_gas?: string +} +export interface BlockParamsAminoMsg { + type: '/tendermint.types.BlockParams' + value: BlockParamsAmino +} +/** BlockParams contains limits on the block size. */ +export interface BlockParamsSDKType { + max_bytes: bigint + max_gas: bigint +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: bigint + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration: Duration + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: bigint +} +export interface EvidenceParamsProtoMsg { + typeUrl: '/tendermint.types.EvidenceParams' + value: Uint8Array +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsAmino { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + max_age_num_blocks?: string + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + max_age_duration?: DurationAmino + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + max_bytes?: string +} +export interface EvidenceParamsAminoMsg { + type: '/tendermint.types.EvidenceParams' + value: EvidenceParamsAmino +} +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParamsSDKType { + max_age_num_blocks: bigint + max_age_duration: DurationSDKType + max_bytes: bigint +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[] +} +export interface ValidatorParamsProtoMsg { + typeUrl: '/tendermint.types.ValidatorParams' + value: Uint8Array +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsAmino { + pub_key_types?: string[] +} +export interface ValidatorParamsAminoMsg { + type: '/tendermint.types.ValidatorParams' + value: ValidatorParamsAmino +} +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParamsSDKType { + pub_key_types: string[] +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + app: bigint +} +export interface VersionParamsProtoMsg { + typeUrl: '/tendermint.types.VersionParams' + value: Uint8Array +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsAmino { + app?: string +} +export interface VersionParamsAminoMsg { + type: '/tendermint.types.VersionParams' + value: VersionParamsAmino +} +/** VersionParams contains the ABCI application version. */ +export interface VersionParamsSDKType { + app: bigint +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: bigint + blockMaxGas: bigint +} +export interface HashedParamsProtoMsg { + typeUrl: '/tendermint.types.HashedParams' + value: Uint8Array +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsAmino { + block_max_bytes?: string + block_max_gas?: string +} +export interface HashedParamsAminoMsg { + type: '/tendermint.types.HashedParams' + value: HashedParamsAmino +} +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParamsSDKType { + block_max_bytes: bigint + block_max_gas: bigint +} +function createBaseConsensusParams(): ConsensusParams { + return { + 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() + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim() + } + if (message.validator !== undefined) { + ValidatorParams.encode( + message.validator, + writer.uint32(26).fork() + ).ldelim() + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensusParams() + 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()) + break + default: + reader.skipType(tag & 7) + break + } + } + 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 { + 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 = {} + 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 + return obj + }, + fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { + return ConsensusParams.fromAmino(object.value) + }, + fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { + return ConsensusParams.decode(message.value) + }, + toProto(message: ConsensusParams): Uint8Array { + return ConsensusParams.encode(message).finish() + }, + toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + return { + typeUrl: '/tendermint.types.ConsensusParams', + value: ConsensusParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ConsensusParams.typeUrl, ConsensusParams) +function createBaseBlockParams(): BlockParams { + return { + maxBytes: 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) + } + if (message.maxGas !== BigInt(0)) { + writer.uint32(16).int64(message.maxGas) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64() + break + case 2: + message.maxGas = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + 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 { + 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 !== BigInt(0) ? message.maxBytes.toString() : undefined + obj.max_gas = + message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined + return obj + }, + fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { + return BlockParams.fromAmino(object.value) + }, + fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { + return BlockParams.decode(message.value) + }, + toProto(message: BlockParams): Uint8Array { + return BlockParams.encode(message).finish() + }, + toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + return { + typeUrl: '/tendermint.types.BlockParams', + value: BlockParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BlockParams.typeUrl, BlockParams) +function createBaseEvidenceParams(): EvidenceParams { + return { + maxAgeNumBlocks: BigInt(0), + 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) + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim() + } + if (message.maxBytes !== BigInt(0)) { + writer.uint32(24).int64(message.maxBytes) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvidenceParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64() + break + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()) + break + case 3: + message.maxBytes = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): EvidenceParams { + const message = createBaseEvidenceParams() + message.maxAgeNumBlocks = + object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null + ? BigInt(object.maxAgeNumBlocks.toString()) + : BigInt(0) + message.maxAgeDuration = + object.maxAgeDuration !== undefined && object.maxAgeDuration !== null + ? Duration.fromPartial(object.maxAgeDuration) + : undefined + message.maxBytes = + object.maxBytes !== undefined && object.maxBytes !== null + ? BigInt(object.maxBytes.toString()) + : BigInt(0) + return message + }, + fromAmino(object: EvidenceParamsAmino): EvidenceParams { + 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 = {} + obj.max_age_num_blocks = + message.maxAgeNumBlocks !== BigInt(0) + ? message.maxAgeNumBlocks.toString() + : undefined + obj.max_age_duration = message.maxAgeDuration + ? Duration.toAmino(message.maxAgeDuration) + : undefined + obj.max_bytes = + message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined + return obj + }, + fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { + return EvidenceParams.fromAmino(object.value) + }, + fromProtoMsg(message: EvidenceParamsProtoMsg): EvidenceParams { + return EvidenceParams.decode(message.value) + }, + toProto(message: EvidenceParams): Uint8Array { + return EvidenceParams.encode(message).finish() + }, + toProtoMsg(message: EvidenceParams): EvidenceParamsProtoMsg { + return { + typeUrl: '/tendermint.types.EvidenceParams', + value: EvidenceParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(EvidenceParams.typeUrl, EvidenceParams) +function createBaseValidatorParams(): ValidatorParams { + return { + pubKeyTypes: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorParams { + const message = createBaseValidatorParams() + message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || [] + return message + }, + fromAmino(object: ValidatorParamsAmino): ValidatorParams { + const message = createBaseValidatorParams() + message.pubKeyTypes = object.pub_key_types?.map((e) => e) || [] + return message + }, + toAmino(message: ValidatorParams): ValidatorParamsAmino { + const obj: any = {} + if (message.pubKeyTypes) { + obj.pub_key_types = message.pubKeyTypes.map((e) => e) + } else { + obj.pub_key_types = message.pubKeyTypes + } + return obj + }, + fromAminoMsg(object: ValidatorParamsAminoMsg): ValidatorParams { + return ValidatorParams.fromAmino(object.value) + }, + fromProtoMsg(message: ValidatorParamsProtoMsg): ValidatorParams { + return ValidatorParams.decode(message.value) + }, + toProto(message: ValidatorParams): Uint8Array { + return ValidatorParams.encode(message).finish() + }, + toProtoMsg(message: ValidatorParams): ValidatorParamsProtoMsg { + return { + typeUrl: '/tendermint.types.ValidatorParams', + value: ValidatorParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValidatorParams.typeUrl, ValidatorParams) +function createBaseVersionParams(): VersionParams { + return { + 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.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVersionParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.app = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): VersionParams { + const message = createBaseVersionParams() + message.app = + object.app !== undefined && object.app !== null + ? BigInt(object.app.toString()) + : BigInt(0) + return message + }, + fromAmino(object: VersionParamsAmino): VersionParams { + 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 = message.app !== BigInt(0) ? message.app.toString() : undefined + return obj + }, + fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { + return VersionParams.fromAmino(object.value) + }, + fromProtoMsg(message: VersionParamsProtoMsg): VersionParams { + return VersionParams.decode(message.value) + }, + toProto(message: VersionParams): Uint8Array { + return VersionParams.encode(message).finish() + }, + toProtoMsg(message: VersionParams): VersionParamsProtoMsg { + return { + typeUrl: '/tendermint.types.VersionParams', + value: VersionParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(VersionParams.typeUrl, VersionParams) +function createBaseHashedParams(): HashedParams { + return { + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0) + } +} +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) + } + if (message.blockMaxGas !== BigInt(0)) { + writer.uint32(16).int64(message.blockMaxGas) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHashedParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64() + break + case 2: + message.blockMaxGas = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): HashedParams { + const message = createBaseHashedParams() + message.blockMaxBytes = + object.blockMaxBytes !== undefined && object.blockMaxBytes !== null + ? BigInt(object.blockMaxBytes.toString()) + : BigInt(0) + message.blockMaxGas = + object.blockMaxGas !== undefined && object.blockMaxGas !== null + ? BigInt(object.blockMaxGas.toString()) + : BigInt(0) + return message + }, + fromAmino(object: HashedParamsAmino): HashedParams { + 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 = {} + obj.block_max_bytes = + message.blockMaxBytes !== BigInt(0) + ? message.blockMaxBytes.toString() + : undefined + obj.block_max_gas = + message.blockMaxGas !== BigInt(0) + ? message.blockMaxGas.toString() + : undefined + return obj + }, + fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { + return HashedParams.fromAmino(object.value) + }, + fromProtoMsg(message: HashedParamsProtoMsg): HashedParams { + return HashedParams.decode(message.value) + }, + toProto(message: HashedParams): Uint8Array { + return HashedParams.encode(message).finish() + }, + toProtoMsg(message: HashedParams): HashedParamsProtoMsg { + return { + typeUrl: '/tendermint.types.HashedParams', + value: HashedParams.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(HashedParams.typeUrl, HashedParams) diff --git a/src/proto/osmojs/tendermint/types/types.ts b/src/proto/osmojs/tendermint/types/types.ts new file mode 100644 index 0000000..b120f2b --- /dev/null +++ b/src/proto/osmojs/tendermint/types/types.ts @@ -0,0 +1,2536 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { Proof, ProofAmino, ProofSDKType } from '../crypto/proof' +import { Consensus, ConsensusAmino, ConsensusSDKType } from '../version/types' +import { Timestamp } from 'cosmjs-types/google/protobuf/timestamp' +import { + ValidatorSet, + ValidatorSetAmino, + ValidatorSetSDKType +} from './validator' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { + bytesFromBase64, + base64FromBytes, + toTimestamp, + fromTimestamp, + isSet +} from '../../../helpers' +import { GlobalDecoderRegistry } from '../../registry' +/** BlockIdFlag indicates which BlcokID the signature is for */ +export enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0, + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1 +} +export const BlockIDFlagSDKType = BlockIDFlag +export const BlockIDFlagAmino = BlockIDFlag +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case 'BLOCK_ID_FLAG_UNKNOWN': + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN + case 1: + case 'BLOCK_ID_FLAG_ABSENT': + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT + case 2: + case 'BLOCK_ID_FLAG_COMMIT': + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT + case 3: + case 'BLOCK_ID_FLAG_NIL': + return BlockIDFlag.BLOCK_ID_FLAG_NIL + case -1: + case 'UNRECOGNIZED': + default: + return BlockIDFlag.UNRECOGNIZED + } +} +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return 'BLOCK_ID_FLAG_UNKNOWN' + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return 'BLOCK_ID_FLAG_ABSENT' + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return 'BLOCK_ID_FLAG_COMMIT' + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return 'BLOCK_ID_FLAG_NIL' + case BlockIDFlag.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1 +} +export const SignedMsgTypeSDKType = SignedMsgType +export const SignedMsgTypeAmino = SignedMsgType +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case 'SIGNED_MSG_TYPE_UNKNOWN': + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN + case 1: + case 'SIGNED_MSG_TYPE_PREVOTE': + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE + case 2: + case 'SIGNED_MSG_TYPE_PRECOMMIT': + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT + case 32: + case 'SIGNED_MSG_TYPE_PROPOSAL': + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL + case -1: + case 'UNRECOGNIZED': + default: + return SignedMsgType.UNRECOGNIZED + } +} +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return 'SIGNED_MSG_TYPE_UNKNOWN' + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return 'SIGNED_MSG_TYPE_PREVOTE' + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return 'SIGNED_MSG_TYPE_PRECOMMIT' + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return 'SIGNED_MSG_TYPE_PROPOSAL' + case SignedMsgType.UNRECOGNIZED: + default: + return 'UNRECOGNIZED' + } +} +/** PartsetHeader */ +export interface PartSetHeader { + total: number + hash: Uint8Array +} +export interface PartSetHeaderProtoMsg { + typeUrl: '/tendermint.types.PartSetHeader' + value: Uint8Array +} +/** PartsetHeader */ +export interface PartSetHeaderAmino { + total?: number + hash?: string +} +export interface PartSetHeaderAminoMsg { + type: '/tendermint.types.PartSetHeader' + value: PartSetHeaderAmino +} +/** PartsetHeader */ +export interface PartSetHeaderSDKType { + total: number + hash: Uint8Array +} +export interface Part { + index: number + bytes: Uint8Array + proof: Proof +} +export interface PartProtoMsg { + typeUrl: '/tendermint.types.Part' + value: Uint8Array +} +export interface PartAmino { + index?: number + bytes?: string + proof?: ProofAmino +} +export interface PartAminoMsg { + type: '/tendermint.types.Part' + value: PartAmino +} +export interface PartSDKType { + index: number + bytes: Uint8Array + proof: ProofSDKType +} +/** BlockID */ +export interface BlockID { + hash: Uint8Array + partSetHeader: PartSetHeader +} +export interface BlockIDProtoMsg { + typeUrl: '/tendermint.types.BlockID' + value: Uint8Array +} +/** BlockID */ +export interface BlockIDAmino { + hash?: string + part_set_header?: PartSetHeaderAmino +} +export interface BlockIDAminoMsg { + type: '/tendermint.types.BlockID' + value: BlockIDAmino +} +/** BlockID */ +export interface BlockIDSDKType { + hash: Uint8Array + part_set_header: PartSetHeaderSDKType +} +/** Header defines the structure of a block header. */ +export interface Header { + /** basic block info */ + version: Consensus + chainId: string + height: bigint + time: Date + /** prev block info */ + lastBlockId: BlockID + /** hashes of block data */ + lastCommitHash: Uint8Array + dataHash: Uint8Array + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array + /** validators for the next block */ + nextValidatorsHash: Uint8Array + /** consensus params for current block */ + consensusHash: Uint8Array + /** state after txs from the previous block */ + appHash: Uint8Array + lastResultsHash: Uint8Array + /** consensus info */ + evidenceHash: Uint8Array + /** original proposer of the block */ + proposerAddress: Uint8Array +} +export interface HeaderProtoMsg { + typeUrl: '/tendermint.types.Header' + value: Uint8Array +} +/** Header defines the structure of a block header. */ +export interface HeaderAmino { + /** basic block info */ + version?: ConsensusAmino + chain_id?: string + height?: string + time?: string + /** prev block info */ + last_block_id?: BlockIDAmino + /** hashes of block data */ + last_commit_hash?: string + data_hash?: string + /** hashes from the app output from the prev block */ + validators_hash?: string + /** validators for the next block */ + next_validators_hash?: string + /** consensus params for current block */ + consensus_hash?: string + /** state after txs from the previous block */ + app_hash?: string + last_results_hash?: string + /** consensus info */ + evidence_hash?: string + /** original proposer of the block */ + proposer_address?: string +} +export interface HeaderAminoMsg { + type: '/tendermint.types.Header' + value: HeaderAmino +} +/** Header defines the structure of a block header. */ +export interface HeaderSDKType { + version: ConsensusSDKType + chain_id: string + height: bigint + time: Date + last_block_id: BlockIDSDKType + last_commit_hash: Uint8Array + data_hash: Uint8Array + validators_hash: Uint8Array + next_validators_hash: Uint8Array + consensus_hash: Uint8Array + app_hash: Uint8Array + last_results_hash: Uint8Array + evidence_hash: Uint8Array + proposer_address: Uint8Array +} +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * 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[] +} +export interface DataProtoMsg { + typeUrl: '/tendermint.types.Data' + value: Uint8Array +} +/** Data contains the set of transactions included in the block */ +export interface DataAmino { + /** + * Txs that will be applied by state @ block.Height+1. + * 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?: string[] +} +export interface DataAminoMsg { + type: '/tendermint.types.Data' + value: DataAmino +} +/** Data contains the set of transactions included in the block */ +export interface DataSDKType { + txs: Uint8Array[] +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface Vote { + type: SignedMsgType + height: bigint + round: number + blockId: BlockID + timestamp: Date + validatorAddress: Uint8Array + validatorIndex: number + signature: Uint8Array +} +export interface VoteProtoMsg { + typeUrl: '/tendermint.types.Vote' + value: Uint8Array +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteAmino { + type?: SignedMsgType + height?: string + round?: number + block_id?: BlockIDAmino + timestamp?: string + validator_address?: string + validator_index?: number + signature?: string +} +export interface VoteAminoMsg { + type: '/tendermint.types.Vote' + value: VoteAmino +} +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface VoteSDKType { + type: SignedMsgType + height: bigint + round: number + block_id: BlockIDSDKType + timestamp: Date + validator_address: Uint8Array + validator_index: number + signature: Uint8Array +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: bigint + round: number + blockId: BlockID + signatures: CommitSig[] +} +export interface CommitProtoMsg { + typeUrl: '/tendermint.types.Commit' + value: Uint8Array +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitAmino { + height?: string + round?: number + block_id?: BlockIDAmino + signatures?: CommitSigAmino[] +} +export interface CommitAminoMsg { + type: '/tendermint.types.Commit' + value: CommitAmino +} +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface CommitSDKType { + height: bigint + round: number + block_id: BlockIDSDKType + signatures: CommitSigSDKType[] +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag + validatorAddress: Uint8Array + timestamp: Date + signature: Uint8Array +} +export interface CommitSigProtoMsg { + typeUrl: '/tendermint.types.CommitSig' + value: Uint8Array +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigAmino { + block_id_flag?: BlockIDFlag + validator_address?: string + timestamp?: string + signature?: string +} +export interface CommitSigAminoMsg { + type: '/tendermint.types.CommitSig' + value: CommitSigAmino +} +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSigSDKType { + block_id_flag: BlockIDFlag + validator_address: Uint8Array + timestamp: Date + signature: Uint8Array +} +export interface Proposal { + type: SignedMsgType + height: bigint + round: number + polRound: number + blockId: BlockID + timestamp: Date + signature: Uint8Array +} +export interface ProposalProtoMsg { + typeUrl: '/tendermint.types.Proposal' + value: Uint8Array +} +export interface ProposalAmino { + type?: SignedMsgType + height?: string + round?: number + pol_round?: number + block_id?: BlockIDAmino + timestamp?: string + signature?: string +} +export interface ProposalAminoMsg { + type: '/tendermint.types.Proposal' + value: ProposalAmino +} +export interface ProposalSDKType { + type: SignedMsgType + height: bigint + round: number + pol_round: number + block_id: BlockIDSDKType + timestamp: Date + signature: Uint8Array +} +export interface SignedHeader { + header?: Header + commit?: Commit +} +export interface SignedHeaderProtoMsg { + typeUrl: '/tendermint.types.SignedHeader' + value: Uint8Array +} +export interface SignedHeaderAmino { + header?: HeaderAmino + commit?: CommitAmino +} +export interface SignedHeaderAminoMsg { + type: '/tendermint.types.SignedHeader' + value: SignedHeaderAmino +} +export interface SignedHeaderSDKType { + header?: HeaderSDKType + commit?: CommitSDKType +} +export interface LightBlock { + signedHeader?: SignedHeader + validatorSet?: ValidatorSet +} +export interface LightBlockProtoMsg { + typeUrl: '/tendermint.types.LightBlock' + value: Uint8Array +} +export interface LightBlockAmino { + signed_header?: SignedHeaderAmino + validator_set?: ValidatorSetAmino +} +export interface LightBlockAminoMsg { + type: '/tendermint.types.LightBlock' + value: LightBlockAmino +} +export interface LightBlockSDKType { + signed_header?: SignedHeaderSDKType + validator_set?: ValidatorSetSDKType +} +export interface BlockMeta { + blockId: BlockID + blockSize: bigint + header: Header + numTxs: bigint +} +export interface BlockMetaProtoMsg { + typeUrl: '/tendermint.types.BlockMeta' + value: Uint8Array +} +export interface BlockMetaAmino { + block_id?: BlockIDAmino + block_size?: string + header?: HeaderAmino + num_txs?: string +} +export interface BlockMetaAminoMsg { + type: '/tendermint.types.BlockMeta' + value: BlockMetaAmino +} +export interface BlockMetaSDKType { + block_id: BlockIDSDKType + block_size: bigint + header: HeaderSDKType + num_txs: bigint +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array + data: Uint8Array + proof?: Proof +} +export interface TxProofProtoMsg { + typeUrl: '/tendermint.types.TxProof' + value: Uint8Array +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofAmino { + root_hash?: string + data?: string + proof?: ProofAmino +} +export interface TxProofAminoMsg { + type: '/tendermint.types.TxProof' + value: TxProofAmino +} +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProofSDKType { + root_hash: Uint8Array + data: Uint8Array + proof?: ProofSDKType +} +function createBasePartSetHeader(): PartSetHeader { + return { + total: 0, + hash: new Uint8Array() + } +} +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) + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePartSetHeader() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.total = reader.uint32() + break + case 2: + message.hash = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): PartSetHeader { + const message = createBasePartSetHeader() + message.total = object.total ?? 0 + message.hash = object.hash ?? new Uint8Array() + return message + }, + fromAmino(object: PartSetHeaderAmino): PartSetHeader { + 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 === 0 ? undefined : message.total + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined + return obj + }, + fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { + return PartSetHeader.fromAmino(object.value) + }, + fromProtoMsg(message: PartSetHeaderProtoMsg): PartSetHeader { + return PartSetHeader.decode(message.value) + }, + toProto(message: PartSetHeader): Uint8Array { + return PartSetHeader.encode(message).finish() + }, + toProtoMsg(message: PartSetHeader): PartSetHeaderProtoMsg { + return { + typeUrl: '/tendermint.types.PartSetHeader', + value: PartSetHeader.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(PartSetHeader.typeUrl, PartSetHeader) +function createBasePart(): Part { + return { + index: 0, + bytes: new Uint8Array(), + proof: Proof.fromPartial({}) + } +} +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) + } + if (message.bytes.length !== 0) { + writer.uint32(18).bytes(message.bytes) + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBasePart() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.index = reader.uint32() + break + case 2: + message.bytes = reader.bytes() + break + case 3: + message.proof = Proof.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Part { + const message = createBasePart() + message.index = object.index ?? 0 + message.bytes = object.bytes ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message + }, + fromAmino(object: PartAmino): Part { + 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 === 0 ? undefined : message.index + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined + return obj + }, + fromAminoMsg(object: PartAminoMsg): Part { + return Part.fromAmino(object.value) + }, + fromProtoMsg(message: PartProtoMsg): Part { + return Part.decode(message.value) + }, + toProto(message: Part): Uint8Array { + return Part.encode(message).finish() + }, + toProtoMsg(message: Part): PartProtoMsg { + return { + typeUrl: '/tendermint.types.Part', + value: Part.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Part.typeUrl, Part) +function createBaseBlockID(): BlockID { + return { + hash: new Uint8Array(), + partSetHeader: PartSetHeader.fromPartial({}) + } +} +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) + } + if (message.partSetHeader !== undefined) { + PartSetHeader.encode( + message.partSetHeader, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockID() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes() + break + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BlockID { + const message = createBaseBlockID() + message.hash = object.hash ?? new Uint8Array() + message.partSetHeader = + object.partSetHeader !== undefined && object.partSetHeader !== null + ? PartSetHeader.fromPartial(object.partSetHeader) + : undefined + return message + }, + fromAmino(object: BlockIDAmino): BlockID { + 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 ? base64FromBytes(message.hash) : undefined + obj.part_set_header = message.partSetHeader + ? PartSetHeader.toAmino(message.partSetHeader) + : undefined + return obj + }, + fromAminoMsg(object: BlockIDAminoMsg): BlockID { + return BlockID.fromAmino(object.value) + }, + fromProtoMsg(message: BlockIDProtoMsg): BlockID { + return BlockID.decode(message.value) + }, + toProto(message: BlockID): Uint8Array { + return BlockID.encode(message).finish() + }, + toProtoMsg(message: BlockID): BlockIDProtoMsg { + return { + typeUrl: '/tendermint.types.BlockID', + value: BlockID.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BlockID.typeUrl, BlockID) +function createBaseHeader(): Header { + return { + version: Consensus.fromPartial({}), + chainId: '', + height: BigInt(0), + time: new Date(), + lastBlockId: BlockID.fromPartial({}), + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: new Uint8Array() + } +} +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() + } + if (message.chainId !== '') { + writer.uint32(18).string(message.chainId) + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height) + } + if (message.time !== undefined) { + Timestamp.encode( + toTimestamp(message.time), + writer.uint32(34).fork() + ).ldelim() + } + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim() + } + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash) + } + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash) + } + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash) + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash) + } + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash) + } + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash) + } + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash) + } + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash) + } + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHeader() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()) + break + case 2: + message.chainId = reader.string() + break + case 3: + message.height = reader.int64() + break + case 4: + message.time = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()) + break + case 6: + message.lastCommitHash = reader.bytes() + break + case 7: + message.dataHash = reader.bytes() + break + case 8: + message.validatorsHash = reader.bytes() + break + case 9: + message.nextValidatorsHash = reader.bytes() + break + case 10: + message.consensusHash = reader.bytes() + break + case 11: + message.appHash = reader.bytes() + break + case 12: + message.lastResultsHash = reader.bytes() + break + case 13: + message.evidenceHash = reader.bytes() + break + case 14: + message.proposerAddress = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader() + message.version = + object.version !== undefined && object.version !== null + ? Consensus.fromPartial(object.version) + : undefined + message.chainId = object.chainId ?? '' + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.time = object.time ?? undefined + message.lastBlockId = + object.lastBlockId !== undefined && object.lastBlockId !== null + ? BlockID.fromPartial(object.lastBlockId) + : undefined + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array() + message.dataHash = object.dataHash ?? new Uint8Array() + message.validatorsHash = object.validatorsHash ?? new Uint8Array() + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array() + message.consensusHash = object.consensusHash ?? new Uint8Array() + message.appHash = object.appHash ?? new Uint8Array() + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array() + message.evidenceHash = object.evidenceHash ?? new Uint8Array() + message.proposerAddress = object.proposerAddress ?? new Uint8Array() + return message + }, + fromAmino(object: HeaderAmino): Header { + 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 === '' ? undefined : message.chainId + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + 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 + ? 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 { + return Header.fromAmino(object.value) + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value) + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish() + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: '/tendermint.types.Header', + value: Header.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Header.typeUrl, Header) +function createBaseData(): Data { + return { + txs: [] + } +} +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!) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData() + 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 + } + } + return message + }, + fromPartial(object: Partial): Data { + const message = createBaseData() + message.txs = object.txs?.map((e) => e) || [] + return message + }, + fromAmino(object: DataAmino): Data { + 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) => base64FromBytes(e)) + } else { + obj.txs = message.txs + } + return obj + }, + fromAminoMsg(object: DataAminoMsg): Data { + return Data.fromAmino(object.value) + }, + fromProtoMsg(message: DataProtoMsg): Data { + return Data.decode(message.value) + }, + toProto(message: Data): Uint8Array { + return Data.encode(message).finish() + }, + toProtoMsg(message: Data): DataProtoMsg { + return { + typeUrl: '/tendermint.types.Data', + value: Data.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Data.typeUrl, Data) +function createBaseVote(): Vote { + return { + type: 0, + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + timestamp: new Date(), + validatorAddress: new Uint8Array(), + validatorIndex: 0, + signature: new Uint8Array() + } +} +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) + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height) + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round) + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim() + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(42).fork() + ).ldelim() + } + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress) + } + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex) + } + if (message.signature.length !== 0) { + writer.uint32(66).bytes(message.signature) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVote() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any + break + case 2: + message.height = reader.int64() + break + case 3: + message.round = reader.int32() + break + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()) + break + case 5: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 6: + message.validatorAddress = reader.bytes() + break + case 7: + message.validatorIndex = reader.int32() + break + case 8: + message.signature = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote() + message.type = object.type ?? 0 + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.round = object.round ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.timestamp = object.timestamp ?? undefined + message.validatorAddress = object.validatorAddress ?? new Uint8Array() + message.validatorIndex = object.validatorIndex ?? 0 + message.signature = object.signature ?? new Uint8Array() + return message + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote() + if (object.type !== undefined && object.type !== null) { + message.type = 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 === 0 ? undefined : message.type + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.round = message.round === 0 ? undefined : message.round + obj.block_id = message.blockId + ? BlockID.toAmino(message.blockId) + : undefined + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined + obj.validator_address = message.validatorAddress + ? base64FromBytes(message.validatorAddress) + : undefined + obj.validator_index = + message.validatorIndex === 0 ? undefined : message.validatorIndex + obj.signature = message.signature + ? base64FromBytes(message.signature) + : undefined + return obj + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value) + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value) + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish() + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: '/tendermint.types.Vote', + value: Vote.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Vote.typeUrl, Vote) +function createBaseCommit(): Commit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + signatures: [] + } +} +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) + } + if (message.round !== 0) { + writer.uint32(16).int32(message.round) + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim() + } + for (const v of message.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.height = reader.int64() + break + case 2: + message.round = reader.int32() + break + case 3: + message.blockId = BlockID.decode(reader, reader.uint32()) + break + case 4: + message.signatures.push(CommitSig.decode(reader, reader.uint32())) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Commit { + const message = createBaseCommit() + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.round = object.round ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.signatures = + object.signatures?.map((e) => CommitSig.fromPartial(e)) || [] + return message + }, + fromAmino(object: CommitAmino): Commit { + 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 = {} + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.round = message.round === 0 ? undefined : message.round + obj.block_id = message.blockId + ? BlockID.toAmino(message.blockId) + : undefined + if (message.signatures) { + obj.signatures = message.signatures.map((e) => + e ? CommitSig.toAmino(e) : undefined + ) + } else { + obj.signatures = message.signatures + } + return obj + }, + fromAminoMsg(object: CommitAminoMsg): Commit { + return Commit.fromAmino(object.value) + }, + fromProtoMsg(message: CommitProtoMsg): Commit { + return Commit.decode(message.value) + }, + toProto(message: Commit): Uint8Array { + return Commit.encode(message).finish() + }, + toProtoMsg(message: Commit): CommitProtoMsg { + return { + typeUrl: '/tendermint.types.Commit', + value: Commit.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Commit.typeUrl, Commit) +function createBaseCommitSig(): CommitSig { + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + 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) + } + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress) + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(26).fork() + ).ldelim() + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCommitSig() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32() as any + break + case 2: + message.validatorAddress = reader.bytes() + break + case 3: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 4: + message.signature = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): CommitSig { + const message = createBaseCommitSig() + message.blockIdFlag = object.blockIdFlag ?? 0 + message.validatorAddress = object.validatorAddress ?? new Uint8Array() + message.timestamp = object.timestamp ?? undefined + message.signature = object.signature ?? new Uint8Array() + return message + }, + fromAmino(object: CommitSigAmino): CommitSig { + const message = createBaseCommitSig() + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = 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 === 0 ? undefined : 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 { + return CommitSig.fromAmino(object.value) + }, + fromProtoMsg(message: CommitSigProtoMsg): CommitSig { + return CommitSig.decode(message.value) + }, + toProto(message: CommitSig): Uint8Array { + return CommitSig.encode(message).finish() + }, + toProtoMsg(message: CommitSig): CommitSigProtoMsg { + return { + typeUrl: '/tendermint.types.CommitSig', + value: CommitSig.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(CommitSig.typeUrl, CommitSig) +function createBaseProposal(): Proposal { + return { + type: 0, + height: BigInt(0), + round: 0, + polRound: 0, + blockId: BlockID.fromPartial({}), + 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) + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height) + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round) + } + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound) + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim() + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(50).fork() + ).ldelim() + } + if (message.signature.length !== 0) { + writer.uint32(58).bytes(message.signature) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any + break + case 2: + message.height = reader.int64() + break + case 3: + message.round = reader.int32() + break + case 4: + message.polRound = reader.int32() + break + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()) + break + case 6: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 7: + message.signature = reader.bytes() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal() + message.type = object.type ?? 0 + message.height = + object.height !== undefined && object.height !== null + ? BigInt(object.height.toString()) + : BigInt(0) + message.round = object.round ?? 0 + message.polRound = object.polRound ?? 0 + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.timestamp = object.timestamp ?? undefined + message.signature = object.signature ?? new Uint8Array() + return message + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal() + if (object.type !== undefined && object.type !== null) { + message.type = 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 === 0 ? undefined : message.type + obj.height = + message.height !== BigInt(0) ? message.height.toString() : undefined + obj.round = message.round === 0 ? undefined : message.round + obj.pol_round = message.polRound === 0 ? undefined : message.polRound + obj.block_id = message.blockId + ? BlockID.toAmino(message.blockId) + : undefined + obj.timestamp = message.timestamp + ? Timestamp.toAmino(toTimestamp(message.timestamp)) + : undefined + obj.signature = message.signature + ? base64FromBytes(message.signature) + : undefined + return obj + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value) + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value) + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish() + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: '/tendermint.types.Proposal', + value: Proposal.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal) +function createBaseSignedHeader(): SignedHeader { + return { + 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() + } + if (message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSignedHeader() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()) + break + case 2: + message.commit = Commit.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SignedHeader { + const message = createBaseSignedHeader() + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.commit = + object.commit !== undefined && object.commit !== null + ? Commit.fromPartial(object.commit) + : undefined + return message + }, + fromAmino(object: SignedHeaderAmino): SignedHeader { + 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 = {} + obj.header = message.header ? Header.toAmino(message.header) : undefined + obj.commit = message.commit ? Commit.toAmino(message.commit) : undefined + return obj + }, + fromAminoMsg(object: SignedHeaderAminoMsg): SignedHeader { + return SignedHeader.fromAmino(object.value) + }, + fromProtoMsg(message: SignedHeaderProtoMsg): SignedHeader { + return SignedHeader.decode(message.value) + }, + toProto(message: SignedHeader): Uint8Array { + return SignedHeader.encode(message).finish() + }, + toProtoMsg(message: SignedHeader): SignedHeaderProtoMsg { + return { + typeUrl: '/tendermint.types.SignedHeader', + value: SignedHeader.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SignedHeader.typeUrl, SignedHeader) +function createBaseLightBlock(): LightBlock { + return { + 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() + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode( + message.validatorSet, + writer.uint32(18).fork() + ).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLightBlock() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()) + break + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): LightBlock { + const message = createBaseLightBlock() + message.signedHeader = + object.signedHeader !== undefined && object.signedHeader !== null + ? SignedHeader.fromPartial(object.signedHeader) + : undefined + message.validatorSet = + object.validatorSet !== undefined && object.validatorSet !== null + ? ValidatorSet.fromPartial(object.validatorSet) + : undefined + return message + }, + fromAmino(object: LightBlockAmino): LightBlock { + 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 = {} + obj.signed_header = message.signedHeader + ? SignedHeader.toAmino(message.signedHeader) + : undefined + obj.validator_set = message.validatorSet + ? ValidatorSet.toAmino(message.validatorSet) + : undefined + return obj + }, + fromAminoMsg(object: LightBlockAminoMsg): LightBlock { + return LightBlock.fromAmino(object.value) + }, + fromProtoMsg(message: LightBlockProtoMsg): LightBlock { + return LightBlock.decode(message.value) + }, + toProto(message: LightBlock): Uint8Array { + return LightBlock.encode(message).finish() + }, + toProtoMsg(message: LightBlock): LightBlockProtoMsg { + return { + typeUrl: '/tendermint.types.LightBlock', + value: LightBlock.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(LightBlock.typeUrl, LightBlock) +function createBaseBlockMeta(): BlockMeta { + return { + blockId: BlockID.fromPartial({}), + blockSize: BigInt(0), + header: Header.fromPartial({}), + numTxs: BigInt(0) + } +} +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() + } + if (message.blockSize !== BigInt(0)) { + writer.uint32(16).int64(message.blockSize) + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim() + } + if (message.numTxs !== BigInt(0)) { + writer.uint32(32).int64(message.numTxs) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockMeta() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()) + break + case 2: + message.blockSize = reader.int64() + break + case 3: + message.header = Header.decode(reader, reader.uint32()) + break + case 4: + message.numTxs = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): BlockMeta { + const message = createBaseBlockMeta() + message.blockId = + object.blockId !== undefined && object.blockId !== null + ? BlockID.fromPartial(object.blockId) + : undefined + message.blockSize = + object.blockSize !== undefined && object.blockSize !== null + ? BigInt(object.blockSize.toString()) + : BigInt(0) + message.header = + object.header !== undefined && object.header !== null + ? Header.fromPartial(object.header) + : undefined + message.numTxs = + object.numTxs !== undefined && object.numTxs !== null + ? BigInt(object.numTxs.toString()) + : BigInt(0) + return message + }, + fromAmino(object: BlockMetaAmino): BlockMeta { + 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 = {} + obj.block_id = message.blockId + ? BlockID.toAmino(message.blockId) + : undefined + obj.block_size = + message.blockSize !== BigInt(0) ? message.blockSize.toString() : undefined + obj.header = message.header ? Header.toAmino(message.header) : undefined + obj.num_txs = + message.numTxs !== BigInt(0) ? message.numTxs.toString() : undefined + return obj + }, + fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { + return BlockMeta.fromAmino(object.value) + }, + fromProtoMsg(message: BlockMetaProtoMsg): BlockMeta { + return BlockMeta.decode(message.value) + }, + toProto(message: BlockMeta): Uint8Array { + return BlockMeta.encode(message).finish() + }, + toProtoMsg(message: BlockMeta): BlockMetaProtoMsg { + return { + typeUrl: '/tendermint.types.BlockMeta', + value: BlockMeta.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(BlockMeta.typeUrl, BlockMeta) +function createBaseTxProof(): TxProof { + return { + rootHash: new Uint8Array(), + data: new Uint8Array(), + 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) + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data) + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTxProof() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes() + break + case 2: + message.data = reader.bytes() + break + case 3: + message.proof = Proof.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): TxProof { + const message = createBaseTxProof() + message.rootHash = object.rootHash ?? new Uint8Array() + message.data = object.data ?? new Uint8Array() + message.proof = + object.proof !== undefined && object.proof !== null + ? Proof.fromPartial(object.proof) + : undefined + return message + }, + fromAmino(object: TxProofAmino): TxProof { + 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 + ? base64FromBytes(message.rootHash) + : undefined + obj.data = message.data ? base64FromBytes(message.data) : undefined + obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined + return obj + }, + fromAminoMsg(object: TxProofAminoMsg): TxProof { + return TxProof.fromAmino(object.value) + }, + fromProtoMsg(message: TxProofProtoMsg): TxProof { + return TxProof.decode(message.value) + }, + toProto(message: TxProof): Uint8Array { + return TxProof.encode(message).finish() + }, + toProtoMsg(message: TxProof): TxProofProtoMsg { + return { + typeUrl: '/tendermint.types.TxProof', + value: TxProof.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(TxProof.typeUrl, TxProof) diff --git a/src/proto/osmojs/tendermint/types/validator.ts b/src/proto/osmojs/tendermint/types/validator.ts new file mode 100644 index 0000000..ba86729 --- /dev/null +++ b/src/proto/osmojs/tendermint/types/validator.ts @@ -0,0 +1,478 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { PublicKey, PublicKeyAmino, PublicKeySDKType } from '../crypto/keys' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { GlobalDecoderRegistry } from '../../registry' +import { bytesFromBase64, base64FromBytes } from '../../../helpers' +export interface ValidatorSet { + validators: Validator[] + proposer?: Validator + totalVotingPower: bigint +} +export interface ValidatorSetProtoMsg { + typeUrl: '/tendermint.types.ValidatorSet' + value: Uint8Array +} +export interface ValidatorSetAmino { + validators?: ValidatorAmino[] + proposer?: ValidatorAmino + total_voting_power?: string +} +export interface ValidatorSetAminoMsg { + type: '/tendermint.types.ValidatorSet' + value: ValidatorSetAmino +} +export interface ValidatorSetSDKType { + validators: ValidatorSDKType[] + proposer?: ValidatorSDKType + total_voting_power: bigint +} +export interface Validator { + address: Uint8Array + pubKey: PublicKey + votingPower: bigint + proposerPriority: bigint +} +export interface ValidatorProtoMsg { + typeUrl: '/tendermint.types.Validator' + value: Uint8Array +} +export interface ValidatorAmino { + address?: string + pub_key?: PublicKeyAmino + voting_power?: string + proposer_priority?: string +} +export interface ValidatorAminoMsg { + type: '/tendermint.types.Validator' + value: ValidatorAmino +} +export interface ValidatorSDKType { + address: Uint8Array + pub_key: PublicKeySDKType + voting_power: bigint + proposer_priority: bigint +} +export interface SimpleValidator { + pubKey?: PublicKey + votingPower: bigint +} +export interface SimpleValidatorProtoMsg { + typeUrl: '/tendermint.types.SimpleValidator' + value: Uint8Array +} +export interface SimpleValidatorAmino { + pub_key?: PublicKeyAmino + voting_power?: string +} +export interface SimpleValidatorAminoMsg { + type: '/tendermint.types.SimpleValidator' + value: SimpleValidatorAmino +} +export interface SimpleValidatorSDKType { + pub_key?: PublicKeySDKType + voting_power: bigint +} +function createBaseValidatorSet(): ValidatorSet { + return { + validators: [], + 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() + } + if (message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim() + } + if (message.totalVotingPower !== BigInt(0)) { + writer.uint32(24).int64(message.totalVotingPower) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidatorSet() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())) + break + case 2: + message.proposer = Validator.decode(reader, reader.uint32()) + break + case 3: + message.totalVotingPower = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): ValidatorSet { + const message = createBaseValidatorSet() + message.validators = + object.validators?.map((e) => Validator.fromPartial(e)) || [] + message.proposer = + object.proposer !== undefined && object.proposer !== null + ? Validator.fromPartial(object.proposer) + : undefined + message.totalVotingPower = + object.totalVotingPower !== undefined && object.totalVotingPower !== null + ? BigInt(object.totalVotingPower.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ValidatorSetAmino): ValidatorSet { + 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 = {} + if (message.validators) { + obj.validators = message.validators.map((e) => + e ? Validator.toAmino(e) : undefined + ) + } else { + obj.validators = message.validators + } + obj.proposer = message.proposer + ? Validator.toAmino(message.proposer) + : undefined + obj.total_voting_power = + message.totalVotingPower !== BigInt(0) + ? message.totalVotingPower.toString() + : undefined + return obj + }, + fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { + return ValidatorSet.fromAmino(object.value) + }, + fromProtoMsg(message: ValidatorSetProtoMsg): ValidatorSet { + return ValidatorSet.decode(message.value) + }, + toProto(message: ValidatorSet): Uint8Array { + return ValidatorSet.encode(message).finish() + }, + toProtoMsg(message: ValidatorSet): ValidatorSetProtoMsg { + return { + typeUrl: '/tendermint.types.ValidatorSet', + value: ValidatorSet.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(ValidatorSet.typeUrl, ValidatorSet) +function createBaseValidator(): Validator { + return { + address: new Uint8Array(), + pubKey: PublicKey.fromPartial({}), + votingPower: BigInt(0), + proposerPriority: BigInt(0) + } +} +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) + } + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim() + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(24).int64(message.votingPower) + } + if (message.proposerPriority !== BigInt(0)) { + writer.uint32(32).int64(message.proposerPriority) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.address = reader.bytes() + break + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break + case 3: + message.votingPower = reader.int64() + break + case 4: + message.proposerPriority = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator() + message.address = object.address ?? new Uint8Array() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.votingPower = + object.votingPower !== undefined && object.votingPower !== null + ? BigInt(object.votingPower.toString()) + : BigInt(0) + message.proposerPriority = + object.proposerPriority !== undefined && object.proposerPriority !== null + ? BigInt(object.proposerPriority.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ValidatorAmino): Validator { + 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 ? base64FromBytes(message.address) : undefined + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined + obj.voting_power = + message.votingPower !== BigInt(0) + ? message.votingPower.toString() + : undefined + obj.proposer_priority = + message.proposerPriority !== BigInt(0) + ? message.proposerPriority.toString() + : undefined + return obj + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value) + }, + fromProtoMsg(message: ValidatorProtoMsg): Validator { + return Validator.decode(message.value) + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish() + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: '/tendermint.types.Validator', + value: Validator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Validator.typeUrl, Validator) +function createBaseSimpleValidator(): SimpleValidator { + return { + 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() + } + if (message.votingPower !== BigInt(0)) { + writer.uint32(16).int64(message.votingPower) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseSimpleValidator() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()) + break + case 2: + message.votingPower = reader.int64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): SimpleValidator { + const message = createBaseSimpleValidator() + message.pubKey = + object.pubKey !== undefined && object.pubKey !== null + ? PublicKey.fromPartial(object.pubKey) + : undefined + message.votingPower = + object.votingPower !== undefined && object.votingPower !== null + ? BigInt(object.votingPower.toString()) + : BigInt(0) + return message + }, + fromAmino(object: SimpleValidatorAmino): SimpleValidator { + 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 = {} + obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined + obj.voting_power = + message.votingPower !== BigInt(0) + ? message.votingPower.toString() + : undefined + return obj + }, + fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { + return SimpleValidator.fromAmino(object.value) + }, + fromProtoMsg(message: SimpleValidatorProtoMsg): SimpleValidator { + return SimpleValidator.decode(message.value) + }, + toProto(message: SimpleValidator): Uint8Array { + return SimpleValidator.encode(message).finish() + }, + toProtoMsg(message: SimpleValidator): SimpleValidatorProtoMsg { + return { + typeUrl: '/tendermint.types.SimpleValidator', + value: SimpleValidator.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(SimpleValidator.typeUrl, SimpleValidator) diff --git a/src/proto/osmojs/tendermint/version/types.ts b/src/proto/osmojs/tendermint/version/types.ts new file mode 100644 index 0000000..cf08e03 --- /dev/null +++ b/src/proto/osmojs/tendermint/version/types.ts @@ -0,0 +1,289 @@ +/* eslint-disable prefer-const */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from '../../../binary' +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 + * updated in ResponseEndBlock. + */ +export interface App { + protocol: bigint + software: string +} +export interface AppProtoMsg { + typeUrl: '/tendermint.version.App' + value: Uint8Array +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppAmino { + protocol?: string + software?: string +} +export interface AppAminoMsg { + type: '/tendermint.version.App' + value: AppAmino +} +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface AppSDKType { + protocol: bigint + software: string +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface Consensus { + block: bigint + app: bigint +} +export interface ConsensusProtoMsg { + typeUrl: '/tendermint.version.Consensus' + value: Uint8Array +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusAmino { + block?: string + app?: string +} +export interface ConsensusAminoMsg { + type: '/tendermint.version.Consensus' + value: ConsensusAmino +} +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface ConsensusSDKType { + block: bigint + app: bigint +} +function createBaseApp(): App { + return { + protocol: BigInt(0), + software: '' + } +} +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) + } + if (message.software !== '') { + writer.uint32(18).string(message.software) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseApp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64() + break + case 2: + message.software = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): App { + const message = createBaseApp() + message.protocol = + object.protocol !== undefined && object.protocol !== null + ? BigInt(object.protocol.toString()) + : BigInt(0) + message.software = object.software ?? '' + return message + }, + fromAmino(object: AppAmino): App { + 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 = {} + obj.protocol = + message.protocol !== BigInt(0) ? message.protocol.toString() : undefined + obj.software = message.software === '' ? undefined : message.software + return obj + }, + fromAminoMsg(object: AppAminoMsg): App { + return App.fromAmino(object.value) + }, + fromProtoMsg(message: AppProtoMsg): App { + return App.decode(message.value) + }, + toProto(message: App): Uint8Array { + return App.encode(message).finish() + }, + toProtoMsg(message: App): AppProtoMsg { + return { + typeUrl: '/tendermint.version.App', + value: App.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(App.typeUrl, App) +function createBaseConsensus(): Consensus { + return { + block: BigInt(0), + app: BigInt(0) + } +} +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) + } + if (message.app !== BigInt(0)) { + writer.uint32(16).uint64(message.app) + } + return writer + }, + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseConsensus() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.block = reader.uint64() + break + case 2: + message.app = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): Consensus { + const message = createBaseConsensus() + message.block = + object.block !== undefined && object.block !== null + ? BigInt(object.block.toString()) + : BigInt(0) + message.app = + object.app !== undefined && object.app !== null + ? BigInt(object.app.toString()) + : BigInt(0) + return message + }, + fromAmino(object: ConsensusAmino): Consensus { + 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 = {} + obj.block = + message.block !== BigInt(0) ? message.block.toString() : undefined + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined + return obj + }, + fromAminoMsg(object: ConsensusAminoMsg): Consensus { + return Consensus.fromAmino(object.value) + }, + fromProtoMsg(message: ConsensusProtoMsg): Consensus { + return Consensus.decode(message.value) + }, + toProto(message: Consensus): Uint8Array { + return Consensus.encode(message).finish() + }, + toProtoMsg(message: Consensus): ConsensusProtoMsg { + return { + typeUrl: '/tendermint.version.Consensus', + value: Consensus.encode(message).finish() + } + } +} +GlobalDecoderRegistry.register(Consensus.typeUrl, Consensus) diff --git a/src/proto/utf8.ts b/src/proto/utf8.ts new file mode 100644 index 0000000..50122f8 --- /dev/null +++ b/src/proto/utf8.ts @@ -0,0 +1,150 @@ +/* eslint-disable @typescript-eslint/no-extra-semi */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +'use strict' + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0 + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i) + if (c < 128) len += 1 + else if (c < 2048) len += 2 + else if ( + (c & 0xfc00) === 0xd800 && + (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i + len += 4 + } else len += 3 + } + return len +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read( + buffer: ArrayLike, + start: number, + end: number +) { + const len = end - start + if (len < 1) return '' + const chunk = [] + let parts: string[] = [], + i = 0, // char offset + t // temporary + while (start < end) { + t = buffer[start++] + if (t < 128) chunk[i++] = t + else if (t > 191 && t < 224) + chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63) + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000 + chunk[i++] = 0xd800 + (t >> 10) + chunk[i++] = 0xdc00 + (t & 1023) + } else + chunk[i++] = + ((t & 15) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63) + if (i > 8191) { + ;(parts || (parts = [])).push(String.fromCharCode(...chunk)) + i = 0 + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))) + return parts.join('') + } + return String.fromCharCode(...chunk.slice(0, i)) +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write( + str: string, + buffer: Uint8Array | Array, + offset: number +) { + const start = offset + let c1, // character 1 + c2 // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i) + if (c1 < 128) { + buffer[offset++] = c1 + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192 + buffer[offset++] = (c1 & 63) | 128 + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff) + ++i + buffer[offset++] = (c1 >> 18) | 240 + buffer[offset++] = ((c1 >> 12) & 63) | 128 + buffer[offset++] = ((c1 >> 6) & 63) | 128 + buffer[offset++] = (c1 & 63) | 128 + } else { + buffer[offset++] = (c1 >> 12) | 224 + buffer[offset++] = ((c1 >> 6) & 63) | 128 + buffer[offset++] = (c1 & 63) | 128 + } + } + return offset - start +} diff --git a/src/proto/varint.ts b/src/proto/varint.ts new file mode 100644 index 0000000..766dbe6 --- /dev/null +++ b/src/proto/varint.ts @@ -0,0 +1,490 @@ +/* eslint-disable @typescript-eslint/no-extra-semi */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +//@ts-nocheck +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.4 + * 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. + */ + +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0 + let highBits = 0 + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++] + lowBits |= (b & 0x7f) << shift + if ((b & 0x80) == 0) { + this.assertBounds() + return [lowBits, highBits] + } + } + + let middleByte = this.buf[this.pos++] + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28 + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4 + + if ((middleByte & 0x80) == 0) { + this.assertBounds() + return [lowBits, highBits] + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++] + highBits |= (b & 0x7f) << shift + if ((b & 0x80) == 0) { + this.assertBounds() + return [lowBits, highBits] + } + } + + throw new Error('invalid varint') +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i + const hasNext = !(shift >>> 7 == 0 && hi == 0) + const byte = (hasNext ? shift | 0x80 : shift) & 0xff + bytes.push(byte) + if (!hasNext) { + return + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4) + const hasMoreBits = !(hi >> 3 == 0) + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff) + + if (!hasMoreBits) { + return + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i + const hasNext = !(shift >>> 7 == 0) + const byte = (hasNext ? shift | 0x80 : shift) & 0xff + bytes.push(byte) + if (!hasNext) { + return + } + } + + bytes.push((hi >>> 31) & 0x01) +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000 + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === '-' + if (minus) { + dec = dec.slice(1) + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6 + let lowBits = 0 + let highBits = 0 + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)) + highBits *= base + lowBits = lowBits * base + digit1e6 + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0) + lowBits = lowBits % TWO_PWR_32_DBL + } + } + + add1e6digit(-24, -18) + add1e6digit(-18, -12) + add1e6digit(-12, -6) + add1e6digit(-6) + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits) +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi) + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000 + if (negative) { + bits = negate(bits.lo, bits.hi) + } + const result = uInt64ToString(bits.lo, bits.hi) + return negative ? '-' + result : result +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ;({ lo, hi } = toUnsigned(lo, hi)) + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo) + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff + const high = (hi >> 16) & 0xffff + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656 + let digitB = mid + high * 8147497 + let digitC = high * 2 + + // Apply carries from A to B and from B to C. + const base = 10000000 + if (digitA >= base) { + digitB += Math.floor(digitA / base) + digitA %= base + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base) + digitB %= base + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return ( + digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA) + ) +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 } +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 } +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits + if (lowBits) { + lowBits = ~lowBits + 1 + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1 + } + return newBits(lowBits, highBits) +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7) + return '0000000'.slice(partial.length) + partial +} + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80) + value = value >>> 7 + } + bytes.push(value) + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128) + value = value >> 7 + } + bytes.push(1) + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++] + let result = b & 0x7f + if ((b & 0x80) == 0) { + this.assertBounds() + return result + } + + b = this.buf[this.pos++] + result |= (b & 0x7f) << 7 + if ((b & 0x80) == 0) { + this.assertBounds() + return result + } + + b = this.buf[this.pos++] + result |= (b & 0x7f) << 14 + if ((b & 0x80) == 0) { + this.assertBounds() + return result + } + + b = this.buf[this.pos++] + result |= (b & 0x7f) << 21 + if ((b & 0x80) == 0) { + this.assertBounds() + return result + } + + // Extract only last 4 bits + b = this.buf[this.pos++] + result |= (b & 0x0f) << 28 + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++] + + if ((b & 0x80) != 0) throw new Error('invalid varint') + + this.assertBounds() + + // Result can have 32 bits, convert it to unsigned + return result >>> 0 +} + +type ReaderLike = { + buf: Uint8Array + pos: number + len: number + assertBounds(): void +} + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31 + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0 + lo = ((lo << 1) ^ mask) >>> 0 + return [lo, hi] +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1) + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0 + hi = ((hi >>> 1) ^ mask) >>> 0 + return [lo, hi] +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + buf[pos + 3] * 0x1000000 + ) +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return ( + (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + + (buf[pos + 3] << 24) + ) +} + +/** + * writing varint32 to pos + */ +export function writeVarint32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + while (val > 127) { + buf[pos++] = (val & 127) | 128 + val >>>= 7 + } + buf[pos] = val +} + +/** + * writing varint64 to pos + */ +export function writeVarint64( + val: { lo: number; hi: number }, + buf: Uint8Array | number[], + pos: number +) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128 + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0 + val.hi >>>= 7 + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128 + val.lo = val.lo >>> 7 + } + buf[pos++] = val.lo +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24 + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10 +} + +export function writeFixed32( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255 + buf[pos + 1] = (val >>> 8) & 255 + buf[pos + 2] = (val >>> 16) & 255 + buf[pos + 3] = val >>> 24 +} + +export function writeByte( + val: number, + buf: Uint8Array | number[], + pos: number +) { + buf[pos] = val & 255 +} diff --git a/src/registry.ts b/src/registry.ts index d6731a5..ee087d0 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -3,8 +3,8 @@ import { cosmosProtoRegistry, osmosisProtoRegistry, ibcProtoRegistry, - cosmwasmProtoRegistry, -} from 'osmojs' + cosmwasmProtoRegistry +} from './proto/osmojs' import { strideProtoRegistry } from 'stridejs' import type { GeneratedEntry, GeneratedRegistry } from './supported-modules' diff --git a/src/util.ts b/src/util.ts index 898f2cd..8eb25ef 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,6 +1,6 @@ import { GeneratedType } from '@cosmjs/proto-signing' import { ProtoFactory } from './codec' -import { cosmos } from 'osmojs' +import { cosmos } from './proto/osmojs' import { SignDoc } from './decoder' export const convertCamelCaseToSnakeCase = (key: string): string => { diff --git a/yarn.lock b/yarn.lock index 5380aa1..e40fef4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,13 +9,6 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.21.0": - version "7.23.2" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" - integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== - dependencies: - regenerator-runtime "^0.14.0" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -39,26 +32,6 @@ "@cosmjs/math" "0.28.13" "@cosmjs/utils" "0.28.13" -"@cosmjs/amino@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.3.tgz#5aa338a301ea970a93e15522706615efea507c10" - integrity sha512-BFz1++ERerIggiFc7iGHhGe1CeV3rCv8BvkoBQTBN/ZwzHOaKvqQj8smDlRGlQxX3HWlTwgiLN2A+OB5yX4ZRw== - dependencies: - "@cosmjs/crypto" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - -"@cosmjs/amino@^0.29.3", "@cosmjs/amino@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.5.tgz#053b4739a90b15b9e2b781ccd484faf64bd49aec" - integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - "@cosmjs/amino@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.30.1.tgz#7c18c14627361ba6c88e3495700ceea1f76baace" @@ -92,19 +65,6 @@ elliptic "^6.5.3" libsodium-wrappers "^0.7.6" -"@cosmjs/crypto@^0.29.3", "@cosmjs/crypto@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.29.5.tgz#ab99fc382b93d8a8db075780cf07487a0f9519fd" - integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== - dependencies: - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers "^0.7.6" - "@cosmjs/crypto@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.30.1.tgz#21e94d5ca8f8ded16eee1389d2639cb5c43c3eb5" @@ -140,15 +100,6 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/encoding@^0.29.3", "@cosmjs/encoding@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.29.5.tgz#009a4b1c596cdfd326f30ccfa79f5e56daa264f2" - integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - "@cosmjs/encoding@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.30.1.tgz#b5c4e0ef7ceb1f2753688eb96400ed70f35c6058" @@ -175,14 +126,6 @@ "@cosmjs/stream" "0.28.13" xstream "^11.14.0" -"@cosmjs/json-rpc@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz#5e483a9bd98a6270f935adf0dfd8a1e7eb777fe4" - integrity sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w== - dependencies: - "@cosmjs/stream" "^0.29.5" - xstream "^11.14.0" - "@cosmjs/json-rpc@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" @@ -198,13 +141,6 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/math@^0.29.3", "@cosmjs/math@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.29.5.tgz#722c96e080d6c2b62215ce9f4c70da7625b241b6" - integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== - dependencies: - bn.js "^5.2.0" - "@cosmjs/math@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.30.1.tgz#8b816ef4de5d3afa66cb9fdfb5df2357a7845b8a" @@ -232,19 +168,6 @@ cosmjs-types "^0.4.0" long "^4.0.0" -"@cosmjs/proto-signing@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.3.tgz#fa5ed609ed2a0007d8d5eacbeb1f5a89ba1b77ff" - integrity sha512-Ai3l9THjMOrLJ4Ebn1Dgptwg6W5ZIRJqtnJjijHhGwTVC1WT0WdYU3aMZ7+PwubcA/cA1rH4ZTK7jrfYbra63g== - dependencies: - "@cosmjs/amino" "^0.29.3" - "@cosmjs/crypto" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - cosmjs-types "^0.5.2" - long "^4.0.0" - "@cosmjs/proto-signing@0.31.3": version "0.31.3" resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.3.tgz#20440b7b96fb2cd924256a10e656fd8d4481cdcd" @@ -258,19 +181,6 @@ cosmjs-types "^0.8.0" long "^4.0.0" -"@cosmjs/proto-signing@^0.29.3": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz#af3b62a46c2c2f1d2327d678b13b7262db1fe87c" - integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== - dependencies: - "@cosmjs/amino" "^0.29.5" - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" - long "^4.0.0" - "@cosmjs/proto-signing@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz#f0dda372488df9cd2677150b89b3e9c72b3cb713" @@ -294,16 +204,6 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/socket@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.29.5.tgz#a48df6b4c45dc6a6ef8e47232725dd4aa556ac2d" - integrity sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ== - dependencies: - "@cosmjs/stream" "^0.29.5" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - "@cosmjs/socket@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" @@ -332,24 +232,6 @@ protobufjs "~6.11.3" xstream "^11.14.0" -"@cosmjs/stargate@0.29.3": - version "0.29.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.29.3.tgz#9bd303bfd32a7399a233e662864e7cc32e2607af" - integrity sha512-455TgXStCi6E8KDjnhDAM8wt6aLSjobH4Dixvd7Up1DfCH6UB9NkC/G0fMJANNcNXMaM4wSX14niTXwD1d31BA== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.29.3" - "@cosmjs/encoding" "^0.29.3" - "@cosmjs/math" "^0.29.3" - "@cosmjs/proto-signing" "^0.29.3" - "@cosmjs/stream" "^0.29.3" - "@cosmjs/tendermint-rpc" "^0.29.3" - "@cosmjs/utils" "^0.29.3" - cosmjs-types "^0.5.2" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - "@cosmjs/stargate@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" @@ -375,13 +257,6 @@ dependencies: xstream "^11.14.0" -"@cosmjs/stream@^0.29.3", "@cosmjs/stream@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.29.5.tgz#350981cac496d04939b92ee793b9b19f44bc1d4e" - integrity sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA== - dependencies: - xstream "^11.14.0" - "@cosmjs/stream@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" @@ -405,22 +280,6 @@ readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.29.3": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" - integrity sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/json-rpc" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/socket" "^0.29.5" - "@cosmjs/stream" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - axios "^0.21.2" - readonly-date "^1.0.0" - xstream "^11.14.0" - "@cosmjs/tendermint-rpc@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" @@ -442,11 +301,6 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.13.tgz#2fd2844ec832d7833811e2ae1691305d09791a08" integrity sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg== -"@cosmjs/utils@^0.29.3", "@cosmjs/utils@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.29.5.tgz#3fed1b3528ae8c5f1eb5d29b68755bebfd3294ee" - integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== - "@cosmjs/utils@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" @@ -457,14 +311,6 @@ resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== -"@cosmology/lcd@^0.12.0": - version "0.12.0" - resolved "https://registry.npmjs.org/@cosmology/lcd/-/lcd-0.12.0.tgz#a6594fc00a8c84c7341e90840627e62a7e63fd1b" - integrity sha512-f2mcySYO1xdislAhuWtNFmg4q/bzY3Aem2UkDzYzI0ZELVev5i2Pi0bQrYUNTeNg1isAo0Kyrdqj/4YPqEwjGA== - dependencies: - "@babel/runtime" "^7.21.0" - axios "0.27.2" - "@esbuild/android-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz#cf91e86df127aa3d141744edafcba0abdc577d23" @@ -1220,14 +1066,6 @@ cosmjs-types@^0.4.0: long "^4.0.0" protobufjs "~6.11.2" -cosmjs-types@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.5.2.tgz#2d42b354946f330dfb5c90a87fdc2a36f97b965d" - integrity sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - cosmjs-types@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.7.2.tgz#a757371abd340949c5bd5d49c6f8379ae1ffd7e2" @@ -2337,17 +2175,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -osmojs@16.5.1: - version "16.5.1" - resolved "https://registry.npmjs.org/osmojs/-/osmojs-16.5.1.tgz#38f2fe3cd65dbd4e4b415e9f22f387a24b634155" - integrity sha512-V2Q2yMt7Paax6i+S5Q1l29Km0As/waXKmSVRe8gtd9he42kcbkpwwk/QUCvgS98XsL7Qz+vas2Tca016uBQHTQ== - dependencies: - "@cosmjs/amino" "0.29.3" - "@cosmjs/proto-signing" "0.29.3" - "@cosmjs/stargate" "0.29.3" - "@cosmjs/tendermint-rpc" "^0.29.3" - "@cosmology/lcd" "^0.12.0" - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -2554,11 +2381,6 @@ regenerator-runtime@^0.13.11: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-runtime@^0.14.0: - version "0.14.0" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" - integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== - regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac"