diff --git a/packages/math/__tests__/swap.test.ts b/packages/math/__tests__/swap.test.ts index 5f68f51a3..f081697f9 100644 --- a/packages/math/__tests__/swap.test.ts +++ b/packages/math/__tests__/swap.test.ts @@ -10,6 +10,8 @@ import { } from "../src/utils"; import { calcAmountWithSlippage, + calcInGivenOut, + calcOutGivenIn, calcPriceImpactGivenIn, calcPriceImpactGivenOut, getRoutesForTrade, @@ -251,4 +253,84 @@ describe("Test swap calculations", () => { }, ] ); + + cases('calcOutGivenIn', opts => { + const result = calcOutGivenIn( + new BigNumber(opts.tokenBalanceIn), + new BigNumber(opts.tokenWeightIn), + new BigNumber(opts.tokenBalanceOut), + new BigNumber(opts.tokenWeightOut), + new BigNumber(opts.tokenAmountIn), + new BigNumber(opts.swapFee) + ); + expect(result.toNumber()).toBeCloseTo(new BigNumber(opts.expected).toNumber(), 5); + }, { + "Exponent not an integer(0.5)": { + tokenBalanceIn: '1000', + tokenWeightIn: '10', + tokenBalanceOut: '500', + tokenWeightOut: '20', + tokenAmountIn: '100', + swapFee: '0.01', + expected: '23.051861474872545' + }, + "Exponent not an integer(1.5)": { + tokenBalanceIn: '1500', + tokenWeightIn: '30', + tokenBalanceOut: '700', + tokenWeightOut: '20', + tokenAmountIn: '200', + swapFee: '0', + expected: '119.8216126711115' + }, + "regular": { + tokenBalanceIn: '2000', + tokenWeightIn: '40', + tokenBalanceOut: '1000', + tokenWeightOut: '10', + tokenAmountIn: '300', + swapFee: '0.05', + expected: '413.0850595232377' + } + }); + + cases('calcInGivenOut', opts => { + const result = calcInGivenOut( + new BigNumber(opts.tokenBalanceIn), + new BigNumber(opts.tokenWeightIn), + new BigNumber(opts.tokenBalanceOut), + new BigNumber(opts.tokenWeightOut), + new BigNumber(opts.tokenAmountOut), + new BigNumber(opts.swapFee) + ); + expect(result.toNumber()).toBeCloseTo(new BigNumber(opts.expected).toNumber(), 5); + }, { + "Exponent not an integer(0.5)": { + tokenBalanceIn: '1000', + tokenWeightIn: '20', + tokenBalanceOut: '500', + tokenWeightOut: '10', + tokenAmountOut: '100', + swapFee: '0.01', + expected: '119.22625126252005' + }, + "Exponent not an integer(1.5)": { + tokenBalanceIn: '1500', + tokenWeightIn: '20', + tokenBalanceOut: '700', + tokenWeightOut: '30', + tokenAmountOut: '200', + swapFee: '0', + expected: '984.7535089018387' + }, + "regular": { + tokenBalanceIn: '2000', + tokenWeightIn: '10', + tokenBalanceOut: '1000', + tokenWeightOut: '40', + tokenAmountOut: '300', + swapFee: '0.05', + expected: '6663.013218176637' + } + }); }); diff --git a/packages/math/package.json b/packages/math/package.json index 561a43efe..b51e340b3 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -87,6 +87,7 @@ "dependencies": { "@chain-registry/types": "0.16.0", "@chain-registry/utils": "1.13.1", + "decimal.js-light": "^2.5.1", "bignumber.js": "9.1.1", "long": "5.2.3", "osmojs": "^16.5.1" diff --git a/packages/math/src/swap.ts b/packages/math/src/swap.ts index 0c670869d..e62164303 100644 --- a/packages/math/src/swap.ts +++ b/packages/math/src/swap.ts @@ -2,7 +2,7 @@ import { Asset } from "@chain-registry/types"; import { BigNumber } from "bignumber.js"; import { CoinDenom, Trade, PrettyPair } from "./types"; import { symbolToOsmoDenom } from "./utils"; -import Long from "long"; +import { Decimal } from "decimal.js-light"; import { SwapAmountInRoute } from "osmojs/dist/codegen/osmosis/poolmanager/v1beta1/swap_route"; import { Pool } from "osmojs/dist/codegen/osmosis/gamm/pool-models/balancer/balancerPool"; import { Coin } from "osmojs/dist/codegen/cosmos/base/v1beta1/coin"; @@ -107,9 +107,7 @@ const getPoolAsset = (pool: Pool, denom: string) => { (asset) => asset?.token && asset.token.denom === denom ); if (!poolAsset) { - throw new Error( - `Pool ${pool.id} doesn't have the pool asset for ${denom}` - ); + throw new Error(`Pool ${pool.id} doesn't have the pool asset for ${denom}`); } return { denom, weight: poolAsset.weight, amount: poolAsset.token!.amount }; }; @@ -140,7 +138,7 @@ export const calcOutGivenIn = ( let adjustedIn = one.minus(swapFee); adjustedIn = tokenAmountIn.multipliedBy(adjustedIn); const y = tokenBalanceIn.div(tokenBalanceIn.plus(adjustedIn)); - const foo = y.pow(weightRatio); + const foo = pow(y, weightRatio); const bar = one.minus(foo); return tokenBalanceOut.multipliedBy(bar); }; @@ -156,7 +154,7 @@ export const calcInGivenOut = ( const weightRatio = tokenWeightOut.div(tokenWeightIn); const diff = tokenBalanceOut.minus(tokenAmountOut); const y = tokenBalanceOut.div(diff); - let foo = y.pow(weightRatio); + let foo = pow(y, weightRatio); foo = foo.minus(one); const tokenAmountIn = one.minus(swapFee); return tokenBalanceIn.multipliedBy(foo).div(tokenAmountIn); @@ -227,3 +225,7 @@ export const calcPriceImpactGivenOut = ( return priceImpact.toString(); }; + +export const pow = (x: BigNumber, y: BigNumber): BigNumber => { + return new BigNumber(new Decimal(x.toString()).pow(new Decimal(y.toString())).toString()) +}; diff --git a/packages/osmojs/cosmos-sdk b/packages/osmojs/cosmos-sdk index ed4eb883f..6ed904cdb 160000 --- a/packages/osmojs/cosmos-sdk +++ b/packages/osmojs/cosmos-sdk @@ -1 +1 @@ -Subproject commit ed4eb883f2a65bd5343e9d2f6186060f45294cb2 +Subproject commit 6ed904cdb75fe08a9310e7df49eaf9c5b2b64692 diff --git a/packages/osmojs/osmosis b/packages/osmojs/osmosis index 326dfb08a..ac133fdd7 160000 --- a/packages/osmojs/osmosis +++ b/packages/osmojs/osmosis @@ -1 +1 @@ -Subproject commit 326dfb08a9af17d53ed5d5a71ac4a591e72ae4b0 +Subproject commit ac133fdd73dbd27b8bc7b6d49049f5d594e771cb diff --git a/packages/osmojs/src/codegen/binary.ts b/packages/osmojs/src/codegen/binary.ts index 428082e04..2e0c41674 100644 --- a/packages/osmojs/src/codegen/binary.ts +++ b/packages/osmojs/src/codegen/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 * 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. */ @@ -348,12 +348,12 @@ export class BinaryWriter { (value = value >>> 0) < 128 ? 1 : value < 16384 - ? 2 - : value < 2097152 - ? 3 - : value < 268435456 - ? 4 - : 5, + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, value )).len; return this; @@ -463,10 +463,10 @@ function pool( function indexOutOfRange(reader: BinaryReader, writeLength?: number) { return RangeError( "index out of range: " + - reader.pos + - " + " + - (writeLength || 1) + - " > " + - reader.len + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len ); } diff --git a/packages/osmojs/src/codegen/capability/bundle.ts b/packages/osmojs/src/codegen/capability/bundle.ts index 486628ae2..ea77c6cf4 100644 --- a/packages/osmojs/src/codegen/capability/bundle.ts +++ b/packages/osmojs/src/codegen/capability/bundle.ts @@ -1,8 +1,8 @@ -import * as _42 from "./v1/capability"; -import * as _43 from "./v1/genesis"; +import * as _53 from "./v1/capability"; +import * as _54 from "./v1/genesis"; export namespace capability { export const v1 = { - ..._42, - ..._43 + ..._53, + ..._54 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts index 204958798..a09d9a80a 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -107,7 +107,7 @@ function createBaseBaseAccount(): BaseAccount { return { $typeUrl: "/cosmos.auth.v1beta1.BaseAccount", address: "", - pubKey: undefined, + pubKey: Any.fromPartial({}), accountNumber: BigInt(0), sequence: BigInt(0) }; diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts index d5d0ca590..4c39c5fec 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts @@ -415,7 +415,7 @@ export const QueryAccountRequest = { }; function createBaseQueryAccountResponse(): QueryAccountResponse { return { - account: undefined + account: Any.fromPartial({}) }; } export const QueryAccountResponse = { diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts index 402fb2a2b..ecdccf145 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -183,8 +183,8 @@ export const GenericAuthorization = { }; function createBaseGrant(): Grant { return { - authorization: undefined, - expiration: undefined + authorization: Any.fromPartial({}), + expiration: new Date() }; } export const Grant = { @@ -262,8 +262,8 @@ function createBaseGrantAuthorization(): GrantAuthorization { return { granter: "", grantee: "", - authorization: undefined, - expiration: undefined + authorization: Any.fromPartial({}), + expiration: new Date() }; } export const GrantAuthorization = { diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts index ebd116310..56fbe3cb8 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts @@ -632,7 +632,7 @@ export const QueryBalanceRequest = { }; function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { - balance: undefined + balance: Coin.fromPartial({}) }; } export const QueryBalanceResponse = { @@ -1072,7 +1072,7 @@ export const QuerySupplyOfRequest = { }; function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { return { - amount: undefined + amount: Coin.fromPartial({}) }; } export const QuerySupplyOfResponse = { @@ -1354,7 +1354,7 @@ export const QuerySupplyOfWithoutOffsetRequest = { }; function createBaseQuerySupplyOfWithoutOffsetResponse(): QuerySupplyOfWithoutOffsetResponse { return { - amount: undefined + amount: Coin.fromPartial({}) }; } export const QuerySupplyOfWithoutOffsetResponse = { diff --git a/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts index 9dd5af368..1f4e47233 100644 --- a/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -441,7 +441,7 @@ function createBaseTxResponse(): TxResponse { info: "", gasWanted: BigInt(0), gasUsed: BigInt(0), - tx: undefined, + tx: Any.fromPartial({}), timestamp: "", events: [] }; diff --git a/packages/osmojs/src/codegen/cosmos/bundle.ts b/packages/osmojs/src/codegen/cosmos/bundle.ts index 8a55932b2..34cf24665 100644 --- a/packages/osmojs/src/codegen/cosmos/bundle.ts +++ b/packages/osmojs/src/codegen/cosmos/bundle.ts @@ -39,42 +39,42 @@ import * as _37 from "./tx/v1beta1/service"; import * as _38 from "./tx/v1beta1/tx"; import * as _39 from "./upgrade/v1beta1/query"; import * as _40 from "./upgrade/v1beta1/upgrade"; -import * as _190 from "./authz/v1beta1/tx.amino"; -import * as _191 from "./bank/v1beta1/tx.amino"; -import * as _192 from "./distribution/v1beta1/tx.amino"; -import * as _193 from "./gov/v1beta1/tx.amino"; -import * as _194 from "./staking/v1beta1/tx.amino"; -import * as _195 from "./authz/v1beta1/tx.registry"; -import * as _196 from "./bank/v1beta1/tx.registry"; -import * as _197 from "./distribution/v1beta1/tx.registry"; -import * as _198 from "./gov/v1beta1/tx.registry"; -import * as _199 from "./staking/v1beta1/tx.registry"; -import * as _200 from "./auth/v1beta1/query.lcd"; -import * as _201 from "./authz/v1beta1/query.lcd"; -import * as _202 from "./bank/v1beta1/query.lcd"; -import * as _203 from "./base/node/v1beta1/query.lcd"; -import * as _204 from "./distribution/v1beta1/query.lcd"; -import * as _205 from "./gov/v1beta1/query.lcd"; -import * as _206 from "./staking/v1beta1/query.lcd"; -import * as _207 from "./tx/v1beta1/service.lcd"; -import * as _208 from "./upgrade/v1beta1/query.lcd"; -import * as _209 from "./auth/v1beta1/query.rpc.Query"; -import * as _210 from "./authz/v1beta1/query.rpc.Query"; -import * as _211 from "./bank/v1beta1/query.rpc.Query"; -import * as _212 from "./base/node/v1beta1/query.rpc.Service"; -import * as _213 from "./distribution/v1beta1/query.rpc.Query"; -import * as _214 from "./gov/v1beta1/query.rpc.Query"; -import * as _215 from "./staking/v1beta1/query.rpc.Query"; -import * as _216 from "./tx/v1beta1/service.rpc.Service"; -import * as _217 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _218 from "./authz/v1beta1/tx.rpc.msg"; -import * as _219 from "./bank/v1beta1/tx.rpc.msg"; -import * as _220 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _221 from "./gov/v1beta1/tx.rpc.msg"; -import * as _222 from "./staking/v1beta1/tx.rpc.msg"; -import * as _332 from "./lcd"; -import * as _333 from "./rpc.query"; -import * as _334 from "./rpc.tx"; +import * as _181 from "./authz/v1beta1/tx.amino"; +import * as _182 from "./bank/v1beta1/tx.amino"; +import * as _183 from "./distribution/v1beta1/tx.amino"; +import * as _184 from "./gov/v1beta1/tx.amino"; +import * as _185 from "./staking/v1beta1/tx.amino"; +import * as _186 from "./authz/v1beta1/tx.registry"; +import * as _187 from "./bank/v1beta1/tx.registry"; +import * as _188 from "./distribution/v1beta1/tx.registry"; +import * as _189 from "./gov/v1beta1/tx.registry"; +import * as _190 from "./staking/v1beta1/tx.registry"; +import * as _191 from "./auth/v1beta1/query.lcd"; +import * as _192 from "./authz/v1beta1/query.lcd"; +import * as _193 from "./bank/v1beta1/query.lcd"; +import * as _194 from "./base/node/v1beta1/query.lcd"; +import * as _195 from "./distribution/v1beta1/query.lcd"; +import * as _196 from "./gov/v1beta1/query.lcd"; +import * as _197 from "./staking/v1beta1/query.lcd"; +import * as _198 from "./tx/v1beta1/service.lcd"; +import * as _199 from "./upgrade/v1beta1/query.lcd"; +import * as _200 from "./auth/v1beta1/query.rpc.Query"; +import * as _201 from "./authz/v1beta1/query.rpc.Query"; +import * as _202 from "./bank/v1beta1/query.rpc.Query"; +import * as _203 from "./base/node/v1beta1/query.rpc.Service"; +import * as _204 from "./distribution/v1beta1/query.rpc.Query"; +import * as _205 from "./gov/v1beta1/query.rpc.Query"; +import * as _206 from "./staking/v1beta1/query.rpc.Query"; +import * as _207 from "./tx/v1beta1/service.rpc.Service"; +import * as _208 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _209 from "./authz/v1beta1/tx.rpc.msg"; +import * as _210 from "./bank/v1beta1/tx.rpc.msg"; +import * as _211 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _212 from "./gov/v1beta1/tx.rpc.msg"; +import * as _213 from "./staking/v1beta1/tx.rpc.msg"; +import * as _320 from "./lcd"; +import * as _321 from "./rpc.query"; +import * as _322 from "./rpc.tx"; export namespace cosmos { export namespace ics23 { export const v1 = { @@ -86,8 +86,8 @@ export namespace cosmos { ..._1, ..._2, ..._3, - ..._200, - ..._209 + ..._191, + ..._200 }; } export namespace authz { @@ -97,11 +97,11 @@ export namespace cosmos { ..._6, ..._7, ..._8, - ..._190, - ..._195, + ..._181, + ..._186, + ..._192, ..._201, - ..._210, - ..._218 + ..._209 }; } export namespace bank { @@ -111,11 +111,11 @@ export namespace cosmos { ..._11, ..._12, ..._13, - ..._191, - ..._196, + ..._182, + ..._187, + ..._193, ..._202, - ..._211, - ..._219 + ..._210 }; } export namespace base { @@ -127,8 +127,8 @@ export namespace cosmos { export namespace node { export const v1beta1 = { ..._15, - ..._203, - ..._212 + ..._194, + ..._203 }; } export namespace query { @@ -165,11 +165,11 @@ export namespace cosmos { ..._24, ..._25, ..._26, - ..._192, - ..._197, + ..._183, + ..._188, + ..._195, ..._204, - ..._213, - ..._220 + ..._211 }; } export namespace gov { @@ -178,11 +178,11 @@ export namespace cosmos { ..._28, ..._29, ..._30, - ..._193, - ..._198, + ..._184, + ..._189, + ..._196, ..._205, - ..._214, - ..._221 + ..._212 }; } export namespace staking { @@ -192,11 +192,11 @@ export namespace cosmos { ..._33, ..._34, ..._35, - ..._194, - ..._199, + ..._185, + ..._190, + ..._197, ..._206, - ..._215, - ..._222 + ..._213 }; } export namespace tx { @@ -208,21 +208,21 @@ export namespace cosmos { export const v1beta1 = { ..._37, ..._38, - ..._207, - ..._216 + ..._198, + ..._207 }; } export namespace upgrade { export const v1beta1 = { ..._39, ..._40, - ..._208, - ..._217 + ..._199, + ..._208 }; } export const ClientFactory = { - ..._332, - ..._333, - ..._334 + ..._320, + ..._321, + ..._322 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts index fe927e7e0..a55f1e3f2 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts @@ -12,7 +12,7 @@ export const AminoConverter = { fromAmino: MsgWithdrawDelegatorReward.fromAmino }, "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { - aminoType: "cosmos-sdk/MsgWithdrawValCommission", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", toAmino: MsgWithdrawValidatorCommission.toAmino, fromAmino: MsgWithdrawValidatorCommission.fromAmino }, diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts index 9c238e436..ba3020536 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -111,7 +111,7 @@ export interface MsgWithdrawValidatorCommissionAmino { validator_address: string; } export interface MsgWithdrawValidatorCommissionAminoMsg { - type: "cosmos-sdk/MsgWithdrawValCommission"; + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; value: MsgWithdrawValidatorCommissionAmino; } /** @@ -495,7 +495,7 @@ export const MsgWithdrawValidatorCommission = { }, toAminoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoMsg { return { - type: "cosmos-sdk/MsgWithdrawValCommission", + type: "cosmos-sdk/MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.toAmino(message) }; }, diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts index 80cdae7d6..0c0ea794c 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -466,8 +466,6 @@ export interface TallyParams { vetoThreshold: Uint8Array; /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ expeditedThreshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expeditedQuorum: Uint8Array; } export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyParams"; @@ -489,8 +487,6 @@ export interface TallyParamsAmino { veto_threshold: Uint8Array; /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ expedited_threshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expedited_quorum: Uint8Array; } export interface TallyParamsAminoMsg { type: "cosmos-sdk/TallyParams"; @@ -502,7 +498,6 @@ export interface TallyParamsSDKType { threshold: Uint8Array; veto_threshold: Uint8Array; expedited_threshold: Uint8Array; - expedited_quorum: Uint8Array; } /** * ProposalVotingPeriod defines custom voting periods for a unique governance @@ -787,14 +782,14 @@ export const Deposit = { function createBaseProposal(): Proposal { return { proposalId: BigInt(0), - content: undefined, + content: Any.fromPartial({}), status: 0, finalTallyResult: TallyResult.fromPartial({}), - submitTime: undefined, - depositEndTime: undefined, + submitTime: new Date(), + depositEndTime: new Date(), totalDeposit: [], - votingStartTime: undefined, - votingEndTime: undefined, + votingStartTime: new Date(), + votingEndTime: new Date(), isExpedited: false }; } @@ -1146,7 +1141,7 @@ export const Vote = { function createBaseDepositParams(): DepositParams { return { minDeposit: [], - maxDepositPeriod: undefined, + maxDepositPeriod: Duration.fromPartial({}), minExpeditedDeposit: [], minInitialDepositRatio: "" }; @@ -1250,9 +1245,9 @@ export const DepositParams = { }; function createBaseVotingParams(): VotingParams { return { - votingPeriod: undefined, + votingPeriod: Duration.fromPartial({}), proposalVotingPeriods: [], - expeditedVotingPeriod: undefined + expeditedVotingPeriod: Duration.fromPartial({}) }; } export const VotingParams = { @@ -1344,8 +1339,7 @@ function createBaseTallyParams(): TallyParams { quorum: new Uint8Array(), threshold: new Uint8Array(), vetoThreshold: new Uint8Array(), - expeditedThreshold: new Uint8Array(), - expeditedQuorum: new Uint8Array() + expeditedThreshold: new Uint8Array() }; } export const TallyParams = { @@ -1363,9 +1357,6 @@ export const TallyParams = { if (message.expeditedThreshold.length !== 0) { writer.uint32(34).bytes(message.expeditedThreshold); } - if (message.expeditedQuorum.length !== 0) { - writer.uint32(42).bytes(message.expeditedQuorum); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { @@ -1387,9 +1378,6 @@ export const TallyParams = { case 4: message.expeditedThreshold = reader.bytes(); break; - case 5: - message.expeditedQuorum = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1403,7 +1391,6 @@ export const TallyParams = { message.threshold = object.threshold ?? new Uint8Array(); message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); message.expeditedThreshold = object.expeditedThreshold ?? new Uint8Array(); - message.expeditedQuorum = object.expeditedQuorum ?? new Uint8Array(); return message; }, fromAmino(object: TallyParamsAmino): TallyParams { @@ -1411,8 +1398,7 @@ export const TallyParams = { quorum: object.quorum, threshold: object.threshold, vetoThreshold: object.veto_threshold, - expeditedThreshold: object.expedited_threshold, - expeditedQuorum: object.expedited_quorum + expeditedThreshold: object.expedited_threshold }; }, toAmino(message: TallyParams): TallyParamsAmino { @@ -1421,7 +1407,6 @@ export const TallyParams = { obj.threshold = message.threshold; obj.veto_threshold = message.vetoThreshold; obj.expedited_threshold = message.expeditedThreshold; - obj.expedited_quorum = message.expeditedQuorum; return obj; }, fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { @@ -1449,7 +1434,7 @@ export const TallyParams = { function createBaseProposalVotingPeriod(): ProposalVotingPeriod { return { proposalType: "", - votingPeriod: undefined + votingPeriod: Duration.fromPartial({}) }; } export const ProposalVotingPeriod = { diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts index d90c3806a..1fe457708 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts @@ -7,7 +7,7 @@ export const AminoConverter = { fromAmino: MsgSubmitProposal.fromAmino }, "/cosmos.gov.v1beta1.MsgVote": { - aminoType: "cosmos-sdk/v1/MsgVote", + aminoType: "cosmos-sdk/MsgVote", toAmino: MsgVote.toAmino, fromAmino: MsgVote.fromAmino }, diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts index 581a05e73..678d77782 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -81,7 +81,7 @@ export interface MsgVoteAmino { option: VoteOption; } export interface MsgVoteAminoMsg { - type: "cosmos-sdk/v1/MsgVote"; + type: "cosmos-sdk/MsgVote"; value: MsgVoteAmino; } /** MsgVote defines a message to cast a vote. */ @@ -210,7 +210,7 @@ export interface MsgDepositResponseAminoMsg { export interface MsgDepositResponseSDKType {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { - content: undefined, + content: Any.fromPartial({}), initialDeposit: [], proposer: "", isExpedited: false @@ -446,7 +446,7 @@ export const MsgVote = { }, toAminoMsg(message: MsgVote): MsgVoteAminoMsg { return { - type: "cosmos-sdk/v1/MsgVote", + type: "cosmos-sdk/MsgVote", value: MsgVote.toAmino(message) }; }, diff --git a/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts b/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts index 1b23b5425..5d83ee3b3 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -140,7 +140,7 @@ export interface StakeAuthorization_ValidatorsSDKType { function createBaseStakeAuthorization(): StakeAuthorization { return { $typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", - maxTokens: undefined, + maxTokens: Coin.fromPartial({}), allowList: undefined, denyList: undefined, authorizationType: 0 diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts index d273366c2..e0b5e8967 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -1005,7 +1005,7 @@ export const CommissionRates = { function createBaseCommission(): Commission { return { commissionRates: CommissionRates.fromPartial({}), - updateTime: undefined + updateTime: new Date() }; } export const Commission = { @@ -1189,14 +1189,14 @@ export const Description = { function createBaseValidator(): Validator { return { operatorAddress: "", - consensusPubkey: undefined, + consensusPubkey: Any.fromPartial({}), jailed: false, status: 0, tokens: "", delegatorShares: "", description: Description.fromPartial({}), unbondingHeight: BigInt(0), - unbondingTime: undefined, + unbondingTime: new Date(), commission: Commission.fromPartial({}), minSelfDelegation: "" }; @@ -1917,7 +1917,7 @@ export const UnbondingDelegation = { function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { return { creationHeight: BigInt(0), - completionTime: undefined, + completionTime: new Date(), initialBalance: "", balance: "" }; @@ -2014,7 +2014,7 @@ export const UnbondingDelegationEntry = { function createBaseRedelegationEntry(): RedelegationEntry { return { creationHeight: BigInt(0), - completionTime: undefined, + completionTime: new Date(), initialBalance: "", sharesDst: "" }; @@ -2211,7 +2211,7 @@ export const Redelegation = { }; function createBaseParams(): Params { return { - unbondingTime: undefined, + unbondingTime: Duration.fromPartial({}), maxValidators: 0, maxEntries: 0, historicalEntries: 0, @@ -2339,7 +2339,7 @@ export const Params = { function createBaseDelegationResponse(): DelegationResponse { return { delegation: Delegation.fromPartial({}), - balance: undefined + balance: Coin.fromPartial({}) }; } export const DelegationResponse = { diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts index a5f55d3cd..bbbe427f3 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -286,8 +286,8 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { minSelfDelegation: "", delegatorAddress: "", validatorAddress: "", - pubkey: undefined, - value: undefined + pubkey: Any.fromPartial({}), + value: Coin.fromPartial({}) }; } export const MsgCreateValidator = { @@ -623,7 +623,7 @@ function createBaseMsgDelegate(): MsgDelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgDelegate = { @@ -766,7 +766,7 @@ function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgBeginRedelegate = { @@ -860,7 +860,7 @@ export const MsgBeginRedelegate = { }; function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { return { - completionTime: undefined + completionTime: new Date() }; } export const MsgBeginRedelegateResponse = { @@ -929,7 +929,7 @@ function createBaseMsgUndelegate(): MsgUndelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgUndelegate = { @@ -1014,7 +1014,7 @@ export const MsgUndelegate = { }; function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { return { - completionTime: undefined + completionTime: new Date() }; } export const MsgUndelegateResponse = { diff --git a/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 18f6e2d55..684a7be97 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -311,7 +311,7 @@ export const SignatureDescriptors = { }; function createBaseSignatureDescriptor(): SignatureDescriptor { return { - publicKey: undefined, + publicKey: Any.fromPartial({}), data: Data.fromPartial({}), sequence: BigInt(0) }; diff --git a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts index ff8d62545..856b8f3a1 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -1030,7 +1030,7 @@ export const AuthInfo = { }; function createBaseSignerInfo(): SignerInfo { return { - publicKey: undefined, + publicKey: Any.fromPartial({}), modeInfo: ModeInfo.fromPartial({}), sequence: BigInt(0) }; diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index 26e473411..0b344875a 100644 --- a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -203,10 +203,10 @@ export interface ModuleVersionSDKType { function createBasePlan(): Plan { return { name: "", - time: undefined, + time: new Date(), height: BigInt(0), info: "", - upgradedClientState: undefined + upgradedClientState: Any.fromPartial({}) }; } export const Plan = { diff --git a/packages/osmojs/src/codegen/cosmos_proto/bundle.ts b/packages/osmojs/src/codegen/cosmos_proto/bundle.ts index b1006fb9c..5b476197a 100644 --- a/packages/osmojs/src/codegen/cosmos_proto/bundle.ts +++ b/packages/osmojs/src/codegen/cosmos_proto/bundle.ts @@ -1,4 +1,4 @@ -import * as _172 from "./cosmos"; +import * as _174 from "./cosmos"; export const cosmos_proto = { - ..._172 + ..._174 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/bundle.ts b/packages/osmojs/src/codegen/cosmwasm/bundle.ts index ce8e13222..564744274 100644 --- a/packages/osmojs/src/codegen/cosmwasm/bundle.ts +++ b/packages/osmojs/src/codegen/cosmwasm/bundle.ts @@ -1,38 +1,38 @@ -import * as _82 from "./wasm/v1/authz"; -import * as _83 from "./wasm/v1/genesis"; -import * as _84 from "./wasm/v1/ibc"; -import * as _85 from "./wasm/v1/proposal"; -import * as _86 from "./wasm/v1/query"; -import * as _87 from "./wasm/v1/tx"; -import * as _88 from "./wasm/v1/types"; -import * as _255 from "./wasm/v1/tx.amino"; -import * as _256 from "./wasm/v1/tx.registry"; -import * as _257 from "./wasm/v1/query.lcd"; -import * as _258 from "./wasm/v1/query.rpc.Query"; -import * as _259 from "./wasm/v1/tx.rpc.msg"; -import * as _338 from "./lcd"; -import * as _339 from "./rpc.query"; -import * as _340 from "./rpc.tx"; +import * as _93 from "./wasm/v1/authz"; +import * as _94 from "./wasm/v1/genesis"; +import * as _95 from "./wasm/v1/ibc"; +import * as _96 from "./wasm/v1/proposal"; +import * as _97 from "./wasm/v1/query"; +import * as _98 from "./wasm/v1/tx"; +import * as _99 from "./wasm/v1/types"; +import * as _246 from "./wasm/v1/tx.amino"; +import * as _247 from "./wasm/v1/tx.registry"; +import * as _248 from "./wasm/v1/query.lcd"; +import * as _249 from "./wasm/v1/query.rpc.Query"; +import * as _250 from "./wasm/v1/tx.rpc.msg"; +import * as _326 from "./lcd"; +import * as _327 from "./rpc.query"; +import * as _328 from "./rpc.tx"; export namespace cosmwasm { export namespace wasm { export const v1 = { - ..._82, - ..._83, - ..._84, - ..._85, - ..._86, - ..._87, - ..._88, - ..._255, - ..._256, - ..._257, - ..._258, - ..._259 + ..._93, + ..._94, + ..._95, + ..._96, + ..._97, + ..._98, + ..._99, + ..._246, + ..._247, + ..._248, + ..._249, + ..._250 }; } export const ClientFactory = { - ..._338, - ..._339, - ..._340 + ..._326, + ..._327, + ..._328 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts index 7975dea7b..353cfae73 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts @@ -491,8 +491,8 @@ export const ContractMigrationAuthorization = { function createBaseContractGrant(): ContractGrant { return { contract: "", - limit: undefined, - filter: undefined + limit: Any.fromPartial({}), + filter: Any.fromPartial({}) }; } export const ContractGrant = { diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts index 4266f68fa..d20c2c6de 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts @@ -2,7 +2,13 @@ import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposal { $typeUrl?: string; /** Title is a short summary */ @@ -34,7 +40,13 @@ export interface StoreCodeProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; value: Uint8Array; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalAmino { /** Title is a short summary */ title: string; @@ -65,7 +77,13 @@ export interface StoreCodeProposalAminoMsg { type: "wasm/StoreCodeProposal"; value: StoreCodeProposalAmino; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalSDKType { $typeUrl?: string; title: string; @@ -79,9 +97,12 @@ export interface StoreCodeProposalSDKType { code_hash: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposal { $typeUrl?: string; /** Title is a short summary */ @@ -106,9 +127,12 @@ export interface InstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalAmino { /** Title is a short summary */ title: string; @@ -132,9 +156,12 @@ export interface InstantiateContractProposalAminoMsg { value: InstantiateContractProposalAmino; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalSDKType { $typeUrl?: string; title: string; @@ -147,9 +174,12 @@ export interface InstantiateContractProposalSDKType { funds: CoinSDKType[]; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2Proposal { $typeUrl?: string; /** Title is a short summary */ @@ -181,9 +211,12 @@ export interface InstantiateContract2ProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalAmino { /** Title is a short summary */ title: string; @@ -214,9 +247,12 @@ export interface InstantiateContract2ProposalAminoMsg { value: InstantiateContract2ProposalAmino; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalSDKType { $typeUrl?: string; title: string; @@ -230,7 +266,13 @@ export interface InstantiateContract2ProposalSDKType { salt: Uint8Array; fix_msg: boolean; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposal { $typeUrl?: string; /** Title is a short summary */ @@ -248,7 +290,13 @@ export interface MigrateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; value: Uint8Array; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalAmino { /** Title is a short summary */ title: string; @@ -265,7 +313,13 @@ export interface MigrateContractProposalAminoMsg { type: "wasm/MigrateContractProposal"; value: MigrateContractProposalAmino; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalSDKType { $typeUrl?: string; title: string; @@ -274,7 +328,13 @@ export interface MigrateContractProposalSDKType { code_id: bigint; msg: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposal { $typeUrl?: string; /** Title is a short summary */ @@ -290,7 +350,13 @@ export interface SudoContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; value: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalAmino { /** Title is a short summary */ title: string; @@ -305,7 +371,13 @@ export interface SudoContractProposalAminoMsg { type: "wasm/SudoContractProposal"; value: SudoContractProposalAmino; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalSDKType { $typeUrl?: string; title: string; @@ -314,9 +386,12 @@ export interface SudoContractProposalSDKType { msg: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposal { $typeUrl?: string; /** Title is a short summary */ @@ -337,9 +412,12 @@ export interface ExecuteContractProposalProtoMsg { value: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalAmino { /** Title is a short summary */ title: string; @@ -359,9 +437,12 @@ export interface ExecuteContractProposalAminoMsg { value: ExecuteContractProposalAmino; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalSDKType { $typeUrl?: string; title: string; @@ -371,7 +452,13 @@ export interface ExecuteContractProposalSDKType { msg: Uint8Array; funds: CoinSDKType[]; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposal { $typeUrl?: string; /** Title is a short summary */ @@ -387,7 +474,13 @@ export interface UpdateAdminProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; value: Uint8Array; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalAmino { /** Title is a short summary */ title: string; @@ -402,7 +495,13 @@ export interface UpdateAdminProposalAminoMsg { type: "wasm/UpdateAdminProposal"; value: UpdateAdminProposalAmino; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalSDKType { $typeUrl?: string; title: string; @@ -411,9 +510,12 @@ export interface UpdateAdminProposalSDKType { contract: string; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposal { $typeUrl?: string; /** Title is a short summary */ @@ -428,9 +530,12 @@ export interface ClearAdminProposalProtoMsg { value: Uint8Array; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalAmino { /** Title is a short summary */ title: string; @@ -444,9 +549,12 @@ export interface ClearAdminProposalAminoMsg { value: ClearAdminProposalAmino; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalSDKType { $typeUrl?: string; title: string; @@ -454,9 +562,12 @@ export interface ClearAdminProposalSDKType { contract: string; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposal { $typeUrl?: string; /** Title is a short summary */ @@ -471,9 +582,12 @@ export interface PinCodesProposalProtoMsg { value: Uint8Array; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalAmino { /** Title is a short summary */ title: string; @@ -487,9 +601,12 @@ export interface PinCodesProposalAminoMsg { value: PinCodesProposalAmino; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalSDKType { $typeUrl?: string; title: string; @@ -497,9 +614,12 @@ export interface PinCodesProposalSDKType { code_ids: bigint[]; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposal { $typeUrl?: string; /** Title is a short summary */ @@ -514,9 +634,12 @@ export interface UnpinCodesProposalProtoMsg { value: Uint8Array; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalAmino { /** Title is a short summary */ title: string; @@ -530,9 +653,12 @@ export interface UnpinCodesProposalAminoMsg { value: UnpinCodesProposalAmino; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalSDKType { $typeUrl?: string; title: string; @@ -576,9 +702,12 @@ export interface AccessConfigUpdateSDKType { instantiate_permission: AccessConfigSDKType; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposal { $typeUrl?: string; /** Title is a short summary */ @@ -596,9 +725,12 @@ export interface UpdateInstantiateConfigProposalProtoMsg { value: Uint8Array; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalAmino { /** Title is a short summary */ title: string; @@ -615,9 +747,12 @@ export interface UpdateInstantiateConfigProposalAminoMsg { value: UpdateInstantiateConfigProposalAmino; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalSDKType { $typeUrl?: string; title: string; @@ -625,9 +760,12 @@ export interface UpdateInstantiateConfigProposalSDKType { access_config_updates: AccessConfigUpdateSDKType[]; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposal { $typeUrl?: string; /** Title is a short summary */ @@ -668,9 +806,12 @@ export interface StoreAndInstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalAmino { /** Title is a short summary */ title: string; @@ -710,9 +851,12 @@ export interface StoreAndInstantiateContractProposalAminoMsg { value: StoreAndInstantiateContractProposalAmino; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalSDKType { $typeUrl?: string; title: string; diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts index 2b9cd59b2..6d4efac92 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract } from "./tx"; export const AminoConverter = { "/cosmwasm.wasm.v1.MsgStoreCode": { aminoType: "wasm/MsgStoreCode", @@ -40,5 +40,30 @@ export const AminoConverter = { aminoType: "wasm/MsgUpdateInstantiateConfig", toAmino: MsgUpdateInstantiateConfig.toAmino, fromAmino: MsgUpdateInstantiateConfig.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateParams": { + aminoType: "wasm/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmwasm.wasm.v1.MsgSudoContract": { + aminoType: "wasm/MsgSudoContract", + toAmino: MsgSudoContract.toAmino, + fromAmino: MsgSudoContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgPinCodes": { + aminoType: "wasm/MsgPinCodes", + toAmino: MsgPinCodes.toAmino, + fromAmino: MsgPinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUnpinCodes": { + aminoType: "wasm/MsgUnpinCodes", + toAmino: MsgUnpinCodes.toAmino, + fromAmino: MsgUnpinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { + aminoType: "wasm/MsgStoreAndInstantiateContract", + toAmino: MsgStoreAndInstantiateContract.toAmino, + fromAmino: MsgStoreAndInstantiateContract.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts index 16b45c68b..38ccda98e 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig]]; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract } 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]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -56,6 +56,36 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(value).finish() + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(value).finish() + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(value).finish() + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(value).finish() + }; } }, withTypeUrl: { @@ -106,6 +136,36 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value + }; } }, fromPartial: { @@ -156,6 +216,36 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromPartial(value) + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromPartial(value) + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromPartial(value) + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts index 7fdd8a748..899918d11 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse } from "./tx"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse } from "./tx"; /** Msg defines the wasm Msg service. */ export interface Msg { /** StoreCode to submit Wasm code to the system */ @@ -25,6 +25,41 @@ export interface Msg { clearAdmin(request: MsgClearAdmin): Promise; /** UpdateInstantiateConfig updates instantiate config for a smart contract */ updateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise; + /** + * UpdateParams defines a governance operation for updating the x/wasm + * module parameters. The authority is defined in the keeper. + * + * Since: 0.40 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SudoContract defines a governance operation for calling sudo + * on a contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + sudoContract(request: MsgSudoContract): Promise; + /** + * PinCodes defines a governance operation for pinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + pinCodes(request: MsgPinCodes): Promise; + /** + * UnpinCodes defines a governance operation for unpinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + unpinCodes(request: MsgUnpinCodes): Promise; + /** + * StoreAndInstantiateContract defines a governance operation for storing + * and instantiating the contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -38,6 +73,11 @@ export class MsgClientImpl implements Msg { this.updateAdmin = this.updateAdmin.bind(this); this.clearAdmin = this.clearAdmin.bind(this); this.updateInstantiateConfig = this.updateInstantiateConfig.bind(this); + this.updateParams = this.updateParams.bind(this); + this.sudoContract = this.sudoContract.bind(this); + this.pinCodes = this.pinCodes.bind(this); + this.unpinCodes = this.unpinCodes.bind(this); + this.storeAndInstantiateContract = this.storeAndInstantiateContract.bind(this); } storeCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); @@ -79,4 +119,29 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); return promise.then(data => MsgUpdateInstantiateConfigResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + sudoContract(request: MsgSudoContract): Promise { + const data = MsgSudoContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); + return promise.then(data => MsgSudoContractResponse.decode(new BinaryReader(data))); + } + pinCodes(request: MsgPinCodes): Promise { + const data = MsgPinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); + return promise.then(data => MsgPinCodesResponse.decode(new BinaryReader(data))); + } + unpinCodes(request: MsgUnpinCodes): Promise { + const data = MsgUnpinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); + return promise.then(data => MsgUnpinCodesResponse.decode(new BinaryReader(data))); + } + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise { + const data = MsgStoreAndInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); + return promise.then(data => MsgStoreAndInstantiateContractResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts index e5e760aab..c81992dd2 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts @@ -1,4 +1,4 @@ -import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; @@ -123,6 +123,33 @@ export interface MsgInstantiateContractSDKType { msg: Uint8Array; funds: CoinSDKType[]; } +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +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. @@ -195,33 +222,6 @@ export interface MsgInstantiateContract2SDKType { salt: Uint8Array; fix_msg: boolean; } -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseProtoMsg { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; - value: Uint8Array; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseAmino { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseAminoMsg { - type: "wasm/MsgInstantiateContractResponse"; - value: MsgInstantiateContractResponseAmino; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseSDKType { - address: string; - data: Uint8Array; -} /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2Response { /** Address is the bech32 address of the new contract instance. */ @@ -506,6 +506,452 @@ export interface MsgUpdateInstantiateConfigResponseAminoMsg { } /** 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: Uint8Array; +} +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: Uint8Array; +} +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: Uint8Array; + /** + * 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: Uint8Array; +} +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: Uint8Array; +} +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; +} function createBaseMsgStoreCode(): MsgStoreCode { return { sender: "", @@ -791,26 +1237,103 @@ export const MsgInstantiateContract = { }; } }; -function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [], - salt: new Uint8Array(), - fixMsg: false + address: "", + data: new Uint8Array() }; } -export const MsgInstantiateContract2 = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); + 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 { + return { + address: object.address, + data: object.data + }; + }, + toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const MsgInstantiateContract2 = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); } if (message.codeId !== BigInt(0)) { writer.uint32(24).uint64(message.codeId); @@ -932,83 +1455,6 @@ export const MsgInstantiateContract2 = { }; } }; -function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { - return { - address: "", - data: new Uint8Array() - }; -} -export const MsgInstantiateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContractResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgInstantiateContractResponse { - const message = createBaseMsgInstantiateContractResponse(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { - return { - address: object.address, - data: object.data - }; - }, - toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { - const obj: any = {}; - obj.address = message.address; - obj.data = message.data; - return obj; - }, - fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { - return { - type: "wasm/MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.toAmino(message) - }; - }, - fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.decode(message.value); - }, - toProto(message: MsgInstantiateContractResponse): Uint8Array { - return MsgInstantiateContractResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.encode(message).finish() - }; - } -}; function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { return { address: "", @@ -1833,4 +2279,828 @@ export const MsgUpdateInstantiateConfigResponse = { value: MsgUpdateInstantiateConfigResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + return { + authority: object.authority, + params: object?.params ? Params.fromAmino(object.params) : undefined + }; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "wasm/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + return {}; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "wasm/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + encode(message: MsgSudoContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(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 { + return { + authority: object.authority, + contract: object.contract, + msg: toUtf8(JSON.stringify(object.msg)) + }; + }, + toAmino(message: MsgSudoContract): MsgSudoContractAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSudoContractAminoMsg): MsgSudoContract { + return MsgSudoContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgSudoContract): MsgSudoContractAminoMsg { + return { + type: "wasm/MsgSudoContract", + value: MsgSudoContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSudoContractProtoMsg): MsgSudoContract { + return MsgSudoContract.decode(message.value); + }, + toProto(message: MsgSudoContract): Uint8Array { + return MsgSudoContract.encode(message).finish(); + }, + toProtoMsg(message: MsgSudoContract): MsgSudoContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + encode(message: MsgSudoContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): 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 { + return { + data: object.data + }; + }, + toAmino(message: MsgSudoContractResponse): MsgSudoContractResponseAmino { + const obj: any = {}; + obj.data = message.data; + 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() + }; + } +}; +function createBaseMsgPinCodes(): MsgPinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + encode(message: MsgPinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + 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 { + return { + authority: object.authority, + codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] + }; + }, + toAmino(message: MsgPinCodes): MsgPinCodesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = []; + } + return obj; + }, + fromAminoMsg(object: MsgPinCodesAminoMsg): MsgPinCodes { + return MsgPinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodes): MsgPinCodesAminoMsg { + return { + type: "wasm/MsgPinCodes", + value: MsgPinCodes.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesProtoMsg): MsgPinCodes { + return MsgPinCodes.decode(message.value); + }, + toProto(message: MsgPinCodes): Uint8Array { + return MsgPinCodes.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodes): MsgPinCodesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(message).finish() + }; + } +}; +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + encode(_: MsgPinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, + fromAmino(_: MsgPinCodesResponseAmino): MsgPinCodesResponse { + return {}; + }, + toAmino(_: MsgPinCodesResponse): MsgPinCodesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPinCodesResponseAminoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseAminoMsg { + return { + type: "wasm/MsgPinCodesResponse", + value: MsgPinCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesResponseProtoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.decode(message.value); + }, + toProto(message: MsgPinCodesResponse): Uint8Array { + return MsgPinCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + value: MsgPinCodesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + encode(message: MsgUnpinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + 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 { + return { + authority: object.authority, + codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] + }; + }, + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = []; + } + return obj; + }, + fromAminoMsg(object: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { + return { + type: "wasm/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() + }; + } +}; +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + encode(_: MsgUnpinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): 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 { + return {}; + }, + 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() + }; + } +}; +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: AccessConfig.fromPartial({}), + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.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 { + return { + authority: object.authority, + wasmByteCode: fromBase64(object.wasm_byte_code), + instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined, + unpinCode: object.unpin_code, + admin: object.admin, + label: object.label, + msg: toUtf8(JSON.stringify(object.msg)), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], + source: object.source, + builder: object.builder, + codeHash: object.code_hash + }; + }, + toAmino(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode; + obj.admin = message.admin; + obj.label = message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + obj.source = message.source; + obj.builder = message.builder; + obj.code_hash = message.codeHash; + 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() + }; + } +}; +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + encode(message: MsgStoreAndInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(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 { + return { + address: object.address, + data: object.data + }; + }, + toAmino(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data; + 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() + }; + } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts index 957838760..a104e119a 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts @@ -714,7 +714,7 @@ function createBaseContractInfo(): ContractInfo { label: "", created: AbsoluteTxPosition.fromPartial({}), ibcPortId: "", - extension: undefined + extension: Any.fromPartial({}) }; } export const ContractInfo = { diff --git a/packages/osmojs/src/codegen/gogoproto/bundle.ts b/packages/osmojs/src/codegen/gogoproto/bundle.ts index 17083f96a..a1370638a 100644 --- a/packages/osmojs/src/codegen/gogoproto/bundle.ts +++ b/packages/osmojs/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _173 from "./gogo"; +import * as _175 from "./gogo"; export const gogoproto = { - ..._173 + ..._175 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/bundle.ts b/packages/osmojs/src/codegen/google/bundle.ts index b198fe56a..1334e6216 100644 --- a/packages/osmojs/src/codegen/google/bundle.ts +++ b/packages/osmojs/src/codegen/google/bundle.ts @@ -1,14 +1,14 @@ -import * as _174 from "./protobuf/any"; -import * as _175 from "./protobuf/descriptor"; -import * as _176 from "./protobuf/duration"; -import * as _177 from "./protobuf/empty"; -import * as _178 from "./protobuf/timestamp"; +import * as _176 from "./protobuf/any"; +import * as _177 from "./protobuf/descriptor"; +import * as _178 from "./protobuf/duration"; +import * as _179 from "./protobuf/empty"; +import * as _180 from "./protobuf/timestamp"; export namespace google { export const protobuf = { - ..._174, - ..._175, ..._176, ..._177, - ..._178 + ..._178, + ..._179, + ..._180 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/helpers.ts b/packages/osmojs/src/codegen/helpers.ts index 105ad0991..001bf14de 100644 --- a/packages/osmojs/src/codegen/helpers.ts +++ b/packages/osmojs/src/codegen/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -182,9 +182,9 @@ type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + Exclude>, + never + >; export interface Rpc { request( diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts index 1769db596..b87014f4f 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -108,7 +108,7 @@ function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", sourceChannel: "", - token: undefined, + token: Coin.fromPartial({}), sender: "", receiver: "", timeoutHeight: Height.fromPartial({}), diff --git a/packages/osmojs/src/codegen/ibc/bundle.ts b/packages/osmojs/src/codegen/ibc/bundle.ts index a4fb5c624..59cca4444 100644 --- a/packages/osmojs/src/codegen/ibc/bundle.ts +++ b/packages/osmojs/src/codegen/ibc/bundle.ts @@ -1,212 +1,212 @@ -import * as _44 from "./applications/fee/v1/ack"; -import * as _45 from "./applications/fee/v1/fee"; -import * as _46 from "./applications/fee/v1/genesis"; -import * as _47 from "./applications/fee/v1/metadata"; -import * as _48 from "./applications/fee/v1/query"; -import * as _49 from "./applications/fee/v1/tx"; -import * as _50 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _51 from "./applications/interchain_accounts/controller/v1/query"; -import * as _52 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _53 from "./applications/interchain_accounts/genesis/v1/genesis"; -import * as _54 from "./applications/interchain_accounts/host/v1/host"; -import * as _55 from "./applications/interchain_accounts/host/v1/query"; -import * as _56 from "./applications/interchain_accounts/v1/account"; -import * as _57 from "./applications/interchain_accounts/v1/metadata"; -import * as _58 from "./applications/interchain_accounts/v1/packet"; -import * as _59 from "./applications/transfer/v1/authz"; -import * as _60 from "./applications/transfer/v1/genesis"; -import * as _61 from "./applications/transfer/v1/query"; -import * as _62 from "./applications/transfer/v1/transfer"; -import * as _63 from "./applications/transfer/v1/tx"; -import * as _64 from "./applications/transfer/v2/packet"; -import * as _65 from "./core/channel/v1/channel"; -import * as _66 from "./core/channel/v1/genesis"; -import * as _67 from "./core/channel/v1/query"; -import * as _68 from "./core/channel/v1/tx"; -import * as _69 from "./core/client/v1/client"; -import * as _70 from "./core/client/v1/genesis"; -import * as _71 from "./core/client/v1/query"; -import * as _72 from "./core/client/v1/tx"; -import * as _73 from "./core/commitment/v1/commitment"; -import * as _74 from "./core/connection/v1/connection"; -import * as _75 from "./core/connection/v1/genesis"; -import * as _76 from "./core/connection/v1/query"; -import * as _77 from "./core/connection/v1/tx"; -import * as _78 from "./lightclients/localhost/v2/localhost"; -import * as _79 from "./lightclients/solomachine/v2/solomachine"; -import * as _80 from "./lightclients/solomachine/v3/solomachine"; -import * as _81 from "./lightclients/tendermint/v1/tendermint"; -import * as _223 from "./applications/fee/v1/tx.amino"; -import * as _224 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _225 from "./applications/transfer/v1/tx.amino"; -import * as _226 from "./core/channel/v1/tx.amino"; -import * as _227 from "./core/client/v1/tx.amino"; -import * as _228 from "./core/connection/v1/tx.amino"; -import * as _229 from "./applications/fee/v1/tx.registry"; -import * as _230 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _231 from "./applications/transfer/v1/tx.registry"; -import * as _232 from "./core/channel/v1/tx.registry"; -import * as _233 from "./core/client/v1/tx.registry"; -import * as _234 from "./core/connection/v1/tx.registry"; -import * as _235 from "./applications/fee/v1/query.lcd"; -import * as _236 from "./applications/interchain_accounts/controller/v1/query.lcd"; -import * as _237 from "./applications/interchain_accounts/host/v1/query.lcd"; -import * as _238 from "./applications/transfer/v1/query.lcd"; -import * as _239 from "./core/channel/v1/query.lcd"; -import * as _240 from "./core/client/v1/query.lcd"; -import * as _241 from "./core/connection/v1/query.lcd"; -import * as _242 from "./applications/fee/v1/query.rpc.Query"; -import * as _243 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _244 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _245 from "./applications/transfer/v1/query.rpc.Query"; -import * as _246 from "./core/channel/v1/query.rpc.Query"; -import * as _247 from "./core/client/v1/query.rpc.Query"; -import * as _248 from "./core/connection/v1/query.rpc.Query"; -import * as _249 from "./applications/fee/v1/tx.rpc.msg"; -import * as _250 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _251 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _252 from "./core/channel/v1/tx.rpc.msg"; -import * as _253 from "./core/client/v1/tx.rpc.msg"; -import * as _254 from "./core/connection/v1/tx.rpc.msg"; -import * as _335 from "./lcd"; -import * as _336 from "./rpc.query"; -import * as _337 from "./rpc.tx"; +import * as _55 from "./applications/fee/v1/ack"; +import * as _56 from "./applications/fee/v1/fee"; +import * as _57 from "./applications/fee/v1/genesis"; +import * as _58 from "./applications/fee/v1/metadata"; +import * as _59 from "./applications/fee/v1/query"; +import * as _60 from "./applications/fee/v1/tx"; +import * as _61 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _62 from "./applications/interchain_accounts/controller/v1/query"; +import * as _63 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _64 from "./applications/interchain_accounts/genesis/v1/genesis"; +import * as _65 from "./applications/interchain_accounts/host/v1/host"; +import * as _66 from "./applications/interchain_accounts/host/v1/query"; +import * as _67 from "./applications/interchain_accounts/v1/account"; +import * as _68 from "./applications/interchain_accounts/v1/metadata"; +import * as _69 from "./applications/interchain_accounts/v1/packet"; +import * as _70 from "./applications/transfer/v1/authz"; +import * as _71 from "./applications/transfer/v1/genesis"; +import * as _72 from "./applications/transfer/v1/query"; +import * as _73 from "./applications/transfer/v1/transfer"; +import * as _74 from "./applications/transfer/v1/tx"; +import * as _75 from "./applications/transfer/v2/packet"; +import * as _76 from "./core/channel/v1/channel"; +import * as _77 from "./core/channel/v1/genesis"; +import * as _78 from "./core/channel/v1/query"; +import * as _79 from "./core/channel/v1/tx"; +import * as _80 from "./core/client/v1/client"; +import * as _81 from "./core/client/v1/genesis"; +import * as _82 from "./core/client/v1/query"; +import * as _83 from "./core/client/v1/tx"; +import * as _84 from "./core/commitment/v1/commitment"; +import * as _85 from "./core/connection/v1/connection"; +import * as _86 from "./core/connection/v1/genesis"; +import * as _87 from "./core/connection/v1/query"; +import * as _88 from "./core/connection/v1/tx"; +import * as _89 from "./lightclients/localhost/v2/localhost"; +import * as _90 from "./lightclients/solomachine/v2/solomachine"; +import * as _91 from "./lightclients/solomachine/v3/solomachine"; +import * as _92 from "./lightclients/tendermint/v1/tendermint"; +import * as _214 from "./applications/fee/v1/tx.amino"; +import * as _215 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _216 from "./applications/transfer/v1/tx.amino"; +import * as _217 from "./core/channel/v1/tx.amino"; +import * as _218 from "./core/client/v1/tx.amino"; +import * as _219 from "./core/connection/v1/tx.amino"; +import * as _220 from "./applications/fee/v1/tx.registry"; +import * as _221 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _222 from "./applications/transfer/v1/tx.registry"; +import * as _223 from "./core/channel/v1/tx.registry"; +import * as _224 from "./core/client/v1/tx.registry"; +import * as _225 from "./core/connection/v1/tx.registry"; +import * as _226 from "./applications/fee/v1/query.lcd"; +import * as _227 from "./applications/interchain_accounts/controller/v1/query.lcd"; +import * as _228 from "./applications/interchain_accounts/host/v1/query.lcd"; +import * as _229 from "./applications/transfer/v1/query.lcd"; +import * as _230 from "./core/channel/v1/query.lcd"; +import * as _231 from "./core/client/v1/query.lcd"; +import * as _232 from "./core/connection/v1/query.lcd"; +import * as _233 from "./applications/fee/v1/query.rpc.Query"; +import * as _234 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _235 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _236 from "./applications/transfer/v1/query.rpc.Query"; +import * as _237 from "./core/channel/v1/query.rpc.Query"; +import * as _238 from "./core/client/v1/query.rpc.Query"; +import * as _239 from "./core/connection/v1/query.rpc.Query"; +import * as _240 from "./applications/fee/v1/tx.rpc.msg"; +import * as _241 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _242 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _243 from "./core/channel/v1/tx.rpc.msg"; +import * as _244 from "./core/client/v1/tx.rpc.msg"; +import * as _245 from "./core/connection/v1/tx.rpc.msg"; +import * as _323 from "./lcd"; +import * as _324 from "./rpc.query"; +import * as _325 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace fee { export const v1 = { - ..._44, - ..._45, - ..._46, - ..._47, - ..._48, - ..._49, - ..._223, - ..._229, - ..._235, - ..._242, - ..._249 + ..._55, + ..._56, + ..._57, + ..._58, + ..._59, + ..._60, + ..._214, + ..._220, + ..._226, + ..._233, + ..._240 }; } export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._50, - ..._51, - ..._52, - ..._224, - ..._230, - ..._236, - ..._243, - ..._250 + ..._61, + ..._62, + ..._63, + ..._215, + ..._221, + ..._227, + ..._234, + ..._241 }; } export namespace genesis { export const v1 = { - ..._53 + ..._64 }; } export namespace host { export const v1 = { - ..._54, - ..._55, - ..._237, - ..._244 + ..._65, + ..._66, + ..._228, + ..._235 }; } export const v1 = { - ..._56, - ..._57, - ..._58 + ..._67, + ..._68, + ..._69 }; } export namespace transfer { export const v1 = { - ..._59, - ..._60, - ..._61, - ..._62, - ..._63, - ..._225, - ..._231, - ..._238, - ..._245, - ..._251 + ..._70, + ..._71, + ..._72, + ..._73, + ..._74, + ..._216, + ..._222, + ..._229, + ..._236, + ..._242 }; export const v2 = { - ..._64 + ..._75 }; } } export namespace core { export namespace channel { export const v1 = { - ..._65, - ..._66, - ..._67, - ..._68, - ..._226, - ..._232, - ..._239, - ..._246, - ..._252 + ..._76, + ..._77, + ..._78, + ..._79, + ..._217, + ..._223, + ..._230, + ..._237, + ..._243 }; } export namespace client { export const v1 = { - ..._69, - ..._70, - ..._71, - ..._72, - ..._227, - ..._233, - ..._240, - ..._247, - ..._253 + ..._80, + ..._81, + ..._82, + ..._83, + ..._218, + ..._224, + ..._231, + ..._238, + ..._244 }; } export namespace commitment { export const v1 = { - ..._73 + ..._84 }; } export namespace connection { export const v1 = { - ..._74, - ..._75, - ..._76, - ..._77, - ..._228, - ..._234, - ..._241, - ..._248, - ..._254 + ..._85, + ..._86, + ..._87, + ..._88, + ..._219, + ..._225, + ..._232, + ..._239, + ..._245 }; } } export namespace lightclients { export namespace localhost { export const v2 = { - ..._78 + ..._89 }; } export namespace solomachine { export const v2 = { - ..._79 + ..._90 }; export const v3 = { - ..._80 + ..._91 }; } export namespace tendermint { export const v1 = { - ..._81 + ..._92 }; } } export const ClientFactory = { - ..._335, - ..._336, - ..._337 + ..._323, + ..._324, + ..._325 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts index eadfa84a6..7ef1ca489 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts @@ -1778,7 +1778,7 @@ export const QueryChannelConsensusStateRequest = { }; function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusStateResponse { return { - consensusState: undefined, + consensusState: Any.fromPartial({}), clientId: "", proof: new Uint8Array(), proofHeight: Height.fromPartial({}) diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts index 203cd359b..4f97407c3 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts @@ -318,7 +318,7 @@ export interface ParamsSDKType { function createBaseIdentifiedClientState(): IdentifiedClientState { return { clientId: "", - clientState: undefined + clientState: Any.fromPartial({}) }; } export const IdentifiedClientState = { @@ -395,7 +395,7 @@ export const IdentifiedClientState = { function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { return { height: Height.fromPartial({}), - consensusState: undefined + consensusState: Any.fromPartial({}) }; } export const ConsensusStateWithHeight = { @@ -654,7 +654,7 @@ function createBaseUpgradeProposal(): UpgradeProposal { title: "", description: "", plan: Plan.fromPartial({}), - upgradedClientState: undefined + upgradedClientState: Any.fromPartial({}) }; } export const UpgradeProposal = { diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts index ac90b9124..67ace4443 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts @@ -675,7 +675,7 @@ export const QueryClientStateRequest = { }; function createBaseQueryClientStateResponse(): QueryClientStateResponse { return { - clientState: undefined, + clientState: Any.fromPartial({}), proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1007,7 +1007,7 @@ export const QueryConsensusStateRequest = { }; function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { return { - consensusState: undefined, + consensusState: Any.fromPartial({}), proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1721,7 +1721,7 @@ export const QueryUpgradedClientStateRequest = { }; function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { return { - upgradedClientState: undefined + upgradedClientState: Any.fromPartial({}) }; } export const QueryUpgradedClientStateResponse = { @@ -1843,7 +1843,7 @@ export const QueryUpgradedConsensusStateRequest = { }; function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { return { - upgradedConsensusState: undefined + upgradedConsensusState: Any.fromPartial({}) }; } export const QueryUpgradedConsensusStateResponse = { diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts index 6e629ae28..9560f7ed7 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts @@ -261,8 +261,8 @@ export interface MsgSubmitMisbehaviourResponseAminoMsg { export interface MsgSubmitMisbehaviourResponseSDKType {} function createBaseMsgCreateClient(): MsgCreateClient { return { - clientState: undefined, - consensusState: undefined, + clientState: Any.fromPartial({}), + consensusState: Any.fromPartial({}), signer: "" }; } @@ -404,7 +404,7 @@ export const MsgCreateClientResponse = { function createBaseMsgUpdateClient(): MsgUpdateClient { return { clientId: "", - clientMessage: undefined, + clientMessage: Any.fromPartial({}), signer: "" }; } @@ -546,8 +546,8 @@ export const MsgUpdateClientResponse = { function createBaseMsgUpgradeClient(): MsgUpgradeClient { return { clientId: "", - clientState: undefined, - consensusState: undefined, + clientState: Any.fromPartial({}), + consensusState: Any.fromPartial({}), proofUpgradeClient: new Uint8Array(), proofUpgradeConsensusState: new Uint8Array(), signer: "" @@ -718,7 +718,7 @@ export const MsgUpgradeClientResponse = { function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { return { clientId: "", - misbehaviour: undefined, + misbehaviour: Any.fromPartial({}), signer: "" }; } diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts index bfb5f5dd8..50042e399 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts @@ -1124,7 +1124,7 @@ export const QueryConnectionConsensusStateRequest = { }; function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { return { - consensusState: undefined, + consensusState: Any.fromPartial({}), clientId: "", proof: new Uint8Array(), proofHeight: Height.fromPartial({}) diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts index 684893d72..08d415551 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts @@ -480,7 +480,7 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { return { clientId: "", previousConnectionId: "", - clientState: undefined, + clientState: Any.fromPartial({}), counterparty: Counterparty.fromPartial({}), delayPeriod: BigInt(0), counterpartyVersions: [], @@ -727,7 +727,7 @@ function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { connectionId: "", counterpartyConnectionId: "", version: Version.fromPartial({}), - clientState: undefined, + clientState: Any.fromPartial({}), proofHeight: Height.fromPartial({}), proofTry: new Uint8Array(), proofClient: new Uint8Array(), diff --git a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts index 7c3953a05..a368d7bac 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts @@ -745,7 +745,7 @@ export const ClientState = { }; function createBaseConsensusState(): ConsensusState { return { - publicKey: undefined, + publicKey: Any.fromPartial({}), diversifier: "", timestamp: BigInt(0) }; @@ -835,7 +835,7 @@ function createBaseHeader(): Header { sequence: BigInt(0), timestamp: BigInt(0), signature: new Uint8Array(), - newPublicKey: undefined, + newPublicKey: Any.fromPartial({}), newDiversifier: "" }; } @@ -1317,7 +1317,7 @@ export const SignBytes = { }; function createBaseHeaderData(): HeaderData { return { - newPubKey: undefined, + newPubKey: Any.fromPartial({}), newDiversifier: "" }; } @@ -1395,7 +1395,7 @@ export const HeaderData = { function createBaseClientStateData(): ClientStateData { return { path: new Uint8Array(), - clientState: undefined + clientState: Any.fromPartial({}) }; } export const ClientStateData = { @@ -1472,7 +1472,7 @@ export const ClientStateData = { function createBaseConsensusStateData(): ConsensusStateData { return { path: new Uint8Array(), - consensusState: undefined + consensusState: Any.fromPartial({}) }; } export const ConsensusStateData = { diff --git a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts index 51a5b97e8..bd9c489bf 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts @@ -381,7 +381,7 @@ export const ClientState = { }; function createBaseConsensusState(): ConsensusState { return { - publicKey: undefined, + publicKey: Any.fromPartial({}), diversifier: "", timestamp: BigInt(0) }; @@ -470,7 +470,7 @@ function createBaseHeader(): Header { return { timestamp: BigInt(0), signature: new Uint8Array(), - newPublicKey: undefined, + newPublicKey: Any.fromPartial({}), newDiversifier: "" }; } @@ -933,7 +933,7 @@ export const SignBytes = { }; function createBaseHeaderData(): HeaderData { return { - newPubKey: undefined, + newPubKey: Any.fromPartial({}), newDiversifier: "" }; } diff --git a/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts b/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts index 46ec90b65..2c2a798e1 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts @@ -292,9 +292,9 @@ function createBaseClientState(): ClientState { return { chainId: "", trustLevel: Fraction.fromPartial({}), - trustingPeriod: undefined, - unbondingPeriod: undefined, - maxClockDrift: undefined, + trustingPeriod: Duration.fromPartial({}), + unbondingPeriod: Duration.fromPartial({}), + maxClockDrift: Duration.fromPartial({}), frozenHeight: Height.fromPartial({}), latestHeight: Height.fromPartial({}), proofSpecs: [], @@ -465,7 +465,7 @@ export const ClientState = { }; function createBaseConsensusState(): ConsensusState { return { - timestamp: undefined, + timestamp: new Date(), root: MerkleRoot.fromPartial({}), nextValidatorsHash: new Uint8Array() }; diff --git a/packages/osmojs/src/codegen/ics23/bundle.ts b/packages/osmojs/src/codegen/ics23/bundle.ts index ed4d55aef..aedc9fdb5 100644 --- a/packages/osmojs/src/codegen/ics23/bundle.ts +++ b/packages/osmojs/src/codegen/ics23/bundle.ts @@ -1,4 +1,4 @@ -import * as _171 from "../confio/proofs"; +import * as _173 from "../confio/proofs"; export const ics23 = { - ..._171 + ..._173 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/index.ts b/packages/osmojs/src/codegen/index.ts index 5dc8d8aa9..cc3d72d84 100644 --- a/packages/osmojs/src/codegen/index.ts +++ b/packages/osmojs/src/codegen/index.ts @@ -1,12 +1,13 @@ /** - * This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 + * This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ - + export * from "./cosmos/bundle"; export * from "./cosmos/client"; export * from "./amino/bundle"; +export * from "./tendermint/bundle"; export * from "./capability/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; @@ -18,7 +19,6 @@ export * from "./ics23/bundle"; export * from "./cosmos_proto/bundle"; export * from "./gogoproto/bundle"; export * from "./google/bundle"; -export * from "./tendermint/bundle"; export * from "./varint"; export * from "./utf8"; export * from "./binary"; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts b/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts index f1cc04c8b..0d8c75663 100644 --- a/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts +++ b/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts @@ -1,11 +1,6 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -/** - * AccumulatorContent is the state-entry for the global accumulator. - * It contains the name of the global accumulator and the total value of - * shares belonging to it from all positions. - */ export interface AccumulatorContent { accumValue: DecCoin[]; totalShares: string; @@ -14,11 +9,6 @@ export interface AccumulatorContentProtoMsg { typeUrl: "/osmosis.accum.v1beta1.AccumulatorContent"; value: Uint8Array; } -/** - * AccumulatorContent is the state-entry for the global accumulator. - * It contains the name of the global accumulator and the total value of - * shares belonging to it from all positions. - */ export interface AccumulatorContentAmino { accum_value: DecCoinAmino[]; total_shares: string; @@ -27,11 +17,6 @@ export interface AccumulatorContentAminoMsg { type: "osmosis/accum/accumulator-content"; value: AccumulatorContentAmino; } -/** - * AccumulatorContent is the state-entry for the global accumulator. - * It contains the name of the global accumulator and the total value of - * shares belonging to it from all positions. - */ export interface AccumulatorContentSDKType { accum_value: DecCoinSDKType[]; total_shares: string; @@ -47,102 +32,30 @@ export interface OptionsAminoMsg { value: OptionsAmino; } export interface OptionsSDKType {} -/** - * Record corresponds to an individual position value belonging to the - * global accumulator. - */ export interface Record { - /** - * num_shares is the number of shares belonging to the position associated - * with this record. - */ numShares: string; - /** - * accum_value_per_share is the subset of coins per shar of the global - * accumulator value that allows to infer how much a position is entitled to - * per share that it owns. - * - * In the default case with no intervals, this value equals to the global - * accumulator value at the time of the position creation, the last update or - * reward claim. - * - * In the interval case such as concentrated liquidity, this value equals to - * the global growth of rewards inside the interval during one of: the time of - * the position creation, the last update or reward claim. Note, that - * immediately prior to claiming or updating rewards, this value must be - * updated to "the growth inside at the time of last update + the growth - * outside at the time of the current block". This is so that the claiming - * logic can subtract this updated value from the global accumulator value to - * get the growth inside the interval from the time of last update up until - * the current block time. - */ - accumValuePerShare: DecCoin[]; - /** - * unclaimed_rewards_total is the total amount of unclaimed rewards that the - * position is entitled to. This value is updated whenever shares are added or - * removed from an existing position. We also expose API for manually updating - * this value for some custom use cases such as merging pre-existing positions - * into a single one. - */ - unclaimedRewardsTotal: DecCoin[]; + initAccumValue: DecCoin[]; + unclaimedRewards: DecCoin[]; options: Options; } export interface RecordProtoMsg { typeUrl: "/osmosis.accum.v1beta1.Record"; value: Uint8Array; } -/** - * Record corresponds to an individual position value belonging to the - * global accumulator. - */ export interface RecordAmino { - /** - * num_shares is the number of shares belonging to the position associated - * with this record. - */ num_shares: string; - /** - * accum_value_per_share is the subset of coins per shar of the global - * accumulator value that allows to infer how much a position is entitled to - * per share that it owns. - * - * In the default case with no intervals, this value equals to the global - * accumulator value at the time of the position creation, the last update or - * reward claim. - * - * In the interval case such as concentrated liquidity, this value equals to - * the global growth of rewards inside the interval during one of: the time of - * the position creation, the last update or reward claim. Note, that - * immediately prior to claiming or updating rewards, this value must be - * updated to "the growth inside at the time of last update + the growth - * outside at the time of the current block". This is so that the claiming - * logic can subtract this updated value from the global accumulator value to - * get the growth inside the interval from the time of last update up until - * the current block time. - */ - accum_value_per_share: DecCoinAmino[]; - /** - * unclaimed_rewards_total is the total amount of unclaimed rewards that the - * position is entitled to. This value is updated whenever shares are added or - * removed from an existing position. We also expose API for manually updating - * this value for some custom use cases such as merging pre-existing positions - * into a single one. - */ - unclaimed_rewards_total: DecCoinAmino[]; + init_accum_value: DecCoinAmino[]; + unclaimed_rewards: DecCoinAmino[]; options?: OptionsAmino; } export interface RecordAminoMsg { type: "osmosis/accum/record"; value: RecordAmino; } -/** - * Record corresponds to an individual position value belonging to the - * global accumulator. - */ export interface RecordSDKType { num_shares: string; - accum_value_per_share: DecCoinSDKType[]; - unclaimed_rewards_total: DecCoinSDKType[]; + init_accum_value: DecCoinSDKType[]; + unclaimed_rewards: DecCoinSDKType[]; options: OptionsSDKType; } function createBaseAccumulatorContent(): AccumulatorContent { @@ -284,8 +197,8 @@ export const Options = { function createBaseRecord(): Record { return { numShares: "", - accumValuePerShare: [], - unclaimedRewardsTotal: [], + initAccumValue: [], + unclaimedRewards: [], options: Options.fromPartial({}) }; } @@ -295,10 +208,10 @@ export const Record = { if (message.numShares !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.numShares, 18).atomics); } - for (const v of message.accumValuePerShare) { + for (const v of message.initAccumValue) { DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); } - for (const v of message.unclaimedRewardsTotal) { + for (const v of message.unclaimedRewards) { DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.options !== undefined) { @@ -317,10 +230,10 @@ export const Record = { message.numShares = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 2: - message.accumValuePerShare.push(DecCoin.decode(reader, reader.uint32())); + message.initAccumValue.push(DecCoin.decode(reader, reader.uint32())); break; case 3: - message.unclaimedRewardsTotal.push(DecCoin.decode(reader, reader.uint32())); + message.unclaimedRewards.push(DecCoin.decode(reader, reader.uint32())); break; case 4: message.options = Options.decode(reader, reader.uint32()); @@ -335,31 +248,31 @@ export const Record = { fromPartial(object: Partial): Record { const message = createBaseRecord(); message.numShares = object.numShares ?? ""; - message.accumValuePerShare = object.accumValuePerShare?.map(e => DecCoin.fromPartial(e)) || []; - message.unclaimedRewardsTotal = object.unclaimedRewardsTotal?.map(e => DecCoin.fromPartial(e)) || []; + message.initAccumValue = object.initAccumValue?.map(e => DecCoin.fromPartial(e)) || []; + message.unclaimedRewards = object.unclaimedRewards?.map(e => DecCoin.fromPartial(e)) || []; message.options = object.options !== undefined && object.options !== null ? Options.fromPartial(object.options) : undefined; return message; }, fromAmino(object: RecordAmino): Record { return { numShares: object.num_shares, - accumValuePerShare: Array.isArray(object?.accum_value_per_share) ? object.accum_value_per_share.map((e: any) => DecCoin.fromAmino(e)) : [], - unclaimedRewardsTotal: Array.isArray(object?.unclaimed_rewards_total) ? object.unclaimed_rewards_total.map((e: any) => DecCoin.fromAmino(e)) : [], + initAccumValue: Array.isArray(object?.init_accum_value) ? object.init_accum_value.map((e: any) => DecCoin.fromAmino(e)) : [], + unclaimedRewards: Array.isArray(object?.unclaimed_rewards) ? object.unclaimed_rewards.map((e: any) => DecCoin.fromAmino(e)) : [], options: object?.options ? Options.fromAmino(object.options) : undefined }; }, toAmino(message: Record): RecordAmino { const obj: any = {}; obj.num_shares = message.numShares; - if (message.accumValuePerShare) { - obj.accum_value_per_share = message.accumValuePerShare.map(e => e ? DecCoin.toAmino(e) : undefined); + if (message.initAccumValue) { + obj.init_accum_value = message.initAccumValue.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.accum_value_per_share = []; + obj.init_accum_value = []; } - if (message.unclaimedRewardsTotal) { - obj.unclaimed_rewards_total = message.unclaimedRewardsTotal.map(e => e ? DecCoin.toAmino(e) : undefined); + if (message.unclaimedRewards) { + obj.unclaimed_rewards = message.unclaimedRewards.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.unclaimed_rewards_total = []; + obj.unclaimed_rewards = []; } obj.options = message.options ? Options.toAmino(message.options) : undefined; return obj; diff --git a/packages/osmojs/src/codegen/osmosis/bundle.ts b/packages/osmojs/src/codegen/osmosis/bundle.ts index ae8d24f63..1d6653157 100644 --- a/packages/osmojs/src/codegen/osmosis/bundle.ts +++ b/packages/osmojs/src/codegen/osmosis/bundle.ts @@ -1,406 +1,376 @@ -import * as _89 from "./accum/v1beta1/accum"; -import * as _90 from "./concentrated-liquidity/params"; -import * as _91 from "./cosmwasmpool/v1beta1/genesis"; -import * as _92 from "./cosmwasmpool/v1beta1/gov"; -import * as _93 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _94 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _95 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _96 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _97 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _98 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _99 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _100 from "./cosmwasmpool/v1beta1/params"; -import * as _101 from "./cosmwasmpool/v1beta1/query"; -import * as _102 from "./cosmwasmpool/v1beta1/tx"; -import * as _103 from "./downtime-detector/v1beta1/downtime_duration"; -import * as _104 from "./downtime-detector/v1beta1/genesis"; -import * as _105 from "./downtime-detector/v1beta1/query"; -import * as _106 from "./epochs/genesis"; -import * as _107 from "./epochs/query"; -import * as _108 from "./gamm/pool-models/balancer/balancerPool"; -import * as _109 from "./gamm/v1beta1/genesis"; -import * as _110 from "./gamm/v1beta1/gov"; -import * as _111 from "./gamm/v1beta1/query"; -import * as _112 from "./gamm/v1beta1/shared"; -import * as _113 from "./gamm/v1beta1/tx"; -import * as _114 from "./gamm/pool-models/balancer/tx/tx"; -import * as _115 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _116 from "./gamm/pool-models/stableswap/tx"; -import * as _117 from "./gamm/v2/query"; -import * as _118 from "./ibc-rate-limit/v1beta1/genesis"; -import * as _119 from "./ibc-rate-limit/v1beta1/params"; -import * as _120 from "./ibc-rate-limit/v1beta1/query"; -import * as _121 from "./incentives/gauge"; -import * as _122 from "./incentives/genesis"; -import * as _123 from "./incentives/params"; -import * as _124 from "./incentives/query"; -import * as _125 from "./incentives/tx"; -import * as _126 from "./lockup/genesis"; -import * as _127 from "./lockup/lock"; -import * as _128 from "./lockup/params"; -import * as _129 from "./lockup/query"; -import * as _130 from "./lockup/tx"; -import * as _131 from "./mint/v1beta1/genesis"; -import * as _132 from "./mint/v1beta1/mint"; -import * as _133 from "./mint/v1beta1/query"; -import * as _134 from "./pool-incentives/v1beta1/genesis"; -import * as _135 from "./pool-incentives/v1beta1/gov"; -import * as _136 from "./pool-incentives/v1beta1/incentives"; -import * as _137 from "./pool-incentives/v1beta1/query"; -import * as _138 from "./pool-incentives/v1beta1/shared"; -import * as _139 from "./poolmanager/v1beta1/genesis"; -import * as _140 from "./poolmanager/v1beta1/module_route"; -import * as _141 from "./poolmanager/v1beta1/query"; -import * as _142 from "./poolmanager/v1beta1/swap_route"; -import * as _143 from "./poolmanager/v1beta1/tx"; -import * as _144 from "./protorev/v1beta1/genesis"; -import * as _145 from "./protorev/v1beta1/gov"; -import * as _146 from "./protorev/v1beta1/params"; -import * as _147 from "./protorev/v1beta1/protorev"; -import * as _148 from "./protorev/v1beta1/query"; -import * as _149 from "./protorev/v1beta1/tx"; -import * as _150 from "./sumtree/v1beta1/tree"; -import * as _151 from "./superfluid/genesis"; -import * as _152 from "./superfluid/params"; -import * as _153 from "./superfluid/query"; -import * as _154 from "./superfluid/superfluid"; -import * as _155 from "./superfluid/tx"; -import * as _156 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _157 from "./tokenfactory/v1beta1/genesis"; -import * as _158 from "./tokenfactory/v1beta1/params"; -import * as _159 from "./tokenfactory/v1beta1/query"; -import * as _160 from "./tokenfactory/v1beta1/tx"; -import * as _161 from "./twap/v1beta1/genesis"; -import * as _162 from "./twap/v1beta1/query"; -import * as _163 from "./twap/v1beta1/twap_record"; -import * as _164 from "./txfees/v1beta1/feetoken"; -import * as _165 from "./txfees/v1beta1/genesis"; -import * as _166 from "./txfees/v1beta1/gov"; -import * as _167 from "./txfees/v1beta1/query"; -import * as _168 from "./valset-pref/v1beta1/query"; -import * as _169 from "./valset-pref/v1beta1/state"; -import * as _170 from "./valset-pref/v1beta1/tx"; -import * as _260 from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; -import * as _261 from "./concentrated-liquidity/tx.amino"; -import * as _262 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _263 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _264 from "./gamm/v1beta1/tx.amino"; -import * as _265 from "./incentives/tx.amino"; -import * as _266 from "./lockup/tx.amino"; -import * as _267 from "./poolmanager/v1beta1/tx.amino"; -import * as _268 from "./protorev/v1beta1/tx.amino"; -import * as _269 from "./superfluid/tx.amino"; -import * as _270 from "./tokenfactory/v1beta1/tx.amino"; -import * as _271 from "./valset-pref/v1beta1/tx.amino"; -import * as _272 from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; -import * as _273 from "./concentrated-liquidity/tx.registry"; -import * as _274 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _275 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _276 from "./gamm/v1beta1/tx.registry"; -import * as _277 from "./incentives/tx.registry"; -import * as _278 from "./lockup/tx.registry"; -import * as _279 from "./poolmanager/v1beta1/tx.registry"; -import * as _280 from "./protorev/v1beta1/tx.registry"; -import * as _281 from "./superfluid/tx.registry"; -import * as _282 from "./tokenfactory/v1beta1/tx.registry"; -import * as _283 from "./valset-pref/v1beta1/tx.registry"; -import * as _284 from "./concentrated-liquidity/query.lcd"; -import * as _285 from "./cosmwasmpool/v1beta1/query.lcd"; -import * as _286 from "./downtime-detector/v1beta1/query.lcd"; -import * as _287 from "./epochs/query.lcd"; -import * as _288 from "./gamm/v1beta1/query.lcd"; -import * as _289 from "./gamm/v2/query.lcd"; -import * as _290 from "./ibc-rate-limit/v1beta1/query.lcd"; -import * as _291 from "./incentives/query.lcd"; -import * as _292 from "./lockup/query.lcd"; -import * as _293 from "./mint/v1beta1/query.lcd"; -import * as _294 from "./pool-incentives/v1beta1/query.lcd"; -import * as _295 from "./poolmanager/v1beta1/query.lcd"; -import * as _296 from "./protorev/v1beta1/query.lcd"; -import * as _297 from "./superfluid/query.lcd"; -import * as _298 from "./tokenfactory/v1beta1/query.lcd"; -import * as _299 from "./twap/v1beta1/query.lcd"; -import * as _300 from "./txfees/v1beta1/query.lcd"; -import * as _301 from "./valset-pref/v1beta1/query.lcd"; -import * as _302 from "./concentrated-liquidity/query.rpc.Query"; -import * as _303 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _304 from "./downtime-detector/v1beta1/query.rpc.Query"; -import * as _305 from "./epochs/query.rpc.Query"; -import * as _306 from "./gamm/v1beta1/query.rpc.Query"; -import * as _307 from "./gamm/v2/query.rpc.Query"; -import * as _308 from "./ibc-rate-limit/v1beta1/query.rpc.Query"; -import * as _309 from "./incentives/query.rpc.Query"; -import * as _310 from "./lockup/query.rpc.Query"; -import * as _311 from "./mint/v1beta1/query.rpc.Query"; -import * as _312 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _313 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _314 from "./protorev/v1beta1/query.rpc.Query"; -import * as _315 from "./superfluid/query.rpc.Query"; -import * as _316 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _317 from "./twap/v1beta1/query.rpc.Query"; -import * as _318 from "./txfees/v1beta1/query.rpc.Query"; -import * as _319 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _320 from "./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg"; -import * as _321 from "./concentrated-liquidity/tx.rpc.msg"; -import * as _322 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _323 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _324 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _325 from "./incentives/tx.rpc.msg"; -import * as _326 from "./lockup/tx.rpc.msg"; -import * as _327 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _328 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _329 from "./superfluid/tx.rpc.msg"; -import * as _330 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _331 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _341 from "./lcd"; -import * as _342 from "./rpc.query"; -import * as _343 from "./rpc.tx"; +import * as _100 from "./accum/v1beta1/accum"; +import * as _101 from "./concentrated-liquidity/params"; +import * as _102 from "./cosmwasmpool/v1beta1/genesis"; +import * as _103 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _104 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _105 from "./cosmwasmpool/v1beta1/query"; +import * as _106 from "./cosmwasmpool/v1beta1/tx"; +import * as _107 from "./downtime-detector/v1beta1/downtime_duration"; +import * as _108 from "./downtime-detector/v1beta1/genesis"; +import * as _109 from "./downtime-detector/v1beta1/query"; +import * as _110 from "./epochs/genesis"; +import * as _111 from "./epochs/query"; +import * as _112 from "./gamm/pool-models/balancer/balancerPool"; +import * as _113 from "./gamm/v1beta1/genesis"; +import * as _114 from "./gamm/v1beta1/gov"; +import * as _115 from "./gamm/v1beta1/query"; +import * as _116 from "./gamm/v1beta1/tx"; +import * as _117 from "./gamm/pool-models/balancer/tx/tx"; +import * as _118 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _119 from "./gamm/pool-models/stableswap/tx"; +import * as _120 from "./gamm/v2/query"; +import * as _121 from "./ibc-rate-limit/v1beta1/genesis"; +import * as _122 from "./ibc-rate-limit/v1beta1/params"; +import * as _123 from "./ibc-rate-limit/v1beta1/query"; +import * as _124 from "./incentives/gauge"; +import * as _125 from "./incentives/genesis"; +import * as _126 from "./incentives/params"; +import * as _127 from "./incentives/query"; +import * as _128 from "./incentives/tx"; +import * as _129 from "./lockup/genesis"; +import * as _130 from "./lockup/lock"; +import * as _131 from "./lockup/params"; +import * as _132 from "./lockup/query"; +import * as _133 from "./lockup/tx"; +import * as _134 from "./mint/v1beta1/genesis"; +import * as _135 from "./mint/v1beta1/mint"; +import * as _136 from "./mint/v1beta1/query"; +import * as _137 from "./pool-incentives/v1beta1/genesis"; +import * as _138 from "./pool-incentives/v1beta1/gov"; +import * as _139 from "./pool-incentives/v1beta1/incentives"; +import * as _140 from "./pool-incentives/v1beta1/query"; +import * as _141 from "./poolmanager/v1beta1/genesis"; +import * as _142 from "./poolmanager/v1beta1/module_route"; +import * as _143 from "./poolmanager/v1beta1/query"; +import * as _144 from "./poolmanager/v1beta1/swap_route"; +import * as _145 from "./poolmanager/v1beta1/tx"; +import * as _146 from "./protorev/v1beta1/genesis"; +import * as _147 from "./protorev/v1beta1/gov"; +import * as _148 from "./protorev/v1beta1/params"; +import * as _149 from "./protorev/v1beta1/protorev"; +import * as _150 from "./protorev/v1beta1/query"; +import * as _151 from "./protorev/v1beta1/tx"; +import * as _152 from "./sumtree/v1beta1/tree"; +import * as _153 from "./superfluid/genesis"; +import * as _154 from "./superfluid/params"; +import * as _155 from "./superfluid/query"; +import * as _156 from "./superfluid/superfluid"; +import * as _157 from "./superfluid/tx"; +import * as _158 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _159 from "./tokenfactory/v1beta1/genesis"; +import * as _160 from "./tokenfactory/v1beta1/params"; +import * as _161 from "./tokenfactory/v1beta1/query"; +import * as _162 from "./tokenfactory/v1beta1/tx"; +import * as _163 from "./twap/v1beta1/genesis"; +import * as _164 from "./twap/v1beta1/query"; +import * as _165 from "./twap/v1beta1/twap_record"; +import * as _166 from "./txfees/v1beta1/feetoken"; +import * as _167 from "./txfees/v1beta1/genesis"; +import * as _168 from "./txfees/v1beta1/gov"; +import * as _169 from "./txfees/v1beta1/query"; +import * as _170 from "./valset-pref/v1beta1/query"; +import * as _171 from "./valset-pref/v1beta1/state"; +import * as _172 from "./valset-pref/v1beta1/tx"; +import * as _251 from "./concentrated-liquidity/tx.amino"; +import * as _252 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _253 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _254 from "./gamm/v1beta1/tx.amino"; +import * as _255 from "./incentives/tx.amino"; +import * as _256 from "./lockup/tx.amino"; +import * as _257 from "./poolmanager/v1beta1/tx.amino"; +import * as _258 from "./protorev/v1beta1/tx.amino"; +import * as _259 from "./superfluid/tx.amino"; +import * as _260 from "./tokenfactory/v1beta1/tx.amino"; +import * as _261 from "./valset-pref/v1beta1/tx.amino"; +import * as _262 from "./concentrated-liquidity/tx.registry"; +import * as _263 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _264 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _265 from "./gamm/v1beta1/tx.registry"; +import * as _266 from "./incentives/tx.registry"; +import * as _267 from "./lockup/tx.registry"; +import * as _268 from "./poolmanager/v1beta1/tx.registry"; +import * as _269 from "./protorev/v1beta1/tx.registry"; +import * as _270 from "./superfluid/tx.registry"; +import * as _271 from "./tokenfactory/v1beta1/tx.registry"; +import * as _272 from "./valset-pref/v1beta1/tx.registry"; +import * as _273 from "./concentrated-liquidity/pool-model/query.lcd"; +import * as _274 from "./cosmwasmpool/v1beta1/query.lcd"; +import * as _275 from "./downtime-detector/v1beta1/query.lcd"; +import * as _276 from "./epochs/query.lcd"; +import * as _277 from "./gamm/v1beta1/query.lcd"; +import * as _278 from "./gamm/v2/query.lcd"; +import * as _279 from "./ibc-rate-limit/v1beta1/query.lcd"; +import * as _280 from "./incentives/query.lcd"; +import * as _281 from "./lockup/query.lcd"; +import * as _282 from "./mint/v1beta1/query.lcd"; +import * as _283 from "./pool-incentives/v1beta1/query.lcd"; +import * as _284 from "./poolmanager/v1beta1/query.lcd"; +import * as _285 from "./protorev/v1beta1/query.lcd"; +import * as _286 from "./superfluid/query.lcd"; +import * as _287 from "./tokenfactory/v1beta1/query.lcd"; +import * as _288 from "./twap/v1beta1/query.lcd"; +import * as _289 from "./txfees/v1beta1/query.lcd"; +import * as _290 from "./valset-pref/v1beta1/query.lcd"; +import * as _291 from "./concentrated-liquidity/pool-model/query.rpc.Query"; +import * as _292 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _293 from "./downtime-detector/v1beta1/query.rpc.Query"; +import * as _294 from "./epochs/query.rpc.Query"; +import * as _295 from "./gamm/v1beta1/query.rpc.Query"; +import * as _296 from "./gamm/v2/query.rpc.Query"; +import * as _297 from "./ibc-rate-limit/v1beta1/query.rpc.Query"; +import * as _298 from "./incentives/query.rpc.Query"; +import * as _299 from "./lockup/query.rpc.Query"; +import * as _300 from "./mint/v1beta1/query.rpc.Query"; +import * as _301 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _302 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _303 from "./protorev/v1beta1/query.rpc.Query"; +import * as _304 from "./superfluid/query.rpc.Query"; +import * as _305 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _306 from "./twap/v1beta1/query.rpc.Query"; +import * as _307 from "./txfees/v1beta1/query.rpc.Query"; +import * as _308 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _309 from "./concentrated-liquidity/tx.rpc.msg"; +import * as _310 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _311 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _312 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _313 from "./incentives/tx.rpc.msg"; +import * as _314 from "./lockup/tx.rpc.msg"; +import * as _315 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _316 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _317 from "./superfluid/tx.rpc.msg"; +import * as _318 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _319 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _329 from "./lcd"; +import * as _330 from "./rpc.query"; +import * as _331 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._89 + ..._100 }; } export const concentratedliquidity = { - ..._90, - poolmodel: { - concentrated: { - v1beta1: { - ..._260, - ..._272, - ..._320 - } - } - }, + ..._101, v1beta1: { - ..._261, + ..._251, + ..._262, ..._273, - ..._284, - ..._302, - ..._321 + ..._291, + ..._309 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._91, - ..._92, - ..._93, - ..._94, - ..._95, - ..._96, - ..._97, - ..._98, - ..._99, - ..._100, - ..._101, ..._102, - ..._285, - ..._303 - }; - } - export namespace downtimedetector { - export const v1beta1 = { ..._103, ..._104, ..._105, - ..._286, - ..._304 + ..._106, + ..._274, + ..._292 }; } - export namespace epochs { + export namespace downtimedetector { export const v1beta1 = { - ..._106, ..._107, - ..._287, - ..._305 + ..._108, + ..._109, + ..._275, + ..._293 }; } - export namespace gamm { + export namespace epochs { export const v1beta1 = { - ..._108, - ..._109, ..._110, ..._111, + ..._276, + ..._294 + }; + } + export namespace gamm { + export const v1beta1 = { ..._112, ..._113, - ..._264, - ..._276, - ..._288, - ..._306, - ..._324 + ..._114, + ..._115, + ..._116, + ..._254, + ..._265, + ..._277, + ..._295, + ..._312 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._114, - ..._262, - ..._274, - ..._322 + ..._117, + ..._252, + ..._263, + ..._310 }; } export namespace stableswap { export const v1beta1 = { - ..._115, - ..._116, - ..._263, - ..._275, - ..._323 + ..._118, + ..._119, + ..._253, + ..._264, + ..._311 }; } } export const v2 = { - ..._117, - ..._289, - ..._307 + ..._120, + ..._278, + ..._296 }; } export namespace ibcratelimit { export const v1beta1 = { - ..._118, - ..._119, - ..._120, - ..._290, - ..._308 + ..._121, + ..._122, + ..._123, + ..._279, + ..._297 }; } export const incentives = { - ..._121, - ..._122, - ..._123, ..._124, ..._125, - ..._265, - ..._277, - ..._291, - ..._309, - ..._325 - }; - export const lockup = { ..._126, ..._127, ..._128, + ..._255, + ..._266, + ..._280, + ..._298, + ..._313 + }; + export const lockup = { ..._129, ..._130, - ..._266, - ..._278, - ..._292, - ..._310, - ..._326 + ..._131, + ..._132, + ..._133, + ..._256, + ..._267, + ..._281, + ..._299, + ..._314 }; export namespace mint { export const v1beta1 = { - ..._131, - ..._132, - ..._133, - ..._293, - ..._311 + ..._134, + ..._135, + ..._136, + ..._282, + ..._300 }; } export namespace poolincentives { export const v1beta1 = { - ..._134, - ..._135, - ..._136, ..._137, ..._138, - ..._294, - ..._312 + ..._139, + ..._140, + ..._283, + ..._301 }; } export namespace poolmanager { export const v1beta1 = { - ..._139, - ..._140, ..._141, ..._142, ..._143, - ..._267, - ..._279, - ..._295, - ..._313, - ..._327 + ..._144, + ..._145, + ..._257, + ..._268, + ..._284, + ..._302, + ..._315 }; } export namespace protorev { export const v1beta1 = { - ..._144, - ..._145, ..._146, ..._147, ..._148, ..._149, - ..._268, - ..._280, - ..._296, - ..._314, - ..._328 + ..._150, + ..._151, + ..._258, + ..._269, + ..._285, + ..._303, + ..._316 }; } export namespace store { export const v1beta1 = { - ..._150 + ..._152 }; } export const superfluid = { - ..._151, - ..._152, ..._153, ..._154, ..._155, - ..._269, - ..._281, - ..._297, - ..._315, - ..._329 + ..._156, + ..._157, + ..._259, + ..._270, + ..._286, + ..._304, + ..._317 }; export namespace tokenfactory { export const v1beta1 = { - ..._156, - ..._157, ..._158, ..._159, ..._160, - ..._270, - ..._282, - ..._298, - ..._316, - ..._330 + ..._161, + ..._162, + ..._260, + ..._271, + ..._287, + ..._305, + ..._318 }; } export namespace twap { export const v1beta1 = { - ..._161, - ..._162, ..._163, - ..._299, - ..._317 + ..._164, + ..._165, + ..._288, + ..._306 }; } export namespace txfees { export const v1beta1 = { - ..._164, - ..._165, ..._166, ..._167, - ..._300, - ..._318 + ..._168, + ..._169, + ..._289, + ..._307 }; } export namespace valsetpref { export const v1beta1 = { - ..._168, - ..._169, ..._170, - ..._271, - ..._283, - ..._301, - ..._319, - ..._331 + ..._171, + ..._172, + ..._261, + ..._272, + ..._290, + ..._308, + ..._319 }; } export const ClientFactory = { - ..._341, - ..._342, - ..._343 + ..._329, + ..._330, + ..._331 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/client.ts b/packages/osmojs/src/codegen/osmosis/client.ts index 7caa9f0bc..9b6f37cfd 100644 --- a/packages/osmojs/src/codegen/osmosis/client.ts +++ b/packages/osmojs/src/codegen/osmosis/client.ts @@ -1,7 +1,6 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; import * as osmosisConcentratedliquidityTxRegistry from "./concentrated-liquidity/tx.registry"; import * as osmosisGammPoolmodelsBalancerTxTxRegistry from "./gamm/pool-models/balancer/tx/tx.registry"; import * as osmosisGammPoolmodelsStableswapTxRegistry from "./gamm/pool-models/stableswap/tx.registry"; @@ -13,7 +12,6 @@ import * as osmosisProtorevV1beta1TxRegistry from "./protorev/v1beta1/tx.registr import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; import * as osmosisValsetprefV1beta1TxRegistry from "./valset-pref/v1beta1/tx.registry"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxAmino from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; import * as osmosisConcentratedliquidityTxAmino from "./concentrated-liquidity/tx.amino"; import * as osmosisGammPoolmodelsBalancerTxTxAmino from "./gamm/pool-models/balancer/tx/tx.amino"; import * as osmosisGammPoolmodelsStableswapTxAmino from "./gamm/pool-models/stableswap/tx.amino"; @@ -26,7 +24,6 @@ import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; import * as osmosisValsetprefV1beta1TxAmino from "./valset-pref/v1beta1/tx.amino"; export const osmosisAminoConverters = { - ...osmosisConcentratedliquidityPoolmodelConcentratedTxAmino.AminoConverter, ...osmosisConcentratedliquidityTxAmino.AminoConverter, ...osmosisGammPoolmodelsBalancerTxTxAmino.AminoConverter, ...osmosisGammPoolmodelsStableswapTxAmino.AminoConverter, @@ -39,7 +36,7 @@ export const osmosisAminoConverters = { ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, ...osmosisValsetprefV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry.registry, ...osmosisConcentratedliquidityTxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityTxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts index ed8dbb1c7..a6e85704c 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts @@ -1,9 +1,9 @@ import { TickInfo, TickInfoAmino, TickInfoSDKType } from "./tickInfo"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; -import { Position, PositionAmino, PositionSDKType } from "./position"; -import { Record, RecordAmino, RecordSDKType, AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../accum/v1beta1/accum"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Position, PositionAmino, PositionSDKType } from "./position"; +import { AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../accum/v1beta1/accum"; import { Pool as Pool1 } from "./pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; import { PoolSDKType as Pool1SDKType } from "./pool"; @@ -65,7 +65,7 @@ export interface PoolData { pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; /** pool's ticks */ ticks: FullTick[]; - spreadRewardAccumulator: AccumObject; + feeAccumulator: AccumObject; incentivesAccumulators: AccumObject[]; /** incentive records to be set */ incentiveRecords: IncentiveRecord[]; @@ -86,7 +86,7 @@ export interface PoolDataAmino { pool?: AnyAmino; /** pool's ticks */ ticks: FullTickAmino[]; - spread_reward_accumulator?: AccumObjectAmino; + fee_accumulator?: AccumObjectAmino; incentives_accumulators: AccumObjectAmino[]; /** incentive records to be set */ incentive_records: IncentiveRecordAmino[]; @@ -102,45 +102,18 @@ export interface PoolDataAminoMsg { export interface PoolDataSDKType { pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; ticks: FullTickSDKType[]; - spread_reward_accumulator: AccumObjectSDKType; + fee_accumulator: AccumObjectSDKType; incentives_accumulators: AccumObjectSDKType[]; incentive_records: IncentiveRecordSDKType[]; } -export interface PositionData { - position: Position; - lockId: bigint; - spreadRewardAccumRecord: Record; - uptimeAccumRecords: Record[]; -} -export interface PositionDataProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionData"; - value: Uint8Array; -} -export interface PositionDataAmino { - position?: PositionAmino; - lock_id: string; - spread_reward_accum_record?: RecordAmino; - uptime_accum_records: RecordAmino[]; -} -export interface PositionDataAminoMsg { - type: "osmosis/concentratedliquidity/position-data"; - value: PositionDataAmino; -} -export interface PositionDataSDKType { - position: PositionSDKType; - lock_id: bigint; - spread_reward_accum_record: RecordSDKType; - uptime_accum_records: RecordSDKType[]; -} /** GenesisState defines the concentrated liquidity module's genesis state. */ export interface GenesisState { /** params are all the parameters of the module */ params: Params; /** pool data containining serialized pool struct and ticks. */ poolData: PoolData[]; - positionData: PositionData[]; + positions: Position[]; nextPositionId: bigint; - nextIncentiveRecordId: bigint; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.GenesisState"; @@ -152,9 +125,8 @@ export interface GenesisStateAmino { params?: ParamsAmino; /** pool data containining serialized pool struct and ticks. */ pool_data: PoolDataAmino[]; - position_data: PositionDataAmino[]; + positions: PositionAmino[]; next_position_id: string; - next_incentive_record_id: string; } export interface GenesisStateAminoMsg { type: "osmosis/concentratedliquidity/genesis-state"; @@ -164,9 +136,8 @@ export interface GenesisStateAminoMsg { export interface GenesisStateSDKType { params: ParamsSDKType; pool_data: PoolDataSDKType[]; - position_data: PositionDataSDKType[]; + positions: PositionSDKType[]; next_position_id: bigint; - next_incentive_record_id: bigint; } export interface AccumObject { /** Accumulator's name (pulled from AccumulatorContent) */ @@ -279,9 +250,9 @@ export const FullTick = { }; function createBasePoolData(): PoolData { return { - pool: undefined, + pool: Any.fromPartial({}), ticks: [], - spreadRewardAccumulator: AccumObject.fromPartial({}), + feeAccumulator: AccumObject.fromPartial({}), incentivesAccumulators: [], incentiveRecords: [] }; @@ -295,8 +266,8 @@ export const PoolData = { for (const v of message.ticks) { FullTick.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.spreadRewardAccumulator !== undefined) { - AccumObject.encode(message.spreadRewardAccumulator, writer.uint32(26).fork()).ldelim(); + if (message.feeAccumulator !== undefined) { + AccumObject.encode(message.feeAccumulator, writer.uint32(26).fork()).ldelim(); } for (const v of message.incentivesAccumulators) { AccumObject.encode(v!, writer.uint32(34).fork()).ldelim(); @@ -320,7 +291,7 @@ export const PoolData = { message.ticks.push(FullTick.decode(reader, reader.uint32())); break; case 3: - message.spreadRewardAccumulator = AccumObject.decode(reader, reader.uint32()); + message.feeAccumulator = AccumObject.decode(reader, reader.uint32()); break; case 4: message.incentivesAccumulators.push(AccumObject.decode(reader, reader.uint32())); @@ -339,7 +310,7 @@ export const PoolData = { const message = createBasePoolData(); message.pool = object.pool !== undefined && object.pool !== null ? Any.fromPartial(object.pool) : undefined; message.ticks = object.ticks?.map(e => FullTick.fromPartial(e)) || []; - message.spreadRewardAccumulator = object.spreadRewardAccumulator !== undefined && object.spreadRewardAccumulator !== null ? AccumObject.fromPartial(object.spreadRewardAccumulator) : undefined; + message.feeAccumulator = object.feeAccumulator !== undefined && object.feeAccumulator !== null ? AccumObject.fromPartial(object.feeAccumulator) : undefined; message.incentivesAccumulators = object.incentivesAccumulators?.map(e => AccumObject.fromPartial(e)) || []; message.incentiveRecords = object.incentiveRecords?.map(e => IncentiveRecord.fromPartial(e)) || []; return message; @@ -348,7 +319,7 @@ export const PoolData = { return { pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined, ticks: Array.isArray(object?.ticks) ? object.ticks.map((e: any) => FullTick.fromAmino(e)) : [], - spreadRewardAccumulator: object?.spread_reward_accumulator ? AccumObject.fromAmino(object.spread_reward_accumulator) : undefined, + feeAccumulator: object?.fee_accumulator ? AccumObject.fromAmino(object.fee_accumulator) : undefined, incentivesAccumulators: Array.isArray(object?.incentives_accumulators) ? object.incentives_accumulators.map((e: any) => AccumObject.fromAmino(e)) : [], incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [] }; @@ -361,7 +332,7 @@ export const PoolData = { } else { obj.ticks = []; } - obj.spread_reward_accumulator = message.spreadRewardAccumulator ? AccumObject.toAmino(message.spreadRewardAccumulator) : undefined; + obj.fee_accumulator = message.feeAccumulator ? AccumObject.toAmino(message.feeAccumulator) : undefined; if (message.incentivesAccumulators) { obj.incentives_accumulators = message.incentivesAccumulators.map(e => e ? AccumObject.toAmino(e) : undefined); } else { @@ -396,114 +367,12 @@ export const PoolData = { }; } }; -function createBasePositionData(): PositionData { - return { - position: Position.fromPartial({}), - lockId: BigInt(0), - spreadRewardAccumRecord: Record.fromPartial({}), - uptimeAccumRecords: [] - }; -} -export const PositionData = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionData", - encode(message: PositionData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(10).fork()).ldelim(); - } - if (message.lockId !== BigInt(0)) { - writer.uint32(16).uint64(message.lockId); - } - if (message.spreadRewardAccumRecord !== undefined) { - Record.encode(message.spreadRewardAccumRecord, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.uptimeAccumRecords) { - Record.encode(v!, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PositionData { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionData(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.position = Position.decode(reader, reader.uint32()); - break; - case 2: - message.lockId = reader.uint64(); - break; - case 3: - message.spreadRewardAccumRecord = Record.decode(reader, reader.uint32()); - break; - case 4: - message.uptimeAccumRecords.push(Record.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PositionData { - const message = createBasePositionData(); - message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; - message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); - message.spreadRewardAccumRecord = object.spreadRewardAccumRecord !== undefined && object.spreadRewardAccumRecord !== null ? Record.fromPartial(object.spreadRewardAccumRecord) : undefined; - message.uptimeAccumRecords = object.uptimeAccumRecords?.map(e => Record.fromPartial(e)) || []; - return message; - }, - fromAmino(object: PositionDataAmino): PositionData { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - lockId: BigInt(object.lock_id), - spreadRewardAccumRecord: object?.spread_reward_accum_record ? Record.fromAmino(object.spread_reward_accum_record) : undefined, - uptimeAccumRecords: Array.isArray(object?.uptime_accum_records) ? object.uptime_accum_records.map((e: any) => Record.fromAmino(e)) : [] - }; - }, - toAmino(message: PositionData): PositionDataAmino { - const obj: any = {}; - obj.position = message.position ? Position.toAmino(message.position) : undefined; - obj.lock_id = message.lockId ? message.lockId.toString() : undefined; - obj.spread_reward_accum_record = message.spreadRewardAccumRecord ? Record.toAmino(message.spreadRewardAccumRecord) : undefined; - if (message.uptimeAccumRecords) { - obj.uptime_accum_records = message.uptimeAccumRecords.map(e => e ? Record.toAmino(e) : undefined); - } else { - obj.uptime_accum_records = []; - } - return obj; - }, - fromAminoMsg(object: PositionDataAminoMsg): PositionData { - return PositionData.fromAmino(object.value); - }, - toAminoMsg(message: PositionData): PositionDataAminoMsg { - return { - type: "osmosis/concentratedliquidity/position-data", - value: PositionData.toAmino(message) - }; - }, - fromProtoMsg(message: PositionDataProtoMsg): PositionData { - return PositionData.decode(message.value); - }, - toProto(message: PositionData): Uint8Array { - return PositionData.encode(message).finish(); - }, - toProtoMsg(message: PositionData): PositionDataProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionData", - value: PositionData.encode(message).finish() - }; - } -}; function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), poolData: [], - positionData: [], - nextPositionId: BigInt(0), - nextIncentiveRecordId: BigInt(0) + positions: [], + nextPositionId: BigInt(0) }; } export const GenesisState = { @@ -515,15 +384,12 @@ export const GenesisState = { for (const v of message.poolData) { PoolData.encode(v!, writer.uint32(18).fork()).ldelim(); } - for (const v of message.positionData) { - PositionData.encode(v!, writer.uint32(26).fork()).ldelim(); + for (const v of message.positions) { + Position.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.nextPositionId !== BigInt(0)) { writer.uint32(32).uint64(message.nextPositionId); } - if (message.nextIncentiveRecordId !== BigInt(0)) { - writer.uint32(40).uint64(message.nextIncentiveRecordId); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -540,14 +406,11 @@ export const GenesisState = { message.poolData.push(PoolData.decode(reader, reader.uint32())); break; case 3: - message.positionData.push(PositionData.decode(reader, reader.uint32())); + message.positions.push(Position.decode(reader, reader.uint32())); break; case 4: message.nextPositionId = reader.uint64(); break; - case 5: - message.nextIncentiveRecordId = reader.uint64(); - break; default: reader.skipType(tag & 7); break; @@ -559,18 +422,16 @@ export const GenesisState = { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.poolData = object.poolData?.map(e => PoolData.fromPartial(e)) || []; - message.positionData = object.positionData?.map(e => PositionData.fromPartial(e)) || []; + message.positions = object.positions?.map(e => Position.fromPartial(e)) || []; message.nextPositionId = object.nextPositionId !== undefined && object.nextPositionId !== null ? BigInt(object.nextPositionId.toString()) : BigInt(0); - message.nextIncentiveRecordId = object.nextIncentiveRecordId !== undefined && object.nextIncentiveRecordId !== null ? BigInt(object.nextIncentiveRecordId.toString()) : BigInt(0); return message; }, fromAmino(object: GenesisStateAmino): GenesisState { return { params: object?.params ? Params.fromAmino(object.params) : undefined, poolData: Array.isArray(object?.pool_data) ? object.pool_data.map((e: any) => PoolData.fromAmino(e)) : [], - positionData: Array.isArray(object?.position_data) ? object.position_data.map((e: any) => PositionData.fromAmino(e)) : [], - nextPositionId: BigInt(object.next_position_id), - nextIncentiveRecordId: BigInt(object.next_incentive_record_id) + positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => Position.fromAmino(e)) : [], + nextPositionId: BigInt(object.next_position_id) }; }, toAmino(message: GenesisState): GenesisStateAmino { @@ -581,13 +442,12 @@ export const GenesisState = { } else { obj.pool_data = []; } - if (message.positionData) { - obj.position_data = message.positionData.map(e => e ? PositionData.toAmino(e) : undefined); + if (message.positions) { + obj.positions = message.positions.map(e => e ? Position.toAmino(e) : undefined); } else { - obj.position_data = []; + obj.positions = []; } obj.next_position_id = message.nextPositionId ? message.nextPositionId.toString() : undefined; - obj.next_incentive_record_id = message.nextIncentiveRecordId ? message.nextIncentiveRecordId.toString() : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts deleted file mode 100644 index 9c7f2cf7b..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts +++ /dev/null @@ -1,508 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../binary"; -import { Decimal } from "@cosmjs/math"; -/** - * CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating - * concentrated liquidity pools. If a CreateConcentratedLiquidityPoolsProposal - * passes, the pools are created via pool manager module account. - */ -export interface CreateConcentratedLiquidityPoolsProposal { - title: string; - description: string; - poolRecords: PoolRecord[]; -} -export interface CreateConcentratedLiquidityPoolsProposalProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CreateConcentratedLiquidityPoolsProposal"; - value: Uint8Array; -} -/** - * CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating - * concentrated liquidity pools. If a CreateConcentratedLiquidityPoolsProposal - * passes, the pools are created via pool manager module account. - */ -export interface CreateConcentratedLiquidityPoolsProposalAmino { - title: string; - description: string; - pool_records: PoolRecordAmino[]; -} -export interface CreateConcentratedLiquidityPoolsProposalAminoMsg { - type: "osmosis/concentratedliquidity/create-concentrated-liquidity-pools-proposal"; - value: CreateConcentratedLiquidityPoolsProposalAmino; -} -/** - * CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating - * concentrated liquidity pools. If a CreateConcentratedLiquidityPoolsProposal - * passes, the pools are created via pool manager module account. - */ -export interface CreateConcentratedLiquidityPoolsProposalSDKType { - title: string; - description: string; - pool_records: PoolRecordSDKType[]; -} -/** - * TickSpacingDecreaseProposal is a gov Content type for proposing a tick - * spacing decrease for a pool. The proposal will fail if one of the pools do - * not exist, or if the new tick spacing is not less than the current tick - * spacing. - */ -export interface TickSpacingDecreaseProposal { - title: string; - description: string; - poolIdToTickSpacingRecords: PoolIdToTickSpacingRecord[]; -} -export interface TickSpacingDecreaseProposalProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickSpacingDecreaseProposal"; - value: Uint8Array; -} -/** - * TickSpacingDecreaseProposal is a gov Content type for proposing a tick - * spacing decrease for a pool. The proposal will fail if one of the pools do - * not exist, or if the new tick spacing is not less than the current tick - * spacing. - */ -export interface TickSpacingDecreaseProposalAmino { - title: string; - description: string; - pool_id_to_tick_spacing_records: PoolIdToTickSpacingRecordAmino[]; -} -export interface TickSpacingDecreaseProposalAminoMsg { - type: "osmosis/concentratedliquidity/tick-spacing-decrease-proposal"; - value: TickSpacingDecreaseProposalAmino; -} -/** - * TickSpacingDecreaseProposal is a gov Content type for proposing a tick - * spacing decrease for a pool. The proposal will fail if one of the pools do - * not exist, or if the new tick spacing is not less than the current tick - * spacing. - */ -export interface TickSpacingDecreaseProposalSDKType { - title: string; - description: string; - pool_id_to_tick_spacing_records: PoolIdToTickSpacingRecordSDKType[]; -} -/** - * PoolIdToTickSpacingRecord is a struct that contains a pool id to new tick - * spacing pair. - */ -export interface PoolIdToTickSpacingRecord { - poolId: bigint; - newTickSpacing: bigint; -} -export interface PoolIdToTickSpacingRecordProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolIdToTickSpacingRecord"; - value: Uint8Array; -} -/** - * PoolIdToTickSpacingRecord is a struct that contains a pool id to new tick - * spacing pair. - */ -export interface PoolIdToTickSpacingRecordAmino { - pool_id: string; - new_tick_spacing: string; -} -export interface PoolIdToTickSpacingRecordAminoMsg { - type: "osmosis/concentratedliquidity/pool-id-to-tick-spacing-record"; - value: PoolIdToTickSpacingRecordAmino; -} -/** - * PoolIdToTickSpacingRecord is a struct that contains a pool id to new tick - * spacing pair. - */ -export interface PoolIdToTickSpacingRecordSDKType { - pool_id: bigint; - new_tick_spacing: bigint; -} -export interface PoolRecord { - denom0: string; - denom1: string; - tickSpacing: bigint; - exponentAtPriceOne: string; - spreadFactor: string; -} -export interface PoolRecordProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolRecord"; - value: Uint8Array; -} -export interface PoolRecordAmino { - denom0: string; - denom1: string; - tick_spacing: string; - exponent_at_price_one: string; - spread_factor: string; -} -export interface PoolRecordAminoMsg { - type: "osmosis/concentratedliquidity/pool-record"; - value: PoolRecordAmino; -} -export interface PoolRecordSDKType { - denom0: string; - denom1: string; - tick_spacing: bigint; - exponent_at_price_one: string; - spread_factor: string; -} -function createBaseCreateConcentratedLiquidityPoolsProposal(): CreateConcentratedLiquidityPoolsProposal { - return { - title: "", - description: "", - poolRecords: [] - }; -} -export const CreateConcentratedLiquidityPoolsProposal = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CreateConcentratedLiquidityPoolsProposal", - encode(message: CreateConcentratedLiquidityPoolsProposal, 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.poolRecords) { - PoolRecord.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateConcentratedLiquidityPoolsProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateConcentratedLiquidityPoolsProposal(); - 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.poolRecords.push(PoolRecord.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CreateConcentratedLiquidityPoolsProposal { - const message = createBaseCreateConcentratedLiquidityPoolsProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.poolRecords = object.poolRecords?.map(e => PoolRecord.fromPartial(e)) || []; - return message; - }, - fromAmino(object: CreateConcentratedLiquidityPoolsProposalAmino): CreateConcentratedLiquidityPoolsProposal { - return { - title: object.title, - description: object.description, - poolRecords: Array.isArray(object?.pool_records) ? object.pool_records.map((e: any) => PoolRecord.fromAmino(e)) : [] - }; - }, - toAmino(message: CreateConcentratedLiquidityPoolsProposal): CreateConcentratedLiquidityPoolsProposalAmino { - const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - if (message.poolRecords) { - obj.pool_records = message.poolRecords.map(e => e ? PoolRecord.toAmino(e) : undefined); - } else { - obj.pool_records = []; - } - return obj; - }, - fromAminoMsg(object: CreateConcentratedLiquidityPoolsProposalAminoMsg): CreateConcentratedLiquidityPoolsProposal { - return CreateConcentratedLiquidityPoolsProposal.fromAmino(object.value); - }, - toAminoMsg(message: CreateConcentratedLiquidityPoolsProposal): CreateConcentratedLiquidityPoolsProposalAminoMsg { - return { - type: "osmosis/concentratedliquidity/create-concentrated-liquidity-pools-proposal", - value: CreateConcentratedLiquidityPoolsProposal.toAmino(message) - }; - }, - fromProtoMsg(message: CreateConcentratedLiquidityPoolsProposalProtoMsg): CreateConcentratedLiquidityPoolsProposal { - return CreateConcentratedLiquidityPoolsProposal.decode(message.value); - }, - toProto(message: CreateConcentratedLiquidityPoolsProposal): Uint8Array { - return CreateConcentratedLiquidityPoolsProposal.encode(message).finish(); - }, - toProtoMsg(message: CreateConcentratedLiquidityPoolsProposal): CreateConcentratedLiquidityPoolsProposalProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CreateConcentratedLiquidityPoolsProposal", - value: CreateConcentratedLiquidityPoolsProposal.encode(message).finish() - }; - } -}; -function createBaseTickSpacingDecreaseProposal(): TickSpacingDecreaseProposal { - return { - title: "", - description: "", - poolIdToTickSpacingRecords: [] - }; -} -export const TickSpacingDecreaseProposal = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickSpacingDecreaseProposal", - encode(message: TickSpacingDecreaseProposal, 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.poolIdToTickSpacingRecords) { - PoolIdToTickSpacingRecord.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TickSpacingDecreaseProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTickSpacingDecreaseProposal(); - 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.poolIdToTickSpacingRecords.push(PoolIdToTickSpacingRecord.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TickSpacingDecreaseProposal { - const message = createBaseTickSpacingDecreaseProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.poolIdToTickSpacingRecords = object.poolIdToTickSpacingRecords?.map(e => PoolIdToTickSpacingRecord.fromPartial(e)) || []; - return message; - }, - fromAmino(object: TickSpacingDecreaseProposalAmino): TickSpacingDecreaseProposal { - return { - title: object.title, - description: object.description, - poolIdToTickSpacingRecords: Array.isArray(object?.pool_id_to_tick_spacing_records) ? object.pool_id_to_tick_spacing_records.map((e: any) => PoolIdToTickSpacingRecord.fromAmino(e)) : [] - }; - }, - toAmino(message: TickSpacingDecreaseProposal): TickSpacingDecreaseProposalAmino { - const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - if (message.poolIdToTickSpacingRecords) { - obj.pool_id_to_tick_spacing_records = message.poolIdToTickSpacingRecords.map(e => e ? PoolIdToTickSpacingRecord.toAmino(e) : undefined); - } else { - obj.pool_id_to_tick_spacing_records = []; - } - return obj; - }, - fromAminoMsg(object: TickSpacingDecreaseProposalAminoMsg): TickSpacingDecreaseProposal { - return TickSpacingDecreaseProposal.fromAmino(object.value); - }, - toAminoMsg(message: TickSpacingDecreaseProposal): TickSpacingDecreaseProposalAminoMsg { - return { - type: "osmosis/concentratedliquidity/tick-spacing-decrease-proposal", - value: TickSpacingDecreaseProposal.toAmino(message) - }; - }, - fromProtoMsg(message: TickSpacingDecreaseProposalProtoMsg): TickSpacingDecreaseProposal { - return TickSpacingDecreaseProposal.decode(message.value); - }, - toProto(message: TickSpacingDecreaseProposal): Uint8Array { - return TickSpacingDecreaseProposal.encode(message).finish(); - }, - toProtoMsg(message: TickSpacingDecreaseProposal): TickSpacingDecreaseProposalProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickSpacingDecreaseProposal", - value: TickSpacingDecreaseProposal.encode(message).finish() - }; - } -}; -function createBasePoolIdToTickSpacingRecord(): PoolIdToTickSpacingRecord { - return { - poolId: BigInt(0), - newTickSpacing: BigInt(0) - }; -} -export const PoolIdToTickSpacingRecord = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolIdToTickSpacingRecord", - encode(message: PoolIdToTickSpacingRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.newTickSpacing !== BigInt(0)) { - writer.uint32(16).uint64(message.newTickSpacing); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolIdToTickSpacingRecord { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolIdToTickSpacingRecord(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.newTickSpacing = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolIdToTickSpacingRecord { - const message = createBasePoolIdToTickSpacingRecord(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.newTickSpacing = object.newTickSpacing !== undefined && object.newTickSpacing !== null ? BigInt(object.newTickSpacing.toString()) : BigInt(0); - return message; - }, - fromAmino(object: PoolIdToTickSpacingRecordAmino): PoolIdToTickSpacingRecord { - return { - poolId: BigInt(object.pool_id), - newTickSpacing: BigInt(object.new_tick_spacing) - }; - }, - toAmino(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.new_tick_spacing = message.newTickSpacing ? message.newTickSpacing.toString() : undefined; - return obj; - }, - fromAminoMsg(object: PoolIdToTickSpacingRecordAminoMsg): PoolIdToTickSpacingRecord { - return PoolIdToTickSpacingRecord.fromAmino(object.value); - }, - toAminoMsg(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordAminoMsg { - return { - type: "osmosis/concentratedliquidity/pool-id-to-tick-spacing-record", - value: PoolIdToTickSpacingRecord.toAmino(message) - }; - }, - fromProtoMsg(message: PoolIdToTickSpacingRecordProtoMsg): PoolIdToTickSpacingRecord { - return PoolIdToTickSpacingRecord.decode(message.value); - }, - toProto(message: PoolIdToTickSpacingRecord): Uint8Array { - return PoolIdToTickSpacingRecord.encode(message).finish(); - }, - toProtoMsg(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolIdToTickSpacingRecord", - value: PoolIdToTickSpacingRecord.encode(message).finish() - }; - } -}; -function createBasePoolRecord(): PoolRecord { - return { - denom0: "", - denom1: "", - tickSpacing: BigInt(0), - exponentAtPriceOne: "", - spreadFactor: "" - }; -} -export const PoolRecord = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolRecord", - encode(message: PoolRecord, 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); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolRecord { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolRecord(); - 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; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolRecord { - const message = createBasePoolRecord(); - message.denom0 = object.denom0 ?? ""; - message.denom1 = object.denom1 ?? ""; - message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); - message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; - message.spreadFactor = object.spreadFactor ?? ""; - return message; - }, - fromAmino(object: PoolRecordAmino): PoolRecord { - return { - denom0: object.denom0, - denom1: object.denom1, - tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: object.exponent_at_price_one, - spreadFactor: object.spread_factor - }; - }, - toAmino(message: PoolRecord): PoolRecordAmino { - const obj: any = {}; - obj.denom0 = message.denom0; - obj.denom1 = message.denom1; - obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; - obj.exponent_at_price_one = message.exponentAtPriceOne; - obj.spread_factor = message.spreadFactor; - return obj; - }, - fromAminoMsg(object: PoolRecordAminoMsg): PoolRecord { - return PoolRecord.fromAmino(object.value); - }, - toAminoMsg(message: PoolRecord): PoolRecordAminoMsg { - return { - type: "osmosis/concentratedliquidity/pool-record", - value: PoolRecord.toAmino(message) - }; - }, - fromProtoMsg(message: PoolRecordProtoMsg): PoolRecord { - return PoolRecord.decode(message.value); - }, - toProto(message: PoolRecord): Uint8Array { - return PoolRecord.encode(message).finish(); - }, - toProtoMsg(message: PoolRecord): PoolRecordProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolRecord", - value: PoolRecord.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts index c90448a4a..a6aec18fa 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts @@ -1,5 +1,4 @@ import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; import { Decimal } from "@cosmjs/math"; @@ -11,9 +10,18 @@ import { toTimestamp, fromTimestamp } from "../../helpers"; * distinction between IncentiveRecord and IncentiveRecordBody. */ export interface IncentiveRecord { - /** incentive_id is the id uniquely identifying this incentive record. */ - incentiveId: bigint; poolId: bigint; + /** + * incentive_denom is the denom of the token being distributed as part of this + * incentive record + */ + incentiveDenom: string; + /** + * incentiveCreator is the address that created the incentive record. This + * address does not have any special privileges – it is only kept to keep + * incentive records created by different addresses separate. + */ + incentiveCreatorAddr: string; /** incentive record body holds necessary */ incentiveRecordBody: IncentiveRecordBody; /** @@ -34,9 +42,18 @@ export interface IncentiveRecordProtoMsg { * distinction between IncentiveRecord and IncentiveRecordBody. */ export interface IncentiveRecordAmino { - /** incentive_id is the id uniquely identifying this incentive record. */ - incentive_id: string; pool_id: string; + /** + * incentive_denom is the denom of the token being distributed as part of this + * incentive record + */ + incentive_denom: string; + /** + * incentiveCreator is the address that created the incentive record. This + * address does not have any special privileges – it is only kept to keep + * incentive records created by different addresses separate. + */ + incentive_creator_addr: string; /** incentive record body holds necessary */ incentive_record_body?: IncentiveRecordBodyAmino; /** @@ -57,8 +74,9 @@ export interface IncentiveRecordAminoMsg { * distinction between IncentiveRecord and IncentiveRecordBody. */ export interface IncentiveRecordSDKType { - incentive_id: bigint; pool_id: bigint; + incentive_denom: string; + incentive_creator_addr: string; incentive_record_body: IncentiveRecordBodySDKType; min_uptime: DurationSDKType; } @@ -67,8 +85,8 @@ export interface IncentiveRecordSDKType { * record. */ export interface IncentiveRecordBody { - /** remaining_coin is the total amount of incentives to be distributed */ - remainingCoin: DecCoin; + /** remaining_amount is the total amount of incentives to be distributed */ + remainingAmount: string; /** emission_rate is the incentive emission rate per second */ emissionRate: string; /** start_time is the time when the incentive starts distributing */ @@ -83,8 +101,8 @@ export interface IncentiveRecordBodyProtoMsg { * record. */ export interface IncentiveRecordBodyAmino { - /** remaining_coin is the total amount of incentives to be distributed */ - remaining_coin?: DecCoinAmino; + /** remaining_amount is the total amount of incentives to be distributed */ + remaining_amount: string; /** emission_rate is the incentive emission rate per second */ emission_rate: string; /** start_time is the time when the incentive starts distributing */ @@ -99,26 +117,30 @@ export interface IncentiveRecordBodyAminoMsg { * record. */ export interface IncentiveRecordBodySDKType { - remaining_coin: DecCoinSDKType; + remaining_amount: string; emission_rate: string; start_time: Date; } function createBaseIncentiveRecord(): IncentiveRecord { return { - incentiveId: BigInt(0), poolId: BigInt(0), + incentiveDenom: "", + incentiveCreatorAddr: "", incentiveRecordBody: IncentiveRecordBody.fromPartial({}), - minUptime: undefined + minUptime: Duration.fromPartial({}) }; } export const IncentiveRecord = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecord", encode(message: IncentiveRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.incentiveId !== BigInt(0)) { - writer.uint32(8).uint64(message.incentiveId); - } if (message.poolId !== BigInt(0)) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(8).uint64(message.poolId); + } + if (message.incentiveDenom !== "") { + writer.uint32(18).string(message.incentiveDenom); + } + if (message.incentiveCreatorAddr !== "") { + writer.uint32(26).string(message.incentiveCreatorAddr); } if (message.incentiveRecordBody !== undefined) { IncentiveRecordBody.encode(message.incentiveRecordBody, writer.uint32(34).fork()).ldelim(); @@ -136,10 +158,13 @@ export const IncentiveRecord = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.incentiveId = reader.uint64(); + message.poolId = reader.uint64(); break; case 2: - message.poolId = reader.uint64(); + message.incentiveDenom = reader.string(); + break; + case 3: + message.incentiveCreatorAddr = reader.string(); break; case 4: message.incentiveRecordBody = IncentiveRecordBody.decode(reader, reader.uint32()); @@ -156,24 +181,27 @@ export const IncentiveRecord = { }, fromPartial(object: Partial): IncentiveRecord { const message = createBaseIncentiveRecord(); - message.incentiveId = object.incentiveId !== undefined && object.incentiveId !== null ? BigInt(object.incentiveId.toString()) : BigInt(0); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.incentiveDenom = object.incentiveDenom ?? ""; + message.incentiveCreatorAddr = object.incentiveCreatorAddr ?? ""; message.incentiveRecordBody = object.incentiveRecordBody !== undefined && object.incentiveRecordBody !== null ? IncentiveRecordBody.fromPartial(object.incentiveRecordBody) : undefined; message.minUptime = object.minUptime !== undefined && object.minUptime !== null ? Duration.fromPartial(object.minUptime) : undefined; return message; }, fromAmino(object: IncentiveRecordAmino): IncentiveRecord { return { - incentiveId: BigInt(object.incentive_id), poolId: BigInt(object.pool_id), + incentiveDenom: object.incentive_denom, + incentiveCreatorAddr: object.incentive_creator_addr, incentiveRecordBody: object?.incentive_record_body ? IncentiveRecordBody.fromAmino(object.incentive_record_body) : undefined, minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined }; }, toAmino(message: IncentiveRecord): IncentiveRecordAmino { const obj: any = {}; - obj.incentive_id = message.incentiveId ? message.incentiveId.toString() : undefined; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.incentive_denom = message.incentiveDenom; + obj.incentive_creator_addr = message.incentiveCreatorAddr; obj.incentive_record_body = message.incentiveRecordBody ? IncentiveRecordBody.toAmino(message.incentiveRecordBody) : undefined; obj.min_uptime = message.minUptime ? Duration.toAmino(message.minUptime) : undefined; return obj; @@ -202,16 +230,16 @@ export const IncentiveRecord = { }; function createBaseIncentiveRecordBody(): IncentiveRecordBody { return { - remainingCoin: DecCoin.fromPartial({}), + remainingAmount: "", emissionRate: "", - startTime: undefined + startTime: new Date() }; } export const IncentiveRecordBody = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordBody", encode(message: IncentiveRecordBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.remainingCoin !== undefined) { - DecCoin.encode(message.remainingCoin, writer.uint32(10).fork()).ldelim(); + if (message.remainingAmount !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.remainingAmount, 18).atomics); } if (message.emissionRate !== "") { writer.uint32(18).string(Decimal.fromUserInput(message.emissionRate, 18).atomics); @@ -229,7 +257,7 @@ export const IncentiveRecordBody = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.remainingCoin = DecCoin.decode(reader, reader.uint32()); + message.remainingAmount = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 2: message.emissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); @@ -246,21 +274,21 @@ export const IncentiveRecordBody = { }, fromPartial(object: Partial): IncentiveRecordBody { const message = createBaseIncentiveRecordBody(); - message.remainingCoin = object.remainingCoin !== undefined && object.remainingCoin !== null ? DecCoin.fromPartial(object.remainingCoin) : undefined; + message.remainingAmount = object.remainingAmount ?? ""; message.emissionRate = object.emissionRate ?? ""; message.startTime = object.startTime ?? undefined; return message; }, fromAmino(object: IncentiveRecordBodyAmino): IncentiveRecordBody { return { - remainingCoin: object?.remaining_coin ? DecCoin.fromAmino(object.remaining_coin) : undefined, + remainingAmount: object.remaining_amount, emissionRate: object.emission_rate, startTime: object.start_time }; }, toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino { const obj: any = {}; - obj.remaining_coin = message.remainingCoin ? DecCoin.toAmino(message.remainingCoin) : undefined; + obj.remaining_amount = message.remainingAmount; obj.emission_rate = message.emissionRate; obj.start_time = message.startTime; return obj; diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts index 9078bd9ab..c758f3447 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts @@ -1,4 +1,3 @@ -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; import { Decimal } from "@cosmjs/math"; export interface Params { @@ -9,35 +8,7 @@ export interface Params { * to be created with tick spacing of 1, 10, or 30. */ authorizedTickSpacing: bigint[]; - authorizedSpreadFactors: string[]; - /** - * balancer_shares_reward_discount is the rate by which incentives flowing - * from CL to Balancer pools will be discounted to encourage LPs to migrate. - * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full - * range CL LPs. - * This field can range from (0,1]. If set to 1, it indicates that all - * incentives stay at cl pool. - */ - balancerSharesRewardDiscount: string; - /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. - */ - authorizedQuoteDenoms: string[]; - authorizedUptimes: Duration[]; - /** - * is_permissionless_pool_creation_enabled is a boolean that determines if - * concentrated liquidity pools can be created via message. At launch, - * we consider allowing only governance to create pools, and then later - * allowing permissionless pool creation by switching this flag to true - * with a governance proposal. - */ - isPermissionlessPoolCreationEnabled: boolean; + authorizedSwapFees: string[]; } export interface ParamsProtoMsg { typeUrl: "/osmosis.concentratedliquidity.Params"; @@ -51,35 +22,7 @@ export interface ParamsAmino { * to be created with tick spacing of 1, 10, or 30. */ authorized_tick_spacing: string[]; - authorized_spread_factors: string[]; - /** - * balancer_shares_reward_discount is the rate by which incentives flowing - * from CL to Balancer pools will be discounted to encourage LPs to migrate. - * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full - * range CL LPs. - * This field can range from (0,1]. If set to 1, it indicates that all - * incentives stay at cl pool. - */ - balancer_shares_reward_discount: string; - /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. - */ - authorized_quote_denoms: string[]; - authorized_uptimes: DurationAmino[]; - /** - * is_permissionless_pool_creation_enabled is a boolean that determines if - * concentrated liquidity pools can be created via message. At launch, - * we consider allowing only governance to create pools, and then later - * allowing permissionless pool creation by switching this flag to true - * with a governance proposal. - */ - is_permissionless_pool_creation_enabled: boolean; + authorized_swap_fees: string[]; } export interface ParamsAminoMsg { type: "osmosis/concentratedliquidity/params"; @@ -87,20 +30,12 @@ export interface ParamsAminoMsg { } export interface ParamsSDKType { authorized_tick_spacing: bigint[]; - authorized_spread_factors: string[]; - balancer_shares_reward_discount: string; - authorized_quote_denoms: string[]; - authorized_uptimes: DurationSDKType[]; - is_permissionless_pool_creation_enabled: boolean; + authorized_swap_fees: string[]; } function createBaseParams(): Params { return { authorizedTickSpacing: [], - authorizedSpreadFactors: [], - balancerSharesRewardDiscount: "", - authorizedQuoteDenoms: [], - authorizedUptimes: [], - isPermissionlessPoolCreationEnabled: false + authorizedSwapFees: [] }; } export const Params = { @@ -111,21 +46,9 @@ export const Params = { writer.uint64(v); } writer.ldelim(); - for (const v of message.authorizedSpreadFactors) { + for (const v of message.authorizedSwapFees) { writer.uint32(18).string(Decimal.fromUserInput(v!, 18).atomics); } - if (message.balancerSharesRewardDiscount !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.balancerSharesRewardDiscount, 18).atomics); - } - for (const v of message.authorizedQuoteDenoms) { - writer.uint32(34).string(v!); - } - for (const v of message.authorizedUptimes) { - Duration.encode(v!, writer.uint32(42).fork()).ldelim(); - } - if (message.isPermissionlessPoolCreationEnabled === true) { - writer.uint32(48).bool(message.isPermissionlessPoolCreationEnabled); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -146,19 +69,7 @@ export const Params = { } break; case 2: - message.authorizedSpreadFactors.push(Decimal.fromAtomics(reader.string(), 18).toString()); - break; - case 3: - message.balancerSharesRewardDiscount = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - case 4: - message.authorizedQuoteDenoms.push(reader.string()); - break; - case 5: - message.authorizedUptimes.push(Duration.decode(reader, reader.uint32())); - break; - case 6: - message.isPermissionlessPoolCreationEnabled = reader.bool(); + message.authorizedSwapFees.push(Decimal.fromAtomics(reader.string(), 18).toString()); break; default: reader.skipType(tag & 7); @@ -170,21 +81,13 @@ export const Params = { fromPartial(object: Partial): Params { const message = createBaseParams(); message.authorizedTickSpacing = object.authorizedTickSpacing?.map(e => BigInt(e.toString())) || []; - message.authorizedSpreadFactors = object.authorizedSpreadFactors?.map(e => e) || []; - message.balancerSharesRewardDiscount = object.balancerSharesRewardDiscount ?? ""; - message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; - message.authorizedUptimes = object.authorizedUptimes?.map(e => Duration.fromPartial(e)) || []; - message.isPermissionlessPoolCreationEnabled = object.isPermissionlessPoolCreationEnabled ?? false; + message.authorizedSwapFees = object.authorizedSwapFees?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { return { authorizedTickSpacing: Array.isArray(object?.authorized_tick_spacing) ? object.authorized_tick_spacing.map((e: any) => BigInt(e)) : [], - authorizedSpreadFactors: Array.isArray(object?.authorized_spread_factors) ? object.authorized_spread_factors.map((e: any) => e) : [], - balancerSharesRewardDiscount: object.balancer_shares_reward_discount, - authorizedQuoteDenoms: Array.isArray(object?.authorized_quote_denoms) ? object.authorized_quote_denoms.map((e: any) => e) : [], - authorizedUptimes: Array.isArray(object?.authorized_uptimes) ? object.authorized_uptimes.map((e: any) => Duration.fromAmino(e)) : [], - isPermissionlessPoolCreationEnabled: object.is_permissionless_pool_creation_enabled + authorizedSwapFees: Array.isArray(object?.authorized_swap_fees) ? object.authorized_swap_fees.map((e: any) => e) : [] }; }, toAmino(message: Params): ParamsAmino { @@ -194,23 +97,11 @@ export const Params = { } else { obj.authorized_tick_spacing = []; } - if (message.authorizedSpreadFactors) { - obj.authorized_spread_factors = message.authorizedSpreadFactors.map(e => e); - } else { - obj.authorized_spread_factors = []; - } - obj.balancer_shares_reward_discount = message.balancerSharesRewardDiscount; - if (message.authorizedQuoteDenoms) { - obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map(e => e); - } else { - obj.authorized_quote_denoms = []; - } - if (message.authorizedUptimes) { - obj.authorized_uptimes = message.authorizedUptimes.map(e => e ? Duration.toAmino(e) : undefined); + if (message.authorizedSwapFees) { + obj.authorized_swap_fees = message.authorizedSwapFees.map(e => e); } else { - obj.authorized_uptimes = []; + obj.authorized_swap_fees = []; } - obj.is_permissionless_pool_creation_enabled = message.isPermissionlessPoolCreationEnabled; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts deleted file mode 100644 index ed2a4306d..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts +++ /dev/null @@ -1,9 +0,0 @@ -//@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 - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts deleted file mode 100644 index 784dc217e..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts +++ /dev/null @@ -1,35 +0,0 @@ -//@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) - }; - } - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts deleted file mode 100644 index 237bcb718..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Rpc } from "../../../../helpers"; -import { BinaryReader } from "../../../../binary"; -import { MsgCreateConcentratedPool, MsgCreateConcentratedPoolResponse } from "./tx"; -export interface Msg { - createConcentratedPool(request: MsgCreateConcentratedPool): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createConcentratedPool = this.createConcentratedPool.bind(this); - } - createConcentratedPool(request: MsgCreateConcentratedPool): Promise { - const data = MsgCreateConcentratedPool.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.Msg", "CreateConcentratedPool", data); - return promise.then(data => MsgCreateConcentratedPoolResponse.decode(new BinaryReader(data))); - } -} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.lcd.ts new file mode 100644 index 000000000..e05682460 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.lcd.ts @@ -0,0 +1,105 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryUserPositionsRequest, QueryUserPositionsResponseSDKType, QueryTotalLiquidityForRangeRequest, QueryTotalLiquidityForRangeResponseSDKType, QueryLiquidityNetInDirectionRequest, QueryLiquidityNetInDirectionResponseSDKType, QueryClaimableFeesRequest, QueryClaimableFeesResponseSDKType, QueryPositionByIdRequest, QueryPositionByIdResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.pools = this.pools.bind(this); + this.params = this.params.bind(this); + this.userPositions = this.userPositions.bind(this); + this.totalLiquidityForRange = this.totalLiquidityForRange.bind(this); + this.liquidityNetInDirection = this.liquidityNetInDirection.bind(this); + this.claimableFees = this.claimableFees.bind(this); + this.positionById = this.positionById.bind(this); + } + /* Pools returns all concentrated liquidity pools */ + async pools(params: QueryPoolsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/pools`; + return await this.req.get(endpoint, options); + } + /* Params returns concentrated liquidity module params. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `osmosis/concentratedliquidity/v1beta1/params`; + return await this.req.get(endpoint); + } + /* UserPositions returns all concentrated postitions of some address. */ + async userPositions(params: QueryUserPositionsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/positions/${params.address}`; + return await this.req.get(endpoint, options); + } + /* TotalLiquidityForRange the amount of liquidity existing within given range. */ + async totalLiquidityForRange(params: QueryTotalLiquidityForRangeRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/total_liquidity_for_range`; + return await this.req.get(endpoint, options); + } + /* LiquidityNetInDirection returns liquidity net in the direction given. + Uses the bound if specified, if not uses either min tick / max tick + depending on the direction. */ + async liquidityNetInDirection(params: QueryLiquidityNetInDirectionRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } + if (typeof params?.tokenIn !== "undefined") { + options.params.token_in = params.tokenIn; + } + if (typeof params?.startTick !== "undefined") { + options.params.start_tick = params.startTick; + } + if (typeof params?.boundTick !== "undefined") { + options.params.bound_tick = params.boundTick; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/query_liquidity_net_in_direction`; + return await this.req.get(endpoint, options); + } + /* ClaimableFees returns the amount of fees that can be claimed by a position + with the given id. */ + async claimableFees(params: QueryClaimableFeesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.positionId !== "undefined") { + options.params.position_id = params.positionId; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/claimable_fees`; + return await this.req.get(endpoint, options); + } + /* PositionById returns a position with the given id. */ + async positionById(params: QueryPositionByIdRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.positionId !== "undefined") { + options.params.position_id = params.positionId; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/position_by_id`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.rpc.Query.ts new file mode 100644 index 000000000..f8356abd4 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.rpc.Query.ts @@ -0,0 +1,104 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryPoolsRequest, QueryPoolsResponse, QueryParamsRequest, QueryParamsResponse, QueryUserPositionsRequest, QueryUserPositionsResponse, QueryTotalLiquidityForRangeRequest, QueryTotalLiquidityForRangeResponse, QueryLiquidityNetInDirectionRequest, QueryLiquidityNetInDirectionResponse, QueryClaimableFeesRequest, QueryClaimableFeesResponse, QueryPositionByIdRequest, QueryPositionByIdResponse } from "./query"; +export interface Query { + /** Pools returns all concentrated liquidity pools */ + pools(request?: QueryPoolsRequest): Promise; + /** Params returns concentrated liquidity module params. */ + params(request?: QueryParamsRequest): Promise; + /** UserPositions returns all concentrated postitions of some address. */ + userPositions(request: QueryUserPositionsRequest): Promise; + /** TotalLiquidityForRange the amount of liquidity existing within given range. */ + totalLiquidityForRange(request: QueryTotalLiquidityForRangeRequest): Promise; + /** + * LiquidityNetInDirection returns liquidity net in the direction given. + * Uses the bound if specified, if not uses either min tick / max tick + * depending on the direction. + */ + liquidityNetInDirection(request: QueryLiquidityNetInDirectionRequest): Promise; + /** + * ClaimableFees returns the amount of fees that can be claimed by a position + * with the given id. + */ + claimableFees(request: QueryClaimableFeesRequest): Promise; + /** PositionById returns a position with the given id. */ + positionById(request: QueryPositionByIdRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.pools = this.pools.bind(this); + this.params = this.params.bind(this); + this.userPositions = this.userPositions.bind(this); + this.totalLiquidityForRange = this.totalLiquidityForRange.bind(this); + this.liquidityNetInDirection = this.liquidityNetInDirection.bind(this); + this.claimableFees = this.claimableFees.bind(this); + this.positionById = this.positionById.bind(this); + } + pools(request: QueryPoolsRequest = { + pagination: undefined + }): Promise { + const data = QueryPoolsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "Pools", data); + return promise.then(data => QueryPoolsResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + userPositions(request: QueryUserPositionsRequest): Promise { + const data = QueryUserPositionsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "UserPositions", data); + return promise.then(data => QueryUserPositionsResponse.decode(new BinaryReader(data))); + } + totalLiquidityForRange(request: QueryTotalLiquidityForRangeRequest): Promise { + const data = QueryTotalLiquidityForRangeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "TotalLiquidityForRange", data); + return promise.then(data => QueryTotalLiquidityForRangeResponse.decode(new BinaryReader(data))); + } + liquidityNetInDirection(request: QueryLiquidityNetInDirectionRequest): Promise { + const data = QueryLiquidityNetInDirectionRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "LiquidityNetInDirection", data); + return promise.then(data => QueryLiquidityNetInDirectionResponse.decode(new BinaryReader(data))); + } + claimableFees(request: QueryClaimableFeesRequest): Promise { + const data = QueryClaimableFeesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "ClaimableFees", data); + return promise.then(data => QueryClaimableFeesResponse.decode(new BinaryReader(data))); + } + positionById(request: QueryPositionByIdRequest): Promise { + const data = QueryPositionByIdRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "PositionById", data); + return promise.then(data => QueryPositionByIdResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + pools(request?: QueryPoolsRequest): Promise { + return queryService.pools(request); + }, + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + userPositions(request: QueryUserPositionsRequest): Promise { + return queryService.userPositions(request); + }, + totalLiquidityForRange(request: QueryTotalLiquidityForRangeRequest): Promise { + return queryService.totalLiquidityForRange(request); + }, + liquidityNetInDirection(request: QueryLiquidityNetInDirectionRequest): Promise { + return queryService.liquidityNetInDirection(request); + }, + claimableFees(request: QueryClaimableFeesRequest): Promise { + return queryService.claimableFees(request); + }, + positionById(request: QueryPositionByIdRequest): Promise { + return queryService.positionById(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.ts new file mode 100644 index 000000000..df69f06c0 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/query.ts @@ -0,0 +1,1589 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { PositionWithUnderlyingAssetBreakdown, PositionWithUnderlyingAssetBreakdownAmino, PositionWithUnderlyingAssetBreakdownSDKType } from "../position"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType } from "../params"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Pool as Pool1 } from "../pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../pool"; +import { PoolSDKType as Pool1SDKType } from "../pool"; +import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; +import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; +import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** =============================== UserPositions */ +export interface QueryUserPositionsRequest { + address: string; + poolId: bigint; +} +export interface QueryUserPositionsRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsRequest"; + value: Uint8Array; +} +/** =============================== UserPositions */ +export interface QueryUserPositionsRequestAmino { + address: string; + pool_id: string; +} +export interface QueryUserPositionsRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-user-positions-request"; + value: QueryUserPositionsRequestAmino; +} +/** =============================== UserPositions */ +export interface QueryUserPositionsRequestSDKType { + address: string; + pool_id: bigint; +} +export interface QueryUserPositionsResponse { + positions: PositionWithUnderlyingAssetBreakdown[]; +} +export interface QueryUserPositionsResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsResponse"; + value: Uint8Array; +} +export interface QueryUserPositionsResponseAmino { + positions: PositionWithUnderlyingAssetBreakdownAmino[]; +} +export interface QueryUserPositionsResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-user-positions-response"; + value: QueryUserPositionsResponseAmino; +} +export interface QueryUserPositionsResponseSDKType { + positions: PositionWithUnderlyingAssetBreakdownSDKType[]; +} +/** =============================== PositionById */ +export interface QueryPositionByIdRequest { + positionId: bigint; +} +export interface QueryPositionByIdRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdRequest"; + value: Uint8Array; +} +/** =============================== PositionById */ +export interface QueryPositionByIdRequestAmino { + position_id: string; +} +export interface QueryPositionByIdRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-position-by-id-request"; + value: QueryPositionByIdRequestAmino; +} +/** =============================== PositionById */ +export interface QueryPositionByIdRequestSDKType { + position_id: bigint; +} +export interface QueryPositionByIdResponse { + position: PositionWithUnderlyingAssetBreakdown; +} +export interface QueryPositionByIdResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdResponse"; + value: Uint8Array; +} +export interface QueryPositionByIdResponseAmino { + position?: PositionWithUnderlyingAssetBreakdownAmino; +} +export interface QueryPositionByIdResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-position-by-id-response"; + value: QueryPositionByIdResponseAmino; +} +export interface QueryPositionByIdResponseSDKType { + position: PositionWithUnderlyingAssetBreakdownSDKType; +} +/** =============================== Pools */ +export interface QueryPoolsRequest { + /** pagination defines an optional pagination for the request. */ + pagination: PageRequest; +} +export interface QueryPoolsRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsRequest"; + value: Uint8Array; +} +/** =============================== Pools */ +export interface QueryPoolsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryPoolsRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-pools-request"; + value: QueryPoolsRequestAmino; +} +/** =============================== Pools */ +export interface QueryPoolsRequestSDKType { + pagination: PageRequestSDKType; +} +export interface QueryPoolsResponse { + pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + /** pagination defines the pagination in the response. */ + pagination: PageResponse; +} +export interface QueryPoolsResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsResponse"; + value: Uint8Array; +} +export type QueryPoolsResponseEncoded = Omit & { + pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; +}; +export interface QueryPoolsResponseAmino { + pools: AnyAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryPoolsResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-pools-response"; + value: QueryPoolsResponseAmino; +} +export interface QueryPoolsResponseSDKType { + pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; + pagination: PageResponseSDKType; +} +/** =============================== ModuleParams */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** =============================== ModuleParams */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-params-request"; + value: QueryParamsRequestAmino; +} +/** =============================== ModuleParams */ +export interface QueryParamsRequestSDKType {} +export interface QueryParamsResponse { + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-params-response"; + value: QueryParamsResponseAmino; +} +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +export interface TickLiquidityNet { + liquidityNet: string; + tickIndex: string; +} +export interface TickLiquidityNetProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet"; + value: Uint8Array; +} +export interface TickLiquidityNetAmino { + liquidity_net: string; + tick_index: string; +} +export interface TickLiquidityNetAminoMsg { + type: "osmosis/concentratedliquidity/tick-liquidity-net"; + value: TickLiquidityNetAmino; +} +export interface TickLiquidityNetSDKType { + liquidity_net: string; + tick_index: string; +} +export interface LiquidityDepthWithRange { + liquidityAmount: string; + lowerTick: string; + upperTick: string; +} +export interface LiquidityDepthWithRangeProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange"; + value: Uint8Array; +} +export interface LiquidityDepthWithRangeAmino { + liquidity_amount: string; + lower_tick: string; + upper_tick: string; +} +export interface LiquidityDepthWithRangeAminoMsg { + type: "osmosis/concentratedliquidity/liquidity-depth-with-range"; + value: LiquidityDepthWithRangeAmino; +} +export interface LiquidityDepthWithRangeSDKType { + liquidity_amount: string; + lower_tick: string; + upper_tick: string; +} +/** =============================== LiquidityNetInDirection */ +export interface QueryLiquidityNetInDirectionRequest { + poolId: bigint; + tokenIn: string; + startTick?: string; + boundTick?: string; +} +export interface QueryLiquidityNetInDirectionRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionRequest"; + value: Uint8Array; +} +/** =============================== LiquidityNetInDirection */ +export interface QueryLiquidityNetInDirectionRequestAmino { + pool_id: string; + token_in: string; + start_tick: string; + bound_tick: string; +} +export interface QueryLiquidityNetInDirectionRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-liquidity-net-in-direction-request"; + value: QueryLiquidityNetInDirectionRequestAmino; +} +/** =============================== LiquidityNetInDirection */ +export interface QueryLiquidityNetInDirectionRequestSDKType { + pool_id: bigint; + token_in: string; + start_tick?: string; + bound_tick?: string; +} +export interface QueryLiquidityNetInDirectionResponse { + liquidityDepths: TickLiquidityNet[]; + currentTick: bigint; + currentLiquidity: string; +} +export interface QueryLiquidityNetInDirectionResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionResponse"; + value: Uint8Array; +} +export interface QueryLiquidityNetInDirectionResponseAmino { + liquidity_depths: TickLiquidityNetAmino[]; + current_tick: string; + current_liquidity: string; +} +export interface QueryLiquidityNetInDirectionResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-liquidity-net-in-direction-response"; + value: QueryLiquidityNetInDirectionResponseAmino; +} +export interface QueryLiquidityNetInDirectionResponseSDKType { + liquidity_depths: TickLiquidityNetSDKType[]; + current_tick: bigint; + current_liquidity: string; +} +/** =============================== TotalLiquidityForRange */ +export interface QueryTotalLiquidityForRangeRequest { + poolId: bigint; +} +export interface QueryTotalLiquidityForRangeRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeRequest"; + value: Uint8Array; +} +/** =============================== TotalLiquidityForRange */ +export interface QueryTotalLiquidityForRangeRequestAmino { + pool_id: string; +} +export interface QueryTotalLiquidityForRangeRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-total-liquidity-for-range-request"; + value: QueryTotalLiquidityForRangeRequestAmino; +} +/** =============================== TotalLiquidityForRange */ +export interface QueryTotalLiquidityForRangeRequestSDKType { + pool_id: bigint; +} +export interface QueryTotalLiquidityForRangeResponse { + liquidity: LiquidityDepthWithRange[]; +} +export interface QueryTotalLiquidityForRangeResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeResponse"; + value: Uint8Array; +} +export interface QueryTotalLiquidityForRangeResponseAmino { + liquidity: LiquidityDepthWithRangeAmino[]; +} +export interface QueryTotalLiquidityForRangeResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-total-liquidity-for-range-response"; + value: QueryTotalLiquidityForRangeResponseAmino; +} +export interface QueryTotalLiquidityForRangeResponseSDKType { + liquidity: LiquidityDepthWithRangeSDKType[]; +} +/** ===================== MsgQueryClaimableFees */ +export interface QueryClaimableFeesRequest { + positionId: bigint; +} +export interface QueryClaimableFeesRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesRequest"; + value: Uint8Array; +} +/** ===================== MsgQueryClaimableFees */ +export interface QueryClaimableFeesRequestAmino { + position_id: string; +} +export interface QueryClaimableFeesRequestAminoMsg { + type: "osmosis/concentratedliquidity/query-claimable-fees-request"; + value: QueryClaimableFeesRequestAmino; +} +/** ===================== MsgQueryClaimableFees */ +export interface QueryClaimableFeesRequestSDKType { + position_id: bigint; +} +export interface QueryClaimableFeesResponse { + claimableFees: Coin[]; +} +export interface QueryClaimableFeesResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesResponse"; + value: Uint8Array; +} +export interface QueryClaimableFeesResponseAmino { + claimable_fees: CoinAmino[]; +} +export interface QueryClaimableFeesResponseAminoMsg { + type: "osmosis/concentratedliquidity/query-claimable-fees-response"; + value: QueryClaimableFeesResponseAmino; +} +export interface QueryClaimableFeesResponseSDKType { + claimable_fees: CoinSDKType[]; +} +function createBaseQueryUserPositionsRequest(): QueryUserPositionsRequest { + return { + address: "", + poolId: BigInt(0) + }; +} +export const QueryUserPositionsRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsRequest", + encode(message: QueryUserPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserPositionsRequest { + const message = createBaseQueryUserPositionsRequest(); + message.address = object.address ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryUserPositionsRequestAmino): QueryUserPositionsRequest { + return { + address: object.address, + poolId: BigInt(object.pool_id) + }; + }, + toAmino(message: QueryUserPositionsRequest): QueryUserPositionsRequestAmino { + const obj: any = {}; + obj.address = message.address; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryUserPositionsRequestAminoMsg): QueryUserPositionsRequest { + return QueryUserPositionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUserPositionsRequest): QueryUserPositionsRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-user-positions-request", + value: QueryUserPositionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUserPositionsRequestProtoMsg): QueryUserPositionsRequest { + return QueryUserPositionsRequest.decode(message.value); + }, + toProto(message: QueryUserPositionsRequest): Uint8Array { + return QueryUserPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUserPositionsRequest): QueryUserPositionsRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsRequest", + value: QueryUserPositionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUserPositionsResponse(): QueryUserPositionsResponse { + return { + positions: [] + }; +} +export const QueryUserPositionsResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsResponse", + encode(message: QueryUserPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.positions) { + PositionWithUnderlyingAssetBreakdown.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positions.push(PositionWithUnderlyingAssetBreakdown.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserPositionsResponse { + const message = createBaseQueryUserPositionsResponse(); + message.positions = object.positions?.map(e => PositionWithUnderlyingAssetBreakdown.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryUserPositionsResponseAmino): QueryUserPositionsResponse { + return { + positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => PositionWithUnderlyingAssetBreakdown.fromAmino(e)) : [] + }; + }, + toAmino(message: QueryUserPositionsResponse): QueryUserPositionsResponseAmino { + const obj: any = {}; + if (message.positions) { + obj.positions = message.positions.map(e => e ? PositionWithUnderlyingAssetBreakdown.toAmino(e) : undefined); + } else { + obj.positions = []; + } + return obj; + }, + fromAminoMsg(object: QueryUserPositionsResponseAminoMsg): QueryUserPositionsResponse { + return QueryUserPositionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUserPositionsResponse): QueryUserPositionsResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-user-positions-response", + value: QueryUserPositionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUserPositionsResponseProtoMsg): QueryUserPositionsResponse { + return QueryUserPositionsResponse.decode(message.value); + }, + toProto(message: QueryUserPositionsResponse): Uint8Array { + return QueryUserPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUserPositionsResponse): QueryUserPositionsResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryUserPositionsResponse", + value: QueryUserPositionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPositionByIdRequest(): QueryPositionByIdRequest { + return { + positionId: BigInt(0) + }; +} +export const QueryPositionByIdRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdRequest", + encode(message: QueryPositionByIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionByIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionByIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPositionByIdRequest { + const message = createBaseQueryPositionByIdRequest(); + message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryPositionByIdRequestAmino): QueryPositionByIdRequest { + return { + positionId: BigInt(object.position_id) + }; + }, + toAmino(message: QueryPositionByIdRequest): QueryPositionByIdRequestAmino { + const obj: any = {}; + obj.position_id = message.positionId ? message.positionId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryPositionByIdRequestAminoMsg): QueryPositionByIdRequest { + return QueryPositionByIdRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPositionByIdRequest): QueryPositionByIdRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-position-by-id-request", + value: QueryPositionByIdRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPositionByIdRequestProtoMsg): QueryPositionByIdRequest { + return QueryPositionByIdRequest.decode(message.value); + }, + toProto(message: QueryPositionByIdRequest): Uint8Array { + return QueryPositionByIdRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionByIdRequest): QueryPositionByIdRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdRequest", + value: QueryPositionByIdRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPositionByIdResponse(): QueryPositionByIdResponse { + return { + position: PositionWithUnderlyingAssetBreakdown.fromPartial({}) + }; +} +export const QueryPositionByIdResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdResponse", + encode(message: QueryPositionByIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.position !== undefined) { + PositionWithUnderlyingAssetBreakdown.encode(message.position, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPositionByIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPositionByIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.position = PositionWithUnderlyingAssetBreakdown.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPositionByIdResponse { + const message = createBaseQueryPositionByIdResponse(); + message.position = object.position !== undefined && object.position !== null ? PositionWithUnderlyingAssetBreakdown.fromPartial(object.position) : undefined; + return message; + }, + fromAmino(object: QueryPositionByIdResponseAmino): QueryPositionByIdResponse { + return { + position: object?.position ? PositionWithUnderlyingAssetBreakdown.fromAmino(object.position) : undefined + }; + }, + toAmino(message: QueryPositionByIdResponse): QueryPositionByIdResponseAmino { + const obj: any = {}; + obj.position = message.position ? PositionWithUnderlyingAssetBreakdown.toAmino(message.position) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPositionByIdResponseAminoMsg): QueryPositionByIdResponse { + return QueryPositionByIdResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPositionByIdResponse): QueryPositionByIdResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-position-by-id-response", + value: QueryPositionByIdResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPositionByIdResponseProtoMsg): QueryPositionByIdResponse { + return QueryPositionByIdResponse.decode(message.value); + }, + toProto(message: QueryPositionByIdResponse): Uint8Array { + return QueryPositionByIdResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPositionByIdResponse): QueryPositionByIdResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPositionByIdResponse", + value: QueryPositionByIdResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPoolsRequest(): QueryPoolsRequest { + return { + pagination: PageRequest.fromPartial({}) + }; +} +export const QueryPoolsRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsRequest", + encode(message: QueryPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPoolsRequest { + const message = createBaseQueryPoolsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPoolsRequestAmino): QueryPoolsRequest { + return { + pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined + }; + }, + toAmino(message: QueryPoolsRequest): QueryPoolsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPoolsRequestAminoMsg): QueryPoolsRequest { + return QueryPoolsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolsRequest): QueryPoolsRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-pools-request", + value: QueryPoolsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolsRequestProtoMsg): QueryPoolsRequest { + return QueryPoolsRequest.decode(message.value); + }, + toProto(message: QueryPoolsRequest): Uint8Array { + return QueryPoolsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolsRequest): QueryPoolsRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsRequest", + value: QueryPoolsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPoolsResponse(): QueryPoolsResponse { + return { + pools: [], + pagination: PageResponse.fromPartial({}) + }; +} +export const QueryPoolsResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsResponse", + encode(message: QueryPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pools) { + Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPoolsResponse { + const message = createBaseQueryPoolsResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryPoolsResponseAmino): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], + pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined + }; + }, + toAmino(message: QueryPoolsResponse): QueryPoolsResponseAmino { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + } else { + obj.pools = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryPoolsResponseAminoMsg): QueryPoolsResponse { + return QueryPoolsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryPoolsResponse): QueryPoolsResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-pools-response", + value: QueryPoolsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryPoolsResponseProtoMsg): QueryPoolsResponse { + return QueryPoolsResponse.decode(message.value); + }, + toProto(message: QueryPoolsResponse): Uint8Array { + return QueryPoolsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPoolsResponse): QueryPoolsResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryPoolsResponse", + value: QueryPoolsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + return {}; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-params-request", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + return { + params: object?.params ? Params.fromAmino(object.params) : undefined + }; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-params-response", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseTickLiquidityNet(): TickLiquidityNet { + return { + liquidityNet: "", + tickIndex: "" + }; +} +export const TickLiquidityNet = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet", + encode(message: TickLiquidityNet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidityNet !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.liquidityNet, 18).atomics); + } + if (message.tickIndex !== "") { + writer.uint32(18).string(message.tickIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TickLiquidityNet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickLiquidityNet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityNet = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.tickIndex = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TickLiquidityNet { + const message = createBaseTickLiquidityNet(); + message.liquidityNet = object.liquidityNet ?? ""; + message.tickIndex = object.tickIndex ?? ""; + return message; + }, + fromAmino(object: TickLiquidityNetAmino): TickLiquidityNet { + return { + liquidityNet: object.liquidity_net, + tickIndex: object.tick_index + }; + }, + toAmino(message: TickLiquidityNet): TickLiquidityNetAmino { + const obj: any = {}; + obj.liquidity_net = message.liquidityNet; + obj.tick_index = message.tickIndex; + return obj; + }, + fromAminoMsg(object: TickLiquidityNetAminoMsg): TickLiquidityNet { + return TickLiquidityNet.fromAmino(object.value); + }, + toAminoMsg(message: TickLiquidityNet): TickLiquidityNetAminoMsg { + return { + type: "osmosis/concentratedliquidity/tick-liquidity-net", + value: TickLiquidityNet.toAmino(message) + }; + }, + fromProtoMsg(message: TickLiquidityNetProtoMsg): TickLiquidityNet { + return TickLiquidityNet.decode(message.value); + }, + toProto(message: TickLiquidityNet): Uint8Array { + return TickLiquidityNet.encode(message).finish(); + }, + toProtoMsg(message: TickLiquidityNet): TickLiquidityNetProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet", + value: TickLiquidityNet.encode(message).finish() + }; + } +}; +function createBaseLiquidityDepthWithRange(): LiquidityDepthWithRange { + return { + liquidityAmount: "", + lowerTick: "", + upperTick: "" + }; +} +export const LiquidityDepthWithRange = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange", + encode(message: LiquidityDepthWithRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidityAmount !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.liquidityAmount, 18).atomics); + } + if (message.lowerTick !== "") { + writer.uint32(18).string(message.lowerTick); + } + if (message.upperTick !== "") { + writer.uint32(26).string(message.upperTick); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LiquidityDepthWithRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidityDepthWithRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityAmount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.lowerTick = reader.string(); + break; + case 3: + message.upperTick = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidityDepthWithRange { + const message = createBaseLiquidityDepthWithRange(); + message.liquidityAmount = object.liquidityAmount ?? ""; + message.lowerTick = object.lowerTick ?? ""; + message.upperTick = object.upperTick ?? ""; + return message; + }, + fromAmino(object: LiquidityDepthWithRangeAmino): LiquidityDepthWithRange { + return { + liquidityAmount: object.liquidity_amount, + lowerTick: object.lower_tick, + upperTick: object.upper_tick + }; + }, + toAmino(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAmino { + const obj: any = {}; + obj.liquidity_amount = message.liquidityAmount; + obj.lower_tick = message.lowerTick; + obj.upper_tick = message.upperTick; + return obj; + }, + fromAminoMsg(object: LiquidityDepthWithRangeAminoMsg): LiquidityDepthWithRange { + return LiquidityDepthWithRange.fromAmino(object.value); + }, + toAminoMsg(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAminoMsg { + return { + type: "osmosis/concentratedliquidity/liquidity-depth-with-range", + value: LiquidityDepthWithRange.toAmino(message) + }; + }, + fromProtoMsg(message: LiquidityDepthWithRangeProtoMsg): LiquidityDepthWithRange { + return LiquidityDepthWithRange.decode(message.value); + }, + toProto(message: LiquidityDepthWithRange): Uint8Array { + return LiquidityDepthWithRange.encode(message).finish(); + }, + toProtoMsg(message: LiquidityDepthWithRange): LiquidityDepthWithRangeProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange", + value: LiquidityDepthWithRange.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidityNetInDirectionRequest(): QueryLiquidityNetInDirectionRequest { + return { + poolId: BigInt(0), + tokenIn: "", + startTick: undefined, + boundTick: undefined + }; +} +export const QueryLiquidityNetInDirectionRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionRequest", + encode(message: QueryLiquidityNetInDirectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenIn !== "") { + writer.uint32(18).string(message.tokenIn); + } + if (message.startTick !== undefined) { + writer.uint32(26).string(message.startTick); + } + if (message.boundTick !== undefined) { + writer.uint32(34).string(message.boundTick); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLiquidityNetInDirectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidityNetInDirectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenIn = reader.string(); + break; + case 3: + message.startTick = reader.string(); + break; + case 4: + message.boundTick = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLiquidityNetInDirectionRequest { + const message = createBaseQueryLiquidityNetInDirectionRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenIn = object.tokenIn ?? ""; + message.startTick = object.startTick ?? undefined; + message.boundTick = object.boundTick ?? undefined; + return message; + }, + fromAmino(object: QueryLiquidityNetInDirectionRequestAmino): QueryLiquidityNetInDirectionRequest { + return { + poolId: BigInt(object.pool_id), + tokenIn: object.token_in, + startTick: object?.start_tick, + boundTick: object?.bound_tick + }; + }, + toAmino(message: QueryLiquidityNetInDirectionRequest): QueryLiquidityNetInDirectionRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in = message.tokenIn; + obj.start_tick = message.startTick; + obj.bound_tick = message.boundTick; + return obj; + }, + fromAminoMsg(object: QueryLiquidityNetInDirectionRequestAminoMsg): QueryLiquidityNetInDirectionRequest { + return QueryLiquidityNetInDirectionRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryLiquidityNetInDirectionRequest): QueryLiquidityNetInDirectionRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-liquidity-net-in-direction-request", + value: QueryLiquidityNetInDirectionRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryLiquidityNetInDirectionRequestProtoMsg): QueryLiquidityNetInDirectionRequest { + return QueryLiquidityNetInDirectionRequest.decode(message.value); + }, + toProto(message: QueryLiquidityNetInDirectionRequest): Uint8Array { + return QueryLiquidityNetInDirectionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidityNetInDirectionRequest): QueryLiquidityNetInDirectionRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionRequest", + value: QueryLiquidityNetInDirectionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidityNetInDirectionResponse(): QueryLiquidityNetInDirectionResponse { + return { + liquidityDepths: [], + currentTick: BigInt(0), + currentLiquidity: "" + }; +} +export const QueryLiquidityNetInDirectionResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionResponse", + encode(message: QueryLiquidityNetInDirectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidityDepths) { + TickLiquidityNet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.currentTick !== BigInt(0)) { + writer.uint32(16).int64(message.currentTick); + } + if (message.currentLiquidity !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryLiquidityNetInDirectionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidityNetInDirectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityDepths.push(TickLiquidityNet.decode(reader, reader.uint32())); + break; + case 2: + message.currentTick = reader.int64(); + break; + case 3: + message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLiquidityNetInDirectionResponse { + const message = createBaseQueryLiquidityNetInDirectionResponse(); + message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; + message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); + message.currentLiquidity = object.currentLiquidity ?? ""; + return message; + }, + fromAmino(object: QueryLiquidityNetInDirectionResponseAmino): QueryLiquidityNetInDirectionResponse { + return { + liquidityDepths: Array.isArray(object?.liquidity_depths) ? object.liquidity_depths.map((e: any) => TickLiquidityNet.fromAmino(e)) : [], + currentTick: BigInt(object.current_tick), + currentLiquidity: object.current_liquidity + }; + }, + toAmino(message: QueryLiquidityNetInDirectionResponse): QueryLiquidityNetInDirectionResponseAmino { + const obj: any = {}; + if (message.liquidityDepths) { + obj.liquidity_depths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toAmino(e) : undefined); + } else { + obj.liquidity_depths = []; + } + obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; + obj.current_liquidity = message.currentLiquidity; + return obj; + }, + fromAminoMsg(object: QueryLiquidityNetInDirectionResponseAminoMsg): QueryLiquidityNetInDirectionResponse { + return QueryLiquidityNetInDirectionResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryLiquidityNetInDirectionResponse): QueryLiquidityNetInDirectionResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-liquidity-net-in-direction-response", + value: QueryLiquidityNetInDirectionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryLiquidityNetInDirectionResponseProtoMsg): QueryLiquidityNetInDirectionResponse { + return QueryLiquidityNetInDirectionResponse.decode(message.value); + }, + toProto(message: QueryLiquidityNetInDirectionResponse): Uint8Array { + return QueryLiquidityNetInDirectionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidityNetInDirectionResponse): QueryLiquidityNetInDirectionResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionResponse", + value: QueryLiquidityNetInDirectionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTotalLiquidityForRangeRequest(): QueryTotalLiquidityForRangeRequest { + return { + poolId: BigInt(0) + }; +} +export const QueryTotalLiquidityForRangeRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeRequest", + encode(message: QueryTotalLiquidityForRangeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalLiquidityForRangeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalLiquidityForRangeRequest(); + 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): QueryTotalLiquidityForRangeRequest { + const message = createBaseQueryTotalLiquidityForRangeRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTotalLiquidityForRangeRequestAmino): QueryTotalLiquidityForRangeRequest { + return { + poolId: BigInt(object.pool_id) + }; + }, + toAmino(message: QueryTotalLiquidityForRangeRequest): QueryTotalLiquidityForRangeRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalLiquidityForRangeRequestAminoMsg): QueryTotalLiquidityForRangeRequest { + return QueryTotalLiquidityForRangeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalLiquidityForRangeRequest): QueryTotalLiquidityForRangeRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-total-liquidity-for-range-request", + value: QueryTotalLiquidityForRangeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalLiquidityForRangeRequestProtoMsg): QueryTotalLiquidityForRangeRequest { + return QueryTotalLiquidityForRangeRequest.decode(message.value); + }, + toProto(message: QueryTotalLiquidityForRangeRequest): Uint8Array { + return QueryTotalLiquidityForRangeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalLiquidityForRangeRequest): QueryTotalLiquidityForRangeRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeRequest", + value: QueryTotalLiquidityForRangeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTotalLiquidityForRangeResponse(): QueryTotalLiquidityForRangeResponse { + return { + liquidity: [] + }; +} +export const QueryTotalLiquidityForRangeResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeResponse", + encode(message: QueryTotalLiquidityForRangeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidity) { + LiquidityDepthWithRange.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalLiquidityForRangeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalLiquidityForRangeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidity.push(LiquidityDepthWithRange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalLiquidityForRangeResponse { + const message = createBaseQueryTotalLiquidityForRangeResponse(); + message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTotalLiquidityForRangeResponseAmino): QueryTotalLiquidityForRangeResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => LiquidityDepthWithRange.fromAmino(e)) : [] + }; + }, + toAmino(message: QueryTotalLiquidityForRangeResponse): QueryTotalLiquidityForRangeResponseAmino { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? LiquidityDepthWithRange.toAmino(e) : undefined); + } else { + obj.liquidity = []; + } + return obj; + }, + fromAminoMsg(object: QueryTotalLiquidityForRangeResponseAminoMsg): QueryTotalLiquidityForRangeResponse { + return QueryTotalLiquidityForRangeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalLiquidityForRangeResponse): QueryTotalLiquidityForRangeResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-total-liquidity-for-range-response", + value: QueryTotalLiquidityForRangeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalLiquidityForRangeResponseProtoMsg): QueryTotalLiquidityForRangeResponse { + return QueryTotalLiquidityForRangeResponse.decode(message.value); + }, + toProto(message: QueryTotalLiquidityForRangeResponse): Uint8Array { + return QueryTotalLiquidityForRangeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalLiquidityForRangeResponse): QueryTotalLiquidityForRangeResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeResponse", + value: QueryTotalLiquidityForRangeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClaimableFeesRequest(): QueryClaimableFeesRequest { + return { + positionId: BigInt(0) + }; +} +export const QueryClaimableFeesRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesRequest", + encode(message: QueryClaimableFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.positionId !== BigInt(0)) { + writer.uint32(8).uint64(message.positionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClaimableFeesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClaimableFeesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positionId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClaimableFeesRequest { + const message = createBaseQueryClaimableFeesRequest(); + message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryClaimableFeesRequestAmino): QueryClaimableFeesRequest { + return { + positionId: BigInt(object.position_id) + }; + }, + toAmino(message: QueryClaimableFeesRequest): QueryClaimableFeesRequestAmino { + const obj: any = {}; + obj.position_id = message.positionId ? message.positionId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryClaimableFeesRequestAminoMsg): QueryClaimableFeesRequest { + return QueryClaimableFeesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClaimableFeesRequest): QueryClaimableFeesRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-claimable-fees-request", + value: QueryClaimableFeesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClaimableFeesRequestProtoMsg): QueryClaimableFeesRequest { + return QueryClaimableFeesRequest.decode(message.value); + }, + toProto(message: QueryClaimableFeesRequest): Uint8Array { + return QueryClaimableFeesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClaimableFeesRequest): QueryClaimableFeesRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesRequest", + value: QueryClaimableFeesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClaimableFeesResponse(): QueryClaimableFeesResponse { + return { + claimableFees: [] + }; +} +export const QueryClaimableFeesResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesResponse", + encode(message: QueryClaimableFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.claimableFees) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClaimableFeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClaimableFeesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.claimableFees.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClaimableFeesResponse { + const message = createBaseQueryClaimableFeesResponse(); + message.claimableFees = object.claimableFees?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryClaimableFeesResponseAmino): QueryClaimableFeesResponse { + return { + claimableFees: Array.isArray(object?.claimable_fees) ? object.claimable_fees.map((e: any) => Coin.fromAmino(e)) : [] + }; + }, + toAmino(message: QueryClaimableFeesResponse): QueryClaimableFeesResponseAmino { + const obj: any = {}; + if (message.claimableFees) { + obj.claimable_fees = message.claimableFees.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.claimable_fees = []; + } + return obj; + }, + fromAminoMsg(object: QueryClaimableFeesResponseAminoMsg): QueryClaimableFeesResponse { + return QueryClaimableFeesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClaimableFeesResponse): QueryClaimableFeesResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/query-claimable-fees-response", + value: QueryClaimableFeesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClaimableFeesResponseProtoMsg): QueryClaimableFeesResponse { + return QueryClaimableFeesResponse.decode(message.value); + }, + toProto(message: QueryClaimableFeesResponse): Uint8Array { + return QueryClaimableFeesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClaimableFeesResponse): QueryClaimableFeesResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesResponse", + value: QueryClaimableFeesResponse.encode(message).finish() + }; + } +}; +export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/osmosis.concentratedliquidity.v1beta1.Pool": + return Pool1.decode(data.value); + case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": + return CosmWasmPool.decode(data.value); + case "/osmosis.gamm.v1beta1.Pool": + return Pool2.decode(data.value); + case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": + return Pool3.decode(data.value); + default: + return data; + } +}; +export const PoolI_FromAmino = (content: AnyAmino) => { + switch (content.type) { + case "osmosis/concentratedliquidity/pool": + return Any.fromPartial({ + typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", + value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() + }); + case "osmosis/cosmwasmpool/cosm-wasm-pool": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", + value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() + }); + case "osmosis/gamm/BalancerPool": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.Pool", + value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() + }); + case "osmosis/gamm/StableswapPool": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const PoolI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/osmosis.concentratedliquidity.v1beta1.Pool": + return { + type: "osmosis/concentratedliquidity/pool", + value: Pool1.toAmino(Pool1.decode(content.value)) + }; + case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": + return { + type: "osmosis/cosmwasmpool/cosm-wasm-pool", + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool2.toAmino(Pool2.decode(content.value)) + }; + case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": + return { + type: "osmosis/gamm/StableswapPool", + value: Pool3.toAmino(Pool3.decode(content.value)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/tx.ts similarity index 80% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts rename to packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/tx.ts index 772fa37c5..2dda1db2d 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/tx.ts @@ -1,4 +1,4 @@ -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; /** ===================== MsgCreateConcentratedPool */ export interface MsgCreateConcentratedPool { @@ -6,10 +6,11 @@ export interface MsgCreateConcentratedPool { denom0: string; denom1: string; tickSpacing: bigint; - spreadFactor: string; + exponentAtPriceOne: string; + swapFee: string; } export interface MsgCreateConcentratedPoolProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool"; + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPool"; value: Uint8Array; } /** ===================== MsgCreateConcentratedPool */ @@ -18,10 +19,11 @@ export interface MsgCreateConcentratedPoolAmino { denom0: string; denom1: string; tick_spacing: string; - spread_factor: string; + exponent_at_price_one: string; + swap_fee: string; } export interface MsgCreateConcentratedPoolAminoMsg { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool"; + type: "osmosis/concentratedliquidity/create-concentrated-pool"; value: MsgCreateConcentratedPoolAmino; } /** ===================== MsgCreateConcentratedPool */ @@ -30,14 +32,15 @@ export interface MsgCreateConcentratedPoolSDKType { denom0: string; denom1: string; tick_spacing: bigint; - spread_factor: string; + exponent_at_price_one: string; + swap_fee: 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"; + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPoolResponse"; value: Uint8Array; } /** Returns a unique poolID to identify the pool with. */ @@ -45,7 +48,7 @@ export interface MsgCreateConcentratedPoolResponseAmino { pool_id: string; } export interface MsgCreateConcentratedPoolResponseAminoMsg { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response"; + type: "osmosis/concentratedliquidity/create-concentrated-pool-response"; value: MsgCreateConcentratedPoolResponseAmino; } /** Returns a unique poolID to identify the pool with. */ @@ -58,11 +61,12 @@ function createBaseMsgCreateConcentratedPool(): MsgCreateConcentratedPool { denom0: "", denom1: "", tickSpacing: BigInt(0), - spreadFactor: "" + exponentAtPriceOne: "", + swapFee: "" }; } export const MsgCreateConcentratedPool = { - typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPool", encode(message: MsgCreateConcentratedPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -76,8 +80,11 @@ export const MsgCreateConcentratedPool = { if (message.tickSpacing !== BigInt(0)) { writer.uint32(32).uint64(message.tickSpacing); } - if (message.spreadFactor !== "") { - writer.uint32(42).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); + if (message.exponentAtPriceOne !== "") { + writer.uint32(42).string(message.exponentAtPriceOne); + } + if (message.swapFee !== "") { + writer.uint32(74).string(Decimal.fromUserInput(message.swapFee, 18).atomics); } return writer; }, @@ -101,7 +108,10 @@ export const MsgCreateConcentratedPool = { message.tickSpacing = reader.uint64(); break; case 5: - message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + message.exponentAtPriceOne = reader.string(); + break; + case 9: + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -116,7 +126,8 @@ export const MsgCreateConcentratedPool = { 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 ?? ""; + message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; + message.swapFee = object.swapFee ?? ""; return message; }, fromAmino(object: MsgCreateConcentratedPoolAmino): MsgCreateConcentratedPool { @@ -125,7 +136,8 @@ export const MsgCreateConcentratedPool = { denom0: object.denom0, denom1: object.denom1, tickSpacing: BigInt(object.tick_spacing), - spreadFactor: object.spread_factor + exponentAtPriceOne: object.exponent_at_price_one, + swapFee: object.swap_fee }; }, toAmino(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolAmino { @@ -134,7 +146,8 @@ export const MsgCreateConcentratedPool = { obj.denom0 = message.denom0; obj.denom1 = message.denom1; obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; - obj.spread_factor = message.spreadFactor; + obj.exponent_at_price_one = message.exponentAtPriceOne; + obj.swap_fee = message.swapFee; return obj; }, fromAminoMsg(object: MsgCreateConcentratedPoolAminoMsg): MsgCreateConcentratedPool { @@ -142,7 +155,7 @@ export const MsgCreateConcentratedPool = { }, toAminoMsg(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolAminoMsg { return { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool", + type: "osmosis/concentratedliquidity/create-concentrated-pool", value: MsgCreateConcentratedPool.toAmino(message) }; }, @@ -154,7 +167,7 @@ export const MsgCreateConcentratedPool = { }, toProtoMsg(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolProtoMsg { return { - typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPool", value: MsgCreateConcentratedPool.encode(message).finish() }; } @@ -165,7 +178,7 @@ function createBaseMsgCreateConcentratedPoolResponse(): MsgCreateConcentratedPoo }; } export const MsgCreateConcentratedPoolResponse = { - typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPoolResponse", encode(message: MsgCreateConcentratedPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -209,7 +222,7 @@ export const MsgCreateConcentratedPoolResponse = { }, toAminoMsg(message: MsgCreateConcentratedPoolResponse): MsgCreateConcentratedPoolResponseAminoMsg { return { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response", + type: "osmosis/concentratedliquidity/create-concentrated-pool-response", value: MsgCreateConcentratedPoolResponse.toAmino(message) }; }, @@ -221,7 +234,7 @@ export const MsgCreateConcentratedPoolResponse = { }, toProtoMsg(message: MsgCreateConcentratedPoolResponse): MsgCreateConcentratedPoolResponseProtoMsg { return { - typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateConcentratedPoolResponse", value: MsgCreateConcentratedPoolResponse.encode(message).finish() }; } diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts index 9aa8f4924..650d7daff 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts @@ -8,23 +8,21 @@ export interface Pool { address: string; /** address holding the incentives liquidity. */ incentivesAddress: string; - /** address holding spread rewards from swaps. */ - spreadRewardsAddress: string; id: bigint; /** Amount of total liquidity */ currentTickLiquidity: string; token0: string; token1: string; currentSqrtPrice: string; - currentTick: bigint; + currentTick: string; /** * tick_spacing must be one of the authorized_tick_spacing values set in the * concentrated-liquidity parameters */ tickSpacing: bigint; - exponentAtPriceOne: bigint; - /** spread_factor is the ratio that is charged on the amount of token in. */ - spreadFactor: string; + exponentAtPriceOne: string; + /** swap_fee is the ratio that is charged on the amount of token in. */ + swapFee: string; /** * last_liquidity_update is the last time either the pool liquidity or the * active tick changed @@ -40,8 +38,6 @@ export interface PoolAmino { address: string; /** address holding the incentives liquidity. */ incentives_address: string; - /** address holding spread rewards from swaps. */ - spread_rewards_address: string; id: string; /** Amount of total liquidity */ current_tick_liquidity: string; @@ -55,8 +51,8 @@ export interface PoolAmino { */ tick_spacing: string; exponent_at_price_one: string; - /** spread_factor is the ratio that is charged on the amount of token in. */ - spread_factor: string; + /** swap_fee is the ratio that is charged on the amount of token in. */ + swap_fee: string; /** * last_liquidity_update is the last time either the pool liquidity or the * active tick changed @@ -71,16 +67,15 @@ export interface PoolSDKType { $typeUrl?: string; address: string; incentives_address: string; - spread_rewards_address: string; id: bigint; current_tick_liquidity: string; token0: string; token1: string; current_sqrt_price: string; - current_tick: bigint; + current_tick: string; tick_spacing: bigint; - exponent_at_price_one: bigint; - spread_factor: string; + exponent_at_price_one: string; + swap_fee: string; last_liquidity_update: Date; } function createBasePool(): Pool { @@ -88,17 +83,16 @@ function createBasePool(): Pool { $typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", address: "", incentivesAddress: "", - spreadRewardsAddress: "", id: BigInt(0), currentTickLiquidity: "", token0: "", token1: "", currentSqrtPrice: "", - currentTick: BigInt(0), + currentTick: "", tickSpacing: BigInt(0), - exponentAtPriceOne: BigInt(0), - spreadFactor: "", - lastLiquidityUpdate: undefined + exponentAtPriceOne: "", + swapFee: "", + lastLiquidityUpdate: new Date() }; } export const Pool = { @@ -110,38 +104,35 @@ export const Pool = { if (message.incentivesAddress !== "") { writer.uint32(18).string(message.incentivesAddress); } - if (message.spreadRewardsAddress !== "") { - writer.uint32(26).string(message.spreadRewardsAddress); - } if (message.id !== BigInt(0)) { - writer.uint32(32).uint64(message.id); + writer.uint32(24).uint64(message.id); } if (message.currentTickLiquidity !== "") { - writer.uint32(42).string(Decimal.fromUserInput(message.currentTickLiquidity, 18).atomics); + writer.uint32(34).string(Decimal.fromUserInput(message.currentTickLiquidity, 18).atomics); } if (message.token0 !== "") { - writer.uint32(50).string(message.token0); + writer.uint32(42).string(message.token0); } if (message.token1 !== "") { - writer.uint32(58).string(message.token1); + writer.uint32(50).string(message.token1); } if (message.currentSqrtPrice !== "") { - writer.uint32(66).string(message.currentSqrtPrice); + writer.uint32(58).string(Decimal.fromUserInput(message.currentSqrtPrice, 18).atomics); } - if (message.currentTick !== BigInt(0)) { - writer.uint32(72).int64(message.currentTick); + if (message.currentTick !== "") { + writer.uint32(66).string(message.currentTick); } if (message.tickSpacing !== BigInt(0)) { - writer.uint32(80).uint64(message.tickSpacing); + writer.uint32(72).uint64(message.tickSpacing); } - if (message.exponentAtPriceOne !== BigInt(0)) { - writer.uint32(88).int64(message.exponentAtPriceOne); + if (message.exponentAtPriceOne !== "") { + writer.uint32(82).string(message.exponentAtPriceOne); } - if (message.spreadFactor !== "") { - writer.uint32(98).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); + if (message.swapFee !== "") { + writer.uint32(90).string(Decimal.fromUserInput(message.swapFee, 18).atomics); } if (message.lastLiquidityUpdate !== undefined) { - Timestamp.encode(toTimestamp(message.lastLiquidityUpdate), writer.uint32(106).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.lastLiquidityUpdate), writer.uint32(98).fork()).ldelim(); } return writer; }, @@ -159,36 +150,33 @@ export const Pool = { message.incentivesAddress = reader.string(); break; case 3: - message.spreadRewardsAddress = reader.string(); + message.id = reader.uint64(); break; case 4: - message.id = reader.uint64(); + message.currentTickLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 5: - message.currentTickLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); + message.token0 = reader.string(); break; case 6: - message.token0 = reader.string(); + message.token1 = reader.string(); break; case 7: - message.token1 = reader.string(); + message.currentSqrtPrice = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 8: - message.currentSqrtPrice = reader.string(); + message.currentTick = reader.string(); break; case 9: - message.currentTick = reader.int64(); + message.tickSpacing = reader.uint64(); break; case 10: - message.tickSpacing = reader.uint64(); + message.exponentAtPriceOne = reader.string(); break; case 11: - message.exponentAtPriceOne = reader.int64(); + message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 12: - message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - case 13: message.lastLiquidityUpdate = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; default: @@ -202,16 +190,15 @@ export const Pool = { const message = createBasePool(); message.address = object.address ?? ""; message.incentivesAddress = object.incentivesAddress ?? ""; - message.spreadRewardsAddress = object.spreadRewardsAddress ?? ""; message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); message.currentTickLiquidity = object.currentTickLiquidity ?? ""; message.token0 = object.token0 ?? ""; message.token1 = object.token1 ?? ""; message.currentSqrtPrice = object.currentSqrtPrice ?? ""; - message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); + message.currentTick = object.currentTick ?? ""; message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); - message.exponentAtPriceOne = object.exponentAtPriceOne !== undefined && object.exponentAtPriceOne !== null ? BigInt(object.exponentAtPriceOne.toString()) : BigInt(0); - message.spreadFactor = object.spreadFactor ?? ""; + message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; + message.swapFee = object.swapFee ?? ""; message.lastLiquidityUpdate = object.lastLiquidityUpdate ?? undefined; return message; }, @@ -219,16 +206,15 @@ export const Pool = { return { address: object.address, incentivesAddress: object.incentives_address, - spreadRewardsAddress: object.spread_rewards_address, id: BigInt(object.id), currentTickLiquidity: object.current_tick_liquidity, token0: object.token0, token1: object.token1, currentSqrtPrice: object.current_sqrt_price, - currentTick: BigInt(object.current_tick), + currentTick: object.current_tick, tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: BigInt(object.exponent_at_price_one), - spreadFactor: object.spread_factor, + exponentAtPriceOne: object.exponent_at_price_one, + swapFee: object.swap_fee, lastLiquidityUpdate: object.last_liquidity_update }; }, @@ -236,16 +222,15 @@ export const Pool = { const obj: any = {}; obj.address = message.address; obj.incentives_address = message.incentivesAddress; - obj.spread_rewards_address = message.spreadRewardsAddress; obj.id = message.id ? message.id.toString() : undefined; obj.current_tick_liquidity = message.currentTickLiquidity; obj.token0 = message.token0; obj.token1 = message.token1; obj.current_sqrt_price = message.currentSqrtPrice; - obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; + obj.current_tick = message.currentTick; obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; - obj.exponent_at_price_one = message.exponentAtPriceOne ? message.exponentAtPriceOne.toString() : undefined; - obj.spread_factor = message.spreadFactor; + obj.exponent_at_price_one = message.exponentAtPriceOne; + obj.swap_fee = message.swapFee; obj.last_liquidity_update = message.lastLiquidityUpdate; return obj; }, diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts index f5207ecfc..c5d062056 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts @@ -1,6 +1,5 @@ import { Timestamp } from "../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "../lockup/lock"; import { BinaryReader, BinaryWriter } from "../../binary"; import { toTimestamp, fromTimestamp } from "../../helpers"; import { Decimal } from "@cosmjs/math"; @@ -51,84 +50,28 @@ export interface PositionSDKType { join_time: Date; liquidity: string; } -/** - * FullPositionBreakdown returns: - * - the position itself - * - the amount the position translates in terms of asset0 and asset1 - * - the amount of claimable fees - * - the amount of claimable incentives - * - the amount of incentives that would be forfeited if the position was closed - * now - */ -export interface FullPositionBreakdown { +export interface PositionWithUnderlyingAssetBreakdown { position: Position; asset0: Coin; asset1: Coin; - claimableSpreadRewards: Coin[]; - claimableIncentives: Coin[]; - forfeitedIncentives: Coin[]; } -export interface FullPositionBreakdownProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.FullPositionBreakdown"; +export interface PositionWithUnderlyingAssetBreakdownProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithUnderlyingAssetBreakdown"; value: Uint8Array; } -/** - * FullPositionBreakdown returns: - * - the position itself - * - the amount the position translates in terms of asset0 and asset1 - * - the amount of claimable fees - * - the amount of claimable incentives - * - the amount of incentives that would be forfeited if the position was closed - * now - */ -export interface FullPositionBreakdownAmino { +export interface PositionWithUnderlyingAssetBreakdownAmino { position?: PositionAmino; asset0?: CoinAmino; asset1?: CoinAmino; - claimable_spread_rewards: CoinAmino[]; - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; } -export interface FullPositionBreakdownAminoMsg { - type: "osmosis/concentratedliquidity/full-position-breakdown"; - value: FullPositionBreakdownAmino; +export interface PositionWithUnderlyingAssetBreakdownAminoMsg { + type: "osmosis/concentratedliquidity/position-with-underlying-asset-breakdown"; + value: PositionWithUnderlyingAssetBreakdownAmino; } -/** - * FullPositionBreakdown returns: - * - the position itself - * - the amount the position translates in terms of asset0 and asset1 - * - the amount of claimable fees - * - the amount of claimable incentives - * - the amount of incentives that would be forfeited if the position was closed - * now - */ -export interface FullPositionBreakdownSDKType { +export interface PositionWithUnderlyingAssetBreakdownSDKType { position: PositionSDKType; asset0: CoinSDKType; asset1: CoinSDKType; - claimable_spread_rewards: CoinSDKType[]; - claimable_incentives: CoinSDKType[]; - forfeited_incentives: CoinSDKType[]; -} -export interface PositionWithPeriodLock { - position: Position; - locks: PeriodLock; -} -export interface PositionWithPeriodLockProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithPeriodLock"; - value: Uint8Array; -} -export interface PositionWithPeriodLockAmino { - position?: PositionAmino; - locks?: PeriodLockAmino; -} -export interface PositionWithPeriodLockAminoMsg { - type: "osmosis/concentratedliquidity/position-with-period-lock"; - value: PositionWithPeriodLockAmino; -} -export interface PositionWithPeriodLockSDKType { - position: PositionSDKType; - locks: PeriodLockSDKType; } function createBasePosition(): Position { return { @@ -137,7 +80,7 @@ function createBasePosition(): Position { poolId: BigInt(0), lowerTick: BigInt(0), upperTick: BigInt(0), - joinTime: undefined, + joinTime: new Date(), liquidity: "" }; } @@ -257,19 +200,16 @@ export const Position = { }; } }; -function createBaseFullPositionBreakdown(): FullPositionBreakdown { +function createBasePositionWithUnderlyingAssetBreakdown(): PositionWithUnderlyingAssetBreakdown { return { position: Position.fromPartial({}), - asset0: undefined, - asset1: undefined, - claimableSpreadRewards: [], - claimableIncentives: [], - forfeitedIncentives: [] + asset0: Coin.fromPartial({}), + asset1: Coin.fromPartial({}) }; } -export const FullPositionBreakdown = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.FullPositionBreakdown", - encode(message: FullPositionBreakdown, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const PositionWithUnderlyingAssetBreakdown = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithUnderlyingAssetBreakdown", + encode(message: PositionWithUnderlyingAssetBreakdown, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.position !== undefined) { Position.encode(message.position, writer.uint32(10).fork()).ldelim(); } @@ -279,21 +219,12 @@ export const FullPositionBreakdown = { if (message.asset1 !== undefined) { Coin.encode(message.asset1, writer.uint32(26).fork()).ldelim(); } - for (const v of message.claimableSpreadRewards) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.claimableIncentives) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.forfeitedIncentives) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): FullPositionBreakdown { + decode(input: BinaryReader | Uint8Array, length?: number): PositionWithUnderlyingAssetBreakdown { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFullPositionBreakdown(); + const message = createBasePositionWithUnderlyingAssetBreakdown(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -306,15 +237,6 @@ export const FullPositionBreakdown = { case 3: message.asset1 = Coin.decode(reader, reader.uint32()); break; - case 4: - message.claimableSpreadRewards.push(Coin.decode(reader, reader.uint32())); - break; - case 5: - message.claimableIncentives.push(Coin.decode(reader, reader.uint32())); - break; - case 6: - message.forfeitedIncentives.push(Coin.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -322,144 +244,46 @@ export const FullPositionBreakdown = { } return message; }, - fromPartial(object: Partial): FullPositionBreakdown { - const message = createBaseFullPositionBreakdown(); + fromPartial(object: Partial): PositionWithUnderlyingAssetBreakdown { + const message = createBasePositionWithUnderlyingAssetBreakdown(); message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; message.asset0 = object.asset0 !== undefined && object.asset0 !== null ? Coin.fromPartial(object.asset0) : undefined; message.asset1 = object.asset1 !== undefined && object.asset1 !== null ? Coin.fromPartial(object.asset1) : undefined; - message.claimableSpreadRewards = object.claimableSpreadRewards?.map(e => Coin.fromPartial(e)) || []; - message.claimableIncentives = object.claimableIncentives?.map(e => Coin.fromPartial(e)) || []; - message.forfeitedIncentives = object.forfeitedIncentives?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: FullPositionBreakdownAmino): FullPositionBreakdown { + fromAmino(object: PositionWithUnderlyingAssetBreakdownAmino): PositionWithUnderlyingAssetBreakdown { return { position: object?.position ? Position.fromAmino(object.position) : undefined, asset0: object?.asset0 ? Coin.fromAmino(object.asset0) : undefined, - asset1: object?.asset1 ? Coin.fromAmino(object.asset1) : undefined, - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [], - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] + asset1: object?.asset1 ? Coin.fromAmino(object.asset1) : undefined }; }, - toAmino(message: FullPositionBreakdown): FullPositionBreakdownAmino { + toAmino(message: PositionWithUnderlyingAssetBreakdown): PositionWithUnderlyingAssetBreakdownAmino { const obj: any = {}; obj.position = message.position ? Position.toAmino(message.position) : undefined; obj.asset0 = message.asset0 ? Coin.toAmino(message.asset0) : undefined; obj.asset1 = message.asset1 ? Coin.toAmino(message.asset1) : undefined; - if (message.claimableSpreadRewards) { - obj.claimable_spread_rewards = message.claimableSpreadRewards.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.claimable_spread_rewards = []; - } - if (message.claimableIncentives) { - obj.claimable_incentives = message.claimableIncentives.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.claimable_incentives = []; - } - if (message.forfeitedIncentives) { - obj.forfeited_incentives = message.forfeitedIncentives.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.forfeited_incentives = []; - } - return obj; - }, - fromAminoMsg(object: FullPositionBreakdownAminoMsg): FullPositionBreakdown { - return FullPositionBreakdown.fromAmino(object.value); - }, - toAminoMsg(message: FullPositionBreakdown): FullPositionBreakdownAminoMsg { - return { - type: "osmosis/concentratedliquidity/full-position-breakdown", - value: FullPositionBreakdown.toAmino(message) - }; - }, - fromProtoMsg(message: FullPositionBreakdownProtoMsg): FullPositionBreakdown { - return FullPositionBreakdown.decode(message.value); - }, - toProto(message: FullPositionBreakdown): Uint8Array { - return FullPositionBreakdown.encode(message).finish(); - }, - toProtoMsg(message: FullPositionBreakdown): FullPositionBreakdownProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.FullPositionBreakdown", - value: FullPositionBreakdown.encode(message).finish() - }; - } -}; -function createBasePositionWithPeriodLock(): PositionWithPeriodLock { - return { - position: Position.fromPartial({}), - locks: PeriodLock.fromPartial({}) - }; -} -export const PositionWithPeriodLock = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithPeriodLock", - encode(message: PositionWithPeriodLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.position !== undefined) { - Position.encode(message.position, writer.uint32(10).fork()).ldelim(); - } - if (message.locks !== undefined) { - PeriodLock.encode(message.locks, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PositionWithPeriodLock { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionWithPeriodLock(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.position = Position.decode(reader, reader.uint32()); - break; - case 2: - message.locks = PeriodLock.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PositionWithPeriodLock { - const message = createBasePositionWithPeriodLock(); - message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; - message.locks = object.locks !== undefined && object.locks !== null ? PeriodLock.fromPartial(object.locks) : undefined; - return message; - }, - fromAmino(object: PositionWithPeriodLockAmino): PositionWithPeriodLock { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - locks: object?.locks ? PeriodLock.fromAmino(object.locks) : undefined - }; - }, - toAmino(message: PositionWithPeriodLock): PositionWithPeriodLockAmino { - const obj: any = {}; - obj.position = message.position ? Position.toAmino(message.position) : undefined; - obj.locks = message.locks ? PeriodLock.toAmino(message.locks) : undefined; return obj; }, - fromAminoMsg(object: PositionWithPeriodLockAminoMsg): PositionWithPeriodLock { - return PositionWithPeriodLock.fromAmino(object.value); + fromAminoMsg(object: PositionWithUnderlyingAssetBreakdownAminoMsg): PositionWithUnderlyingAssetBreakdown { + return PositionWithUnderlyingAssetBreakdown.fromAmino(object.value); }, - toAminoMsg(message: PositionWithPeriodLock): PositionWithPeriodLockAminoMsg { + toAminoMsg(message: PositionWithUnderlyingAssetBreakdown): PositionWithUnderlyingAssetBreakdownAminoMsg { return { - type: "osmosis/concentratedliquidity/position-with-period-lock", - value: PositionWithPeriodLock.toAmino(message) + type: "osmosis/concentratedliquidity/position-with-underlying-asset-breakdown", + value: PositionWithUnderlyingAssetBreakdown.toAmino(message) }; }, - fromProtoMsg(message: PositionWithPeriodLockProtoMsg): PositionWithPeriodLock { - return PositionWithPeriodLock.decode(message.value); + fromProtoMsg(message: PositionWithUnderlyingAssetBreakdownProtoMsg): PositionWithUnderlyingAssetBreakdown { + return PositionWithUnderlyingAssetBreakdown.decode(message.value); }, - toProto(message: PositionWithPeriodLock): Uint8Array { - return PositionWithPeriodLock.encode(message).finish(); + toProto(message: PositionWithUnderlyingAssetBreakdown): Uint8Array { + return PositionWithUnderlyingAssetBreakdown.encode(message).finish(); }, - toProtoMsg(message: PositionWithPeriodLock): PositionWithPeriodLockProtoMsg { + toProtoMsg(message: PositionWithUnderlyingAssetBreakdown): PositionWithUnderlyingAssetBreakdownProtoMsg { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithPeriodLock", - value: PositionWithPeriodLock.encode(message).finish() + typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithUnderlyingAssetBreakdown", + value: PositionWithUnderlyingAssetBreakdown.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts deleted file mode 100644 index 327955ea6..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { setPaginationParams } from "../../helpers"; -import { LCDClient } from "@cosmology/lcd"; -import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, UserPositionsRequest, UserPositionsResponseSDKType, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponseSDKType, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponseSDKType, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponseSDKType, ClaimableIncentivesRequest, ClaimableIncentivesResponseSDKType, PositionByIdRequest, PositionByIdResponseSDKType, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponseSDKType, IncentiveRecordsRequest, IncentiveRecordsResponseSDKType, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponseSDKType, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType, UserUnbondingPositionsRequest, UserUnbondingPositionsResponseSDKType, GetTotalLiquidityRequest, GetTotalLiquidityResponseSDKType } from "./query"; -export class LCDQueryClient { - req: LCDClient; - constructor({ - requestClient - }: { - requestClient: LCDClient; - }) { - this.req = requestClient; - this.pools = this.pools.bind(this); - this.params = this.params.bind(this); - this.userPositions = this.userPositions.bind(this); - this.liquidityPerTickRange = this.liquidityPerTickRange.bind(this); - this.liquidityNetInDirection = this.liquidityNetInDirection.bind(this); - this.claimableSpreadRewards = this.claimableSpreadRewards.bind(this); - this.claimableIncentives = this.claimableIncentives.bind(this); - this.positionById = this.positionById.bind(this); - this.poolAccumulatorRewards = this.poolAccumulatorRewards.bind(this); - this.incentiveRecords = this.incentiveRecords.bind(this); - this.tickAccumulatorTrackers = this.tickAccumulatorTrackers.bind(this); - this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); - this.userUnbondingPositions = this.userUnbondingPositions.bind(this); - this.getTotalLiquidity = this.getTotalLiquidity.bind(this); - } - /* Pools returns all concentrated liquidity pools */ - async pools(params: PoolsRequest = { - pagination: undefined - }): Promise { - const options: any = { - params: {} - }; - if (typeof params?.pagination !== "undefined") { - setPaginationParams(options, params.pagination); - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/pools`; - return await this.req.get(endpoint, options); - } - /* Params returns concentrated liquidity module params. */ - async params(_params: ParamsRequest = {}): Promise { - const endpoint = `osmosis/concentratedliquidity/v1beta1/params`; - return await this.req.get(endpoint); - } - /* UserPositions returns all concentrated postitions of some address. */ - async userPositions(params: UserPositionsRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - if (typeof params?.pagination !== "undefined") { - setPaginationParams(options, params.pagination); - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/positions/${params.address}`; - return await this.req.get(endpoint, options); - } - /* LiquidityPerTickRange returns the amount of liquidity per every tick range - existing within the given pool */ - async liquidityPerTickRange(params: LiquidityPerTickRangeRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/liquidity_per_tick_range`; - return await this.req.get(endpoint, options); - } - /* LiquidityNetInDirection returns liquidity net in the direction given. - Uses the bound if specified, if not uses either min tick / max tick - depending on the direction. */ - async liquidityNetInDirection(params: LiquidityNetInDirectionRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - if (typeof params?.tokenIn !== "undefined") { - options.params.token_in = params.tokenIn; - } - if (typeof params?.startTick !== "undefined") { - options.params.start_tick = params.startTick; - } - if (typeof params?.useCurTick !== "undefined") { - options.params.use_cur_tick = params.useCurTick; - } - if (typeof params?.boundTick !== "undefined") { - options.params.bound_tick = params.boundTick; - } - if (typeof params?.useNoBound !== "undefined") { - options.params.use_no_bound = params.useNoBound; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/liquidity_net_in_direction`; - return await this.req.get(endpoint, options); - } - /* ClaimableSpreadRewards returns the amount of spread rewards that can be - claimed by a position with the given id. */ - async claimableSpreadRewards(params: ClaimableSpreadRewardsRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.positionId !== "undefined") { - options.params.position_id = params.positionId; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/claimable_spread_rewards`; - return await this.req.get(endpoint, options); - } - /* ClaimableIncentives returns the amount of incentives that can be claimed - and how many would be forfeited by a position with the given id. */ - async claimableIncentives(params: ClaimableIncentivesRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.positionId !== "undefined") { - options.params.position_id = params.positionId; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/claimable_incentives`; - return await this.req.get(endpoint, options); - } - /* PositionById returns a position with the given id. */ - async positionById(params: PositionByIdRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.positionId !== "undefined") { - options.params.position_id = params.positionId; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/position_by_id`; - return await this.req.get(endpoint, options); - } - /* PoolAccumulatorRewards returns the pool-global accumulator rewards. - Contains spread factor rewards and uptime rewards. */ - async poolAccumulatorRewards(params: PoolAccumulatorRewardsRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/pool_accum_rewards`; - return await this.req.get(endpoint, options); - } - /* IncentiveRecords returns the incentive records for a given poolId */ - async incentiveRecords(params: IncentiveRecordsRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - if (typeof params?.pagination !== "undefined") { - setPaginationParams(options, params.pagination); - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/incentive_records`; - return await this.req.get(endpoint, options); - } - /* TickAccumulatorTrackers returns the tick accumulator trackers. - Contains spread factor and uptime accumulator trackers. */ - async tickAccumulatorTrackers(params: TickAccumulatorTrackersRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - if (typeof params?.tickIndex !== "undefined") { - options.params.tick_index = params.tickIndex; - } - const endpoint = `osmosis/concentratedliquidity/v1beta1/tick_accum_trackers`; - return await this.req.get(endpoint, options); - } - /* CFMMPoolIdLinkFromConcentratedPoolId returns the pool id of the CFMM - pool that is linked with the given concentrated pool. */ - async cFMMPoolIdLinkFromConcentratedPoolId(params: CFMMPoolIdLinkFromConcentratedPoolIdRequest): Promise { - const endpoint = `osmosis/concentratedliquidity/v1beta1/cfmm_pool_id_link_from_concentrated/${params.concentratedPoolId}`; - return await this.req.get(endpoint); - } - /* UserUnbondingPositions returns the position and lock info of unbonding - positions of the given address. */ - async userUnbondingPositions(params: UserUnbondingPositionsRequest): Promise { - const endpoint = `osmosis/concentratedliquidity/v1beta1/user_unbonding_positions/${params.address}`; - return await this.req.get(endpoint); - } - /* GetTotalLiquidity returns total liquidity across all cl pools. */ - async getTotalLiquidity(_params: GetTotalLiquidityRequest = {}): Promise { - const endpoint = `osmosis/concentratedliquidity/v1beta1/get_total_liquidity`; - return await this.req.get(endpoint); - } -} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts deleted file mode 100644 index f7e9e53c8..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; -import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, UserPositionsRequest, UserPositionsResponse, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponse, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponse, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponse, ClaimableIncentivesRequest, ClaimableIncentivesResponse, PositionByIdRequest, PositionByIdResponse, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponse, IncentiveRecordsRequest, IncentiveRecordsResponse, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponse, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponse, UserUnbondingPositionsRequest, UserUnbondingPositionsResponse, GetTotalLiquidityRequest, GetTotalLiquidityResponse } from "./query"; -export interface Query { - /** Pools returns all concentrated liquidity pools */ - pools(request?: PoolsRequest): Promise; - /** Params returns concentrated liquidity module params. */ - params(request?: ParamsRequest): Promise; - /** UserPositions returns all concentrated postitions of some address. */ - userPositions(request: UserPositionsRequest): Promise; - /** - * LiquidityPerTickRange returns the amount of liquidity per every tick range - * existing within the given pool - */ - liquidityPerTickRange(request: LiquidityPerTickRangeRequest): Promise; - /** - * LiquidityNetInDirection returns liquidity net in the direction given. - * Uses the bound if specified, if not uses either min tick / max tick - * depending on the direction. - */ - liquidityNetInDirection(request: LiquidityNetInDirectionRequest): Promise; - /** - * ClaimableSpreadRewards returns the amount of spread rewards that can be - * claimed by a position with the given id. - */ - claimableSpreadRewards(request: ClaimableSpreadRewardsRequest): Promise; - /** - * ClaimableIncentives returns the amount of incentives that can be claimed - * and how many would be forfeited by a position with the given id. - */ - claimableIncentives(request: ClaimableIncentivesRequest): Promise; - /** PositionById returns a position with the given id. */ - positionById(request: PositionByIdRequest): Promise; - /** - * PoolAccumulatorRewards returns the pool-global accumulator rewards. - * Contains spread factor rewards and uptime rewards. - */ - poolAccumulatorRewards(request: PoolAccumulatorRewardsRequest): Promise; - /** IncentiveRecords returns the incentive records for a given poolId */ - incentiveRecords(request: IncentiveRecordsRequest): Promise; - /** - * TickAccumulatorTrackers returns the tick accumulator trackers. - * Contains spread factor and uptime accumulator trackers. - */ - tickAccumulatorTrackers(request: TickAccumulatorTrackersRequest): Promise; - /** - * CFMMPoolIdLinkFromConcentratedPoolId returns the pool id of the CFMM - * pool that is linked with the given concentrated pool. - */ - cFMMPoolIdLinkFromConcentratedPoolId(request: CFMMPoolIdLinkFromConcentratedPoolIdRequest): Promise; - /** - * UserUnbondingPositions returns the position and lock info of unbonding - * positions of the given address. - */ - userUnbondingPositions(request: UserUnbondingPositionsRequest): Promise; - /** GetTotalLiquidity returns total liquidity across all cl pools. */ - getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.pools = this.pools.bind(this); - this.params = this.params.bind(this); - this.userPositions = this.userPositions.bind(this); - this.liquidityPerTickRange = this.liquidityPerTickRange.bind(this); - this.liquidityNetInDirection = this.liquidityNetInDirection.bind(this); - this.claimableSpreadRewards = this.claimableSpreadRewards.bind(this); - this.claimableIncentives = this.claimableIncentives.bind(this); - this.positionById = this.positionById.bind(this); - this.poolAccumulatorRewards = this.poolAccumulatorRewards.bind(this); - this.incentiveRecords = this.incentiveRecords.bind(this); - this.tickAccumulatorTrackers = this.tickAccumulatorTrackers.bind(this); - this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); - this.userUnbondingPositions = this.userUnbondingPositions.bind(this); - this.getTotalLiquidity = this.getTotalLiquidity.bind(this); - } - pools(request: PoolsRequest = { - pagination: undefined - }): Promise { - const data = PoolsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "Pools", data); - return promise.then(data => PoolsResponse.decode(new BinaryReader(data))); - } - params(request: ParamsRequest = {}): Promise { - const data = ParamsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "Params", data); - return promise.then(data => ParamsResponse.decode(new BinaryReader(data))); - } - userPositions(request: UserPositionsRequest): Promise { - const data = UserPositionsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "UserPositions", data); - return promise.then(data => UserPositionsResponse.decode(new BinaryReader(data))); - } - liquidityPerTickRange(request: LiquidityPerTickRangeRequest): Promise { - const data = LiquidityPerTickRangeRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "LiquidityPerTickRange", data); - return promise.then(data => LiquidityPerTickRangeResponse.decode(new BinaryReader(data))); - } - liquidityNetInDirection(request: LiquidityNetInDirectionRequest): Promise { - const data = LiquidityNetInDirectionRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "LiquidityNetInDirection", data); - return promise.then(data => LiquidityNetInDirectionResponse.decode(new BinaryReader(data))); - } - claimableSpreadRewards(request: ClaimableSpreadRewardsRequest): Promise { - const data = ClaimableSpreadRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "ClaimableSpreadRewards", data); - return promise.then(data => ClaimableSpreadRewardsResponse.decode(new BinaryReader(data))); - } - claimableIncentives(request: ClaimableIncentivesRequest): Promise { - const data = ClaimableIncentivesRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "ClaimableIncentives", data); - return promise.then(data => ClaimableIncentivesResponse.decode(new BinaryReader(data))); - } - positionById(request: PositionByIdRequest): Promise { - const data = PositionByIdRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "PositionById", data); - return promise.then(data => PositionByIdResponse.decode(new BinaryReader(data))); - } - poolAccumulatorRewards(request: PoolAccumulatorRewardsRequest): Promise { - const data = PoolAccumulatorRewardsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "PoolAccumulatorRewards", data); - return promise.then(data => PoolAccumulatorRewardsResponse.decode(new BinaryReader(data))); - } - incentiveRecords(request: IncentiveRecordsRequest): Promise { - const data = IncentiveRecordsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "IncentiveRecords", data); - return promise.then(data => IncentiveRecordsResponse.decode(new BinaryReader(data))); - } - tickAccumulatorTrackers(request: TickAccumulatorTrackersRequest): Promise { - const data = TickAccumulatorTrackersRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "TickAccumulatorTrackers", data); - return promise.then(data => TickAccumulatorTrackersResponse.decode(new BinaryReader(data))); - } - cFMMPoolIdLinkFromConcentratedPoolId(request: CFMMPoolIdLinkFromConcentratedPoolIdRequest): Promise { - const data = CFMMPoolIdLinkFromConcentratedPoolIdRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "CFMMPoolIdLinkFromConcentratedPoolId", data); - return promise.then(data => CFMMPoolIdLinkFromConcentratedPoolIdResponse.decode(new BinaryReader(data))); - } - userUnbondingPositions(request: UserUnbondingPositionsRequest): Promise { - const data = UserUnbondingPositionsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "UserUnbondingPositions", data); - return promise.then(data => UserUnbondingPositionsResponse.decode(new BinaryReader(data))); - } - getTotalLiquidity(request: GetTotalLiquidityRequest = {}): Promise { - const data = GetTotalLiquidityRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "GetTotalLiquidity", data); - return promise.then(data => GetTotalLiquidityResponse.decode(new BinaryReader(data))); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - pools(request?: PoolsRequest): Promise { - return queryService.pools(request); - }, - params(request?: ParamsRequest): Promise { - return queryService.params(request); - }, - userPositions(request: UserPositionsRequest): Promise { - return queryService.userPositions(request); - }, - liquidityPerTickRange(request: LiquidityPerTickRangeRequest): Promise { - return queryService.liquidityPerTickRange(request); - }, - liquidityNetInDirection(request: LiquidityNetInDirectionRequest): Promise { - return queryService.liquidityNetInDirection(request); - }, - claimableSpreadRewards(request: ClaimableSpreadRewardsRequest): Promise { - return queryService.claimableSpreadRewards(request); - }, - claimableIncentives(request: ClaimableIncentivesRequest): Promise { - return queryService.claimableIncentives(request); - }, - positionById(request: PositionByIdRequest): Promise { - return queryService.positionById(request); - }, - poolAccumulatorRewards(request: PoolAccumulatorRewardsRequest): Promise { - return queryService.poolAccumulatorRewards(request); - }, - incentiveRecords(request: IncentiveRecordsRequest): Promise { - return queryService.incentiveRecords(request); - }, - tickAccumulatorTrackers(request: TickAccumulatorTrackersRequest): Promise { - return queryService.tickAccumulatorTrackers(request); - }, - cFMMPoolIdLinkFromConcentratedPoolId(request: CFMMPoolIdLinkFromConcentratedPoolIdRequest): Promise { - return queryService.cFMMPoolIdLinkFromConcentratedPoolId(request); - }, - userUnbondingPositions(request: UserUnbondingPositionsRequest): Promise { - return queryService.userUnbondingPositions(request); - }, - getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise { - return queryService.getTotalLiquidity(request); - } - }; -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts deleted file mode 100644 index 690888652..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts +++ /dev/null @@ -1,2938 +0,0 @@ -import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; -import { FullPositionBreakdown, FullPositionBreakdownAmino, FullPositionBreakdownSDKType, PositionWithPeriodLock, PositionWithPeriodLockAmino, PositionWithPeriodLockSDKType } from "./position"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { UptimeTracker, UptimeTrackerAmino, UptimeTrackerSDKType } from "./tickInfo"; -import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; -import { Pool as Pool1 } from "./pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; -import { PoolSDKType as Pool1SDKType } from "./pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { Decimal } from "@cosmjs/math"; -/** =============================== UserPositions */ -export interface UserPositionsRequest { - address: string; - poolId: bigint; - pagination: PageRequest; -} -export interface UserPositionsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest"; - value: Uint8Array; -} -/** =============================== UserPositions */ -export interface UserPositionsRequestAmino { - address: string; - pool_id: string; - pagination?: PageRequestAmino; -} -export interface UserPositionsRequestAminoMsg { - type: "osmosis/concentratedliquidity/user-positions-request"; - value: UserPositionsRequestAmino; -} -/** =============================== UserPositions */ -export interface UserPositionsRequestSDKType { - address: string; - pool_id: bigint; - pagination: PageRequestSDKType; -} -export interface UserPositionsResponse { - positions: FullPositionBreakdown[]; - pagination: PageResponse; -} -export interface UserPositionsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse"; - value: Uint8Array; -} -export interface UserPositionsResponseAmino { - positions: FullPositionBreakdownAmino[]; - pagination?: PageResponseAmino; -} -export interface UserPositionsResponseAminoMsg { - type: "osmosis/concentratedliquidity/user-positions-response"; - value: UserPositionsResponseAmino; -} -export interface UserPositionsResponseSDKType { - positions: FullPositionBreakdownSDKType[]; - pagination: PageResponseSDKType; -} -/** =============================== PositionById */ -export interface PositionByIdRequest { - positionId: bigint; -} -export interface PositionByIdRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdRequest"; - value: Uint8Array; -} -/** =============================== PositionById */ -export interface PositionByIdRequestAmino { - position_id: string; -} -export interface PositionByIdRequestAminoMsg { - type: "osmosis/concentratedliquidity/position-by-id-request"; - value: PositionByIdRequestAmino; -} -/** =============================== PositionById */ -export interface PositionByIdRequestSDKType { - position_id: bigint; -} -export interface PositionByIdResponse { - position: FullPositionBreakdown; -} -export interface PositionByIdResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdResponse"; - value: Uint8Array; -} -export interface PositionByIdResponseAmino { - position?: FullPositionBreakdownAmino; -} -export interface PositionByIdResponseAminoMsg { - type: "osmosis/concentratedliquidity/position-by-id-response"; - value: PositionByIdResponseAmino; -} -export interface PositionByIdResponseSDKType { - position: FullPositionBreakdownSDKType; -} -/** =============================== Pools */ -export interface PoolsRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; -} -export interface PoolsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest"; - value: Uint8Array; -} -/** =============================== Pools */ -export interface PoolsRequestAmino { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface PoolsRequestAminoMsg { - type: "osmosis/concentratedliquidity/pools-request"; - value: PoolsRequestAmino; -} -/** =============================== Pools */ -export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; -} -export interface PoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse; -} -export interface PoolsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse"; - value: Uint8Array; -} -export type PoolsResponseEncoded = Omit & { - pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; -}; -export interface PoolsResponseAmino { - pools: AnyAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface PoolsResponseAminoMsg { - type: "osmosis/concentratedliquidity/pools-response"; - value: PoolsResponseAmino; -} -export interface PoolsResponseSDKType { - pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; -} -/** =============================== ModuleParams */ -export interface ParamsRequest {} -export interface ParamsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsRequest"; - value: Uint8Array; -} -/** =============================== ModuleParams */ -export interface ParamsRequestAmino {} -export interface ParamsRequestAminoMsg { - type: "osmosis/concentratedliquidity/params-request"; - value: ParamsRequestAmino; -} -/** =============================== ModuleParams */ -export interface ParamsRequestSDKType {} -export interface ParamsResponse { - params: Params; -} -export interface ParamsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsResponse"; - value: Uint8Array; -} -export interface ParamsResponseAmino { - params?: ParamsAmino; -} -export interface ParamsResponseAminoMsg { - type: "osmosis/concentratedliquidity/params-response"; - value: ParamsResponseAmino; -} -export interface ParamsResponseSDKType { - params: ParamsSDKType; -} -export interface TickLiquidityNet { - liquidityNet: string; - tickIndex: bigint; -} -export interface TickLiquidityNetProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet"; - value: Uint8Array; -} -export interface TickLiquidityNetAmino { - liquidity_net: string; - tick_index: string; -} -export interface TickLiquidityNetAminoMsg { - type: "osmosis/concentratedliquidity/tick-liquidity-net"; - value: TickLiquidityNetAmino; -} -export interface TickLiquidityNetSDKType { - liquidity_net: string; - tick_index: bigint; -} -export interface LiquidityDepthWithRange { - liquidityAmount: string; - lowerTick: bigint; - upperTick: bigint; -} -export interface LiquidityDepthWithRangeProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange"; - value: Uint8Array; -} -export interface LiquidityDepthWithRangeAmino { - liquidity_amount: string; - lower_tick: string; - upper_tick: string; -} -export interface LiquidityDepthWithRangeAminoMsg { - type: "osmosis/concentratedliquidity/liquidity-depth-with-range"; - value: LiquidityDepthWithRangeAmino; -} -export interface LiquidityDepthWithRangeSDKType { - liquidity_amount: string; - lower_tick: bigint; - upper_tick: bigint; -} -/** =============================== LiquidityNetInDirection */ -export interface LiquidityNetInDirectionRequest { - poolId: bigint; - tokenIn: string; - startTick: bigint; - useCurTick: boolean; - boundTick: bigint; - useNoBound: boolean; -} -export interface LiquidityNetInDirectionRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionRequest"; - value: Uint8Array; -} -/** =============================== LiquidityNetInDirection */ -export interface LiquidityNetInDirectionRequestAmino { - pool_id: string; - token_in: string; - start_tick: string; - use_cur_tick: boolean; - bound_tick: string; - use_no_bound: boolean; -} -export interface LiquidityNetInDirectionRequestAminoMsg { - type: "osmosis/concentratedliquidity/liquidity-net-in-direction-request"; - value: LiquidityNetInDirectionRequestAmino; -} -/** =============================== LiquidityNetInDirection */ -export interface LiquidityNetInDirectionRequestSDKType { - pool_id: bigint; - token_in: string; - start_tick: bigint; - use_cur_tick: boolean; - bound_tick: bigint; - use_no_bound: boolean; -} -export interface LiquidityNetInDirectionResponse { - liquidityDepths: TickLiquidityNet[]; - currentTick: bigint; - currentLiquidity: string; -} -export interface LiquidityNetInDirectionResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse"; - value: Uint8Array; -} -export interface LiquidityNetInDirectionResponseAmino { - liquidity_depths: TickLiquidityNetAmino[]; - current_tick: string; - current_liquidity: string; -} -export interface LiquidityNetInDirectionResponseAminoMsg { - type: "osmosis/concentratedliquidity/liquidity-net-in-direction-response"; - value: LiquidityNetInDirectionResponseAmino; -} -export interface LiquidityNetInDirectionResponseSDKType { - liquidity_depths: TickLiquidityNetSDKType[]; - current_tick: bigint; - current_liquidity: string; -} -/** =============================== LiquidityPerTickRange */ -export interface LiquidityPerTickRangeRequest { - poolId: bigint; -} -export interface LiquidityPerTickRangeRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeRequest"; - value: Uint8Array; -} -/** =============================== LiquidityPerTickRange */ -export interface LiquidityPerTickRangeRequestAmino { - pool_id: string; -} -export interface LiquidityPerTickRangeRequestAminoMsg { - type: "osmosis/concentratedliquidity/liquidity-per-tick-range-request"; - value: LiquidityPerTickRangeRequestAmino; -} -/** =============================== LiquidityPerTickRange */ -export interface LiquidityPerTickRangeRequestSDKType { - pool_id: bigint; -} -export interface LiquidityPerTickRangeResponse { - liquidity: LiquidityDepthWithRange[]; -} -export interface LiquidityPerTickRangeResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse"; - value: Uint8Array; -} -export interface LiquidityPerTickRangeResponseAmino { - liquidity: LiquidityDepthWithRangeAmino[]; -} -export interface LiquidityPerTickRangeResponseAminoMsg { - type: "osmosis/concentratedliquidity/liquidity-per-tick-range-response"; - value: LiquidityPerTickRangeResponseAmino; -} -export interface LiquidityPerTickRangeResponseSDKType { - liquidity: LiquidityDepthWithRangeSDKType[]; -} -/** ===================== QueryClaimableSpreadRewards */ -export interface ClaimableSpreadRewardsRequest { - positionId: bigint; -} -export interface ClaimableSpreadRewardsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsRequest"; - value: Uint8Array; -} -/** ===================== QueryClaimableSpreadRewards */ -export interface ClaimableSpreadRewardsRequestAmino { - position_id: string; -} -export interface ClaimableSpreadRewardsRequestAminoMsg { - type: "osmosis/concentratedliquidity/claimable-spread-rewards-request"; - value: ClaimableSpreadRewardsRequestAmino; -} -/** ===================== QueryClaimableSpreadRewards */ -export interface ClaimableSpreadRewardsRequestSDKType { - position_id: bigint; -} -export interface ClaimableSpreadRewardsResponse { - claimableSpreadRewards: Coin[]; -} -export interface ClaimableSpreadRewardsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsResponse"; - value: Uint8Array; -} -export interface ClaimableSpreadRewardsResponseAmino { - claimable_spread_rewards: CoinAmino[]; -} -export interface ClaimableSpreadRewardsResponseAminoMsg { - type: "osmosis/concentratedliquidity/claimable-spread-rewards-response"; - value: ClaimableSpreadRewardsResponseAmino; -} -export interface ClaimableSpreadRewardsResponseSDKType { - claimable_spread_rewards: CoinSDKType[]; -} -/** ===================== QueryClaimableIncentives */ -export interface ClaimableIncentivesRequest { - positionId: bigint; -} -export interface ClaimableIncentivesRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesRequest"; - value: Uint8Array; -} -/** ===================== QueryClaimableIncentives */ -export interface ClaimableIncentivesRequestAmino { - position_id: string; -} -export interface ClaimableIncentivesRequestAminoMsg { - type: "osmosis/concentratedliquidity/claimable-incentives-request"; - value: ClaimableIncentivesRequestAmino; -} -/** ===================== QueryClaimableIncentives */ -export interface ClaimableIncentivesRequestSDKType { - position_id: bigint; -} -export interface ClaimableIncentivesResponse { - claimableIncentives: Coin[]; - forfeitedIncentives: Coin[]; -} -export interface ClaimableIncentivesResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesResponse"; - value: Uint8Array; -} -export interface ClaimableIncentivesResponseAmino { - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; -} -export interface ClaimableIncentivesResponseAminoMsg { - type: "osmosis/concentratedliquidity/claimable-incentives-response"; - value: ClaimableIncentivesResponseAmino; -} -export interface ClaimableIncentivesResponseSDKType { - claimable_incentives: CoinSDKType[]; - forfeited_incentives: CoinSDKType[]; -} -/** ===================== QueryPoolAccumulatorRewards */ -export interface PoolAccumulatorRewardsRequest { - poolId: bigint; -} -export interface PoolAccumulatorRewardsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsRequest"; - value: Uint8Array; -} -/** ===================== QueryPoolAccumulatorRewards */ -export interface PoolAccumulatorRewardsRequestAmino { - pool_id: string; -} -export interface PoolAccumulatorRewardsRequestAminoMsg { - type: "osmosis/concentratedliquidity/pool-accumulator-rewards-request"; - value: PoolAccumulatorRewardsRequestAmino; -} -/** ===================== QueryPoolAccumulatorRewards */ -export interface PoolAccumulatorRewardsRequestSDKType { - pool_id: bigint; -} -export interface PoolAccumulatorRewardsResponse { - spreadRewardGrowthGlobal: DecCoin[]; - uptimeGrowthGlobal: UptimeTracker[]; -} -export interface PoolAccumulatorRewardsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsResponse"; - value: Uint8Array; -} -export interface PoolAccumulatorRewardsResponseAmino { - spread_reward_growth_global: DecCoinAmino[]; - uptime_growth_global: UptimeTrackerAmino[]; -} -export interface PoolAccumulatorRewardsResponseAminoMsg { - type: "osmosis/concentratedliquidity/pool-accumulator-rewards-response"; - value: PoolAccumulatorRewardsResponseAmino; -} -export interface PoolAccumulatorRewardsResponseSDKType { - spread_reward_growth_global: DecCoinSDKType[]; - uptime_growth_global: UptimeTrackerSDKType[]; -} -/** ===================== QueryTickAccumulatorTrackers */ -export interface TickAccumulatorTrackersRequest { - poolId: bigint; - tickIndex: bigint; -} -export interface TickAccumulatorTrackersRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersRequest"; - value: Uint8Array; -} -/** ===================== QueryTickAccumulatorTrackers */ -export interface TickAccumulatorTrackersRequestAmino { - pool_id: string; - tick_index: string; -} -export interface TickAccumulatorTrackersRequestAminoMsg { - type: "osmosis/concentratedliquidity/tick-accumulator-trackers-request"; - value: TickAccumulatorTrackersRequestAmino; -} -/** ===================== QueryTickAccumulatorTrackers */ -export interface TickAccumulatorTrackersRequestSDKType { - pool_id: bigint; - tick_index: bigint; -} -export interface TickAccumulatorTrackersResponse { - spreadRewardGrowthOppositeDirectionOfLastTraversal: DecCoin[]; - uptimeTrackers: UptimeTracker[]; -} -export interface TickAccumulatorTrackersResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersResponse"; - value: Uint8Array; -} -export interface TickAccumulatorTrackersResponseAmino { - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; - uptime_trackers: UptimeTrackerAmino[]; -} -export interface TickAccumulatorTrackersResponseAminoMsg { - type: "osmosis/concentratedliquidity/tick-accumulator-trackers-response"; - value: TickAccumulatorTrackersResponseAmino; -} -export interface TickAccumulatorTrackersResponseSDKType { - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinSDKType[]; - uptime_trackers: UptimeTrackerSDKType[]; -} -/** ===================== QueryIncentiveRecords */ -export interface IncentiveRecordsRequest { - poolId: bigint; - pagination: PageRequest; -} -export interface IncentiveRecordsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest"; - value: Uint8Array; -} -/** ===================== QueryIncentiveRecords */ -export interface IncentiveRecordsRequestAmino { - pool_id: string; - pagination?: PageRequestAmino; -} -export interface IncentiveRecordsRequestAminoMsg { - type: "osmosis/concentratedliquidity/incentive-records-request"; - value: IncentiveRecordsRequestAmino; -} -/** ===================== QueryIncentiveRecords */ -export interface IncentiveRecordsRequestSDKType { - pool_id: bigint; - pagination: PageRequestSDKType; -} -export interface IncentiveRecordsResponse { - incentiveRecords: IncentiveRecord[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse; -} -export interface IncentiveRecordsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse"; - value: Uint8Array; -} -export interface IncentiveRecordsResponseAmino { - incentive_records: IncentiveRecordAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface IncentiveRecordsResponseAminoMsg { - type: "osmosis/concentratedliquidity/incentive-records-response"; - value: IncentiveRecordsResponseAmino; -} -export interface IncentiveRecordsResponseSDKType { - incentive_records: IncentiveRecordSDKType[]; - pagination: PageResponseSDKType; -} -/** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ -export interface CFMMPoolIdLinkFromConcentratedPoolIdRequest { - concentratedPoolId: bigint; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdRequest"; - value: Uint8Array; -} -/** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ -export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { - concentrated_pool_id: string; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAminoMsg { - type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-request"; - value: CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino; -} -/** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ -export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestSDKType { - concentrated_pool_id: bigint; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdResponse { - cfmmPoolId: bigint; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdResponse"; - value: Uint8Array; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { - cfmm_pool_id: string; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAminoMsg { - type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-response"; - value: CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino; -} -export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType { - cfmm_pool_id: bigint; -} -/** =============================== UserUnbondingPositions */ -export interface UserUnbondingPositionsRequest { - address: string; -} -export interface UserUnbondingPositionsRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsRequest"; - value: Uint8Array; -} -/** =============================== UserUnbondingPositions */ -export interface UserUnbondingPositionsRequestAmino { - address: string; -} -export interface UserUnbondingPositionsRequestAminoMsg { - type: "osmosis/concentratedliquidity/user-unbonding-positions-request"; - value: UserUnbondingPositionsRequestAmino; -} -/** =============================== UserUnbondingPositions */ -export interface UserUnbondingPositionsRequestSDKType { - address: string; -} -export interface UserUnbondingPositionsResponse { - positionsWithPeriodLock: PositionWithPeriodLock[]; -} -export interface UserUnbondingPositionsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsResponse"; - value: Uint8Array; -} -export interface UserUnbondingPositionsResponseAmino { - positions_with_period_lock: PositionWithPeriodLockAmino[]; -} -export interface UserUnbondingPositionsResponseAminoMsg { - type: "osmosis/concentratedliquidity/user-unbonding-positions-response"; - value: UserUnbondingPositionsResponseAmino; -} -export interface UserUnbondingPositionsResponseSDKType { - positions_with_period_lock: PositionWithPeriodLockSDKType[]; -} -/** =============================== GetTotalLiquidity */ -export interface GetTotalLiquidityRequest {} -export interface GetTotalLiquidityRequestProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityRequest"; - value: Uint8Array; -} -/** =============================== GetTotalLiquidity */ -export interface GetTotalLiquidityRequestAmino {} -export interface GetTotalLiquidityRequestAminoMsg { - type: "osmosis/concentratedliquidity/get-total-liquidity-request"; - value: GetTotalLiquidityRequestAmino; -} -/** =============================== GetTotalLiquidity */ -export interface GetTotalLiquidityRequestSDKType {} -export interface GetTotalLiquidityResponse { - totalLiquidity: Coin[]; -} -export interface GetTotalLiquidityResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityResponse"; - value: Uint8Array; -} -export interface GetTotalLiquidityResponseAmino { - total_liquidity: CoinAmino[]; -} -export interface GetTotalLiquidityResponseAminoMsg { - type: "osmosis/concentratedliquidity/get-total-liquidity-response"; - value: GetTotalLiquidityResponseAmino; -} -export interface GetTotalLiquidityResponseSDKType { - total_liquidity: CoinSDKType[]; -} -function createBaseUserPositionsRequest(): UserPositionsRequest { - return { - address: "", - poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) - }; -} -export const UserPositionsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest", - encode(message: UserPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.poolId !== BigInt(0)) { - writer.uint32(16).uint64(message.poolId); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserPositionsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPositionsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.poolId = reader.uint64(); - break; - case 3: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserPositionsRequest { - const message = createBaseUserPositionsRequest(); - message.address = object.address ?? ""; - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: UserPositionsRequestAmino): UserPositionsRequest { - return { - address: object.address, - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: UserPositionsRequest): UserPositionsRequestAmino { - const obj: any = {}; - obj.address = message.address; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: UserPositionsRequestAminoMsg): UserPositionsRequest { - return UserPositionsRequest.fromAmino(object.value); - }, - toAminoMsg(message: UserPositionsRequest): UserPositionsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/user-positions-request", - value: UserPositionsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: UserPositionsRequestProtoMsg): UserPositionsRequest { - return UserPositionsRequest.decode(message.value); - }, - toProto(message: UserPositionsRequest): Uint8Array { - return UserPositionsRequest.encode(message).finish(); - }, - toProtoMsg(message: UserPositionsRequest): UserPositionsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest", - value: UserPositionsRequest.encode(message).finish() - }; - } -}; -function createBaseUserPositionsResponse(): UserPositionsResponse { - return { - positions: [], - pagination: PageResponse.fromPartial({}) - }; -} -export const UserPositionsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse", - encode(message: UserPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.positions) { - FullPositionBreakdown.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserPositionsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPositionsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.positions.push(FullPositionBreakdown.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserPositionsResponse { - const message = createBaseUserPositionsResponse(); - message.positions = object.positions?.map(e => FullPositionBreakdown.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: UserPositionsResponseAmino): UserPositionsResponse { - return { - positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => FullPositionBreakdown.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: UserPositionsResponse): UserPositionsResponseAmino { - const obj: any = {}; - if (message.positions) { - obj.positions = message.positions.map(e => e ? FullPositionBreakdown.toAmino(e) : undefined); - } else { - obj.positions = []; - } - obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: UserPositionsResponseAminoMsg): UserPositionsResponse { - return UserPositionsResponse.fromAmino(object.value); - }, - toAminoMsg(message: UserPositionsResponse): UserPositionsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/user-positions-response", - value: UserPositionsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: UserPositionsResponseProtoMsg): UserPositionsResponse { - return UserPositionsResponse.decode(message.value); - }, - toProto(message: UserPositionsResponse): Uint8Array { - return UserPositionsResponse.encode(message).finish(); - }, - toProtoMsg(message: UserPositionsResponse): UserPositionsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse", - value: UserPositionsResponse.encode(message).finish() - }; - } -}; -function createBasePositionByIdRequest(): PositionByIdRequest { - return { - positionId: BigInt(0) - }; -} -export const PositionByIdRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdRequest", - encode(message: PositionByIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.positionId !== BigInt(0)) { - writer.uint32(8).uint64(message.positionId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PositionByIdRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionByIdRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.positionId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PositionByIdRequest { - const message = createBasePositionByIdRequest(); - message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: PositionByIdRequestAmino): PositionByIdRequest { - return { - positionId: BigInt(object.position_id) - }; - }, - toAmino(message: PositionByIdRequest): PositionByIdRequestAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: PositionByIdRequestAminoMsg): PositionByIdRequest { - return PositionByIdRequest.fromAmino(object.value); - }, - toAminoMsg(message: PositionByIdRequest): PositionByIdRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/position-by-id-request", - value: PositionByIdRequest.toAmino(message) - }; - }, - fromProtoMsg(message: PositionByIdRequestProtoMsg): PositionByIdRequest { - return PositionByIdRequest.decode(message.value); - }, - toProto(message: PositionByIdRequest): Uint8Array { - return PositionByIdRequest.encode(message).finish(); - }, - toProtoMsg(message: PositionByIdRequest): PositionByIdRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdRequest", - value: PositionByIdRequest.encode(message).finish() - }; - } -}; -function createBasePositionByIdResponse(): PositionByIdResponse { - return { - position: FullPositionBreakdown.fromPartial({}) - }; -} -export const PositionByIdResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdResponse", - encode(message: PositionByIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.position !== undefined) { - FullPositionBreakdown.encode(message.position, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PositionByIdResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePositionByIdResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.position = FullPositionBreakdown.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PositionByIdResponse { - const message = createBasePositionByIdResponse(); - message.position = object.position !== undefined && object.position !== null ? FullPositionBreakdown.fromPartial(object.position) : undefined; - return message; - }, - fromAmino(object: PositionByIdResponseAmino): PositionByIdResponse { - return { - position: object?.position ? FullPositionBreakdown.fromAmino(object.position) : undefined - }; - }, - toAmino(message: PositionByIdResponse): PositionByIdResponseAmino { - const obj: any = {}; - obj.position = message.position ? FullPositionBreakdown.toAmino(message.position) : undefined; - return obj; - }, - fromAminoMsg(object: PositionByIdResponseAminoMsg): PositionByIdResponse { - return PositionByIdResponse.fromAmino(object.value); - }, - toAminoMsg(message: PositionByIdResponse): PositionByIdResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/position-by-id-response", - value: PositionByIdResponse.toAmino(message) - }; - }, - fromProtoMsg(message: PositionByIdResponseProtoMsg): PositionByIdResponse { - return PositionByIdResponse.decode(message.value); - }, - toProto(message: PositionByIdResponse): Uint8Array { - return PositionByIdResponse.encode(message).finish(); - }, - toProtoMsg(message: PositionByIdResponse): PositionByIdResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdResponse", - value: PositionByIdResponse.encode(message).finish() - }; - } -}; -function createBasePoolsRequest(): PoolsRequest { - return { - pagination: PageRequest.fromPartial({}) - }; -} -export const PoolsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest", - encode(message: PoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolsRequest { - const message = createBasePoolsRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: PoolsRequest): PoolsRequestAmino { - const obj: any = {}; - obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: PoolsRequestAminoMsg): PoolsRequest { - return PoolsRequest.fromAmino(object.value); - }, - toAminoMsg(message: PoolsRequest): PoolsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/pools-request", - value: PoolsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: PoolsRequestProtoMsg): PoolsRequest { - return PoolsRequest.decode(message.value); - }, - toProto(message: PoolsRequest): Uint8Array { - return PoolsRequest.encode(message).finish(); - }, - toProtoMsg(message: PoolsRequest): PoolsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest", - value: PoolsRequest.encode(message).finish() - }; - } -}; -function createBasePoolsResponse(): PoolsResponse { - return { - pools: [], - pagination: PageResponse.fromPartial({}) - }; -} -export const PoolsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse", - encode(message: PoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolsResponse { - const message = createBasePoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: PoolsResponse): PoolsResponseAmino { - const obj: any = {}; - if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); - } else { - obj.pools = []; - } - obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: PoolsResponseAminoMsg): PoolsResponse { - return PoolsResponse.fromAmino(object.value); - }, - toAminoMsg(message: PoolsResponse): PoolsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/pools-response", - value: PoolsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: PoolsResponseProtoMsg): PoolsResponse { - return PoolsResponse.decode(message.value); - }, - toProto(message: PoolsResponse): Uint8Array { - return PoolsResponse.encode(message).finish(); - }, - toProtoMsg(message: PoolsResponse): PoolsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse", - value: PoolsResponse.encode(message).finish() - }; - } -}; -function createBaseParamsRequest(): ParamsRequest { - return {}; -} -export const ParamsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsRequest", - encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ParamsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParamsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): ParamsRequest { - const message = createBaseParamsRequest(); - return message; - }, - fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; - }, - toAmino(_: ParamsRequest): ParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { - return ParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: ParamsRequest): ParamsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/params-request", - value: ParamsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsRequestProtoMsg): ParamsRequest { - return ParamsRequest.decode(message.value); - }, - toProto(message: ParamsRequest): Uint8Array { - return ParamsRequest.encode(message).finish(); - }, - toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsRequest", - value: ParamsRequest.encode(message).finish() - }; - } -}; -function createBaseParamsResponse(): ParamsResponse { - return { - params: Params.fromPartial({}) - }; -} -export const ParamsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsResponse", - encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ParamsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParamsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ParamsResponse { - const message = createBaseParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - }, - fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; - }, - toAmino(message: ParamsResponse): ParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { - return ParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: ParamsResponse): ParamsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/params-response", - value: ParamsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsResponseProtoMsg): ParamsResponse { - return ParamsResponse.decode(message.value); - }, - toProto(message: ParamsResponse): Uint8Array { - return ParamsResponse.encode(message).finish(); - }, - toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsResponse", - value: ParamsResponse.encode(message).finish() - }; - } -}; -function createBaseTickLiquidityNet(): TickLiquidityNet { - return { - liquidityNet: "", - tickIndex: BigInt(0) - }; -} -export const TickLiquidityNet = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet", - encode(message: TickLiquidityNet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.liquidityNet !== "") { - writer.uint32(10).string(Decimal.fromUserInput(message.liquidityNet, 18).atomics); - } - if (message.tickIndex !== BigInt(0)) { - writer.uint32(16).int64(message.tickIndex); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TickLiquidityNet { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTickLiquidityNet(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidityNet = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - case 2: - message.tickIndex = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TickLiquidityNet { - const message = createBaseTickLiquidityNet(); - message.liquidityNet = object.liquidityNet ?? ""; - message.tickIndex = object.tickIndex !== undefined && object.tickIndex !== null ? BigInt(object.tickIndex.toString()) : BigInt(0); - return message; - }, - fromAmino(object: TickLiquidityNetAmino): TickLiquidityNet { - return { - liquidityNet: object.liquidity_net, - tickIndex: BigInt(object.tick_index) - }; - }, - toAmino(message: TickLiquidityNet): TickLiquidityNetAmino { - const obj: any = {}; - obj.liquidity_net = message.liquidityNet; - obj.tick_index = message.tickIndex ? message.tickIndex.toString() : undefined; - return obj; - }, - fromAminoMsg(object: TickLiquidityNetAminoMsg): TickLiquidityNet { - return TickLiquidityNet.fromAmino(object.value); - }, - toAminoMsg(message: TickLiquidityNet): TickLiquidityNetAminoMsg { - return { - type: "osmosis/concentratedliquidity/tick-liquidity-net", - value: TickLiquidityNet.toAmino(message) - }; - }, - fromProtoMsg(message: TickLiquidityNetProtoMsg): TickLiquidityNet { - return TickLiquidityNet.decode(message.value); - }, - toProto(message: TickLiquidityNet): Uint8Array { - return TickLiquidityNet.encode(message).finish(); - }, - toProtoMsg(message: TickLiquidityNet): TickLiquidityNetProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet", - value: TickLiquidityNet.encode(message).finish() - }; - } -}; -function createBaseLiquidityDepthWithRange(): LiquidityDepthWithRange { - return { - liquidityAmount: "", - lowerTick: BigInt(0), - upperTick: BigInt(0) - }; -} -export const LiquidityDepthWithRange = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange", - encode(message: LiquidityDepthWithRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.liquidityAmount !== "") { - writer.uint32(10).string(Decimal.fromUserInput(message.liquidityAmount, 18).atomics); - } - if (message.lowerTick !== BigInt(0)) { - writer.uint32(16).int64(message.lowerTick); - } - if (message.upperTick !== BigInt(0)) { - writer.uint32(24).int64(message.upperTick); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LiquidityDepthWithRange { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityDepthWithRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidityAmount = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - case 2: - message.lowerTick = reader.int64(); - break; - case 3: - message.upperTick = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LiquidityDepthWithRange { - const message = createBaseLiquidityDepthWithRange(); - message.liquidityAmount = object.liquidityAmount ?? ""; - 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: LiquidityDepthWithRangeAmino): LiquidityDepthWithRange { - return { - liquidityAmount: object.liquidity_amount, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) - }; - }, - toAmino(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAmino { - const obj: any = {}; - obj.liquidity_amount = message.liquidityAmount; - obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; - obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; - return obj; - }, - fromAminoMsg(object: LiquidityDepthWithRangeAminoMsg): LiquidityDepthWithRange { - return LiquidityDepthWithRange.fromAmino(object.value); - }, - toAminoMsg(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAminoMsg { - return { - type: "osmosis/concentratedliquidity/liquidity-depth-with-range", - value: LiquidityDepthWithRange.toAmino(message) - }; - }, - fromProtoMsg(message: LiquidityDepthWithRangeProtoMsg): LiquidityDepthWithRange { - return LiquidityDepthWithRange.decode(message.value); - }, - toProto(message: LiquidityDepthWithRange): Uint8Array { - return LiquidityDepthWithRange.encode(message).finish(); - }, - toProtoMsg(message: LiquidityDepthWithRange): LiquidityDepthWithRangeProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange", - value: LiquidityDepthWithRange.encode(message).finish() - }; - } -}; -function createBaseLiquidityNetInDirectionRequest(): LiquidityNetInDirectionRequest { - return { - poolId: BigInt(0), - tokenIn: "", - startTick: BigInt(0), - useCurTick: false, - boundTick: BigInt(0), - useNoBound: false - }; -} -export const LiquidityNetInDirectionRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionRequest", - encode(message: LiquidityNetInDirectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.tokenIn !== "") { - writer.uint32(18).string(message.tokenIn); - } - if (message.startTick !== BigInt(0)) { - writer.uint32(24).int64(message.startTick); - } - if (message.useCurTick === true) { - writer.uint32(32).bool(message.useCurTick); - } - if (message.boundTick !== BigInt(0)) { - writer.uint32(40).int64(message.boundTick); - } - if (message.useNoBound === true) { - writer.uint32(48).bool(message.useNoBound); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LiquidityNetInDirectionRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityNetInDirectionRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.tokenIn = reader.string(); - break; - case 3: - message.startTick = reader.int64(); - break; - case 4: - message.useCurTick = reader.bool(); - break; - case 5: - message.boundTick = reader.int64(); - break; - case 6: - message.useNoBound = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LiquidityNetInDirectionRequest { - const message = createBaseLiquidityNetInDirectionRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.tokenIn = object.tokenIn ?? ""; - message.startTick = object.startTick !== undefined && object.startTick !== null ? BigInt(object.startTick.toString()) : BigInt(0); - message.useCurTick = object.useCurTick ?? false; - message.boundTick = object.boundTick !== undefined && object.boundTick !== null ? BigInt(object.boundTick.toString()) : BigInt(0); - message.useNoBound = object.useNoBound ?? false; - return message; - }, - fromAmino(object: LiquidityNetInDirectionRequestAmino): LiquidityNetInDirectionRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - startTick: BigInt(object.start_tick), - useCurTick: object.use_cur_tick, - boundTick: BigInt(object.bound_tick), - useNoBound: object.use_no_bound - }; - }, - toAmino(message: LiquidityNetInDirectionRequest): LiquidityNetInDirectionRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.token_in = message.tokenIn; - obj.start_tick = message.startTick ? message.startTick.toString() : undefined; - obj.use_cur_tick = message.useCurTick; - obj.bound_tick = message.boundTick ? message.boundTick.toString() : undefined; - obj.use_no_bound = message.useNoBound; - return obj; - }, - fromAminoMsg(object: LiquidityNetInDirectionRequestAminoMsg): LiquidityNetInDirectionRequest { - return LiquidityNetInDirectionRequest.fromAmino(object.value); - }, - toAminoMsg(message: LiquidityNetInDirectionRequest): LiquidityNetInDirectionRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/liquidity-net-in-direction-request", - value: LiquidityNetInDirectionRequest.toAmino(message) - }; - }, - fromProtoMsg(message: LiquidityNetInDirectionRequestProtoMsg): LiquidityNetInDirectionRequest { - return LiquidityNetInDirectionRequest.decode(message.value); - }, - toProto(message: LiquidityNetInDirectionRequest): Uint8Array { - return LiquidityNetInDirectionRequest.encode(message).finish(); - }, - toProtoMsg(message: LiquidityNetInDirectionRequest): LiquidityNetInDirectionRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionRequest", - value: LiquidityNetInDirectionRequest.encode(message).finish() - }; - } -}; -function createBaseLiquidityNetInDirectionResponse(): LiquidityNetInDirectionResponse { - return { - liquidityDepths: [], - currentTick: BigInt(0), - currentLiquidity: "" - }; -} -export const LiquidityNetInDirectionResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse", - encode(message: LiquidityNetInDirectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.liquidityDepths) { - TickLiquidityNet.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.currentTick !== BigInt(0)) { - writer.uint32(16).int64(message.currentTick); - } - if (message.currentLiquidity !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LiquidityNetInDirectionResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityNetInDirectionResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidityDepths.push(TickLiquidityNet.decode(reader, reader.uint32())); - break; - case 2: - message.currentTick = reader.int64(); - break; - case 3: - message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LiquidityNetInDirectionResponse { - const message = createBaseLiquidityNetInDirectionResponse(); - message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; - message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); - message.currentLiquidity = object.currentLiquidity ?? ""; - return message; - }, - fromAmino(object: LiquidityNetInDirectionResponseAmino): LiquidityNetInDirectionResponse { - return { - liquidityDepths: Array.isArray(object?.liquidity_depths) ? object.liquidity_depths.map((e: any) => TickLiquidityNet.fromAmino(e)) : [], - currentTick: BigInt(object.current_tick), - currentLiquidity: object.current_liquidity - }; - }, - toAmino(message: LiquidityNetInDirectionResponse): LiquidityNetInDirectionResponseAmino { - const obj: any = {}; - if (message.liquidityDepths) { - obj.liquidity_depths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toAmino(e) : undefined); - } else { - obj.liquidity_depths = []; - } - obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; - obj.current_liquidity = message.currentLiquidity; - return obj; - }, - fromAminoMsg(object: LiquidityNetInDirectionResponseAminoMsg): LiquidityNetInDirectionResponse { - return LiquidityNetInDirectionResponse.fromAmino(object.value); - }, - toAminoMsg(message: LiquidityNetInDirectionResponse): LiquidityNetInDirectionResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/liquidity-net-in-direction-response", - value: LiquidityNetInDirectionResponse.toAmino(message) - }; - }, - fromProtoMsg(message: LiquidityNetInDirectionResponseProtoMsg): LiquidityNetInDirectionResponse { - return LiquidityNetInDirectionResponse.decode(message.value); - }, - toProto(message: LiquidityNetInDirectionResponse): Uint8Array { - return LiquidityNetInDirectionResponse.encode(message).finish(); - }, - toProtoMsg(message: LiquidityNetInDirectionResponse): LiquidityNetInDirectionResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse", - value: LiquidityNetInDirectionResponse.encode(message).finish() - }; - } -}; -function createBaseLiquidityPerTickRangeRequest(): LiquidityPerTickRangeRequest { - return { - poolId: BigInt(0) - }; -} -export const LiquidityPerTickRangeRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeRequest", - encode(message: LiquidityPerTickRangeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LiquidityPerTickRangeRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityPerTickRangeRequest(); - 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): LiquidityPerTickRangeRequest { - const message = createBaseLiquidityPerTickRangeRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: LiquidityPerTickRangeRequestAmino): LiquidityPerTickRangeRequest { - return { - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: LiquidityPerTickRangeRequest): LiquidityPerTickRangeRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: LiquidityPerTickRangeRequestAminoMsg): LiquidityPerTickRangeRequest { - return LiquidityPerTickRangeRequest.fromAmino(object.value); - }, - toAminoMsg(message: LiquidityPerTickRangeRequest): LiquidityPerTickRangeRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/liquidity-per-tick-range-request", - value: LiquidityPerTickRangeRequest.toAmino(message) - }; - }, - fromProtoMsg(message: LiquidityPerTickRangeRequestProtoMsg): LiquidityPerTickRangeRequest { - return LiquidityPerTickRangeRequest.decode(message.value); - }, - toProto(message: LiquidityPerTickRangeRequest): Uint8Array { - return LiquidityPerTickRangeRequest.encode(message).finish(); - }, - toProtoMsg(message: LiquidityPerTickRangeRequest): LiquidityPerTickRangeRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeRequest", - value: LiquidityPerTickRangeRequest.encode(message).finish() - }; - } -}; -function createBaseLiquidityPerTickRangeResponse(): LiquidityPerTickRangeResponse { - return { - liquidity: [] - }; -} -export const LiquidityPerTickRangeResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse", - encode(message: LiquidityPerTickRangeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.liquidity) { - LiquidityDepthWithRange.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LiquidityPerTickRangeResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLiquidityPerTickRangeResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidity.push(LiquidityDepthWithRange.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LiquidityPerTickRangeResponse { - const message = createBaseLiquidityPerTickRangeResponse(); - message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromPartial(e)) || []; - return message; - }, - fromAmino(object: LiquidityPerTickRangeResponseAmino): LiquidityPerTickRangeResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => LiquidityDepthWithRange.fromAmino(e)) : [] - }; - }, - toAmino(message: LiquidityPerTickRangeResponse): LiquidityPerTickRangeResponseAmino { - const obj: any = {}; - if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? LiquidityDepthWithRange.toAmino(e) : undefined); - } else { - obj.liquidity = []; - } - return obj; - }, - fromAminoMsg(object: LiquidityPerTickRangeResponseAminoMsg): LiquidityPerTickRangeResponse { - return LiquidityPerTickRangeResponse.fromAmino(object.value); - }, - toAminoMsg(message: LiquidityPerTickRangeResponse): LiquidityPerTickRangeResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/liquidity-per-tick-range-response", - value: LiquidityPerTickRangeResponse.toAmino(message) - }; - }, - fromProtoMsg(message: LiquidityPerTickRangeResponseProtoMsg): LiquidityPerTickRangeResponse { - return LiquidityPerTickRangeResponse.decode(message.value); - }, - toProto(message: LiquidityPerTickRangeResponse): Uint8Array { - return LiquidityPerTickRangeResponse.encode(message).finish(); - }, - toProtoMsg(message: LiquidityPerTickRangeResponse): LiquidityPerTickRangeResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse", - value: LiquidityPerTickRangeResponse.encode(message).finish() - }; - } -}; -function createBaseClaimableSpreadRewardsRequest(): ClaimableSpreadRewardsRequest { - return { - positionId: BigInt(0) - }; -} -export const ClaimableSpreadRewardsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsRequest", - encode(message: ClaimableSpreadRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.positionId !== BigInt(0)) { - writer.uint32(8).uint64(message.positionId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ClaimableSpreadRewardsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClaimableSpreadRewardsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.positionId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ClaimableSpreadRewardsRequest { - const message = createBaseClaimableSpreadRewardsRequest(); - message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: ClaimableSpreadRewardsRequestAmino): ClaimableSpreadRewardsRequest { - return { - positionId: BigInt(object.position_id) - }; - }, - toAmino(message: ClaimableSpreadRewardsRequest): ClaimableSpreadRewardsRequestAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ClaimableSpreadRewardsRequestAminoMsg): ClaimableSpreadRewardsRequest { - return ClaimableSpreadRewardsRequest.fromAmino(object.value); - }, - toAminoMsg(message: ClaimableSpreadRewardsRequest): ClaimableSpreadRewardsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/claimable-spread-rewards-request", - value: ClaimableSpreadRewardsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: ClaimableSpreadRewardsRequestProtoMsg): ClaimableSpreadRewardsRequest { - return ClaimableSpreadRewardsRequest.decode(message.value); - }, - toProto(message: ClaimableSpreadRewardsRequest): Uint8Array { - return ClaimableSpreadRewardsRequest.encode(message).finish(); - }, - toProtoMsg(message: ClaimableSpreadRewardsRequest): ClaimableSpreadRewardsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsRequest", - value: ClaimableSpreadRewardsRequest.encode(message).finish() - }; - } -}; -function createBaseClaimableSpreadRewardsResponse(): ClaimableSpreadRewardsResponse { - return { - claimableSpreadRewards: [] - }; -} -export const ClaimableSpreadRewardsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsResponse", - encode(message: ClaimableSpreadRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.claimableSpreadRewards) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ClaimableSpreadRewardsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClaimableSpreadRewardsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.claimableSpreadRewards.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ClaimableSpreadRewardsResponse { - const message = createBaseClaimableSpreadRewardsResponse(); - message.claimableSpreadRewards = object.claimableSpreadRewards?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: ClaimableSpreadRewardsResponseAmino): ClaimableSpreadRewardsResponse { - return { - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: ClaimableSpreadRewardsResponse): ClaimableSpreadRewardsResponseAmino { - const obj: any = {}; - if (message.claimableSpreadRewards) { - obj.claimable_spread_rewards = message.claimableSpreadRewards.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.claimable_spread_rewards = []; - } - return obj; - }, - fromAminoMsg(object: ClaimableSpreadRewardsResponseAminoMsg): ClaimableSpreadRewardsResponse { - return ClaimableSpreadRewardsResponse.fromAmino(object.value); - }, - toAminoMsg(message: ClaimableSpreadRewardsResponse): ClaimableSpreadRewardsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/claimable-spread-rewards-response", - value: ClaimableSpreadRewardsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: ClaimableSpreadRewardsResponseProtoMsg): ClaimableSpreadRewardsResponse { - return ClaimableSpreadRewardsResponse.decode(message.value); - }, - toProto(message: ClaimableSpreadRewardsResponse): Uint8Array { - return ClaimableSpreadRewardsResponse.encode(message).finish(); - }, - toProtoMsg(message: ClaimableSpreadRewardsResponse): ClaimableSpreadRewardsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsResponse", - value: ClaimableSpreadRewardsResponse.encode(message).finish() - }; - } -}; -function createBaseClaimableIncentivesRequest(): ClaimableIncentivesRequest { - return { - positionId: BigInt(0) - }; -} -export const ClaimableIncentivesRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesRequest", - encode(message: ClaimableIncentivesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.positionId !== BigInt(0)) { - writer.uint32(8).uint64(message.positionId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ClaimableIncentivesRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClaimableIncentivesRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.positionId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ClaimableIncentivesRequest { - const message = createBaseClaimableIncentivesRequest(); - message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: ClaimableIncentivesRequestAmino): ClaimableIncentivesRequest { - return { - positionId: BigInt(object.position_id) - }; - }, - toAmino(message: ClaimableIncentivesRequest): ClaimableIncentivesRequestAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ClaimableIncentivesRequestAminoMsg): ClaimableIncentivesRequest { - return ClaimableIncentivesRequest.fromAmino(object.value); - }, - toAminoMsg(message: ClaimableIncentivesRequest): ClaimableIncentivesRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/claimable-incentives-request", - value: ClaimableIncentivesRequest.toAmino(message) - }; - }, - fromProtoMsg(message: ClaimableIncentivesRequestProtoMsg): ClaimableIncentivesRequest { - return ClaimableIncentivesRequest.decode(message.value); - }, - toProto(message: ClaimableIncentivesRequest): Uint8Array { - return ClaimableIncentivesRequest.encode(message).finish(); - }, - toProtoMsg(message: ClaimableIncentivesRequest): ClaimableIncentivesRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesRequest", - value: ClaimableIncentivesRequest.encode(message).finish() - }; - } -}; -function createBaseClaimableIncentivesResponse(): ClaimableIncentivesResponse { - return { - claimableIncentives: [], - forfeitedIncentives: [] - }; -} -export const ClaimableIncentivesResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesResponse", - encode(message: ClaimableIncentivesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.claimableIncentives) { - 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): ClaimableIncentivesResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClaimableIncentivesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.claimableIncentives.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): ClaimableIncentivesResponse { - const message = createBaseClaimableIncentivesResponse(); - message.claimableIncentives = object.claimableIncentives?.map(e => Coin.fromPartial(e)) || []; - message.forfeitedIncentives = object.forfeitedIncentives?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: ClaimableIncentivesResponseAmino): ClaimableIncentivesResponse { - return { - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: ClaimableIncentivesResponse): ClaimableIncentivesResponseAmino { - const obj: any = {}; - if (message.claimableIncentives) { - obj.claimable_incentives = message.claimableIncentives.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.claimable_incentives = []; - } - if (message.forfeitedIncentives) { - obj.forfeited_incentives = message.forfeitedIncentives.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.forfeited_incentives = []; - } - return obj; - }, - fromAminoMsg(object: ClaimableIncentivesResponseAminoMsg): ClaimableIncentivesResponse { - return ClaimableIncentivesResponse.fromAmino(object.value); - }, - toAminoMsg(message: ClaimableIncentivesResponse): ClaimableIncentivesResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/claimable-incentives-response", - value: ClaimableIncentivesResponse.toAmino(message) - }; - }, - fromProtoMsg(message: ClaimableIncentivesResponseProtoMsg): ClaimableIncentivesResponse { - return ClaimableIncentivesResponse.decode(message.value); - }, - toProto(message: ClaimableIncentivesResponse): Uint8Array { - return ClaimableIncentivesResponse.encode(message).finish(); - }, - toProtoMsg(message: ClaimableIncentivesResponse): ClaimableIncentivesResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesResponse", - value: ClaimableIncentivesResponse.encode(message).finish() - }; - } -}; -function createBasePoolAccumulatorRewardsRequest(): PoolAccumulatorRewardsRequest { - return { - poolId: BigInt(0) - }; -} -export const PoolAccumulatorRewardsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsRequest", - encode(message: PoolAccumulatorRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolAccumulatorRewardsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolAccumulatorRewardsRequest(); - 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): PoolAccumulatorRewardsRequest { - const message = createBasePoolAccumulatorRewardsRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: PoolAccumulatorRewardsRequestAmino): PoolAccumulatorRewardsRequest { - return { - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: PoolAccumulatorRewardsRequest): PoolAccumulatorRewardsRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: PoolAccumulatorRewardsRequestAminoMsg): PoolAccumulatorRewardsRequest { - return PoolAccumulatorRewardsRequest.fromAmino(object.value); - }, - toAminoMsg(message: PoolAccumulatorRewardsRequest): PoolAccumulatorRewardsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/pool-accumulator-rewards-request", - value: PoolAccumulatorRewardsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: PoolAccumulatorRewardsRequestProtoMsg): PoolAccumulatorRewardsRequest { - return PoolAccumulatorRewardsRequest.decode(message.value); - }, - toProto(message: PoolAccumulatorRewardsRequest): Uint8Array { - return PoolAccumulatorRewardsRequest.encode(message).finish(); - }, - toProtoMsg(message: PoolAccumulatorRewardsRequest): PoolAccumulatorRewardsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsRequest", - value: PoolAccumulatorRewardsRequest.encode(message).finish() - }; - } -}; -function createBasePoolAccumulatorRewardsResponse(): PoolAccumulatorRewardsResponse { - return { - spreadRewardGrowthGlobal: [], - uptimeGrowthGlobal: [] - }; -} -export const PoolAccumulatorRewardsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsResponse", - encode(message: PoolAccumulatorRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.spreadRewardGrowthGlobal) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.uptimeGrowthGlobal) { - UptimeTracker.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolAccumulatorRewardsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolAccumulatorRewardsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spreadRewardGrowthGlobal.push(DecCoin.decode(reader, reader.uint32())); - break; - case 2: - message.uptimeGrowthGlobal.push(UptimeTracker.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolAccumulatorRewardsResponse { - const message = createBasePoolAccumulatorRewardsResponse(); - message.spreadRewardGrowthGlobal = object.spreadRewardGrowthGlobal?.map(e => DecCoin.fromPartial(e)) || []; - message.uptimeGrowthGlobal = object.uptimeGrowthGlobal?.map(e => UptimeTracker.fromPartial(e)) || []; - return message; - }, - fromAmino(object: PoolAccumulatorRewardsResponseAmino): PoolAccumulatorRewardsResponse { - return { - spreadRewardGrowthGlobal: Array.isArray(object?.spread_reward_growth_global) ? object.spread_reward_growth_global.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeGrowthGlobal: Array.isArray(object?.uptime_growth_global) ? object.uptime_growth_global.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; - }, - toAmino(message: PoolAccumulatorRewardsResponse): PoolAccumulatorRewardsResponseAmino { - const obj: any = {}; - if (message.spreadRewardGrowthGlobal) { - obj.spread_reward_growth_global = message.spreadRewardGrowthGlobal.map(e => e ? DecCoin.toAmino(e) : undefined); - } else { - obj.spread_reward_growth_global = []; - } - if (message.uptimeGrowthGlobal) { - obj.uptime_growth_global = message.uptimeGrowthGlobal.map(e => e ? UptimeTracker.toAmino(e) : undefined); - } else { - obj.uptime_growth_global = []; - } - return obj; - }, - fromAminoMsg(object: PoolAccumulatorRewardsResponseAminoMsg): PoolAccumulatorRewardsResponse { - return PoolAccumulatorRewardsResponse.fromAmino(object.value); - }, - toAminoMsg(message: PoolAccumulatorRewardsResponse): PoolAccumulatorRewardsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/pool-accumulator-rewards-response", - value: PoolAccumulatorRewardsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: PoolAccumulatorRewardsResponseProtoMsg): PoolAccumulatorRewardsResponse { - return PoolAccumulatorRewardsResponse.decode(message.value); - }, - toProto(message: PoolAccumulatorRewardsResponse): Uint8Array { - return PoolAccumulatorRewardsResponse.encode(message).finish(); - }, - toProtoMsg(message: PoolAccumulatorRewardsResponse): PoolAccumulatorRewardsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsResponse", - value: PoolAccumulatorRewardsResponse.encode(message).finish() - }; - } -}; -function createBaseTickAccumulatorTrackersRequest(): TickAccumulatorTrackersRequest { - return { - poolId: BigInt(0), - tickIndex: BigInt(0) - }; -} -export const TickAccumulatorTrackersRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersRequest", - encode(message: TickAccumulatorTrackersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.tickIndex !== BigInt(0)) { - writer.uint32(16).int64(message.tickIndex); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TickAccumulatorTrackersRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTickAccumulatorTrackersRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.tickIndex = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TickAccumulatorTrackersRequest { - const message = createBaseTickAccumulatorTrackersRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.tickIndex = object.tickIndex !== undefined && object.tickIndex !== null ? BigInt(object.tickIndex.toString()) : BigInt(0); - return message; - }, - fromAmino(object: TickAccumulatorTrackersRequestAmino): TickAccumulatorTrackersRequest { - return { - poolId: BigInt(object.pool_id), - tickIndex: BigInt(object.tick_index) - }; - }, - toAmino(message: TickAccumulatorTrackersRequest): TickAccumulatorTrackersRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.tick_index = message.tickIndex ? message.tickIndex.toString() : undefined; - return obj; - }, - fromAminoMsg(object: TickAccumulatorTrackersRequestAminoMsg): TickAccumulatorTrackersRequest { - return TickAccumulatorTrackersRequest.fromAmino(object.value); - }, - toAminoMsg(message: TickAccumulatorTrackersRequest): TickAccumulatorTrackersRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/tick-accumulator-trackers-request", - value: TickAccumulatorTrackersRequest.toAmino(message) - }; - }, - fromProtoMsg(message: TickAccumulatorTrackersRequestProtoMsg): TickAccumulatorTrackersRequest { - return TickAccumulatorTrackersRequest.decode(message.value); - }, - toProto(message: TickAccumulatorTrackersRequest): Uint8Array { - return TickAccumulatorTrackersRequest.encode(message).finish(); - }, - toProtoMsg(message: TickAccumulatorTrackersRequest): TickAccumulatorTrackersRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersRequest", - value: TickAccumulatorTrackersRequest.encode(message).finish() - }; - } -}; -function createBaseTickAccumulatorTrackersResponse(): TickAccumulatorTrackersResponse { - return { - spreadRewardGrowthOppositeDirectionOfLastTraversal: [], - uptimeTrackers: [] - }; -} -export const TickAccumulatorTrackersResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersResponse", - encode(message: TickAccumulatorTrackersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { - DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.uptimeTrackers) { - UptimeTracker.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TickAccumulatorTrackersResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTickAccumulatorTrackersResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spreadRewardGrowthOppositeDirectionOfLastTraversal.push(DecCoin.decode(reader, reader.uint32())); - break; - case 2: - message.uptimeTrackers.push(UptimeTracker.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TickAccumulatorTrackersResponse { - const message = createBaseTickAccumulatorTrackersResponse(); - message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spreadRewardGrowthOppositeDirectionOfLastTraversal?.map(e => DecCoin.fromPartial(e)) || []; - message.uptimeTrackers = object.uptimeTrackers?.map(e => UptimeTracker.fromPartial(e)) || []; - return message; - }, - fromAmino(object: TickAccumulatorTrackersResponseAmino): TickAccumulatorTrackersResponse { - return { - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: Array.isArray(object?.uptime_trackers) ? object.uptime_trackers.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; - }, - toAmino(message: TickAccumulatorTrackersResponse): TickAccumulatorTrackersResponseAmino { - const obj: any = {}; - if (message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { - obj.spread_reward_growth_opposite_direction_of_last_traversal = message.spreadRewardGrowthOppositeDirectionOfLastTraversal.map(e => e ? DecCoin.toAmino(e) : undefined); - } else { - obj.spread_reward_growth_opposite_direction_of_last_traversal = []; - } - if (message.uptimeTrackers) { - obj.uptime_trackers = message.uptimeTrackers.map(e => e ? UptimeTracker.toAmino(e) : undefined); - } else { - obj.uptime_trackers = []; - } - return obj; - }, - fromAminoMsg(object: TickAccumulatorTrackersResponseAminoMsg): TickAccumulatorTrackersResponse { - return TickAccumulatorTrackersResponse.fromAmino(object.value); - }, - toAminoMsg(message: TickAccumulatorTrackersResponse): TickAccumulatorTrackersResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/tick-accumulator-trackers-response", - value: TickAccumulatorTrackersResponse.toAmino(message) - }; - }, - fromProtoMsg(message: TickAccumulatorTrackersResponseProtoMsg): TickAccumulatorTrackersResponse { - return TickAccumulatorTrackersResponse.decode(message.value); - }, - toProto(message: TickAccumulatorTrackersResponse): Uint8Array { - return TickAccumulatorTrackersResponse.encode(message).finish(); - }, - toProtoMsg(message: TickAccumulatorTrackersResponse): TickAccumulatorTrackersResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersResponse", - value: TickAccumulatorTrackersResponse.encode(message).finish() - }; - } -}; -function createBaseIncentiveRecordsRequest(): IncentiveRecordsRequest { - return { - poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) - }; -} -export const IncentiveRecordsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest", - encode(message: IncentiveRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): IncentiveRecordsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncentiveRecordsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): IncentiveRecordsRequest { - const message = createBaseIncentiveRecordsRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: IncentiveRecordsRequestAmino): IncentiveRecordsRequest { - return { - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: IncentiveRecordsRequest): IncentiveRecordsRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: IncentiveRecordsRequestAminoMsg): IncentiveRecordsRequest { - return IncentiveRecordsRequest.fromAmino(object.value); - }, - toAminoMsg(message: IncentiveRecordsRequest): IncentiveRecordsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/incentive-records-request", - value: IncentiveRecordsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: IncentiveRecordsRequestProtoMsg): IncentiveRecordsRequest { - return IncentiveRecordsRequest.decode(message.value); - }, - toProto(message: IncentiveRecordsRequest): Uint8Array { - return IncentiveRecordsRequest.encode(message).finish(); - }, - toProtoMsg(message: IncentiveRecordsRequest): IncentiveRecordsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest", - value: IncentiveRecordsRequest.encode(message).finish() - }; - } -}; -function createBaseIncentiveRecordsResponse(): IncentiveRecordsResponse { - return { - incentiveRecords: [], - pagination: PageResponse.fromPartial({}) - }; -} -export const IncentiveRecordsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse", - encode(message: IncentiveRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.incentiveRecords) { - IncentiveRecord.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): IncentiveRecordsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIncentiveRecordsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.incentiveRecords.push(IncentiveRecord.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): IncentiveRecordsResponse { - const message = createBaseIncentiveRecordsResponse(); - message.incentiveRecords = object.incentiveRecords?.map(e => IncentiveRecord.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: IncentiveRecordsResponseAmino): IncentiveRecordsResponse { - return { - incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: IncentiveRecordsResponse): IncentiveRecordsResponseAmino { - const obj: any = {}; - if (message.incentiveRecords) { - obj.incentive_records = message.incentiveRecords.map(e => e ? IncentiveRecord.toAmino(e) : undefined); - } else { - obj.incentive_records = []; - } - obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: IncentiveRecordsResponseAminoMsg): IncentiveRecordsResponse { - return IncentiveRecordsResponse.fromAmino(object.value); - }, - toAminoMsg(message: IncentiveRecordsResponse): IncentiveRecordsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/incentive-records-response", - value: IncentiveRecordsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: IncentiveRecordsResponseProtoMsg): IncentiveRecordsResponse { - return IncentiveRecordsResponse.decode(message.value); - }, - toProto(message: IncentiveRecordsResponse): Uint8Array { - return IncentiveRecordsResponse.encode(message).finish(); - }, - toProtoMsg(message: IncentiveRecordsResponse): IncentiveRecordsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse", - value: IncentiveRecordsResponse.encode(message).finish() - }; - } -}; -function createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return { - concentratedPoolId: BigInt(0) - }; -} -export const CFMMPoolIdLinkFromConcentratedPoolIdRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdRequest", - encode(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.concentratedPoolId !== BigInt(0)) { - writer.uint32(8).uint64(message.concentratedPoolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concentratedPoolId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(); - message.concentratedPoolId = object.concentratedPoolId !== undefined && object.concentratedPoolId !== null ? BigInt(object.concentratedPoolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; - }, - toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { - const obj: any = {}; - obj.concentrated_pool_id = message.concentratedPoolId ? message.concentratedPoolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: CFMMPoolIdLinkFromConcentratedPoolIdRequestAminoMsg): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return CFMMPoolIdLinkFromConcentratedPoolIdRequest.fromAmino(object.value); - }, - toAminoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): CFMMPoolIdLinkFromConcentratedPoolIdRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-request", - value: CFMMPoolIdLinkFromConcentratedPoolIdRequest.toAmino(message) - }; - }, - fromProtoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdRequestProtoMsg): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return CFMMPoolIdLinkFromConcentratedPoolIdRequest.decode(message.value); - }, - toProto(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): Uint8Array { - return CFMMPoolIdLinkFromConcentratedPoolIdRequest.encode(message).finish(); - }, - toProtoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): CFMMPoolIdLinkFromConcentratedPoolIdRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdRequest", - value: CFMMPoolIdLinkFromConcentratedPoolIdRequest.encode(message).finish() - }; - } -}; -function createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return { - cfmmPoolId: BigInt(0) - }; -} -export const CFMMPoolIdLinkFromConcentratedPoolIdResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdResponse", - encode(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.cfmmPoolId !== BigInt(0)) { - writer.uint32(8).uint64(message.cfmmPoolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cfmmPoolId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(); - message.cfmmPoolId = object.cfmmPoolId !== undefined && object.cfmmPoolId !== null ? BigInt(object.cfmmPoolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; - }, - toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { - const obj: any = {}; - obj.cfmm_pool_id = message.cfmmPoolId ? message.cfmmPoolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: CFMMPoolIdLinkFromConcentratedPoolIdResponseAminoMsg): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return CFMMPoolIdLinkFromConcentratedPoolIdResponse.fromAmino(object.value); - }, - toAminoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): CFMMPoolIdLinkFromConcentratedPoolIdResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-response", - value: CFMMPoolIdLinkFromConcentratedPoolIdResponse.toAmino(message) - }; - }, - fromProtoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdResponseProtoMsg): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return CFMMPoolIdLinkFromConcentratedPoolIdResponse.decode(message.value); - }, - toProto(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): Uint8Array { - return CFMMPoolIdLinkFromConcentratedPoolIdResponse.encode(message).finish(); - }, - toProtoMsg(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): CFMMPoolIdLinkFromConcentratedPoolIdResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdResponse", - value: CFMMPoolIdLinkFromConcentratedPoolIdResponse.encode(message).finish() - }; - } -}; -function createBaseUserUnbondingPositionsRequest(): UserUnbondingPositionsRequest { - return { - address: "" - }; -} -export const UserUnbondingPositionsRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsRequest", - encode(message: UserUnbondingPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserUnbondingPositionsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserUnbondingPositionsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserUnbondingPositionsRequest { - const message = createBaseUserUnbondingPositionsRequest(); - message.address = object.address ?? ""; - return message; - }, - fromAmino(object: UserUnbondingPositionsRequestAmino): UserUnbondingPositionsRequest { - return { - address: object.address - }; - }, - toAmino(message: UserUnbondingPositionsRequest): UserUnbondingPositionsRequestAmino { - const obj: any = {}; - obj.address = message.address; - return obj; - }, - fromAminoMsg(object: UserUnbondingPositionsRequestAminoMsg): UserUnbondingPositionsRequest { - return UserUnbondingPositionsRequest.fromAmino(object.value); - }, - toAminoMsg(message: UserUnbondingPositionsRequest): UserUnbondingPositionsRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/user-unbonding-positions-request", - value: UserUnbondingPositionsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: UserUnbondingPositionsRequestProtoMsg): UserUnbondingPositionsRequest { - return UserUnbondingPositionsRequest.decode(message.value); - }, - toProto(message: UserUnbondingPositionsRequest): Uint8Array { - return UserUnbondingPositionsRequest.encode(message).finish(); - }, - toProtoMsg(message: UserUnbondingPositionsRequest): UserUnbondingPositionsRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsRequest", - value: UserUnbondingPositionsRequest.encode(message).finish() - }; - } -}; -function createBaseUserUnbondingPositionsResponse(): UserUnbondingPositionsResponse { - return { - positionsWithPeriodLock: [] - }; -} -export const UserUnbondingPositionsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsResponse", - encode(message: UserUnbondingPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.positionsWithPeriodLock) { - PositionWithPeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserUnbondingPositionsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserUnbondingPositionsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.positionsWithPeriodLock.push(PositionWithPeriodLock.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserUnbondingPositionsResponse { - const message = createBaseUserUnbondingPositionsResponse(); - message.positionsWithPeriodLock = object.positionsWithPeriodLock?.map(e => PositionWithPeriodLock.fromPartial(e)) || []; - return message; - }, - fromAmino(object: UserUnbondingPositionsResponseAmino): UserUnbondingPositionsResponse { - return { - positionsWithPeriodLock: Array.isArray(object?.positions_with_period_lock) ? object.positions_with_period_lock.map((e: any) => PositionWithPeriodLock.fromAmino(e)) : [] - }; - }, - toAmino(message: UserUnbondingPositionsResponse): UserUnbondingPositionsResponseAmino { - const obj: any = {}; - if (message.positionsWithPeriodLock) { - obj.positions_with_period_lock = message.positionsWithPeriodLock.map(e => e ? PositionWithPeriodLock.toAmino(e) : undefined); - } else { - obj.positions_with_period_lock = []; - } - return obj; - }, - fromAminoMsg(object: UserUnbondingPositionsResponseAminoMsg): UserUnbondingPositionsResponse { - return UserUnbondingPositionsResponse.fromAmino(object.value); - }, - toAminoMsg(message: UserUnbondingPositionsResponse): UserUnbondingPositionsResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/user-unbonding-positions-response", - value: UserUnbondingPositionsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: UserUnbondingPositionsResponseProtoMsg): UserUnbondingPositionsResponse { - return UserUnbondingPositionsResponse.decode(message.value); - }, - toProto(message: UserUnbondingPositionsResponse): Uint8Array { - return UserUnbondingPositionsResponse.encode(message).finish(); - }, - toProtoMsg(message: UserUnbondingPositionsResponse): UserUnbondingPositionsResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsResponse", - value: UserUnbondingPositionsResponse.encode(message).finish() - }; - } -}; -function createBaseGetTotalLiquidityRequest(): GetTotalLiquidityRequest { - return {}; -} -export const GetTotalLiquidityRequest = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityRequest", - encode(_: GetTotalLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalLiquidityRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalLiquidityRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): GetTotalLiquidityRequest { - const message = createBaseGetTotalLiquidityRequest(); - return message; - }, - fromAmino(_: GetTotalLiquidityRequestAmino): GetTotalLiquidityRequest { - return {}; - }, - toAmino(_: GetTotalLiquidityRequest): GetTotalLiquidityRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: GetTotalLiquidityRequestAminoMsg): GetTotalLiquidityRequest { - return GetTotalLiquidityRequest.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalLiquidityRequest): GetTotalLiquidityRequestAminoMsg { - return { - type: "osmosis/concentratedliquidity/get-total-liquidity-request", - value: GetTotalLiquidityRequest.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalLiquidityRequestProtoMsg): GetTotalLiquidityRequest { - return GetTotalLiquidityRequest.decode(message.value); - }, - toProto(message: GetTotalLiquidityRequest): Uint8Array { - return GetTotalLiquidityRequest.encode(message).finish(); - }, - toProtoMsg(message: GetTotalLiquidityRequest): GetTotalLiquidityRequestProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityRequest", - value: GetTotalLiquidityRequest.encode(message).finish() - }; - } -}; -function createBaseGetTotalLiquidityResponse(): GetTotalLiquidityResponse { - return { - totalLiquidity: [] - }; -} -export const GetTotalLiquidityResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityResponse", - encode(message: GetTotalLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.totalLiquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalLiquidityResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalLiquidityResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalLiquidity.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetTotalLiquidityResponse { - const message = createBaseGetTotalLiquidityResponse(); - message.totalLiquidity = object.totalLiquidity?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: GetTotalLiquidityResponseAmino): GetTotalLiquidityResponse { - return { - totalLiquidity: Array.isArray(object?.total_liquidity) ? object.total_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: GetTotalLiquidityResponse): GetTotalLiquidityResponseAmino { - const obj: any = {}; - if (message.totalLiquidity) { - obj.total_liquidity = message.totalLiquidity.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.total_liquidity = []; - } - return obj; - }, - fromAminoMsg(object: GetTotalLiquidityResponseAminoMsg): GetTotalLiquidityResponse { - return GetTotalLiquidityResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalLiquidityResponse): GetTotalLiquidityResponseAminoMsg { - return { - type: "osmosis/concentratedliquidity/get-total-liquidity-response", - value: GetTotalLiquidityResponse.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalLiquidityResponseProtoMsg): GetTotalLiquidityResponse { - return GetTotalLiquidityResponse.decode(message.value); - }, - toProto(message: GetTotalLiquidityResponse): Uint8Array { - return GetTotalLiquidityResponse.encode(message).finish(); - }, - toProtoMsg(message: GetTotalLiquidityResponse): GetTotalLiquidityResponseProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityResponse", - value: GetTotalLiquidityResponse.encode(message).finish() - }; - } -}; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts index ac30bbbd9..68ce9b416 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts @@ -4,14 +4,8 @@ import { Decimal } from "@cosmjs/math"; export interface TickInfo { liquidityGross: string; liquidityNet: string; - spreadRewardGrowthOppositeDirectionOfLastTraversal: DecCoin[]; - /** - * uptime_trackers is a container encapsulating the uptime trackers. - * We use a container instead of a "repeated UptimeTracker" directly - * because we need the ability to serialize and deserialize the - * container easily for events when crossing a tick. - */ - uptimeTrackers: UptimeTrackers; + feeGrowthOutside: DecCoin[]; + uptimeTrackers: UptimeTracker[]; } export interface TickInfoProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickInfo"; @@ -20,14 +14,8 @@ export interface TickInfoProtoMsg { export interface TickInfoAmino { liquidity_gross: string; liquidity_net: string; - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; - /** - * uptime_trackers is a container encapsulating the uptime trackers. - * We use a container instead of a "repeated UptimeTracker" directly - * because we need the ability to serialize and deserialize the - * container easily for events when crossing a tick. - */ - uptime_trackers?: UptimeTrackersAmino; + fee_growth_outside: DecCoinAmino[]; + uptime_trackers: UptimeTrackerAmino[]; } export interface TickInfoAminoMsg { type: "osmosis/concentratedliquidity/tick-info"; @@ -36,25 +24,8 @@ export interface TickInfoAminoMsg { export interface TickInfoSDKType { liquidity_gross: string; liquidity_net: string; - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinSDKType[]; - uptime_trackers: UptimeTrackersSDKType; -} -export interface UptimeTrackers { - list: UptimeTracker[]; -} -export interface UptimeTrackersProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UptimeTrackers"; - value: Uint8Array; -} -export interface UptimeTrackersAmino { - list: UptimeTrackerAmino[]; -} -export interface UptimeTrackersAminoMsg { - type: "osmosis/concentratedliquidity/uptime-trackers"; - value: UptimeTrackersAmino; -} -export interface UptimeTrackersSDKType { - list: UptimeTrackerSDKType[]; + fee_growth_outside: DecCoinSDKType[]; + uptime_trackers: UptimeTrackerSDKType[]; } export interface UptimeTracker { uptimeGrowthOutside: DecCoin[]; @@ -77,8 +48,8 @@ function createBaseTickInfo(): TickInfo { return { liquidityGross: "", liquidityNet: "", - spreadRewardGrowthOppositeDirectionOfLastTraversal: [], - uptimeTrackers: UptimeTrackers.fromPartial({}) + feeGrowthOutside: [], + uptimeTrackers: [] }; } export const TickInfo = { @@ -90,11 +61,11 @@ export const TickInfo = { if (message.liquidityNet !== "") { writer.uint32(18).string(Decimal.fromUserInput(message.liquidityNet, 18).atomics); } - for (const v of message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { + for (const v of message.feeGrowthOutside) { DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.uptimeTrackers !== undefined) { - UptimeTrackers.encode(message.uptimeTrackers, writer.uint32(34).fork()).ldelim(); + for (const v of message.uptimeTrackers) { + UptimeTracker.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -112,10 +83,10 @@ export const TickInfo = { message.liquidityNet = Decimal.fromAtomics(reader.string(), 18).toString(); break; case 3: - message.spreadRewardGrowthOppositeDirectionOfLastTraversal.push(DecCoin.decode(reader, reader.uint32())); + message.feeGrowthOutside.push(DecCoin.decode(reader, reader.uint32())); break; case 4: - message.uptimeTrackers = UptimeTrackers.decode(reader, reader.uint32()); + message.uptimeTrackers.push(UptimeTracker.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -128,28 +99,32 @@ export const TickInfo = { const message = createBaseTickInfo(); message.liquidityGross = object.liquidityGross ?? ""; message.liquidityNet = object.liquidityNet ?? ""; - message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spreadRewardGrowthOppositeDirectionOfLastTraversal?.map(e => DecCoin.fromPartial(e)) || []; - message.uptimeTrackers = object.uptimeTrackers !== undefined && object.uptimeTrackers !== null ? UptimeTrackers.fromPartial(object.uptimeTrackers) : undefined; + message.feeGrowthOutside = object.feeGrowthOutside?.map(e => DecCoin.fromPartial(e)) || []; + message.uptimeTrackers = object.uptimeTrackers?.map(e => UptimeTracker.fromPartial(e)) || []; return message; }, fromAmino(object: TickInfoAmino): TickInfo { return { liquidityGross: object.liquidity_gross, liquidityNet: object.liquidity_net, - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: object?.uptime_trackers ? UptimeTrackers.fromAmino(object.uptime_trackers) : undefined + feeGrowthOutside: Array.isArray(object?.fee_growth_outside) ? object.fee_growth_outside.map((e: any) => DecCoin.fromAmino(e)) : [], + uptimeTrackers: Array.isArray(object?.uptime_trackers) ? object.uptime_trackers.map((e: any) => UptimeTracker.fromAmino(e)) : [] }; }, toAmino(message: TickInfo): TickInfoAmino { const obj: any = {}; obj.liquidity_gross = message.liquidityGross; obj.liquidity_net = message.liquidityNet; - if (message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { - obj.spread_reward_growth_opposite_direction_of_last_traversal = message.spreadRewardGrowthOppositeDirectionOfLastTraversal.map(e => e ? DecCoin.toAmino(e) : undefined); + if (message.feeGrowthOutside) { + obj.fee_growth_outside = message.feeGrowthOutside.map(e => e ? DecCoin.toAmino(e) : undefined); } else { - obj.spread_reward_growth_opposite_direction_of_last_traversal = []; + obj.fee_growth_outside = []; + } + if (message.uptimeTrackers) { + obj.uptime_trackers = message.uptimeTrackers.map(e => e ? UptimeTracker.toAmino(e) : undefined); + } else { + obj.uptime_trackers = []; } - obj.uptime_trackers = message.uptimeTrackers ? UptimeTrackers.toAmino(message.uptimeTrackers) : undefined; return obj; }, fromAminoMsg(object: TickInfoAminoMsg): TickInfo { @@ -174,77 +149,6 @@ export const TickInfo = { }; } }; -function createBaseUptimeTrackers(): UptimeTrackers { - return { - list: [] - }; -} -export const UptimeTrackers = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UptimeTrackers", - encode(message: UptimeTrackers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.list) { - UptimeTracker.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UptimeTrackers { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUptimeTrackers(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.list.push(UptimeTracker.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UptimeTrackers { - const message = createBaseUptimeTrackers(); - message.list = object.list?.map(e => UptimeTracker.fromPartial(e)) || []; - return message; - }, - fromAmino(object: UptimeTrackersAmino): UptimeTrackers { - return { - list: Array.isArray(object?.list) ? object.list.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; - }, - toAmino(message: UptimeTrackers): UptimeTrackersAmino { - const obj: any = {}; - if (message.list) { - obj.list = message.list.map(e => e ? UptimeTracker.toAmino(e) : undefined); - } else { - obj.list = []; - } - return obj; - }, - fromAminoMsg(object: UptimeTrackersAminoMsg): UptimeTrackers { - return UptimeTrackers.fromAmino(object.value); - }, - toAminoMsg(message: UptimeTrackers): UptimeTrackersAminoMsg { - return { - type: "osmosis/concentratedliquidity/uptime-trackers", - value: UptimeTrackers.toAmino(message) - }; - }, - fromProtoMsg(message: UptimeTrackersProtoMsg): UptimeTrackers { - return UptimeTrackers.decode(message.value); - }, - toProto(message: UptimeTrackers): Uint8Array { - return UptimeTrackers.encode(message).finish(); - }, - toProtoMsg(message: UptimeTrackers): UptimeTrackersProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.UptimeTrackers", - value: UptimeTrackers.encode(message).finish() - }; - } -}; function createBaseUptimeTracker(): UptimeTracker { return { uptimeGrowthOutside: [] diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts index 42b960a5a..3a7510f61 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; +import { MsgCreatePosition, MsgWithdrawPosition, MsgCollectFees, MsgCollectIncentives, MsgFungifyChargedPositions } from "./tx"; export const AminoConverter = { "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition": { aminoType: "osmosis/concentratedliquidity/create-position", @@ -11,19 +11,19 @@ export const AminoConverter = { toAmino: MsgWithdrawPosition.toAmino, fromAmino: MsgWithdrawPosition.fromAmino }, - "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition": { - aminoType: "osmosis/concentratedliquidity/add-to-position", - toAmino: MsgAddToPosition.toAmino, - fromAmino: MsgAddToPosition.fromAmino - }, - "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards": { - aminoType: "osmosis/concentratedliquidity/collect-spread-rewards", - toAmino: MsgCollectSpreadRewards.toAmino, - fromAmino: MsgCollectSpreadRewards.fromAmino + "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees": { + aminoType: "osmosis/concentratedliquidity/collect-fees", + toAmino: MsgCollectFees.toAmino, + fromAmino: MsgCollectFees.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives": { aminoType: "osmosis/concentratedliquidity/collect-incentives", toAmino: MsgCollectIncentives.toAmino, fromAmino: MsgCollectIncentives.fromAmino + }, + "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions": { + aminoType: "osmosis/concentratedliquidity/fungify-charged-positions", + toAmino: MsgFungifyChargedPositions.toAmino, + fromAmino: MsgFungifyChargedPositions.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts index 965fa2714..f10ed049a 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", MsgAddToPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", MsgCollectSpreadRewards], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives]]; +import { MsgCreatePosition, MsgWithdrawPosition, MsgCollectFees, MsgCollectIncentives, MsgFungifyChargedPositions } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", MsgCollectFees], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives], ["/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions", MsgFungifyChargedPositions]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -21,16 +21,10 @@ export const MessageComposer = { value: MsgWithdrawPosition.encode(value).finish() }; }, - addToPosition(value: MsgAddToPosition) { + collectFees(value: MsgCollectFees) { 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() + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", + value: MsgCollectFees.encode(value).finish() }; }, collectIncentives(value: MsgCollectIncentives) { @@ -38,6 +32,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.encode(value).finish() }; + }, + fungifyChargedPositions(value: MsgFungifyChargedPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions", + value: MsgFungifyChargedPositions.encode(value).finish() + }; } }, withTypeUrl: { @@ -53,21 +53,21 @@ export const MessageComposer = { value }; }, - addToPosition(value: MsgAddToPosition) { + collectFees(value: MsgCollectFees) { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", value }; }, - collectSpreadRewards(value: MsgCollectSpreadRewards) { + collectIncentives(value: MsgCollectIncentives) { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value }; }, - collectIncentives(value: MsgCollectIncentives) { + fungifyChargedPositions(value: MsgFungifyChargedPositions) { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions", value }; } @@ -85,16 +85,10 @@ export const MessageComposer = { value: MsgWithdrawPosition.fromPartial(value) }; }, - addToPosition(value: MsgAddToPosition) { - return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", - value: MsgAddToPosition.fromPartial(value) - }; - }, - collectSpreadRewards(value: MsgCollectSpreadRewards) { + collectFees(value: MsgCollectFees) { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", - value: MsgCollectSpreadRewards.fromPartial(value) + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", + value: MsgCollectFees.fromPartial(value) }; }, collectIncentives(value: MsgCollectIncentives) { @@ -102,6 +96,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.fromPartial(value) }; + }, + fungifyChargedPositions(value: MsgFungifyChargedPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions", + value: MsgFungifyChargedPositions.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts index 0de3af954..7b960600d 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts @@ -1,19 +1,12 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgAddToPosition, MsgAddToPositionResponse, MsgCollectSpreadRewards, MsgCollectSpreadRewardsResponse, MsgCollectIncentives, MsgCollectIncentivesResponse } from "./tx"; +import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgCollectFees, MsgCollectFeesResponse, MsgCollectIncentives, MsgCollectIncentivesResponse, MsgFungifyChargedPositions, MsgFungifyChargedPositionsResponse } from "./tx"; export interface Msg { createPosition(request: MsgCreatePosition): Promise; withdrawPosition(request: MsgWithdrawPosition): Promise; - /** - * AddToPosition attempts to add amount0 and amount1 to a position - * with the given position id. - * To maintain backwards-compatibility with future implementations of - * charging, this function deletes the old position and creates a new one with - * the resulting amount after addition. - */ - addToPosition(request: MsgAddToPosition): Promise; - collectSpreadRewards(request: MsgCollectSpreadRewards): Promise; + collectFees(request: MsgCollectFees): Promise; collectIncentives(request: MsgCollectIncentives): Promise; + fungifyChargedPositions(request: MsgFungifyChargedPositions): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -21,9 +14,9 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.createPosition = this.createPosition.bind(this); this.withdrawPosition = this.withdrawPosition.bind(this); - this.addToPosition = this.addToPosition.bind(this); - this.collectSpreadRewards = this.collectSpreadRewards.bind(this); + this.collectFees = this.collectFees.bind(this); this.collectIncentives = this.collectIncentives.bind(this); + this.fungifyChargedPositions = this.fungifyChargedPositions.bind(this); } createPosition(request: MsgCreatePosition): Promise { const data = MsgCreatePosition.encode(request).finish(); @@ -35,19 +28,19 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "WithdrawPosition", data); return promise.then(data => MsgWithdrawPositionResponse.decode(new BinaryReader(data))); } - addToPosition(request: MsgAddToPosition): Promise { - const data = MsgAddToPosition.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "AddToPosition", data); - return promise.then(data => MsgAddToPositionResponse.decode(new BinaryReader(data))); - } - collectSpreadRewards(request: MsgCollectSpreadRewards): Promise { - const data = MsgCollectSpreadRewards.encode(request).finish(); - const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "CollectSpreadRewards", data); - return promise.then(data => MsgCollectSpreadRewardsResponse.decode(new BinaryReader(data))); + collectFees(request: MsgCollectFees): Promise { + const data = MsgCollectFees.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "CollectFees", data); + return promise.then(data => MsgCollectFeesResponse.decode(new BinaryReader(data))); } collectIncentives(request: MsgCollectIncentives): Promise { const data = MsgCollectIncentives.encode(request).finish(); const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "CollectIncentives", data); return promise.then(data => MsgCollectIncentivesResponse.decode(new BinaryReader(data))); } + fungifyChargedPositions(request: MsgFungifyChargedPositions): Promise { + const data = MsgFungifyChargedPositions.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "FungifyChargedPositions", data); + return promise.then(data => MsgFungifyChargedPositionsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts index 52a00f6b5..47bdd7eb0 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts @@ -1,5 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { toTimestamp, fromTimestamp } from "../../helpers"; import { Decimal } from "@cosmjs/math"; /** ===================== MsgCreatePosition */ export interface MsgCreatePosition { @@ -7,13 +10,8 @@ export interface MsgCreatePosition { 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[]; + tokenDesired0: Coin; + tokenDesired1: Coin; tokenMinAmount0: string; tokenMinAmount1: string; } @@ -27,13 +25,8 @@ export interface MsgCreatePositionAmino { 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_desired0?: CoinAmino; + token_desired1?: CoinAmino; token_min_amount0: string; token_min_amount1: string; } @@ -47,7 +40,8 @@ export interface MsgCreatePositionSDKType { sender: string; lower_tick: bigint; upper_tick: bigint; - tokens_provided: CoinSDKType[]; + token_desired0: CoinSDKType; + token_desired1: CoinSDKType; token_min_amount0: string; token_min_amount1: string; } @@ -55,15 +49,8 @@ export interface MsgCreatePositionResponse { positionId: bigint; amount0: string; amount1: string; + joinTime: Date; 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"; @@ -73,15 +60,8 @@ export interface MsgCreatePositionResponseAmino { position_id: string; amount0: string; amount1: string; + join_time?: Date; 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"; @@ -91,95 +71,8 @@ export interface MsgCreatePositionResponseSDKType { position_id: bigint; amount0: string; amount1: string; + join_time: Date; 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/concentratedliquidity/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 { @@ -227,45 +120,45 @@ export interface MsgWithdrawPositionResponseSDKType { amount0: string; amount1: string; } -/** ===================== MsgCollectSpreadRewards */ -export interface MsgCollectSpreadRewards { +/** ===================== MsgCollectFees */ +export interface MsgCollectFees { positionIds: bigint[]; sender: string; } -export interface MsgCollectSpreadRewardsProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards"; +export interface MsgCollectFeesProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees"; value: Uint8Array; } -/** ===================== MsgCollectSpreadRewards */ -export interface MsgCollectSpreadRewardsAmino { +/** ===================== MsgCollectFees */ +export interface MsgCollectFeesAmino { position_ids: string[]; sender: string; } -export interface MsgCollectSpreadRewardsAminoMsg { - type: "osmosis/concentratedliquidity/collect-spread-rewards"; - value: MsgCollectSpreadRewardsAmino; +export interface MsgCollectFeesAminoMsg { + type: "osmosis/concentratedliquidity/collect-fees"; + value: MsgCollectFeesAmino; } -/** ===================== MsgCollectSpreadRewards */ -export interface MsgCollectSpreadRewardsSDKType { +/** ===================== MsgCollectFees */ +export interface MsgCollectFeesSDKType { position_ids: bigint[]; sender: string; } -export interface MsgCollectSpreadRewardsResponse { - collectedSpreadRewards: Coin[]; +export interface MsgCollectFeesResponse { + collectedFees: Coin[]; } -export interface MsgCollectSpreadRewardsResponseProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse"; +export interface MsgCollectFeesResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFeesResponse"; value: Uint8Array; } -export interface MsgCollectSpreadRewardsResponseAmino { - collected_spread_rewards: CoinAmino[]; +export interface MsgCollectFeesResponseAmino { + collected_fees: CoinAmino[]; } -export interface MsgCollectSpreadRewardsResponseAminoMsg { - type: "osmosis/concentratedliquidity/collect-spread-rewards-response"; - value: MsgCollectSpreadRewardsResponseAmino; +export interface MsgCollectFeesResponseAminoMsg { + type: "osmosis/concentratedliquidity/collect-fees-response"; + value: MsgCollectFeesResponseAmino; } -export interface MsgCollectSpreadRewardsResponseSDKType { - collected_spread_rewards: CoinSDKType[]; +export interface MsgCollectFeesResponseSDKType { + collected_fees: CoinSDKType[]; } /** ===================== MsgCollectIncentives */ export interface MsgCollectIncentives { @@ -292,7 +185,6 @@ export interface MsgCollectIncentivesSDKType { } export interface MsgCollectIncentivesResponse { collectedIncentives: Coin[]; - forfeitedIncentives: Coin[]; } export interface MsgCollectIncentivesResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse"; @@ -300,7 +192,6 @@ export interface MsgCollectIncentivesResponseProtoMsg { } export interface MsgCollectIncentivesResponseAmino { collected_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; } export interface MsgCollectIncentivesResponseAminoMsg { type: "osmosis/concentratedliquidity/collect-incentives-response"; @@ -308,7 +199,73 @@ export interface MsgCollectIncentivesResponseAminoMsg { } export interface MsgCollectIncentivesResponseSDKType { collected_incentives: CoinSDKType[]; - forfeited_incentives: CoinSDKType[]; +} +/** ===================== MsgCreateIncentive */ +export interface MsgCreateIncentive { + poolId: bigint; + sender: string; + incentiveDenom: string; + incentiveAmount: string; + emissionRate: string; + startTime: Date; + minUptime: Duration; +} +export interface MsgCreateIncentiveProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentive"; + value: Uint8Array; +} +/** ===================== MsgCreateIncentive */ +export interface MsgCreateIncentiveAmino { + pool_id: string; + sender: string; + incentive_denom: string; + incentive_amount: string; + emission_rate: string; + start_time?: Date; + min_uptime?: DurationAmino; +} +export interface MsgCreateIncentiveAminoMsg { + type: "osmosis/concentratedliquidity/create-incentive"; + value: MsgCreateIncentiveAmino; +} +/** ===================== MsgCreateIncentive */ +export interface MsgCreateIncentiveSDKType { + pool_id: bigint; + sender: string; + incentive_denom: string; + incentive_amount: string; + emission_rate: string; + start_time: Date; + min_uptime: DurationSDKType; +} +export interface MsgCreateIncentiveResponse { + incentiveDenom: string; + incentiveAmount: string; + emissionRate: string; + startTime: Date; + minUptime: Duration; +} +export interface MsgCreateIncentiveResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentiveResponse"; + value: Uint8Array; +} +export interface MsgCreateIncentiveResponseAmino { + incentive_denom: string; + incentive_amount: string; + emission_rate: string; + start_time?: Date; + min_uptime?: DurationAmino; +} +export interface MsgCreateIncentiveResponseAminoMsg { + type: "osmosis/concentratedliquidity/create-incentive-response"; + value: MsgCreateIncentiveResponseAmino; +} +export interface MsgCreateIncentiveResponseSDKType { + incentive_denom: string; + incentive_amount: string; + emission_rate: string; + start_time: Date; + min_uptime: DurationSDKType; } /** ===================== MsgFungifyChargedPositions */ export interface MsgFungifyChargedPositions { @@ -356,7 +313,8 @@ function createBaseMsgCreatePosition(): MsgCreatePosition { sender: "", lowerTick: BigInt(0), upperTick: BigInt(0), - tokensProvided: [], + tokenDesired0: Coin.fromPartial({}), + tokenDesired1: Coin.fromPartial({}), tokenMinAmount0: "", tokenMinAmount1: "" }; @@ -376,14 +334,17 @@ export const MsgCreatePosition = { 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.tokenDesired0 !== undefined) { + Coin.encode(message.tokenDesired0, writer.uint32(42).fork()).ldelim(); + } + if (message.tokenDesired1 !== undefined) { + Coin.encode(message.tokenDesired1, writer.uint32(50).fork()).ldelim(); } if (message.tokenMinAmount0 !== "") { - writer.uint32(50).string(message.tokenMinAmount0); + writer.uint32(58).string(message.tokenMinAmount0); } if (message.tokenMinAmount1 !== "") { - writer.uint32(58).string(message.tokenMinAmount1); + writer.uint32(66).string(message.tokenMinAmount1); } return writer; }, @@ -407,12 +368,15 @@ export const MsgCreatePosition = { message.upperTick = reader.int64(); break; case 5: - message.tokensProvided.push(Coin.decode(reader, reader.uint32())); + message.tokenDesired0 = Coin.decode(reader, reader.uint32()); break; case 6: - message.tokenMinAmount0 = reader.string(); + message.tokenDesired1 = Coin.decode(reader, reader.uint32()); break; case 7: + message.tokenMinAmount0 = reader.string(); + break; + case 8: message.tokenMinAmount1 = reader.string(); break; default: @@ -428,7 +392,8 @@ export const MsgCreatePosition = { 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.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; message.tokenMinAmount0 = object.tokenMinAmount0 ?? ""; message.tokenMinAmount1 = object.tokenMinAmount1 ?? ""; return message; @@ -439,7 +404,8 @@ export const MsgCreatePosition = { sender: object.sender, lowerTick: BigInt(object.lower_tick), upperTick: BigInt(object.upper_tick), - tokensProvided: Array.isArray(object?.tokens_provided) ? object.tokens_provided.map((e: any) => Coin.fromAmino(e)) : [], + tokenDesired0: object?.token_desired0 ? Coin.fromAmino(object.token_desired0) : undefined, + tokenDesired1: object?.token_desired1 ? Coin.fromAmino(object.token_desired1) : undefined, tokenMinAmount0: object.token_min_amount0, tokenMinAmount1: object.token_min_amount1 }; @@ -450,11 +416,8 @@ export const MsgCreatePosition = { obj.sender = message.sender; obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; - if (message.tokensProvided) { - obj.tokens_provided = message.tokensProvided.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.tokens_provided = []; - } + obj.token_desired0 = message.tokenDesired0 ? Coin.toAmino(message.tokenDesired0) : undefined; + obj.token_desired1 = message.tokenDesired1 ? Coin.toAmino(message.tokenDesired1) : undefined; obj.token_min_amount0 = message.tokenMinAmount0; obj.token_min_amount1 = message.tokenMinAmount1; return obj; @@ -486,9 +449,8 @@ function createBaseMsgCreatePositionResponse(): MsgCreatePositionResponse { positionId: BigInt(0), amount0: "", amount1: "", - liquidityCreated: "", - lowerTick: BigInt(0), - upperTick: BigInt(0) + joinTime: new Date(), + liquidityCreated: "" }; } export const MsgCreatePositionResponse = { @@ -503,15 +465,12 @@ export const MsgCreatePositionResponse = { if (message.amount1 !== "") { writer.uint32(26).string(message.amount1); } + if (message.joinTime !== undefined) { + Timestamp.encode(toTimestamp(message.joinTime), writer.uint32(34).fork()).ldelim(); + } 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 { @@ -530,15 +489,12 @@ export const MsgCreatePositionResponse = { case 3: message.amount1 = reader.string(); break; + case 4: + message.joinTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + 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; @@ -551,9 +507,8 @@ export const MsgCreatePositionResponse = { message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); message.amount0 = object.amount0 ?? ""; message.amount1 = object.amount1 ?? ""; + message.joinTime = object.joinTime ?? undefined; 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 { @@ -561,9 +516,8 @@ export const MsgCreatePositionResponse = { positionId: BigInt(object.position_id), amount0: object.amount0, amount1: object.amount1, - liquidityCreated: object.liquidity_created, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) + joinTime: object.join_time, + liquidityCreated: object.liquidity_created }; }, toAmino(message: MsgCreatePositionResponse): MsgCreatePositionResponseAmino { @@ -571,9 +525,8 @@ export const MsgCreatePositionResponse = { obj.position_id = message.positionId ? message.positionId.toString() : undefined; obj.amount0 = message.amount0; obj.amount1 = message.amount1; + obj.join_time = message.joinTime; obj.liquidity_created = message.liquidityCreated; - obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; - obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; return obj; }, fromAminoMsg(object: MsgCreatePositionResponseAminoMsg): MsgCreatePositionResponse { @@ -598,210 +551,6 @@ export const MsgCreatePositionResponse = { }; } }; -function createBaseMsgAddToPosition(): MsgAddToPosition { - return { - positionId: BigInt(0), - sender: "", - amount0: "", - amount1: "", - tokenMinAmount0: "", - tokenMinAmount1: "" - }; -} -export const MsgAddToPosition = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", - 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 { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - amount0: object.amount0, - amount1: object.amount1, - tokenMinAmount0: object.token_min_amount0, - tokenMinAmount1: object.token_min_amount1 - }; - }, - toAmino(message: MsgAddToPosition): MsgAddToPositionAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - obj.sender = message.sender; - obj.amount0 = message.amount0; - obj.amount1 = message.amount1; - obj.token_min_amount0 = message.tokenMinAmount0; - obj.token_min_amount1 = message.tokenMinAmount1; - return obj; - }, - fromAminoMsg(object: MsgAddToPositionAminoMsg): MsgAddToPosition { - return MsgAddToPosition.fromAmino(object.value); - }, - toAminoMsg(message: MsgAddToPosition): MsgAddToPositionAminoMsg { - return { - type: "osmosis/concentratedliquidity/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() - }; - } -}; -function createBaseMsgAddToPositionResponse(): MsgAddToPositionResponse { - return { - positionId: BigInt(0), - amount0: "", - amount1: "" - }; -} -export const MsgAddToPositionResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse", - 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 { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1 - }; - }, - toAmino(message: MsgAddToPositionResponse): MsgAddToPositionResponseAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - obj.amount0 = message.amount0; - obj.amount1 = 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() - }; - } -}; function createBaseMsgWithdrawPosition(): MsgWithdrawPosition { return { positionId: BigInt(0), @@ -966,15 +715,15 @@ export const MsgWithdrawPositionResponse = { }; } }; -function createBaseMsgCollectSpreadRewards(): MsgCollectSpreadRewards { +function createBaseMsgCollectFees(): MsgCollectFees { return { positionIds: [], sender: "" }; } -export const MsgCollectSpreadRewards = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", - encode(message: MsgCollectSpreadRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgCollectFees = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", + encode(message: MsgCollectFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.positionIds) { writer.uint64(v); @@ -985,10 +734,10 @@ export const MsgCollectSpreadRewards = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgCollectSpreadRewards { + decode(input: BinaryReader | Uint8Array, length?: number): MsgCollectFees { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCollectSpreadRewards(); + const message = createBaseMsgCollectFees(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1012,19 +761,19 @@ export const MsgCollectSpreadRewards = { } return message; }, - fromPartial(object: Partial): MsgCollectSpreadRewards { - const message = createBaseMsgCollectSpreadRewards(); + fromPartial(object: Partial): MsgCollectFees { + const message = createBaseMsgCollectFees(); message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; message.sender = object.sender ?? ""; return message; }, - fromAmino(object: MsgCollectSpreadRewardsAmino): MsgCollectSpreadRewards { + fromAmino(object: MsgCollectFeesAmino): MsgCollectFees { return { positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], sender: object.sender }; }, - toAmino(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAmino { + toAmino(message: MsgCollectFees): MsgCollectFeesAmino { const obj: any = {}; if (message.positionIds) { obj.position_ids = message.positionIds.map(e => e.toString()); @@ -1034,50 +783,50 @@ export const MsgCollectSpreadRewards = { obj.sender = message.sender; return obj; }, - fromAminoMsg(object: MsgCollectSpreadRewardsAminoMsg): MsgCollectSpreadRewards { - return MsgCollectSpreadRewards.fromAmino(object.value); + fromAminoMsg(object: MsgCollectFeesAminoMsg): MsgCollectFees { + return MsgCollectFees.fromAmino(object.value); }, - toAminoMsg(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAminoMsg { + toAminoMsg(message: MsgCollectFees): MsgCollectFeesAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-spread-rewards", - value: MsgCollectSpreadRewards.toAmino(message) + type: "osmosis/concentratedliquidity/collect-fees", + value: MsgCollectFees.toAmino(message) }; }, - fromProtoMsg(message: MsgCollectSpreadRewardsProtoMsg): MsgCollectSpreadRewards { - return MsgCollectSpreadRewards.decode(message.value); + fromProtoMsg(message: MsgCollectFeesProtoMsg): MsgCollectFees { + return MsgCollectFees.decode(message.value); }, - toProto(message: MsgCollectSpreadRewards): Uint8Array { - return MsgCollectSpreadRewards.encode(message).finish(); + toProto(message: MsgCollectFees): Uint8Array { + return MsgCollectFees.encode(message).finish(); }, - toProtoMsg(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsProtoMsg { + toProtoMsg(message: MsgCollectFees): MsgCollectFeesProtoMsg { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", - value: MsgCollectSpreadRewards.encode(message).finish() + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFees", + value: MsgCollectFees.encode(message).finish() }; } }; -function createBaseMsgCollectSpreadRewardsResponse(): MsgCollectSpreadRewardsResponse { +function createBaseMsgCollectFeesResponse(): MsgCollectFeesResponse { return { - collectedSpreadRewards: [] + collectedFees: [] }; } -export const MsgCollectSpreadRewardsResponse = { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse", - encode(message: MsgCollectSpreadRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.collectedSpreadRewards) { +export const MsgCollectFeesResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFeesResponse", + encode(message: MsgCollectFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.collectedFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgCollectSpreadRewardsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgCollectFeesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCollectSpreadRewardsResponse(); + const message = createBaseMsgCollectFeesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.collectedSpreadRewards.push(Coin.decode(reader, reader.uint32())); + message.collectedFees.push(Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -1086,44 +835,44 @@ export const MsgCollectSpreadRewardsResponse = { } return message; }, - fromPartial(object: Partial): MsgCollectSpreadRewardsResponse { - const message = createBaseMsgCollectSpreadRewardsResponse(); - message.collectedSpreadRewards = object.collectedSpreadRewards?.map(e => Coin.fromPartial(e)) || []; + fromPartial(object: Partial): MsgCollectFeesResponse { + const message = createBaseMsgCollectFeesResponse(); + message.collectedFees = object.collectedFees?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgCollectSpreadRewardsResponseAmino): MsgCollectSpreadRewardsResponse { + fromAmino(object: MsgCollectFeesResponseAmino): MsgCollectFeesResponse { return { - collectedSpreadRewards: Array.isArray(object?.collected_spread_rewards) ? object.collected_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] + collectedFees: Array.isArray(object?.collected_fees) ? object.collected_fees.map((e: any) => Coin.fromAmino(e)) : [] }; }, - toAmino(message: MsgCollectSpreadRewardsResponse): MsgCollectSpreadRewardsResponseAmino { + toAmino(message: MsgCollectFeesResponse): MsgCollectFeesResponseAmino { const obj: any = {}; - if (message.collectedSpreadRewards) { - obj.collected_spread_rewards = message.collectedSpreadRewards.map(e => e ? Coin.toAmino(e) : undefined); + if (message.collectedFees) { + obj.collected_fees = message.collectedFees.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.collected_spread_rewards = []; + obj.collected_fees = []; } return obj; }, - fromAminoMsg(object: MsgCollectSpreadRewardsResponseAminoMsg): MsgCollectSpreadRewardsResponse { - return MsgCollectSpreadRewardsResponse.fromAmino(object.value); + fromAminoMsg(object: MsgCollectFeesResponseAminoMsg): MsgCollectFeesResponse { + return MsgCollectFeesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgCollectSpreadRewardsResponse): MsgCollectSpreadRewardsResponseAminoMsg { + toAminoMsg(message: MsgCollectFeesResponse): MsgCollectFeesResponseAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-spread-rewards-response", - value: MsgCollectSpreadRewardsResponse.toAmino(message) + type: "osmosis/concentratedliquidity/collect-fees-response", + value: MsgCollectFeesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgCollectSpreadRewardsResponseProtoMsg): MsgCollectSpreadRewardsResponse { - return MsgCollectSpreadRewardsResponse.decode(message.value); + fromProtoMsg(message: MsgCollectFeesResponseProtoMsg): MsgCollectFeesResponse { + return MsgCollectFeesResponse.decode(message.value); }, - toProto(message: MsgCollectSpreadRewardsResponse): Uint8Array { - return MsgCollectSpreadRewardsResponse.encode(message).finish(); + toProto(message: MsgCollectFeesResponse): Uint8Array { + return MsgCollectFeesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgCollectSpreadRewardsResponse): MsgCollectSpreadRewardsResponseProtoMsg { + toProtoMsg(message: MsgCollectFeesResponse): MsgCollectFeesResponseProtoMsg { return { - typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse", - value: MsgCollectSpreadRewardsResponse.encode(message).finish() + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectFeesResponse", + value: MsgCollectFeesResponse.encode(message).finish() }; } }; @@ -1219,8 +968,7 @@ export const MsgCollectIncentives = { }; function createBaseMsgCollectIncentivesResponse(): MsgCollectIncentivesResponse { return { - collectedIncentives: [], - forfeitedIncentives: [] + collectedIncentives: [] }; } export const MsgCollectIncentivesResponse = { @@ -1229,9 +977,6 @@ export const MsgCollectIncentivesResponse = { 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 { @@ -1244,9 +989,6 @@ export const MsgCollectIncentivesResponse = { 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; @@ -1257,13 +999,11 @@ export const MsgCollectIncentivesResponse = { 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 { return { - collectedIncentives: Array.isArray(object?.collected_incentives) ? object.collected_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] + collectedIncentives: Array.isArray(object?.collected_incentives) ? object.collected_incentives.map((e: any) => Coin.fromAmino(e)) : [] }; }, toAmino(message: MsgCollectIncentivesResponse): MsgCollectIncentivesResponseAmino { @@ -1273,11 +1013,6 @@ export const MsgCollectIncentivesResponse = { } else { obj.collected_incentives = []; } - if (message.forfeitedIncentives) { - obj.forfeited_incentives = message.forfeitedIncentives.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.forfeited_incentives = []; - } return obj; }, fromAminoMsg(object: MsgCollectIncentivesResponseAminoMsg): MsgCollectIncentivesResponse { @@ -1302,6 +1037,240 @@ export const MsgCollectIncentivesResponse = { }; } }; +function createBaseMsgCreateIncentive(): MsgCreateIncentive { + return { + poolId: BigInt(0), + sender: "", + incentiveDenom: "", + incentiveAmount: "", + emissionRate: "", + startTime: new Date(), + minUptime: Duration.fromPartial({}) + }; +} +export const MsgCreateIncentive = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentive", + encode(message: MsgCreateIncentive, 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.incentiveDenom !== "") { + writer.uint32(26).string(message.incentiveDenom); + } + if (message.incentiveAmount !== "") { + writer.uint32(34).string(message.incentiveAmount); + } + if (message.emissionRate !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.emissionRate, 18).atomics); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(50).fork()).ldelim(); + } + if (message.minUptime !== undefined) { + Duration.encode(message.minUptime, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateIncentive { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateIncentive(); + 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.incentiveDenom = reader.string(); + break; + case 4: + message.incentiveAmount = reader.string(); + break; + case 5: + message.emissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.minUptime = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateIncentive { + const message = createBaseMsgCreateIncentive(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.incentiveDenom = object.incentiveDenom ?? ""; + message.incentiveAmount = object.incentiveAmount ?? ""; + message.emissionRate = object.emissionRate ?? ""; + message.startTime = object.startTime ?? undefined; + message.minUptime = object.minUptime !== undefined && object.minUptime !== null ? Duration.fromPartial(object.minUptime) : undefined; + return message; + }, + fromAmino(object: MsgCreateIncentiveAmino): MsgCreateIncentive { + return { + poolId: BigInt(object.pool_id), + sender: object.sender, + incentiveDenom: object.incentive_denom, + incentiveAmount: object.incentive_amount, + emissionRate: object.emission_rate, + startTime: object.start_time, + minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined + }; + }, + toAmino(message: MsgCreateIncentive): MsgCreateIncentiveAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.sender = message.sender; + obj.incentive_denom = message.incentiveDenom; + obj.incentive_amount = message.incentiveAmount; + obj.emission_rate = message.emissionRate; + obj.start_time = message.startTime; + obj.min_uptime = message.minUptime ? Duration.toAmino(message.minUptime) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateIncentiveAminoMsg): MsgCreateIncentive { + return MsgCreateIncentive.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateIncentive): MsgCreateIncentiveAminoMsg { + return { + type: "osmosis/concentratedliquidity/create-incentive", + value: MsgCreateIncentive.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateIncentiveProtoMsg): MsgCreateIncentive { + return MsgCreateIncentive.decode(message.value); + }, + toProto(message: MsgCreateIncentive): Uint8Array { + return MsgCreateIncentive.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateIncentive): MsgCreateIncentiveProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentive", + value: MsgCreateIncentive.encode(message).finish() + }; + } +}; +function createBaseMsgCreateIncentiveResponse(): MsgCreateIncentiveResponse { + return { + incentiveDenom: "", + incentiveAmount: "", + emissionRate: "", + startTime: new Date(), + minUptime: Duration.fromPartial({}) + }; +} +export const MsgCreateIncentiveResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentiveResponse", + encode(message: MsgCreateIncentiveResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.incentiveDenom !== "") { + writer.uint32(10).string(message.incentiveDenom); + } + if (message.incentiveAmount !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.incentiveAmount, 18).atomics); + } + if (message.emissionRate !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.emissionRate, 18).atomics); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(34).fork()).ldelim(); + } + if (message.minUptime !== undefined) { + Duration.encode(message.minUptime, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateIncentiveResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateIncentiveResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.incentiveDenom = reader.string(); + break; + case 2: + message.incentiveAmount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.emissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.minUptime = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateIncentiveResponse { + const message = createBaseMsgCreateIncentiveResponse(); + message.incentiveDenom = object.incentiveDenom ?? ""; + message.incentiveAmount = object.incentiveAmount ?? ""; + message.emissionRate = object.emissionRate ?? ""; + message.startTime = object.startTime ?? undefined; + message.minUptime = object.minUptime !== undefined && object.minUptime !== null ? Duration.fromPartial(object.minUptime) : undefined; + return message; + }, + fromAmino(object: MsgCreateIncentiveResponseAmino): MsgCreateIncentiveResponse { + return { + incentiveDenom: object.incentive_denom, + incentiveAmount: object.incentive_amount, + emissionRate: object.emission_rate, + startTime: object.start_time, + minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined + }; + }, + toAmino(message: MsgCreateIncentiveResponse): MsgCreateIncentiveResponseAmino { + const obj: any = {}; + obj.incentive_denom = message.incentiveDenom; + obj.incentive_amount = message.incentiveAmount; + obj.emission_rate = message.emissionRate; + obj.start_time = message.startTime; + obj.min_uptime = message.minUptime ? Duration.toAmino(message.minUptime) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateIncentiveResponseAminoMsg): MsgCreateIncentiveResponse { + return MsgCreateIncentiveResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateIncentiveResponse): MsgCreateIncentiveResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/create-incentive-response", + value: MsgCreateIncentiveResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateIncentiveResponseProtoMsg): MsgCreateIncentiveResponse { + return MsgCreateIncentiveResponse.decode(message.value); + }, + toProto(message: MsgCreateIncentiveResponse): Uint8Array { + return MsgCreateIncentiveResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateIncentiveResponse): MsgCreateIncentiveResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreateIncentiveResponse", + value: MsgCreateIncentiveResponse.encode(message).finish() + }; + } +}; function createBaseMsgFungifyChargedPositions(): MsgFungifyChargedPositions { return { positionIds: [], diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts index d19703641..66480661c 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts @@ -1,34 +1,31 @@ -import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params holds parameters for the cosmwasmpool module */ +export interface Params {} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.cosmwasmpool.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the cosmwasmpool module */ +export interface ParamsAmino {} +export interface ParamsAminoMsg { + type: "osmosis/cosmwasmpool/params"; + value: ParamsAmino; +} +/** Params holds parameters for the cosmwasmpool module */ +export interface ParamsSDKType {} /** GenesisState defines the cosmwasmpool module's genesis state. */ export interface GenesisState { /** params is the container of cosmwasmpool parameters. */ params: Params; - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GenesisState"; value: Uint8Array; } -export type GenesisStateEncoded = Omit & { - pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; -}; /** GenesisState defines the cosmwasmpool module's genesis state. */ export interface GenesisStateAmino { /** params is the container of cosmwasmpool parameters. */ params?: ParamsAmino; - pools: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/cosmwasmpool/genesis-state"; @@ -37,12 +34,65 @@ export interface GenesisStateAminoMsg { /** GenesisState defines the cosmwasmpool module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; - pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; } +function createBaseParams(): Params { + return {}; +} +export const Params = { + typeUrl: "/osmosis.cosmwasmpool.v1beta1.Params", + encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + 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) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Params { + const message = createBaseParams(); + return message; + }, + fromAmino(_: ParamsAmino): Params { + return {}; + }, + toAmino(_: Params): ParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/cosmwasmpool/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.cosmwasmpool.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; function createBaseGenesisState(): GenesisState { return { - params: Params.fromPartial({}), - pools: [] + params: Params.fromPartial({}) }; } export const GenesisState = { @@ -51,9 +101,6 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -66,9 +113,6 @@ export const GenesisState = { case 1: message.params = Params.decode(reader, reader.uint32()); break; - case 2: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); - break; default: reader.skipType(tag & 7); break; @@ -79,23 +123,16 @@ export const GenesisState = { fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [] + params: object?.params ? Params.fromAmino(object.params) : undefined }; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; obj.params = message.params ? Params.toAmino(message.params) : undefined; - if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); - } else { - obj.pools = []; - } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -119,72 +156,4 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts deleted file mode 100644 index ec833f7f9..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts +++ /dev/null @@ -1,407 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../binary"; -import { fromBase64, toBase64 } from "@cosmjs/encoding"; -/** - * UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for - * uploading coswasm pool code and adding it to internal whitelist. Only the - * code ids created by this message are eligible for being x/cosmwasmpool pools. - */ -export interface UploadCosmWasmPoolCodeAndWhiteListProposal { - title: string; - description: string; - /** WASMByteCode can be raw or gzip compressed */ - wasmByteCode: Uint8Array; -} -export interface UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal"; - value: Uint8Array; -} -/** - * UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for - * uploading coswasm pool code and adding it to internal whitelist. Only the - * code ids created by this message are eligible for being x/cosmwasmpool pools. - */ -export interface UploadCosmWasmPoolCodeAndWhiteListProposalAmino { - title: string; - description: string; - /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; -} -export interface UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg { - type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal"; - value: UploadCosmWasmPoolCodeAndWhiteListProposalAmino; -} -/** - * UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for - * uploading coswasm pool code and adding it to internal whitelist. Only the - * code ids created by this message are eligible for being x/cosmwasmpool pools. - */ -export interface UploadCosmWasmPoolCodeAndWhiteListProposalSDKType { - title: string; - description: string; - wasm_byte_code: Uint8Array; -} -/** - * MigratePoolContractsProposal is a gov Content type for - * migrating given pools to the new contract code and adding to internal - * whitelist if needed. It has two options to perform the migration: - * - * 1. If the codeID is non-zero, it will migrate the pool contracts to a given - * codeID assuming that it has already been uploaded. uploadByteCode must be - * empty in such a case. Fails if codeID does not exist. Fails if uploadByteCode - * is not empty. - * - * 2. If the codeID is zero, it will upload the given uploadByteCode and use the - * new resulting code id to migrate the pool to. Errors if uploadByteCode is - * empty or invalid. - * - * In both cases, if one of the pools specified by the given poolID does not - * exist, the proposal fails. - * - * The reason for having poolIDs be a slice of ids is to account for the - * potential need for emergency migration of all old code ids associated with - * particular pools to new code ids, or simply having the flexibility of - * migrating multiple older pool contracts to a new one at once when there is a - * release. - * - * poolD count to be submitted at once is gated by a governance paramets (20 at - * launch). The proposal fails if more. Note that 20 was chosen arbitrarily to - * have a constant bound on the number of pools migrated at once. This size will - * be configured by a module parameter so it can be changed by a constant. - */ -export interface MigratePoolContractsProposal { - title: string; - description: string; - /** - * pool_ids are the pool ids of the contracts to be migrated - * either to the new_code_id that is already uploaded to chain or to - * the given wasm_byte_code. - */ - poolIds: bigint[]; - /** - * new_code_id is the code id of the contract code to migrate to. - * Assumes that the code is already uploaded to chain. Only one of - * new_code_id and wasm_byte_code should be set. - */ - newCodeId: bigint; - /** - * WASMByteCode can be raw or gzip compressed. Assumes that the code id - * has not been uploaded yet so uploads the given code and migrates to it. - * Only one of new_code_id and wasm_byte_code should be set. - */ - wasmByteCode: Uint8Array; - /** MigrateMsg migrate message to be used for migrating the pool contracts. */ - migrateMsg: Uint8Array; -} -export interface MigratePoolContractsProposalProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal"; - value: Uint8Array; -} -/** - * MigratePoolContractsProposal is a gov Content type for - * migrating given pools to the new contract code and adding to internal - * whitelist if needed. It has two options to perform the migration: - * - * 1. If the codeID is non-zero, it will migrate the pool contracts to a given - * codeID assuming that it has already been uploaded. uploadByteCode must be - * empty in such a case. Fails if codeID does not exist. Fails if uploadByteCode - * is not empty. - * - * 2. If the codeID is zero, it will upload the given uploadByteCode and use the - * new resulting code id to migrate the pool to. Errors if uploadByteCode is - * empty or invalid. - * - * In both cases, if one of the pools specified by the given poolID does not - * exist, the proposal fails. - * - * The reason for having poolIDs be a slice of ids is to account for the - * potential need for emergency migration of all old code ids associated with - * particular pools to new code ids, or simply having the flexibility of - * migrating multiple older pool contracts to a new one at once when there is a - * release. - * - * poolD count to be submitted at once is gated by a governance paramets (20 at - * launch). The proposal fails if more. Note that 20 was chosen arbitrarily to - * have a constant bound on the number of pools migrated at once. This size will - * be configured by a module parameter so it can be changed by a constant. - */ -export interface MigratePoolContractsProposalAmino { - title: string; - description: string; - /** - * pool_ids are the pool ids of the contracts to be migrated - * either to the new_code_id that is already uploaded to chain or to - * the given wasm_byte_code. - */ - pool_ids: string[]; - /** - * new_code_id is the code id of the contract code to migrate to. - * Assumes that the code is already uploaded to chain. Only one of - * new_code_id and wasm_byte_code should be set. - */ - new_code_id: string; - /** - * WASMByteCode can be raw or gzip compressed. Assumes that the code id - * has not been uploaded yet so uploads the given code and migrates to it. - * Only one of new_code_id and wasm_byte_code should be set. - */ - wasm_byte_code: string; - /** MigrateMsg migrate message to be used for migrating the pool contracts. */ - migrate_msg: Uint8Array; -} -export interface MigratePoolContractsProposalAminoMsg { - type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal"; - value: MigratePoolContractsProposalAmino; -} -/** - * MigratePoolContractsProposal is a gov Content type for - * migrating given pools to the new contract code and adding to internal - * whitelist if needed. It has two options to perform the migration: - * - * 1. If the codeID is non-zero, it will migrate the pool contracts to a given - * codeID assuming that it has already been uploaded. uploadByteCode must be - * empty in such a case. Fails if codeID does not exist. Fails if uploadByteCode - * is not empty. - * - * 2. If the codeID is zero, it will upload the given uploadByteCode and use the - * new resulting code id to migrate the pool to. Errors if uploadByteCode is - * empty or invalid. - * - * In both cases, if one of the pools specified by the given poolID does not - * exist, the proposal fails. - * - * The reason for having poolIDs be a slice of ids is to account for the - * potential need for emergency migration of all old code ids associated with - * particular pools to new code ids, or simply having the flexibility of - * migrating multiple older pool contracts to a new one at once when there is a - * release. - * - * poolD count to be submitted at once is gated by a governance paramets (20 at - * launch). The proposal fails if more. Note that 20 was chosen arbitrarily to - * have a constant bound on the number of pools migrated at once. This size will - * be configured by a module parameter so it can be changed by a constant. - */ -export interface MigratePoolContractsProposalSDKType { - title: string; - description: string; - pool_ids: bigint[]; - new_code_id: bigint; - wasm_byte_code: Uint8Array; - migrate_msg: Uint8Array; -} -function createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(): UploadCosmWasmPoolCodeAndWhiteListProposal { - return { - title: "", - description: "", - wasmByteCode: new Uint8Array() - }; -} -export const UploadCosmWasmPoolCodeAndWhiteListProposal = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", - encode(message: UploadCosmWasmPoolCodeAndWhiteListProposal, 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.wasmByteCode.length !== 0) { - writer.uint32(26).bytes(message.wasmByteCode); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UploadCosmWasmPoolCodeAndWhiteListProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(); - 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.wasmByteCode = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UploadCosmWasmPoolCodeAndWhiteListProposal { - const message = createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); - return message; - }, - fromAmino(object: UploadCosmWasmPoolCodeAndWhiteListProposalAmino): UploadCosmWasmPoolCodeAndWhiteListProposal { - return { - title: object.title, - description: object.description, - wasmByteCode: fromBase64(object.wasm_byte_code) - }; - }, - toAmino(message: UploadCosmWasmPoolCodeAndWhiteListProposal): UploadCosmWasmPoolCodeAndWhiteListProposalAmino { - const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - return obj; - }, - fromAminoMsg(object: UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg): UploadCosmWasmPoolCodeAndWhiteListProposal { - return UploadCosmWasmPoolCodeAndWhiteListProposal.fromAmino(object.value); - }, - toAminoMsg(message: UploadCosmWasmPoolCodeAndWhiteListProposal): UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg { - return { - type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal", - value: UploadCosmWasmPoolCodeAndWhiteListProposal.toAmino(message) - }; - }, - fromProtoMsg(message: UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg): UploadCosmWasmPoolCodeAndWhiteListProposal { - return UploadCosmWasmPoolCodeAndWhiteListProposal.decode(message.value); - }, - toProto(message: UploadCosmWasmPoolCodeAndWhiteListProposal): Uint8Array { - return UploadCosmWasmPoolCodeAndWhiteListProposal.encode(message).finish(); - }, - toProtoMsg(message: UploadCosmWasmPoolCodeAndWhiteListProposal): UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", - value: UploadCosmWasmPoolCodeAndWhiteListProposal.encode(message).finish() - }; - } -}; -function createBaseMigratePoolContractsProposal(): MigratePoolContractsProposal { - return { - title: "", - description: "", - poolIds: [], - newCodeId: BigInt(0), - wasmByteCode: new Uint8Array(), - migrateMsg: new Uint8Array() - }; -} -export const MigratePoolContractsProposal = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", - encode(message: MigratePoolContractsProposal, 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.poolIds) { - writer.uint64(v); - } - writer.ldelim(); - if (message.newCodeId !== BigInt(0)) { - writer.uint32(32).uint64(message.newCodeId); - } - if (message.wasmByteCode.length !== 0) { - writer.uint32(42).bytes(message.wasmByteCode); - } - if (message.migrateMsg.length !== 0) { - writer.uint32(50).bytes(message.migrateMsg); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MigratePoolContractsProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMigratePoolContractsProposal(); - 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.poolIds.push(reader.uint64()); - } - } else { - message.poolIds.push(reader.uint64()); - } - break; - case 4: - message.newCodeId = reader.uint64(); - break; - case 5: - message.wasmByteCode = reader.bytes(); - break; - case 6: - message.migrateMsg = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MigratePoolContractsProposal { - const message = createBaseMigratePoolContractsProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; - message.newCodeId = object.newCodeId !== undefined && object.newCodeId !== null ? BigInt(object.newCodeId.toString()) : BigInt(0); - message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); - message.migrateMsg = object.migrateMsg ?? new Uint8Array(); - return message; - }, - fromAmino(object: MigratePoolContractsProposalAmino): MigratePoolContractsProposal { - return { - title: object.title, - description: object.description, - poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => BigInt(e)) : [], - newCodeId: BigInt(object.new_code_id), - wasmByteCode: fromBase64(object.wasm_byte_code), - migrateMsg: object.migrate_msg - }; - }, - toAmino(message: MigratePoolContractsProposal): MigratePoolContractsProposalAmino { - const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - if (message.poolIds) { - obj.pool_ids = message.poolIds.map(e => e.toString()); - } else { - obj.pool_ids = []; - } - obj.new_code_id = message.newCodeId ? message.newCodeId.toString() : undefined; - obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.migrate_msg = message.migrateMsg; - return obj; - }, - fromAminoMsg(object: MigratePoolContractsProposalAminoMsg): MigratePoolContractsProposal { - return MigratePoolContractsProposal.fromAmino(object.value); - }, - toAminoMsg(message: MigratePoolContractsProposal): MigratePoolContractsProposalAminoMsg { - return { - type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal", - value: MigratePoolContractsProposal.toAmino(message) - }; - }, - fromProtoMsg(message: MigratePoolContractsProposalProtoMsg): MigratePoolContractsProposal { - return MigratePoolContractsProposal.decode(message.value); - }, - toProto(message: MigratePoolContractsProposal): Uint8Array { - return MigratePoolContractsProposal.encode(message).finish(); - }, - toProtoMsg(message: MigratePoolContractsProposal): MigratePoolContractsProposalProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", - value: MigratePoolContractsProposal.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts deleted file mode 100644 index 800b249c4..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../../binary"; -/** ===================== InstantiateMsg */ -export interface InstantiateMsg { - /** - * pool_asset_denoms is the list of asset denoms that are initialized - * at pool creation time. - */ - poolAssetDenoms: string[]; -} -export interface InstantiateMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.InstantiateMsg"; - value: Uint8Array; -} -/** ===================== InstantiateMsg */ -export interface InstantiateMsgAmino { - /** - * pool_asset_denoms is the list of asset denoms that are initialized - * at pool creation time. - */ - pool_asset_denoms: string[]; -} -export interface InstantiateMsgAminoMsg { - type: "osmosis/cosmwasmpool/instantiate-msg"; - value: InstantiateMsgAmino; -} -/** ===================== InstantiateMsg */ -export interface InstantiateMsgSDKType { - pool_asset_denoms: string[]; -} -function createBaseInstantiateMsg(): InstantiateMsg { - return { - poolAssetDenoms: [] - }; -} -export const InstantiateMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.InstantiateMsg", - encode(message: InstantiateMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.poolAssetDenoms) { - writer.uint32(10).string(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): InstantiateMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstantiateMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolAssetDenoms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): InstantiateMsg { - const message = createBaseInstantiateMsg(); - message.poolAssetDenoms = object.poolAssetDenoms?.map(e => e) || []; - return message; - }, - fromAmino(object: InstantiateMsgAmino): InstantiateMsg { - return { - poolAssetDenoms: Array.isArray(object?.pool_asset_denoms) ? object.pool_asset_denoms.map((e: any) => e) : [] - }; - }, - toAmino(message: InstantiateMsg): InstantiateMsgAmino { - const obj: any = {}; - if (message.poolAssetDenoms) { - obj.pool_asset_denoms = message.poolAssetDenoms.map(e => e); - } else { - obj.pool_asset_denoms = []; - } - return obj; - }, - fromAminoMsg(object: InstantiateMsgAminoMsg): InstantiateMsg { - return InstantiateMsg.fromAmino(object.value); - }, - toAminoMsg(message: InstantiateMsg): InstantiateMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/instantiate-msg", - value: InstantiateMsg.toAmino(message) - }; - }, - fromProtoMsg(message: InstantiateMsgProtoMsg): InstantiateMsg { - return InstantiateMsg.decode(message.value); - }, - toProto(message: InstantiateMsg): Uint8Array { - return InstantiateMsg.encode(message).finish(); - }, - toProtoMsg(message: InstantiateMsg): InstantiateMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.InstantiateMsg", - value: InstantiateMsg.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts deleted file mode 100644 index 0bcc4dab8..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts +++ /dev/null @@ -1,597 +0,0 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { Decimal } from "@cosmjs/math"; -/** ===================== CalcOutAmtGivenIn */ -export interface CalcOutAmtGivenIn { - /** token_in is the token to be sent to the pool. */ - tokenIn: Coin; - /** token_out_denom is the token denom to be received from the pool. */ - tokenOutDenom: string; - /** swap_fee is the swap fee for this swap estimate. */ - swapFee: string; -} -export interface CalcOutAmtGivenInProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenIn"; - value: Uint8Array; -} -/** ===================== CalcOutAmtGivenIn */ -export interface CalcOutAmtGivenInAmino { - /** token_in is the token to be sent to the pool. */ - token_in?: CoinAmino; - /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; - /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; -} -export interface CalcOutAmtGivenInAminoMsg { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in"; - value: CalcOutAmtGivenInAmino; -} -/** ===================== CalcOutAmtGivenIn */ -export interface CalcOutAmtGivenInSDKType { - token_in: CoinSDKType; - token_out_denom: string; - swap_fee: string; -} -export interface CalcOutAmtGivenInRequest { - /** - * calc_out_amt_given_in is the structure containing all the request - * information for this query. - */ - calcOutAmtGivenIn: CalcOutAmtGivenIn; -} -export interface CalcOutAmtGivenInRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInRequest"; - value: Uint8Array; -} -export interface CalcOutAmtGivenInRequestAmino { - /** - * calc_out_amt_given_in is the structure containing all the request - * information for this query. - */ - calc_out_amt_given_in?: CalcOutAmtGivenInAmino; -} -export interface CalcOutAmtGivenInRequestAminoMsg { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in-request"; - value: CalcOutAmtGivenInRequestAmino; -} -export interface CalcOutAmtGivenInRequestSDKType { - calc_out_amt_given_in: CalcOutAmtGivenInSDKType; -} -export interface CalcOutAmtGivenInResponse { - /** token_out is the token out computed from this swap estimate call. */ - tokenOut: Coin; -} -export interface CalcOutAmtGivenInResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInResponse"; - value: Uint8Array; -} -export interface CalcOutAmtGivenInResponseAmino { - /** token_out is the token out computed from this swap estimate call. */ - token_out?: CoinAmino; -} -export interface CalcOutAmtGivenInResponseAminoMsg { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in-response"; - value: CalcOutAmtGivenInResponseAmino; -} -export interface CalcOutAmtGivenInResponseSDKType { - token_out: CoinSDKType; -} -/** ===================== CalcInAmtGivenOut */ -export interface CalcInAmtGivenOut { - /** token_out is the token out to be receoved from the pool. */ - tokenOut: Coin; - /** token_in_denom is the token denom to be sentt to the pool. */ - tokenInDenom: string; - /** swap_fee is the swap fee for this swap estimate. */ - swapFee: string; -} -export interface CalcInAmtGivenOutProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOut"; - value: Uint8Array; -} -/** ===================== CalcInAmtGivenOut */ -export interface CalcInAmtGivenOutAmino { - /** token_out is the token out to be receoved from the pool. */ - token_out?: CoinAmino; - /** token_in_denom is the token denom to be sentt to the pool. */ - token_in_denom: string; - /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; -} -export interface CalcInAmtGivenOutAminoMsg { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out"; - value: CalcInAmtGivenOutAmino; -} -/** ===================== CalcInAmtGivenOut */ -export interface CalcInAmtGivenOutSDKType { - token_out: CoinSDKType; - token_in_denom: string; - swap_fee: string; -} -export interface CalcInAmtGivenOutRequest { - /** - * calc_in_amt_given_out is the structure containing all the request - * information for this query. - */ - calcInAmtGivenOut: CalcInAmtGivenOut; -} -export interface CalcInAmtGivenOutRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutRequest"; - value: Uint8Array; -} -export interface CalcInAmtGivenOutRequestAmino { - /** - * calc_in_amt_given_out is the structure containing all the request - * information for this query. - */ - calc_in_amt_given_out?: CalcInAmtGivenOutAmino; -} -export interface CalcInAmtGivenOutRequestAminoMsg { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out-request"; - value: CalcInAmtGivenOutRequestAmino; -} -export interface CalcInAmtGivenOutRequestSDKType { - calc_in_amt_given_out: CalcInAmtGivenOutSDKType; -} -export interface CalcInAmtGivenOutResponse { - /** token_in is the token in computed from this swap estimate call. */ - tokenIn: Coin; -} -export interface CalcInAmtGivenOutResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutResponse"; - value: Uint8Array; -} -export interface CalcInAmtGivenOutResponseAmino { - /** token_in is the token in computed from this swap estimate call. */ - token_in?: CoinAmino; -} -export interface CalcInAmtGivenOutResponseAminoMsg { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out-response"; - value: CalcInAmtGivenOutResponseAmino; -} -export interface CalcInAmtGivenOutResponseSDKType { - token_in: CoinSDKType; -} -function createBaseCalcOutAmtGivenIn(): CalcOutAmtGivenIn { - return { - tokenIn: undefined, - tokenOutDenom: "", - swapFee: "" - }; -} -export const CalcOutAmtGivenIn = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenIn", - encode(message: CalcOutAmtGivenIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(10).fork()).ldelim(); - } - if (message.tokenOutDenom !== "") { - writer.uint32(18).string(message.tokenOutDenom); - } - if (message.swapFee !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.swapFee, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcOutAmtGivenIn { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcOutAmtGivenIn(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.tokenOutDenom = reader.string(); - break; - case 3: - message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcOutAmtGivenIn { - const message = createBaseCalcOutAmtGivenIn(); - message.tokenIn = object.tokenIn !== undefined && object.tokenIn !== null ? Coin.fromPartial(object.tokenIn) : undefined; - message.tokenOutDenom = object.tokenOutDenom ?? ""; - message.swapFee = object.swapFee ?? ""; - return message; - }, - fromAmino(object: CalcOutAmtGivenInAmino): CalcOutAmtGivenIn { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - swapFee: object.swap_fee - }; - }, - toAmino(message: CalcOutAmtGivenIn): CalcOutAmtGivenInAmino { - const obj: any = {}; - obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; - obj.token_out_denom = message.tokenOutDenom; - obj.swap_fee = message.swapFee; - return obj; - }, - fromAminoMsg(object: CalcOutAmtGivenInAminoMsg): CalcOutAmtGivenIn { - return CalcOutAmtGivenIn.fromAmino(object.value); - }, - toAminoMsg(message: CalcOutAmtGivenIn): CalcOutAmtGivenInAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in", - value: CalcOutAmtGivenIn.toAmino(message) - }; - }, - fromProtoMsg(message: CalcOutAmtGivenInProtoMsg): CalcOutAmtGivenIn { - return CalcOutAmtGivenIn.decode(message.value); - }, - toProto(message: CalcOutAmtGivenIn): Uint8Array { - return CalcOutAmtGivenIn.encode(message).finish(); - }, - toProtoMsg(message: CalcOutAmtGivenIn): CalcOutAmtGivenInProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenIn", - value: CalcOutAmtGivenIn.encode(message).finish() - }; - } -}; -function createBaseCalcOutAmtGivenInRequest(): CalcOutAmtGivenInRequest { - return { - calcOutAmtGivenIn: CalcOutAmtGivenIn.fromPartial({}) - }; -} -export const CalcOutAmtGivenInRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInRequest", - encode(message: CalcOutAmtGivenInRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.calcOutAmtGivenIn !== undefined) { - CalcOutAmtGivenIn.encode(message.calcOutAmtGivenIn, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcOutAmtGivenInRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcOutAmtGivenInRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.calcOutAmtGivenIn = CalcOutAmtGivenIn.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcOutAmtGivenInRequest { - const message = createBaseCalcOutAmtGivenInRequest(); - message.calcOutAmtGivenIn = object.calcOutAmtGivenIn !== undefined && object.calcOutAmtGivenIn !== null ? CalcOutAmtGivenIn.fromPartial(object.calcOutAmtGivenIn) : undefined; - return message; - }, - fromAmino(object: CalcOutAmtGivenInRequestAmino): CalcOutAmtGivenInRequest { - return { - calcOutAmtGivenIn: object?.calc_out_amt_given_in ? CalcOutAmtGivenIn.fromAmino(object.calc_out_amt_given_in) : undefined - }; - }, - toAmino(message: CalcOutAmtGivenInRequest): CalcOutAmtGivenInRequestAmino { - const obj: any = {}; - obj.calc_out_amt_given_in = message.calcOutAmtGivenIn ? CalcOutAmtGivenIn.toAmino(message.calcOutAmtGivenIn) : undefined; - return obj; - }, - fromAminoMsg(object: CalcOutAmtGivenInRequestAminoMsg): CalcOutAmtGivenInRequest { - return CalcOutAmtGivenInRequest.fromAmino(object.value); - }, - toAminoMsg(message: CalcOutAmtGivenInRequest): CalcOutAmtGivenInRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in-request", - value: CalcOutAmtGivenInRequest.toAmino(message) - }; - }, - fromProtoMsg(message: CalcOutAmtGivenInRequestProtoMsg): CalcOutAmtGivenInRequest { - return CalcOutAmtGivenInRequest.decode(message.value); - }, - toProto(message: CalcOutAmtGivenInRequest): Uint8Array { - return CalcOutAmtGivenInRequest.encode(message).finish(); - }, - toProtoMsg(message: CalcOutAmtGivenInRequest): CalcOutAmtGivenInRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInRequest", - value: CalcOutAmtGivenInRequest.encode(message).finish() - }; - } -}; -function createBaseCalcOutAmtGivenInResponse(): CalcOutAmtGivenInResponse { - return { - tokenOut: undefined - }; -} -export const CalcOutAmtGivenInResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInResponse", - encode(message: CalcOutAmtGivenInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcOutAmtGivenInResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcOutAmtGivenInResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcOutAmtGivenInResponse { - const message = createBaseCalcOutAmtGivenInResponse(); - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - return message; - }, - fromAmino(object: CalcOutAmtGivenInResponseAmino): CalcOutAmtGivenInResponse { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; - }, - toAmino(message: CalcOutAmtGivenInResponse): CalcOutAmtGivenInResponseAmino { - const obj: any = {}; - obj.token_out = message.tokenOut ? Coin.toAmino(message.tokenOut) : undefined; - return obj; - }, - fromAminoMsg(object: CalcOutAmtGivenInResponseAminoMsg): CalcOutAmtGivenInResponse { - return CalcOutAmtGivenInResponse.fromAmino(object.value); - }, - toAminoMsg(message: CalcOutAmtGivenInResponse): CalcOutAmtGivenInResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-out-amt-given-in-response", - value: CalcOutAmtGivenInResponse.toAmino(message) - }; - }, - fromProtoMsg(message: CalcOutAmtGivenInResponseProtoMsg): CalcOutAmtGivenInResponse { - return CalcOutAmtGivenInResponse.decode(message.value); - }, - toProto(message: CalcOutAmtGivenInResponse): Uint8Array { - return CalcOutAmtGivenInResponse.encode(message).finish(); - }, - toProtoMsg(message: CalcOutAmtGivenInResponse): CalcOutAmtGivenInResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInResponse", - value: CalcOutAmtGivenInResponse.encode(message).finish() - }; - } -}; -function createBaseCalcInAmtGivenOut(): CalcInAmtGivenOut { - return { - tokenOut: undefined, - tokenInDenom: "", - swapFee: "" - }; -} -export const CalcInAmtGivenOut = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOut", - encode(message: CalcInAmtGivenOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(10).fork()).ldelim(); - } - if (message.tokenInDenom !== "") { - writer.uint32(18).string(message.tokenInDenom); - } - if (message.swapFee !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.swapFee, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcInAmtGivenOut { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcInAmtGivenOut(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - case 2: - message.tokenInDenom = reader.string(); - break; - case 3: - message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcInAmtGivenOut { - const message = createBaseCalcInAmtGivenOut(); - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - message.tokenInDenom = object.tokenInDenom ?? ""; - message.swapFee = object.swapFee ?? ""; - return message; - }, - fromAmino(object: CalcInAmtGivenOutAmino): CalcInAmtGivenOut { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - swapFee: object.swap_fee - }; - }, - toAmino(message: CalcInAmtGivenOut): CalcInAmtGivenOutAmino { - const obj: any = {}; - obj.token_out = message.tokenOut ? Coin.toAmino(message.tokenOut) : undefined; - obj.token_in_denom = message.tokenInDenom; - obj.swap_fee = message.swapFee; - return obj; - }, - fromAminoMsg(object: CalcInAmtGivenOutAminoMsg): CalcInAmtGivenOut { - return CalcInAmtGivenOut.fromAmino(object.value); - }, - toAminoMsg(message: CalcInAmtGivenOut): CalcInAmtGivenOutAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out", - value: CalcInAmtGivenOut.toAmino(message) - }; - }, - fromProtoMsg(message: CalcInAmtGivenOutProtoMsg): CalcInAmtGivenOut { - return CalcInAmtGivenOut.decode(message.value); - }, - toProto(message: CalcInAmtGivenOut): Uint8Array { - return CalcInAmtGivenOut.encode(message).finish(); - }, - toProtoMsg(message: CalcInAmtGivenOut): CalcInAmtGivenOutProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOut", - value: CalcInAmtGivenOut.encode(message).finish() - }; - } -}; -function createBaseCalcInAmtGivenOutRequest(): CalcInAmtGivenOutRequest { - return { - calcInAmtGivenOut: CalcInAmtGivenOut.fromPartial({}) - }; -} -export const CalcInAmtGivenOutRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutRequest", - encode(message: CalcInAmtGivenOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.calcInAmtGivenOut !== undefined) { - CalcInAmtGivenOut.encode(message.calcInAmtGivenOut, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcInAmtGivenOutRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcInAmtGivenOutRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.calcInAmtGivenOut = CalcInAmtGivenOut.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcInAmtGivenOutRequest { - const message = createBaseCalcInAmtGivenOutRequest(); - message.calcInAmtGivenOut = object.calcInAmtGivenOut !== undefined && object.calcInAmtGivenOut !== null ? CalcInAmtGivenOut.fromPartial(object.calcInAmtGivenOut) : undefined; - return message; - }, - fromAmino(object: CalcInAmtGivenOutRequestAmino): CalcInAmtGivenOutRequest { - return { - calcInAmtGivenOut: object?.calc_in_amt_given_out ? CalcInAmtGivenOut.fromAmino(object.calc_in_amt_given_out) : undefined - }; - }, - toAmino(message: CalcInAmtGivenOutRequest): CalcInAmtGivenOutRequestAmino { - const obj: any = {}; - obj.calc_in_amt_given_out = message.calcInAmtGivenOut ? CalcInAmtGivenOut.toAmino(message.calcInAmtGivenOut) : undefined; - return obj; - }, - fromAminoMsg(object: CalcInAmtGivenOutRequestAminoMsg): CalcInAmtGivenOutRequest { - return CalcInAmtGivenOutRequest.fromAmino(object.value); - }, - toAminoMsg(message: CalcInAmtGivenOutRequest): CalcInAmtGivenOutRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out-request", - value: CalcInAmtGivenOutRequest.toAmino(message) - }; - }, - fromProtoMsg(message: CalcInAmtGivenOutRequestProtoMsg): CalcInAmtGivenOutRequest { - return CalcInAmtGivenOutRequest.decode(message.value); - }, - toProto(message: CalcInAmtGivenOutRequest): Uint8Array { - return CalcInAmtGivenOutRequest.encode(message).finish(); - }, - toProtoMsg(message: CalcInAmtGivenOutRequest): CalcInAmtGivenOutRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutRequest", - value: CalcInAmtGivenOutRequest.encode(message).finish() - }; - } -}; -function createBaseCalcInAmtGivenOutResponse(): CalcInAmtGivenOutResponse { - return { - tokenIn: undefined - }; -} -export const CalcInAmtGivenOutResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutResponse", - encode(message: CalcInAmtGivenOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): CalcInAmtGivenOutResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCalcInAmtGivenOutResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): CalcInAmtGivenOutResponse { - const message = createBaseCalcInAmtGivenOutResponse(); - message.tokenIn = object.tokenIn !== undefined && object.tokenIn !== null ? Coin.fromPartial(object.tokenIn) : undefined; - return message; - }, - fromAmino(object: CalcInAmtGivenOutResponseAmino): CalcInAmtGivenOutResponse { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined - }; - }, - toAmino(message: CalcInAmtGivenOutResponse): CalcInAmtGivenOutResponseAmino { - const obj: any = {}; - obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; - return obj; - }, - fromAminoMsg(object: CalcInAmtGivenOutResponseAminoMsg): CalcInAmtGivenOutResponse { - return CalcInAmtGivenOutResponse.fromAmino(object.value); - }, - toAminoMsg(message: CalcInAmtGivenOutResponse): CalcInAmtGivenOutResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/calc-in-amt-given-out-response", - value: CalcInAmtGivenOutResponse.toAmino(message) - }; - }, - fromProtoMsg(message: CalcInAmtGivenOutResponseProtoMsg): CalcInAmtGivenOutResponse { - return CalcInAmtGivenOutResponse.decode(message.value); - }, - toProto(message: CalcInAmtGivenOutResponse): Uint8Array { - return CalcInAmtGivenOutResponse.encode(message).finish(); - }, - toProtoMsg(message: CalcInAmtGivenOutResponse): CalcInAmtGivenOutResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutResponse", - value: CalcInAmtGivenOutResponse.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts deleted file mode 100644 index ca77e5009..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts +++ /dev/null @@ -1,665 +0,0 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { Decimal } from "@cosmjs/math"; -/** ===================== SwapExactAmountIn */ -export interface SwapExactAmountIn { - sender: string; - /** token_in is the token to be sent to the pool. */ - tokenIn: Coin; - /** token_out_denom is the token denom to be received from the pool. */ - tokenOutDenom: string; - /** - * token_out_min_amount is the minimum amount of token_out to be received from - * the pool. - */ - tokenOutMinAmount: string; - /** swap_fee is the swap fee for this swap estimate. */ - swapFee: string; -} -export interface SwapExactAmountInProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountIn"; - value: Uint8Array; -} -/** ===================== SwapExactAmountIn */ -export interface SwapExactAmountInAmino { - sender: string; - /** token_in is the token to be sent to the pool. */ - token_in?: CoinAmino; - /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; - /** - * token_out_min_amount is the minimum amount of token_out to be received from - * the pool. - */ - token_out_min_amount: string; - /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; -} -export interface SwapExactAmountInAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-in"; - value: SwapExactAmountInAmino; -} -/** ===================== SwapExactAmountIn */ -export interface SwapExactAmountInSDKType { - sender: string; - token_in: CoinSDKType; - token_out_denom: string; - token_out_min_amount: string; - swap_fee: string; -} -export interface SwapExactAmountInSudoMsg { - /** - * swap_exact_amount_in is the structure containing all the request - * information for this message. - */ - swapExactAmountIn: SwapExactAmountIn; -} -export interface SwapExactAmountInSudoMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsg"; - value: Uint8Array; -} -export interface SwapExactAmountInSudoMsgAmino { - /** - * swap_exact_amount_in is the structure containing all the request - * information for this message. - */ - swap_exact_amount_in?: SwapExactAmountInAmino; -} -export interface SwapExactAmountInSudoMsgAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg"; - value: SwapExactAmountInSudoMsgAmino; -} -export interface SwapExactAmountInSudoMsgSDKType { - swap_exact_amount_in: SwapExactAmountInSDKType; -} -export interface SwapExactAmountInSudoMsgResponse { - /** token_out_amount is the token out computed from this swap estimate call. */ - tokenOutAmount: string; -} -export interface SwapExactAmountInSudoMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsgResponse"; - value: Uint8Array; -} -export interface SwapExactAmountInSudoMsgResponseAmino { - /** token_out_amount is the token out computed from this swap estimate call. */ - token_out_amount: string; -} -export interface SwapExactAmountInSudoMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg-response"; - value: SwapExactAmountInSudoMsgResponseAmino; -} -export interface SwapExactAmountInSudoMsgResponseSDKType { - token_out_amount: string; -} -/** ===================== SwapExactAmountOut */ -export interface SwapExactAmountOut { - sender: string; - /** token_out is the token to be sent out of the pool. */ - tokenOut: Coin; - /** token_in_denom is the token denom to be sent too the pool. */ - tokenInDenom: string; - /** - * token_in_max_amount is the maximum amount of token_in to be sent to the - * pool. - */ - tokenInMaxAmount: string; - /** swap_fee is the swap fee for this swap estimate. */ - swapFee: string; -} -export interface SwapExactAmountOutProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOut"; - value: Uint8Array; -} -/** ===================== SwapExactAmountOut */ -export interface SwapExactAmountOutAmino { - sender: string; - /** token_out is the token to be sent out of the pool. */ - token_out?: CoinAmino; - /** token_in_denom is the token denom to be sent too the pool. */ - token_in_denom: string; - /** - * token_in_max_amount is the maximum amount of token_in to be sent to the - * pool. - */ - token_in_max_amount: string; - /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; -} -export interface SwapExactAmountOutAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-out"; - value: SwapExactAmountOutAmino; -} -/** ===================== SwapExactAmountOut */ -export interface SwapExactAmountOutSDKType { - sender: string; - token_out: CoinSDKType; - token_in_denom: string; - token_in_max_amount: string; - swap_fee: string; -} -export interface SwapExactAmountOutSudoMsg { - /** - * swap_exact_amount_out is the structure containing all the request - * information for this message. - */ - swapExactAmountOut: SwapExactAmountOut; -} -export interface SwapExactAmountOutSudoMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsg"; - value: Uint8Array; -} -export interface SwapExactAmountOutSudoMsgAmino { - /** - * swap_exact_amount_out is the structure containing all the request - * information for this message. - */ - swap_exact_amount_out?: SwapExactAmountOutAmino; -} -export interface SwapExactAmountOutSudoMsgAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg"; - value: SwapExactAmountOutSudoMsgAmino; -} -export interface SwapExactAmountOutSudoMsgSDKType { - swap_exact_amount_out: SwapExactAmountOutSDKType; -} -export interface SwapExactAmountOutSudoMsgResponse { - /** token_in_amount is the token in computed from this swap estimate call. */ - tokenInAmount: string; -} -export interface SwapExactAmountOutSudoMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsgResponse"; - value: Uint8Array; -} -export interface SwapExactAmountOutSudoMsgResponseAmino { - /** token_in_amount is the token in computed from this swap estimate call. */ - token_in_amount: string; -} -export interface SwapExactAmountOutSudoMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg-response"; - value: SwapExactAmountOutSudoMsgResponseAmino; -} -export interface SwapExactAmountOutSudoMsgResponseSDKType { - token_in_amount: string; -} -function createBaseSwapExactAmountIn(): SwapExactAmountIn { - return { - sender: "", - tokenIn: undefined, - tokenOutDenom: "", - tokenOutMinAmount: "", - swapFee: "" - }; -} -export const SwapExactAmountIn = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountIn", - encode(message: SwapExactAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.tokenIn !== undefined) { - Coin.encode(message.tokenIn, writer.uint32(18).fork()).ldelim(); - } - if (message.tokenOutDenom !== "") { - writer.uint32(26).string(message.tokenOutDenom); - } - if (message.tokenOutMinAmount !== "") { - writer.uint32(34).string(message.tokenOutMinAmount); - } - if (message.swapFee !== "") { - writer.uint32(42).string(Decimal.fromUserInput(message.swapFee, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountIn { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountIn(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.tokenIn = Coin.decode(reader, reader.uint32()); - break; - case 3: - message.tokenOutDenom = reader.string(); - break; - case 4: - message.tokenOutMinAmount = reader.string(); - break; - case 5: - message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SwapExactAmountIn { - const message = createBaseSwapExactAmountIn(); - message.sender = object.sender ?? ""; - message.tokenIn = object.tokenIn !== undefined && object.tokenIn !== null ? Coin.fromPartial(object.tokenIn) : undefined; - message.tokenOutDenom = object.tokenOutDenom ?? ""; - message.tokenOutMinAmount = object.tokenOutMinAmount ?? ""; - message.swapFee = object.swapFee ?? ""; - return message; - }, - fromAmino(object: SwapExactAmountInAmino): SwapExactAmountIn { - return { - sender: object.sender, - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - tokenOutMinAmount: object.token_out_min_amount, - swapFee: object.swap_fee - }; - }, - toAmino(message: SwapExactAmountIn): SwapExactAmountInAmino { - const obj: any = {}; - obj.sender = message.sender; - obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; - obj.token_out_denom = message.tokenOutDenom; - obj.token_out_min_amount = message.tokenOutMinAmount; - obj.swap_fee = message.swapFee; - return obj; - }, - fromAminoMsg(object: SwapExactAmountInAminoMsg): SwapExactAmountIn { - return SwapExactAmountIn.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountIn): SwapExactAmountInAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-in", - value: SwapExactAmountIn.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountInProtoMsg): SwapExactAmountIn { - return SwapExactAmountIn.decode(message.value); - }, - toProto(message: SwapExactAmountIn): Uint8Array { - return SwapExactAmountIn.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountIn): SwapExactAmountInProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountIn", - value: SwapExactAmountIn.encode(message).finish() - }; - } -}; -function createBaseSwapExactAmountInSudoMsg(): SwapExactAmountInSudoMsg { - return { - swapExactAmountIn: SwapExactAmountIn.fromPartial({}) - }; -} -export const SwapExactAmountInSudoMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsg", - encode(message: SwapExactAmountInSudoMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.swapExactAmountIn !== undefined) { - SwapExactAmountIn.encode(message.swapExactAmountIn, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountInSudoMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountInSudoMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.swapExactAmountIn = SwapExactAmountIn.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SwapExactAmountInSudoMsg { - const message = createBaseSwapExactAmountInSudoMsg(); - message.swapExactAmountIn = object.swapExactAmountIn !== undefined && object.swapExactAmountIn !== null ? SwapExactAmountIn.fromPartial(object.swapExactAmountIn) : undefined; - return message; - }, - fromAmino(object: SwapExactAmountInSudoMsgAmino): SwapExactAmountInSudoMsg { - return { - swapExactAmountIn: object?.swap_exact_amount_in ? SwapExactAmountIn.fromAmino(object.swap_exact_amount_in) : undefined - }; - }, - toAmino(message: SwapExactAmountInSudoMsg): SwapExactAmountInSudoMsgAmino { - const obj: any = {}; - obj.swap_exact_amount_in = message.swapExactAmountIn ? SwapExactAmountIn.toAmino(message.swapExactAmountIn) : undefined; - return obj; - }, - fromAminoMsg(object: SwapExactAmountInSudoMsgAminoMsg): SwapExactAmountInSudoMsg { - return SwapExactAmountInSudoMsg.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountInSudoMsg): SwapExactAmountInSudoMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg", - value: SwapExactAmountInSudoMsg.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountInSudoMsgProtoMsg): SwapExactAmountInSudoMsg { - return SwapExactAmountInSudoMsg.decode(message.value); - }, - toProto(message: SwapExactAmountInSudoMsg): Uint8Array { - return SwapExactAmountInSudoMsg.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountInSudoMsg): SwapExactAmountInSudoMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsg", - value: SwapExactAmountInSudoMsg.encode(message).finish() - }; - } -}; -function createBaseSwapExactAmountInSudoMsgResponse(): SwapExactAmountInSudoMsgResponse { - return { - tokenOutAmount: "" - }; -} -export const SwapExactAmountInSudoMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsgResponse", - encode(message: SwapExactAmountInSudoMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenOutAmount !== "") { - writer.uint32(10).string(message.tokenOutAmount); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountInSudoMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountInSudoMsgResponse(); - 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): SwapExactAmountInSudoMsgResponse { - const message = createBaseSwapExactAmountInSudoMsgResponse(); - message.tokenOutAmount = object.tokenOutAmount ?? ""; - return message; - }, - fromAmino(object: SwapExactAmountInSudoMsgResponseAmino): SwapExactAmountInSudoMsgResponse { - return { - tokenOutAmount: object.token_out_amount - }; - }, - toAmino(message: SwapExactAmountInSudoMsgResponse): SwapExactAmountInSudoMsgResponseAmino { - const obj: any = {}; - obj.token_out_amount = message.tokenOutAmount; - return obj; - }, - fromAminoMsg(object: SwapExactAmountInSudoMsgResponseAminoMsg): SwapExactAmountInSudoMsgResponse { - return SwapExactAmountInSudoMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountInSudoMsgResponse): SwapExactAmountInSudoMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg-response", - value: SwapExactAmountInSudoMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountInSudoMsgResponseProtoMsg): SwapExactAmountInSudoMsgResponse { - return SwapExactAmountInSudoMsgResponse.decode(message.value); - }, - toProto(message: SwapExactAmountInSudoMsgResponse): Uint8Array { - return SwapExactAmountInSudoMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountInSudoMsgResponse): SwapExactAmountInSudoMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsgResponse", - value: SwapExactAmountInSudoMsgResponse.encode(message).finish() - }; - } -}; -function createBaseSwapExactAmountOut(): SwapExactAmountOut { - return { - sender: "", - tokenOut: undefined, - tokenInDenom: "", - tokenInMaxAmount: "", - swapFee: "" - }; -} -export const SwapExactAmountOut = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOut", - encode(message: SwapExactAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(18).fork()).ldelim(); - } - if (message.tokenInDenom !== "") { - writer.uint32(26).string(message.tokenInDenom); - } - if (message.tokenInMaxAmount !== "") { - writer.uint32(34).string(message.tokenInMaxAmount); - } - if (message.swapFee !== "") { - writer.uint32(42).string(Decimal.fromUserInput(message.swapFee, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountOut { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountOut(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - case 3: - message.tokenInDenom = reader.string(); - break; - case 4: - message.tokenInMaxAmount = reader.string(); - break; - case 5: - message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SwapExactAmountOut { - const message = createBaseSwapExactAmountOut(); - message.sender = object.sender ?? ""; - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - message.tokenInDenom = object.tokenInDenom ?? ""; - message.tokenInMaxAmount = object.tokenInMaxAmount ?? ""; - message.swapFee = object.swapFee ?? ""; - return message; - }, - fromAmino(object: SwapExactAmountOutAmino): SwapExactAmountOut { - return { - sender: object.sender, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - tokenInMaxAmount: object.token_in_max_amount, - swapFee: object.swap_fee - }; - }, - toAmino(message: SwapExactAmountOut): SwapExactAmountOutAmino { - const obj: any = {}; - obj.sender = message.sender; - obj.token_out = message.tokenOut ? Coin.toAmino(message.tokenOut) : undefined; - obj.token_in_denom = message.tokenInDenom; - obj.token_in_max_amount = message.tokenInMaxAmount; - obj.swap_fee = message.swapFee; - return obj; - }, - fromAminoMsg(object: SwapExactAmountOutAminoMsg): SwapExactAmountOut { - return SwapExactAmountOut.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountOut): SwapExactAmountOutAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-out", - value: SwapExactAmountOut.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountOutProtoMsg): SwapExactAmountOut { - return SwapExactAmountOut.decode(message.value); - }, - toProto(message: SwapExactAmountOut): Uint8Array { - return SwapExactAmountOut.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountOut): SwapExactAmountOutProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOut", - value: SwapExactAmountOut.encode(message).finish() - }; - } -}; -function createBaseSwapExactAmountOutSudoMsg(): SwapExactAmountOutSudoMsg { - return { - swapExactAmountOut: SwapExactAmountOut.fromPartial({}) - }; -} -export const SwapExactAmountOutSudoMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsg", - encode(message: SwapExactAmountOutSudoMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.swapExactAmountOut !== undefined) { - SwapExactAmountOut.encode(message.swapExactAmountOut, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountOutSudoMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountOutSudoMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.swapExactAmountOut = SwapExactAmountOut.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SwapExactAmountOutSudoMsg { - const message = createBaseSwapExactAmountOutSudoMsg(); - message.swapExactAmountOut = object.swapExactAmountOut !== undefined && object.swapExactAmountOut !== null ? SwapExactAmountOut.fromPartial(object.swapExactAmountOut) : undefined; - return message; - }, - fromAmino(object: SwapExactAmountOutSudoMsgAmino): SwapExactAmountOutSudoMsg { - return { - swapExactAmountOut: object?.swap_exact_amount_out ? SwapExactAmountOut.fromAmino(object.swap_exact_amount_out) : undefined - }; - }, - toAmino(message: SwapExactAmountOutSudoMsg): SwapExactAmountOutSudoMsgAmino { - const obj: any = {}; - obj.swap_exact_amount_out = message.swapExactAmountOut ? SwapExactAmountOut.toAmino(message.swapExactAmountOut) : undefined; - return obj; - }, - fromAminoMsg(object: SwapExactAmountOutSudoMsgAminoMsg): SwapExactAmountOutSudoMsg { - return SwapExactAmountOutSudoMsg.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountOutSudoMsg): SwapExactAmountOutSudoMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg", - value: SwapExactAmountOutSudoMsg.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountOutSudoMsgProtoMsg): SwapExactAmountOutSudoMsg { - return SwapExactAmountOutSudoMsg.decode(message.value); - }, - toProto(message: SwapExactAmountOutSudoMsg): Uint8Array { - return SwapExactAmountOutSudoMsg.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountOutSudoMsg): SwapExactAmountOutSudoMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsg", - value: SwapExactAmountOutSudoMsg.encode(message).finish() - }; - } -}; -function createBaseSwapExactAmountOutSudoMsgResponse(): SwapExactAmountOutSudoMsgResponse { - return { - tokenInAmount: "" - }; -} -export const SwapExactAmountOutSudoMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsgResponse", - encode(message: SwapExactAmountOutSudoMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenInAmount !== "") { - writer.uint32(10).string(message.tokenInAmount); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SwapExactAmountOutSudoMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSwapExactAmountOutSudoMsgResponse(); - 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): SwapExactAmountOutSudoMsgResponse { - const message = createBaseSwapExactAmountOutSudoMsgResponse(); - message.tokenInAmount = object.tokenInAmount ?? ""; - return message; - }, - fromAmino(object: SwapExactAmountOutSudoMsgResponseAmino): SwapExactAmountOutSudoMsgResponse { - return { - tokenInAmount: object.token_in_amount - }; - }, - toAmino(message: SwapExactAmountOutSudoMsgResponse): SwapExactAmountOutSudoMsgResponseAmino { - const obj: any = {}; - obj.token_in_amount = message.tokenInAmount; - return obj; - }, - fromAminoMsg(object: SwapExactAmountOutSudoMsgResponseAminoMsg): SwapExactAmountOutSudoMsgResponse { - return SwapExactAmountOutSudoMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: SwapExactAmountOutSudoMsgResponse): SwapExactAmountOutSudoMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg-response", - value: SwapExactAmountOutSudoMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: SwapExactAmountOutSudoMsgResponseProtoMsg): SwapExactAmountOutSudoMsgResponse { - return SwapExactAmountOutSudoMsgResponse.decode(message.value); - }, - toProto(message: SwapExactAmountOutSudoMsgResponse): Uint8Array { - return SwapExactAmountOutSudoMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: SwapExactAmountOutSudoMsgResponse): SwapExactAmountOutSudoMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsgResponse", - value: SwapExactAmountOutSudoMsgResponse.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts index 4e044f4b1..b0a7376d5 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts @@ -1,20 +1,20 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; export interface CosmWasmPool { $typeUrl?: string; + poolAddress: string; contractAddress: string; poolId: bigint; codeId: bigint; - instantiateMsg: Uint8Array; } export interface CosmWasmPoolProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; value: Uint8Array; } export interface CosmWasmPoolAmino { + pool_address: string; contract_address: string; pool_id: string; code_id: string; - instantiate_msg: Uint8Array; } export interface CosmWasmPoolAminoMsg { type: "osmosis/cosmwasmpool/cosm-wasm-pool"; @@ -22,34 +22,34 @@ export interface CosmWasmPoolAminoMsg { } export interface CosmWasmPoolSDKType { $typeUrl?: string; + pool_address: string; contract_address: string; pool_id: bigint; code_id: bigint; - instantiate_msg: Uint8Array; } function createBaseCosmWasmPool(): CosmWasmPool { return { $typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", + poolAddress: "", contractAddress: "", poolId: BigInt(0), - codeId: BigInt(0), - instantiateMsg: new Uint8Array() + codeId: BigInt(0) }; } export const CosmWasmPool = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", encode(message: CosmWasmPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolAddress !== "") { + writer.uint32(10).string(message.poolAddress); + } if (message.contractAddress !== "") { - writer.uint32(10).string(message.contractAddress); + writer.uint32(18).string(message.contractAddress); } if (message.poolId !== BigInt(0)) { - writer.uint32(16).uint64(message.poolId); + writer.uint32(24).uint64(message.poolId); } if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); - } - if (message.instantiateMsg.length !== 0) { - writer.uint32(34).bytes(message.instantiateMsg); + writer.uint32(32).uint64(message.codeId); } return writer; }, @@ -61,16 +61,16 @@ export const CosmWasmPool = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.contractAddress = reader.string(); + message.poolAddress = reader.string(); break; case 2: - message.poolId = reader.uint64(); + message.contractAddress = reader.string(); break; case 3: - message.codeId = reader.uint64(); + message.poolId = reader.uint64(); break; case 4: - message.instantiateMsg = reader.bytes(); + message.codeId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -81,26 +81,26 @@ export const CosmWasmPool = { }, fromPartial(object: Partial): CosmWasmPool { const message = createBaseCosmWasmPool(); + message.poolAddress = object.poolAddress ?? ""; message.contractAddress = object.contractAddress ?? ""; message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.instantiateMsg = object.instantiateMsg ?? new Uint8Array(); return message; }, fromAmino(object: CosmWasmPoolAmino): CosmWasmPool { return { + poolAddress: object.pool_address, contractAddress: object.contract_address, poolId: BigInt(object.pool_id), - codeId: BigInt(object.code_id), - instantiateMsg: object.instantiate_msg + codeId: BigInt(object.code_id) }; }, toAmino(message: CosmWasmPool): CosmWasmPoolAmino { const obj: any = {}; + obj.pool_address = message.poolAddress; obj.contract_address = message.contractAddress; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_msg = message.instantiateMsg; return obj; }, fromAminoMsg(object: CosmWasmPoolAminoMsg): CosmWasmPool { diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts deleted file mode 100644 index 4f6f9eb22..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts +++ /dev/null @@ -1,898 +0,0 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { Decimal } from "@cosmjs/math"; -/** ===================== GetSwapFeeQueryMsg */ -export interface GetSwapFeeQueryMsg { - /** get_swap_fee is the query strcuture to get swap fee. */ - getSwapFee: EmptyStruct; -} -export interface GetSwapFeeQueryMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsg"; - value: Uint8Array; -} -/** ===================== GetSwapFeeQueryMsg */ -export interface GetSwapFeeQueryMsgAmino { - /** get_swap_fee is the query strcuture to get swap fee. */ - get_swap_fee?: EmptyStructAmino; -} -export interface GetSwapFeeQueryMsgAminoMsg { - type: "osmosis/cosmwasmpool/get-swap-fee-query-msg"; - value: GetSwapFeeQueryMsgAmino; -} -/** ===================== GetSwapFeeQueryMsg */ -export interface GetSwapFeeQueryMsgSDKType { - get_swap_fee: EmptyStructSDKType; -} -export interface GetSwapFeeQueryMsgResponse { - /** swap_fee is the swap fee for this swap estimate. */ - swapFee: string; -} -export interface GetSwapFeeQueryMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsgResponse"; - value: Uint8Array; -} -export interface GetSwapFeeQueryMsgResponseAmino { - /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; -} -export interface GetSwapFeeQueryMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/get-swap-fee-query-msg-response"; - value: GetSwapFeeQueryMsgResponseAmino; -} -export interface GetSwapFeeQueryMsgResponseSDKType { - swap_fee: string; -} -/** ===================== SpotPriceQueryMsg */ -export interface SpotPrice { - /** quote_asset_denom is the quote asset of the spot query. */ - quoteAssetDenom: string; - /** base_asset_denom is the base asset of the spot query. */ - baseAssetDenom: string; -} -export interface SpotPriceProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPrice"; - value: Uint8Array; -} -/** ===================== SpotPriceQueryMsg */ -export interface SpotPriceAmino { - /** quote_asset_denom is the quote asset of the spot query. */ - quote_asset_denom: string; - /** base_asset_denom is the base asset of the spot query. */ - base_asset_denom: string; -} -export interface SpotPriceAminoMsg { - type: "osmosis/cosmwasmpool/spot-price"; - value: SpotPriceAmino; -} -/** ===================== SpotPriceQueryMsg */ -export interface SpotPriceSDKType { - quote_asset_denom: string; - base_asset_denom: string; -} -export interface SpotPriceQueryMsg { - /** - * spot_price is the structure containing request field of the spot price - * query message. - */ - spotPrice: SpotPrice; -} -export interface SpotPriceQueryMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsg"; - value: Uint8Array; -} -export interface SpotPriceQueryMsgAmino { - /** - * spot_price is the structure containing request field of the spot price - * query message. - */ - spot_price?: SpotPriceAmino; -} -export interface SpotPriceQueryMsgAminoMsg { - type: "osmosis/cosmwasmpool/spot-price-query-msg"; - value: SpotPriceQueryMsgAmino; -} -export interface SpotPriceQueryMsgSDKType { - spot_price: SpotPriceSDKType; -} -export interface SpotPriceQueryMsgResponse { - /** spot_price is the spot price returned. */ - spotPrice: string; -} -export interface SpotPriceQueryMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsgResponse"; - value: Uint8Array; -} -export interface SpotPriceQueryMsgResponseAmino { - /** spot_price is the spot price returned. */ - spot_price: string; -} -export interface SpotPriceQueryMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/spot-price-query-msg-response"; - value: SpotPriceQueryMsgResponseAmino; -} -export interface SpotPriceQueryMsgResponseSDKType { - spot_price: string; -} -/** ===================== GetTotalPoolLiquidityQueryMsg */ -export interface EmptyStruct {} -export interface EmptyStructProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyStruct"; - value: Uint8Array; -} -/** ===================== GetTotalPoolLiquidityQueryMsg */ -export interface EmptyStructAmino {} -export interface EmptyStructAminoMsg { - type: "osmosis/cosmwasmpool/empty-struct"; - value: EmptyStructAmino; -} -/** ===================== GetTotalPoolLiquidityQueryMsg */ -export interface EmptyStructSDKType {} -export interface GetTotalPoolLiquidityQueryMsg { - /** - * get_total_pool_liquidity is the structure containing request field of the - * total pool liquidity query message. - */ - getTotalPoolLiquidity: EmptyStruct; -} -export interface GetTotalPoolLiquidityQueryMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsg"; - value: Uint8Array; -} -export interface GetTotalPoolLiquidityQueryMsgAmino { - /** - * get_total_pool_liquidity is the structure containing request field of the - * total pool liquidity query message. - */ - get_total_pool_liquidity?: EmptyStructAmino; -} -export interface GetTotalPoolLiquidityQueryMsgAminoMsg { - type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg"; - value: GetTotalPoolLiquidityQueryMsgAmino; -} -export interface GetTotalPoolLiquidityQueryMsgSDKType { - get_total_pool_liquidity: EmptyStructSDKType; -} -export interface GetTotalPoolLiquidityQueryMsgResponse { - /** - * total_pool_liquidity is the total liquidity in the pool denominated in - * coins. - */ - totalPoolLiquidity: Coin[]; -} -export interface GetTotalPoolLiquidityQueryMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsgResponse"; - value: Uint8Array; -} -export interface GetTotalPoolLiquidityQueryMsgResponseAmino { - /** - * total_pool_liquidity is the total liquidity in the pool denominated in - * coins. - */ - total_pool_liquidity: CoinAmino[]; -} -export interface GetTotalPoolLiquidityQueryMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg-response"; - value: GetTotalPoolLiquidityQueryMsgResponseAmino; -} -export interface GetTotalPoolLiquidityQueryMsgResponseSDKType { - total_pool_liquidity: CoinSDKType[]; -} -/** ===================== GetTotalSharesQueryMsg */ -export interface GetTotalSharesQueryMsg { - /** - * get_total_shares is the structure containing request field of the - * total shares query message. - */ - getTotalShares: EmptyStruct; -} -export interface GetTotalSharesQueryMsgProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsg"; - value: Uint8Array; -} -/** ===================== GetTotalSharesQueryMsg */ -export interface GetTotalSharesQueryMsgAmino { - /** - * get_total_shares is the structure containing request field of the - * total shares query message. - */ - get_total_shares?: EmptyStructAmino; -} -export interface GetTotalSharesQueryMsgAminoMsg { - type: "osmosis/cosmwasmpool/get-total-shares-query-msg"; - value: GetTotalSharesQueryMsgAmino; -} -/** ===================== GetTotalSharesQueryMsg */ -export interface GetTotalSharesQueryMsgSDKType { - get_total_shares: EmptyStructSDKType; -} -export interface GetTotalSharesQueryMsgResponse { - /** total_shares is the amount of shares returned. */ - totalShares: string; -} -export interface GetTotalSharesQueryMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsgResponse"; - value: Uint8Array; -} -export interface GetTotalSharesQueryMsgResponseAmino { - /** total_shares is the amount of shares returned. */ - total_shares: string; -} -export interface GetTotalSharesQueryMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/get-total-shares-query-msg-response"; - value: GetTotalSharesQueryMsgResponseAmino; -} -export interface GetTotalSharesQueryMsgResponseSDKType { - total_shares: string; -} -function createBaseGetSwapFeeQueryMsg(): GetSwapFeeQueryMsg { - return { - getSwapFee: EmptyStruct.fromPartial({}) - }; -} -export const GetSwapFeeQueryMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsg", - encode(message: GetSwapFeeQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.getSwapFee !== undefined) { - EmptyStruct.encode(message.getSwapFee, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetSwapFeeQueryMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSwapFeeQueryMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.getSwapFee = EmptyStruct.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetSwapFeeQueryMsg { - const message = createBaseGetSwapFeeQueryMsg(); - message.getSwapFee = object.getSwapFee !== undefined && object.getSwapFee !== null ? EmptyStruct.fromPartial(object.getSwapFee) : undefined; - return message; - }, - fromAmino(object: GetSwapFeeQueryMsgAmino): GetSwapFeeQueryMsg { - return { - getSwapFee: object?.get_swap_fee ? EmptyStruct.fromAmino(object.get_swap_fee) : undefined - }; - }, - toAmino(message: GetSwapFeeQueryMsg): GetSwapFeeQueryMsgAmino { - const obj: any = {}; - obj.get_swap_fee = message.getSwapFee ? EmptyStruct.toAmino(message.getSwapFee) : undefined; - return obj; - }, - fromAminoMsg(object: GetSwapFeeQueryMsgAminoMsg): GetSwapFeeQueryMsg { - return GetSwapFeeQueryMsg.fromAmino(object.value); - }, - toAminoMsg(message: GetSwapFeeQueryMsg): GetSwapFeeQueryMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-swap-fee-query-msg", - value: GetSwapFeeQueryMsg.toAmino(message) - }; - }, - fromProtoMsg(message: GetSwapFeeQueryMsgProtoMsg): GetSwapFeeQueryMsg { - return GetSwapFeeQueryMsg.decode(message.value); - }, - toProto(message: GetSwapFeeQueryMsg): Uint8Array { - return GetSwapFeeQueryMsg.encode(message).finish(); - }, - toProtoMsg(message: GetSwapFeeQueryMsg): GetSwapFeeQueryMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsg", - value: GetSwapFeeQueryMsg.encode(message).finish() - }; - } -}; -function createBaseGetSwapFeeQueryMsgResponse(): GetSwapFeeQueryMsgResponse { - return { - swapFee: "" - }; -} -export const GetSwapFeeQueryMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsgResponse", - encode(message: GetSwapFeeQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.swapFee !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.swapFee, 18).atomics); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetSwapFeeQueryMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSwapFeeQueryMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.swapFee = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetSwapFeeQueryMsgResponse { - const message = createBaseGetSwapFeeQueryMsgResponse(); - message.swapFee = object.swapFee ?? ""; - return message; - }, - fromAmino(object: GetSwapFeeQueryMsgResponseAmino): GetSwapFeeQueryMsgResponse { - return { - swapFee: object.swap_fee - }; - }, - toAmino(message: GetSwapFeeQueryMsgResponse): GetSwapFeeQueryMsgResponseAmino { - const obj: any = {}; - obj.swap_fee = message.swapFee; - return obj; - }, - fromAminoMsg(object: GetSwapFeeQueryMsgResponseAminoMsg): GetSwapFeeQueryMsgResponse { - return GetSwapFeeQueryMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetSwapFeeQueryMsgResponse): GetSwapFeeQueryMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-swap-fee-query-msg-response", - value: GetSwapFeeQueryMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: GetSwapFeeQueryMsgResponseProtoMsg): GetSwapFeeQueryMsgResponse { - return GetSwapFeeQueryMsgResponse.decode(message.value); - }, - toProto(message: GetSwapFeeQueryMsgResponse): Uint8Array { - return GetSwapFeeQueryMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: GetSwapFeeQueryMsgResponse): GetSwapFeeQueryMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsgResponse", - value: GetSwapFeeQueryMsgResponse.encode(message).finish() - }; - } -}; -function createBaseSpotPrice(): SpotPrice { - return { - quoteAssetDenom: "", - baseAssetDenom: "" - }; -} -export const SpotPrice = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPrice", - encode(message: SpotPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.quoteAssetDenom !== "") { - writer.uint32(10).string(message.quoteAssetDenom); - } - if (message.baseAssetDenom !== "") { - writer.uint32(18).string(message.baseAssetDenom); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SpotPrice { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSpotPrice(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quoteAssetDenom = reader.string(); - break; - case 2: - message.baseAssetDenom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SpotPrice { - const message = createBaseSpotPrice(); - message.quoteAssetDenom = object.quoteAssetDenom ?? ""; - message.baseAssetDenom = object.baseAssetDenom ?? ""; - return message; - }, - fromAmino(object: SpotPriceAmino): SpotPrice { - return { - quoteAssetDenom: object.quote_asset_denom, - baseAssetDenom: object.base_asset_denom - }; - }, - toAmino(message: SpotPrice): SpotPriceAmino { - const obj: any = {}; - obj.quote_asset_denom = message.quoteAssetDenom; - obj.base_asset_denom = message.baseAssetDenom; - return obj; - }, - fromAminoMsg(object: SpotPriceAminoMsg): SpotPrice { - return SpotPrice.fromAmino(object.value); - }, - toAminoMsg(message: SpotPrice): SpotPriceAminoMsg { - return { - type: "osmosis/cosmwasmpool/spot-price", - value: SpotPrice.toAmino(message) - }; - }, - fromProtoMsg(message: SpotPriceProtoMsg): SpotPrice { - return SpotPrice.decode(message.value); - }, - toProto(message: SpotPrice): Uint8Array { - return SpotPrice.encode(message).finish(); - }, - toProtoMsg(message: SpotPrice): SpotPriceProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPrice", - value: SpotPrice.encode(message).finish() - }; - } -}; -function createBaseSpotPriceQueryMsg(): SpotPriceQueryMsg { - return { - spotPrice: SpotPrice.fromPartial({}) - }; -} -export const SpotPriceQueryMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsg", - encode(message: SpotPriceQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.spotPrice !== undefined) { - SpotPrice.encode(message.spotPrice, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceQueryMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSpotPriceQueryMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spotPrice = SpotPrice.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SpotPriceQueryMsg { - const message = createBaseSpotPriceQueryMsg(); - message.spotPrice = object.spotPrice !== undefined && object.spotPrice !== null ? SpotPrice.fromPartial(object.spotPrice) : undefined; - return message; - }, - fromAmino(object: SpotPriceQueryMsgAmino): SpotPriceQueryMsg { - return { - spotPrice: object?.spot_price ? SpotPrice.fromAmino(object.spot_price) : undefined - }; - }, - toAmino(message: SpotPriceQueryMsg): SpotPriceQueryMsgAmino { - const obj: any = {}; - obj.spot_price = message.spotPrice ? SpotPrice.toAmino(message.spotPrice) : undefined; - return obj; - }, - fromAminoMsg(object: SpotPriceQueryMsgAminoMsg): SpotPriceQueryMsg { - return SpotPriceQueryMsg.fromAmino(object.value); - }, - toAminoMsg(message: SpotPriceQueryMsg): SpotPriceQueryMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/spot-price-query-msg", - value: SpotPriceQueryMsg.toAmino(message) - }; - }, - fromProtoMsg(message: SpotPriceQueryMsgProtoMsg): SpotPriceQueryMsg { - return SpotPriceQueryMsg.decode(message.value); - }, - toProto(message: SpotPriceQueryMsg): Uint8Array { - return SpotPriceQueryMsg.encode(message).finish(); - }, - toProtoMsg(message: SpotPriceQueryMsg): SpotPriceQueryMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsg", - value: SpotPriceQueryMsg.encode(message).finish() - }; - } -}; -function createBaseSpotPriceQueryMsgResponse(): SpotPriceQueryMsgResponse { - return { - spotPrice: "" - }; -} -export const SpotPriceQueryMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsgResponse", - encode(message: SpotPriceQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.spotPrice !== "") { - writer.uint32(10).string(message.spotPrice); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceQueryMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSpotPriceQueryMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.spotPrice = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SpotPriceQueryMsgResponse { - const message = createBaseSpotPriceQueryMsgResponse(); - message.spotPrice = object.spotPrice ?? ""; - return message; - }, - fromAmino(object: SpotPriceQueryMsgResponseAmino): SpotPriceQueryMsgResponse { - return { - spotPrice: object.spot_price - }; - }, - toAmino(message: SpotPriceQueryMsgResponse): SpotPriceQueryMsgResponseAmino { - const obj: any = {}; - obj.spot_price = message.spotPrice; - return obj; - }, - fromAminoMsg(object: SpotPriceQueryMsgResponseAminoMsg): SpotPriceQueryMsgResponse { - return SpotPriceQueryMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: SpotPriceQueryMsgResponse): SpotPriceQueryMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/spot-price-query-msg-response", - value: SpotPriceQueryMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: SpotPriceQueryMsgResponseProtoMsg): SpotPriceQueryMsgResponse { - return SpotPriceQueryMsgResponse.decode(message.value); - }, - toProto(message: SpotPriceQueryMsgResponse): Uint8Array { - return SpotPriceQueryMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: SpotPriceQueryMsgResponse): SpotPriceQueryMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsgResponse", - value: SpotPriceQueryMsgResponse.encode(message).finish() - }; - } -}; -function createBaseEmptyStruct(): EmptyStruct { - return {}; -} -export const EmptyStruct = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyStruct", - encode(_: EmptyStruct, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): EmptyStruct { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEmptyStruct(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): EmptyStruct { - const message = createBaseEmptyStruct(); - return message; - }, - fromAmino(_: EmptyStructAmino): EmptyStruct { - return {}; - }, - toAmino(_: EmptyStruct): EmptyStructAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: EmptyStructAminoMsg): EmptyStruct { - return EmptyStruct.fromAmino(object.value); - }, - toAminoMsg(message: EmptyStruct): EmptyStructAminoMsg { - return { - type: "osmosis/cosmwasmpool/empty-struct", - value: EmptyStruct.toAmino(message) - }; - }, - fromProtoMsg(message: EmptyStructProtoMsg): EmptyStruct { - return EmptyStruct.decode(message.value); - }, - toProto(message: EmptyStruct): Uint8Array { - return EmptyStruct.encode(message).finish(); - }, - toProtoMsg(message: EmptyStruct): EmptyStructProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyStruct", - value: EmptyStruct.encode(message).finish() - }; - } -}; -function createBaseGetTotalPoolLiquidityQueryMsg(): GetTotalPoolLiquidityQueryMsg { - return { - getTotalPoolLiquidity: EmptyStruct.fromPartial({}) - }; -} -export const GetTotalPoolLiquidityQueryMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsg", - encode(message: GetTotalPoolLiquidityQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.getTotalPoolLiquidity !== undefined) { - EmptyStruct.encode(message.getTotalPoolLiquidity, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalPoolLiquidityQueryMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalPoolLiquidityQueryMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.getTotalPoolLiquidity = EmptyStruct.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetTotalPoolLiquidityQueryMsg { - const message = createBaseGetTotalPoolLiquidityQueryMsg(); - message.getTotalPoolLiquidity = object.getTotalPoolLiquidity !== undefined && object.getTotalPoolLiquidity !== null ? EmptyStruct.fromPartial(object.getTotalPoolLiquidity) : undefined; - return message; - }, - fromAmino(object: GetTotalPoolLiquidityQueryMsgAmino): GetTotalPoolLiquidityQueryMsg { - return { - getTotalPoolLiquidity: object?.get_total_pool_liquidity ? EmptyStruct.fromAmino(object.get_total_pool_liquidity) : undefined - }; - }, - toAmino(message: GetTotalPoolLiquidityQueryMsg): GetTotalPoolLiquidityQueryMsgAmino { - const obj: any = {}; - obj.get_total_pool_liquidity = message.getTotalPoolLiquidity ? EmptyStruct.toAmino(message.getTotalPoolLiquidity) : undefined; - return obj; - }, - fromAminoMsg(object: GetTotalPoolLiquidityQueryMsgAminoMsg): GetTotalPoolLiquidityQueryMsg { - return GetTotalPoolLiquidityQueryMsg.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalPoolLiquidityQueryMsg): GetTotalPoolLiquidityQueryMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg", - value: GetTotalPoolLiquidityQueryMsg.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalPoolLiquidityQueryMsgProtoMsg): GetTotalPoolLiquidityQueryMsg { - return GetTotalPoolLiquidityQueryMsg.decode(message.value); - }, - toProto(message: GetTotalPoolLiquidityQueryMsg): Uint8Array { - return GetTotalPoolLiquidityQueryMsg.encode(message).finish(); - }, - toProtoMsg(message: GetTotalPoolLiquidityQueryMsg): GetTotalPoolLiquidityQueryMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsg", - value: GetTotalPoolLiquidityQueryMsg.encode(message).finish() - }; - } -}; -function createBaseGetTotalPoolLiquidityQueryMsgResponse(): GetTotalPoolLiquidityQueryMsgResponse { - return { - totalPoolLiquidity: [] - }; -} -export const GetTotalPoolLiquidityQueryMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsgResponse", - encode(message: GetTotalPoolLiquidityQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.totalPoolLiquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalPoolLiquidityQueryMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalPoolLiquidityQueryMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalPoolLiquidity.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetTotalPoolLiquidityQueryMsgResponse { - const message = createBaseGetTotalPoolLiquidityQueryMsgResponse(); - message.totalPoolLiquidity = object.totalPoolLiquidity?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: GetTotalPoolLiquidityQueryMsgResponseAmino): GetTotalPoolLiquidityQueryMsgResponse { - return { - totalPoolLiquidity: Array.isArray(object?.total_pool_liquidity) ? object.total_pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: GetTotalPoolLiquidityQueryMsgResponse): GetTotalPoolLiquidityQueryMsgResponseAmino { - const obj: any = {}; - if (message.totalPoolLiquidity) { - obj.total_pool_liquidity = message.totalPoolLiquidity.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.total_pool_liquidity = []; - } - return obj; - }, - fromAminoMsg(object: GetTotalPoolLiquidityQueryMsgResponseAminoMsg): GetTotalPoolLiquidityQueryMsgResponse { - return GetTotalPoolLiquidityQueryMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalPoolLiquidityQueryMsgResponse): GetTotalPoolLiquidityQueryMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg-response", - value: GetTotalPoolLiquidityQueryMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalPoolLiquidityQueryMsgResponseProtoMsg): GetTotalPoolLiquidityQueryMsgResponse { - return GetTotalPoolLiquidityQueryMsgResponse.decode(message.value); - }, - toProto(message: GetTotalPoolLiquidityQueryMsgResponse): Uint8Array { - return GetTotalPoolLiquidityQueryMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: GetTotalPoolLiquidityQueryMsgResponse): GetTotalPoolLiquidityQueryMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsgResponse", - value: GetTotalPoolLiquidityQueryMsgResponse.encode(message).finish() - }; - } -}; -function createBaseGetTotalSharesQueryMsg(): GetTotalSharesQueryMsg { - return { - getTotalShares: EmptyStruct.fromPartial({}) - }; -} -export const GetTotalSharesQueryMsg = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsg", - encode(message: GetTotalSharesQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.getTotalShares !== undefined) { - EmptyStruct.encode(message.getTotalShares, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalSharesQueryMsg { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalSharesQueryMsg(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.getTotalShares = EmptyStruct.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetTotalSharesQueryMsg { - const message = createBaseGetTotalSharesQueryMsg(); - message.getTotalShares = object.getTotalShares !== undefined && object.getTotalShares !== null ? EmptyStruct.fromPartial(object.getTotalShares) : undefined; - return message; - }, - fromAmino(object: GetTotalSharesQueryMsgAmino): GetTotalSharesQueryMsg { - return { - getTotalShares: object?.get_total_shares ? EmptyStruct.fromAmino(object.get_total_shares) : undefined - }; - }, - toAmino(message: GetTotalSharesQueryMsg): GetTotalSharesQueryMsgAmino { - const obj: any = {}; - obj.get_total_shares = message.getTotalShares ? EmptyStruct.toAmino(message.getTotalShares) : undefined; - return obj; - }, - fromAminoMsg(object: GetTotalSharesQueryMsgAminoMsg): GetTotalSharesQueryMsg { - return GetTotalSharesQueryMsg.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalSharesQueryMsg): GetTotalSharesQueryMsgAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-total-shares-query-msg", - value: GetTotalSharesQueryMsg.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalSharesQueryMsgProtoMsg): GetTotalSharesQueryMsg { - return GetTotalSharesQueryMsg.decode(message.value); - }, - toProto(message: GetTotalSharesQueryMsg): Uint8Array { - return GetTotalSharesQueryMsg.encode(message).finish(); - }, - toProtoMsg(message: GetTotalSharesQueryMsg): GetTotalSharesQueryMsgProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsg", - value: GetTotalSharesQueryMsg.encode(message).finish() - }; - } -}; -function createBaseGetTotalSharesQueryMsgResponse(): GetTotalSharesQueryMsgResponse { - return { - totalShares: "" - }; -} -export const GetTotalSharesQueryMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsgResponse", - encode(message: GetTotalSharesQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.totalShares !== "") { - writer.uint32(10).string(message.totalShares); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GetTotalSharesQueryMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetTotalSharesQueryMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalShares = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GetTotalSharesQueryMsgResponse { - const message = createBaseGetTotalSharesQueryMsgResponse(); - message.totalShares = object.totalShares ?? ""; - return message; - }, - fromAmino(object: GetTotalSharesQueryMsgResponseAmino): GetTotalSharesQueryMsgResponse { - return { - totalShares: object.total_shares - }; - }, - toAmino(message: GetTotalSharesQueryMsgResponse): GetTotalSharesQueryMsgResponseAmino { - const obj: any = {}; - obj.total_shares = message.totalShares; - return obj; - }, - fromAminoMsg(object: GetTotalSharesQueryMsgResponseAminoMsg): GetTotalSharesQueryMsgResponse { - return GetTotalSharesQueryMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetTotalSharesQueryMsgResponse): GetTotalSharesQueryMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/get-total-shares-query-msg-response", - value: GetTotalSharesQueryMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: GetTotalSharesQueryMsgResponseProtoMsg): GetTotalSharesQueryMsgResponse { - return GetTotalSharesQueryMsgResponse.decode(message.value); - }, - toProto(message: GetTotalSharesQueryMsgResponse): Uint8Array { - return GetTotalSharesQueryMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: GetTotalSharesQueryMsgResponse): GetTotalSharesQueryMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsgResponse", - value: GetTotalSharesQueryMsgResponse.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts deleted file mode 100644 index 11c03681b..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts +++ /dev/null @@ -1,389 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../../binary"; -/** ===================== JoinPoolExecuteMsg */ -export interface EmptyRequest {} -export interface EmptyRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyRequest"; - value: Uint8Array; -} -/** ===================== JoinPoolExecuteMsg */ -export interface EmptyRequestAmino {} -export interface EmptyRequestAminoMsg { - type: "osmosis/cosmwasmpool/empty-request"; - value: EmptyRequestAmino; -} -/** ===================== JoinPoolExecuteMsg */ -export interface EmptyRequestSDKType {} -export interface JoinPoolExecuteMsgRequest { - /** - * join_pool is the structure containing all request fields of the join pool - * execute message. - */ - joinPool: EmptyRequest; -} -export interface JoinPoolExecuteMsgRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgRequest"; - value: Uint8Array; -} -export interface JoinPoolExecuteMsgRequestAmino { - /** - * join_pool is the structure containing all request fields of the join pool - * execute message. - */ - join_pool?: EmptyRequestAmino; -} -export interface JoinPoolExecuteMsgRequestAminoMsg { - type: "osmosis/cosmwasmpool/join-pool-execute-msg-request"; - value: JoinPoolExecuteMsgRequestAmino; -} -export interface JoinPoolExecuteMsgRequestSDKType { - join_pool: EmptyRequestSDKType; -} -export interface JoinPoolExecuteMsgResponse {} -export interface JoinPoolExecuteMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgResponse"; - value: Uint8Array; -} -export interface JoinPoolExecuteMsgResponseAmino {} -export interface JoinPoolExecuteMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/join-pool-execute-msg-response"; - value: JoinPoolExecuteMsgResponseAmino; -} -export interface JoinPoolExecuteMsgResponseSDKType {} -/** ===================== ExitPoolExecuteMsg */ -export interface ExitPoolExecuteMsgRequest { - /** - * exit_pool is the structure containing all request fields of the exit pool - * execute message. - */ - exitPool: EmptyRequest; -} -export interface ExitPoolExecuteMsgRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgRequest"; - value: Uint8Array; -} -/** ===================== ExitPoolExecuteMsg */ -export interface ExitPoolExecuteMsgRequestAmino { - /** - * exit_pool is the structure containing all request fields of the exit pool - * execute message. - */ - exit_pool?: EmptyRequestAmino; -} -export interface ExitPoolExecuteMsgRequestAminoMsg { - type: "osmosis/cosmwasmpool/exit-pool-execute-msg-request"; - value: ExitPoolExecuteMsgRequestAmino; -} -/** ===================== ExitPoolExecuteMsg */ -export interface ExitPoolExecuteMsgRequestSDKType { - exit_pool: EmptyRequestSDKType; -} -export interface ExitPoolExecuteMsgResponse {} -export interface ExitPoolExecuteMsgResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgResponse"; - value: Uint8Array; -} -export interface ExitPoolExecuteMsgResponseAmino {} -export interface ExitPoolExecuteMsgResponseAminoMsg { - type: "osmosis/cosmwasmpool/exit-pool-execute-msg-response"; - value: ExitPoolExecuteMsgResponseAmino; -} -export interface ExitPoolExecuteMsgResponseSDKType {} -function createBaseEmptyRequest(): EmptyRequest { - return {}; -} -export const EmptyRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyRequest", - encode(_: EmptyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): EmptyRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEmptyRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): EmptyRequest { - const message = createBaseEmptyRequest(); - return message; - }, - fromAmino(_: EmptyRequestAmino): EmptyRequest { - return {}; - }, - toAmino(_: EmptyRequest): EmptyRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: EmptyRequestAminoMsg): EmptyRequest { - return EmptyRequest.fromAmino(object.value); - }, - toAminoMsg(message: EmptyRequest): EmptyRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/empty-request", - value: EmptyRequest.toAmino(message) - }; - }, - fromProtoMsg(message: EmptyRequestProtoMsg): EmptyRequest { - return EmptyRequest.decode(message.value); - }, - toProto(message: EmptyRequest): Uint8Array { - return EmptyRequest.encode(message).finish(); - }, - toProtoMsg(message: EmptyRequest): EmptyRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyRequest", - value: EmptyRequest.encode(message).finish() - }; - } -}; -function createBaseJoinPoolExecuteMsgRequest(): JoinPoolExecuteMsgRequest { - return { - joinPool: EmptyRequest.fromPartial({}) - }; -} -export const JoinPoolExecuteMsgRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgRequest", - encode(message: JoinPoolExecuteMsgRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.joinPool !== undefined) { - EmptyRequest.encode(message.joinPool, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): JoinPoolExecuteMsgRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseJoinPoolExecuteMsgRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.joinPool = EmptyRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): JoinPoolExecuteMsgRequest { - const message = createBaseJoinPoolExecuteMsgRequest(); - message.joinPool = object.joinPool !== undefined && object.joinPool !== null ? EmptyRequest.fromPartial(object.joinPool) : undefined; - return message; - }, - fromAmino(object: JoinPoolExecuteMsgRequestAmino): JoinPoolExecuteMsgRequest { - return { - joinPool: object?.join_pool ? EmptyRequest.fromAmino(object.join_pool) : undefined - }; - }, - toAmino(message: JoinPoolExecuteMsgRequest): JoinPoolExecuteMsgRequestAmino { - const obj: any = {}; - obj.join_pool = message.joinPool ? EmptyRequest.toAmino(message.joinPool) : undefined; - return obj; - }, - fromAminoMsg(object: JoinPoolExecuteMsgRequestAminoMsg): JoinPoolExecuteMsgRequest { - return JoinPoolExecuteMsgRequest.fromAmino(object.value); - }, - toAminoMsg(message: JoinPoolExecuteMsgRequest): JoinPoolExecuteMsgRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/join-pool-execute-msg-request", - value: JoinPoolExecuteMsgRequest.toAmino(message) - }; - }, - fromProtoMsg(message: JoinPoolExecuteMsgRequestProtoMsg): JoinPoolExecuteMsgRequest { - return JoinPoolExecuteMsgRequest.decode(message.value); - }, - toProto(message: JoinPoolExecuteMsgRequest): Uint8Array { - return JoinPoolExecuteMsgRequest.encode(message).finish(); - }, - toProtoMsg(message: JoinPoolExecuteMsgRequest): JoinPoolExecuteMsgRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgRequest", - value: JoinPoolExecuteMsgRequest.encode(message).finish() - }; - } -}; -function createBaseJoinPoolExecuteMsgResponse(): JoinPoolExecuteMsgResponse { - return {}; -} -export const JoinPoolExecuteMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgResponse", - encode(_: JoinPoolExecuteMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): JoinPoolExecuteMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseJoinPoolExecuteMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): JoinPoolExecuteMsgResponse { - const message = createBaseJoinPoolExecuteMsgResponse(); - return message; - }, - fromAmino(_: JoinPoolExecuteMsgResponseAmino): JoinPoolExecuteMsgResponse { - return {}; - }, - toAmino(_: JoinPoolExecuteMsgResponse): JoinPoolExecuteMsgResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: JoinPoolExecuteMsgResponseAminoMsg): JoinPoolExecuteMsgResponse { - return JoinPoolExecuteMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: JoinPoolExecuteMsgResponse): JoinPoolExecuteMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/join-pool-execute-msg-response", - value: JoinPoolExecuteMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: JoinPoolExecuteMsgResponseProtoMsg): JoinPoolExecuteMsgResponse { - return JoinPoolExecuteMsgResponse.decode(message.value); - }, - toProto(message: JoinPoolExecuteMsgResponse): Uint8Array { - return JoinPoolExecuteMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: JoinPoolExecuteMsgResponse): JoinPoolExecuteMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgResponse", - value: JoinPoolExecuteMsgResponse.encode(message).finish() - }; - } -}; -function createBaseExitPoolExecuteMsgRequest(): ExitPoolExecuteMsgRequest { - return { - exitPool: EmptyRequest.fromPartial({}) - }; -} -export const ExitPoolExecuteMsgRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgRequest", - encode(message: ExitPoolExecuteMsgRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.exitPool !== undefined) { - EmptyRequest.encode(message.exitPool, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ExitPoolExecuteMsgRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExitPoolExecuteMsgRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exitPool = EmptyRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ExitPoolExecuteMsgRequest { - const message = createBaseExitPoolExecuteMsgRequest(); - message.exitPool = object.exitPool !== undefined && object.exitPool !== null ? EmptyRequest.fromPartial(object.exitPool) : undefined; - return message; - }, - fromAmino(object: ExitPoolExecuteMsgRequestAmino): ExitPoolExecuteMsgRequest { - return { - exitPool: object?.exit_pool ? EmptyRequest.fromAmino(object.exit_pool) : undefined - }; - }, - toAmino(message: ExitPoolExecuteMsgRequest): ExitPoolExecuteMsgRequestAmino { - const obj: any = {}; - obj.exit_pool = message.exitPool ? EmptyRequest.toAmino(message.exitPool) : undefined; - return obj; - }, - fromAminoMsg(object: ExitPoolExecuteMsgRequestAminoMsg): ExitPoolExecuteMsgRequest { - return ExitPoolExecuteMsgRequest.fromAmino(object.value); - }, - toAminoMsg(message: ExitPoolExecuteMsgRequest): ExitPoolExecuteMsgRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/exit-pool-execute-msg-request", - value: ExitPoolExecuteMsgRequest.toAmino(message) - }; - }, - fromProtoMsg(message: ExitPoolExecuteMsgRequestProtoMsg): ExitPoolExecuteMsgRequest { - return ExitPoolExecuteMsgRequest.decode(message.value); - }, - toProto(message: ExitPoolExecuteMsgRequest): Uint8Array { - return ExitPoolExecuteMsgRequest.encode(message).finish(); - }, - toProtoMsg(message: ExitPoolExecuteMsgRequest): ExitPoolExecuteMsgRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgRequest", - value: ExitPoolExecuteMsgRequest.encode(message).finish() - }; - } -}; -function createBaseExitPoolExecuteMsgResponse(): ExitPoolExecuteMsgResponse { - return {}; -} -export const ExitPoolExecuteMsgResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgResponse", - encode(_: ExitPoolExecuteMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ExitPoolExecuteMsgResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExitPoolExecuteMsgResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): ExitPoolExecuteMsgResponse { - const message = createBaseExitPoolExecuteMsgResponse(); - return message; - }, - fromAmino(_: ExitPoolExecuteMsgResponseAmino): ExitPoolExecuteMsgResponse { - return {}; - }, - toAmino(_: ExitPoolExecuteMsgResponse): ExitPoolExecuteMsgResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: ExitPoolExecuteMsgResponseAminoMsg): ExitPoolExecuteMsgResponse { - return ExitPoolExecuteMsgResponse.fromAmino(object.value); - }, - toAminoMsg(message: ExitPoolExecuteMsgResponse): ExitPoolExecuteMsgResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/exit-pool-execute-msg-response", - value: ExitPoolExecuteMsgResponse.toAmino(message) - }; - }, - fromProtoMsg(message: ExitPoolExecuteMsgResponseProtoMsg): ExitPoolExecuteMsgResponse { - return ExitPoolExecuteMsgResponse.decode(message.value); - }, - toProto(message: ExitPoolExecuteMsgResponse): Uint8Array { - return ExitPoolExecuteMsgResponse.encode(message).finish(); - }, - toProtoMsg(message: ExitPoolExecuteMsgResponse): ExitPoolExecuteMsgResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgResponse", - value: ExitPoolExecuteMsgResponse.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts deleted file mode 100644 index ab972baa2..000000000 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../binary"; -export interface Params { - /** - * code_ide_whitelist contains the list of code ids that are allowed to be - * instantiated. - */ - codeIdWhitelist: bigint[]; - /** - * pool_migration_limit is the maximum number of pools that can be migrated - * at once via governance proposal. This is to have a constant bound on the - * number of pools that can be migrated at once and remove the possibility - * of an unlikely scenario of causing a chain halt due to a large migration. - */ - poolMigrationLimit: bigint; -} -export interface ParamsProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.Params"; - value: Uint8Array; -} -export interface ParamsAmino { - /** - * code_ide_whitelist contains the list of code ids that are allowed to be - * instantiated. - */ - code_id_whitelist: string[]; - /** - * pool_migration_limit is the maximum number of pools that can be migrated - * at once via governance proposal. This is to have a constant bound on the - * number of pools that can be migrated at once and remove the possibility - * of an unlikely scenario of causing a chain halt due to a large migration. - */ - pool_migration_limit: string; -} -export interface ParamsAminoMsg { - type: "osmosis/cosmwasmpool/params"; - value: ParamsAmino; -} -export interface ParamsSDKType { - code_id_whitelist: bigint[]; - pool_migration_limit: bigint; -} -function createBaseParams(): Params { - return { - codeIdWhitelist: [], - poolMigrationLimit: BigInt(0) - }; -} -export const Params = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - writer.uint32(10).fork(); - for (const v of message.codeIdWhitelist) { - writer.uint64(v); - } - writer.ldelim(); - if (message.poolMigrationLimit !== BigInt(0)) { - writer.uint32(16).uint64(message.poolMigrationLimit); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.codeIdWhitelist.push(reader.uint64()); - } - } else { - message.codeIdWhitelist.push(reader.uint64()); - } - break; - case 2: - message.poolMigrationLimit = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.codeIdWhitelist = object.codeIdWhitelist?.map(e => BigInt(e.toString())) || []; - message.poolMigrationLimit = object.poolMigrationLimit !== undefined && object.poolMigrationLimit !== null ? BigInt(object.poolMigrationLimit.toString()) : BigInt(0); - return message; - }, - fromAmino(object: ParamsAmino): Params { - return { - codeIdWhitelist: Array.isArray(object?.code_id_whitelist) ? object.code_id_whitelist.map((e: any) => BigInt(e)) : [], - poolMigrationLimit: BigInt(object.pool_migration_limit) - }; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.codeIdWhitelist) { - obj.code_id_whitelist = message.codeIdWhitelist.map(e => e.toString()); - } else { - obj.code_id_whitelist = []; - } - obj.pool_migration_limit = message.poolMigrationLimit ? message.poolMigrationLimit.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "osmosis/cosmwasmpool/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.cosmwasmpool.v1beta1.Params", - value: Params.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.lcd.ts index 924498fc4..00f40ab36 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.lcd.ts @@ -1,6 +1,5 @@ -import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, ContractInfoByPoolIdRequest, ContractInfoByPoolIdResponseSDKType } from "./query"; +import { ParamsRequest, ParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -9,37 +8,11 @@ export class LCDQueryClient { requestClient: LCDClient; }) { this.req = requestClient; - this.pools = this.pools.bind(this); this.params = this.params.bind(this); - this.contractInfoByPoolId = this.contractInfoByPoolId.bind(this); } - /* Pools returns all cosmwasm pools */ - async pools(params: PoolsRequest = { - pagination: undefined - }): Promise { - const options: any = { - params: {} - }; - if (typeof params?.pagination !== "undefined") { - setPaginationParams(options, params.pagination); - } - const endpoint = `osmosis/cosmwasmpool/v1beta1/pools`; - return await this.req.get(endpoint, options); - } - /* Params returns the parameters of the x/cosmwasmpool module. */ + /* Params */ async params(_params: ParamsRequest = {}): Promise { - const endpoint = `osmosis/cosmwasmpool/v1beta1/params`; + const endpoint = `osmosis/cosmwasmpool/v1beta1/Params`; return await this.req.get(endpoint); } - /* ContractInfoByPoolId */ - async contractInfoByPoolId(params: ContractInfoByPoolIdRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.poolId !== "undefined") { - options.params.pool_id = params.poolId; - } - const endpoint = `osmosis/cosmwasmpool/v1beta1/contract_info`; - return await this.req.get(endpoint, options); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts index 613c4bde7..43009fde9 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts @@ -1,52 +1,28 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, ContractInfoByPoolIdRequest, ContractInfoByPoolIdResponse } from "./query"; +import { ParamsRequest, ParamsResponse } from "./query"; export interface Query { - /** Pools returns all cosmwasm pools */ - pools(request?: PoolsRequest): Promise; - /** Params returns the parameters of the x/cosmwasmpool module. */ params(request?: ParamsRequest): Promise; - contractInfoByPoolId(request: ContractInfoByPoolIdRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; - this.pools = this.pools.bind(this); this.params = this.params.bind(this); - this.contractInfoByPoolId = this.contractInfoByPoolId.bind(this); - } - pools(request: PoolsRequest = { - pagination: undefined - }): Promise { - const data = PoolsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.cosmwasmpool.v1beta1.Query", "Pools", data); - return promise.then(data => PoolsResponse.decode(new BinaryReader(data))); } params(request: ParamsRequest = {}): Promise { const data = ParamsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.cosmwasmpool.v1beta1.Query", "Params", data); return promise.then(data => ParamsResponse.decode(new BinaryReader(data))); } - contractInfoByPoolId(request: ContractInfoByPoolIdRequest): Promise { - const data = ContractInfoByPoolIdRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.cosmwasmpool.v1beta1.Query", "ContractInfoByPoolId", data); - return promise.then(data => ContractInfoByPoolIdResponse.decode(new BinaryReader(data))); - } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); const queryService = new QueryClientImpl(rpc); return { - pools(request?: PoolsRequest): Promise { - return queryService.pools(request); - }, params(request?: ParamsRequest): Promise { return queryService.params(request); - }, - contractInfoByPoolId(request: ContractInfoByPoolIdRequest): Promise { - return queryService.contractInfoByPoolId(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts index b158bbae1..886df72e7 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts @@ -1,30 +1,18 @@ -import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; -/** =============================== ContractInfoByPoolId */ +/** =============================== Params */ export interface ParamsRequest {} export interface ParamsRequestProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ParamsRequest"; value: Uint8Array; } -/** =============================== ContractInfoByPoolId */ +/** =============================== Params */ export interface ParamsRequestAmino {} export interface ParamsRequestAminoMsg { type: "osmosis/cosmwasmpool/params-request"; value: ParamsRequestAmino; } -/** =============================== ContractInfoByPoolId */ +/** =============================== Params */ export interface ParamsRequestSDKType {} export interface ParamsResponse { params: Params; @@ -43,105 +31,6 @@ export interface ParamsResponseAminoMsg { export interface ParamsResponseSDKType { params: ParamsSDKType; } -/** =============================== Pools */ -export interface PoolsRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; -} -export interface PoolsRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest"; - value: Uint8Array; -} -/** =============================== Pools */ -export interface PoolsRequestAmino { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface PoolsRequestAminoMsg { - type: "osmosis/cosmwasmpool/pools-request"; - value: PoolsRequestAmino; -} -/** =============================== Pools */ -export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; -} -export interface PoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse; -} -export interface PoolsResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse"; - value: Uint8Array; -} -export type PoolsResponseEncoded = Omit & { - pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; -}; -export interface PoolsResponseAmino { - pools: AnyAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface PoolsResponseAminoMsg { - type: "osmosis/cosmwasmpool/pools-response"; - value: PoolsResponseAmino; -} -export interface PoolsResponseSDKType { - pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; -} -/** =============================== ContractInfoByPoolId */ -export interface ContractInfoByPoolIdRequest { - /** pool_id is the pool id of the requested pool. */ - poolId: bigint; -} -export interface ContractInfoByPoolIdRequestProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdRequest"; - value: Uint8Array; -} -/** =============================== ContractInfoByPoolId */ -export interface ContractInfoByPoolIdRequestAmino { - /** pool_id is the pool id of the requested pool. */ - pool_id: string; -} -export interface ContractInfoByPoolIdRequestAminoMsg { - type: "osmosis/cosmwasmpool/contract-info-by-pool-id-request"; - value: ContractInfoByPoolIdRequestAmino; -} -/** =============================== ContractInfoByPoolId */ -export interface ContractInfoByPoolIdRequestSDKType { - pool_id: bigint; -} -export interface ContractInfoByPoolIdResponse { - /** - * contract_address is the pool address and contract address - * of the requested pool id. - */ - contractAddress: string; - /** code_id is the code id of the requested pool id. */ - codeId: bigint; -} -export interface ContractInfoByPoolIdResponseProtoMsg { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdResponse"; - value: Uint8Array; -} -export interface ContractInfoByPoolIdResponseAmino { - /** - * contract_address is the pool address and contract address - * of the requested pool id. - */ - contract_address: string; - /** code_id is the code id of the requested pool id. */ - code_id: string; -} -export interface ContractInfoByPoolIdResponseAminoMsg { - type: "osmosis/cosmwasmpool/contract-info-by-pool-id-response"; - value: ContractInfoByPoolIdResponseAmino; -} -export interface ContractInfoByPoolIdResponseSDKType { - contract_address: string; - code_id: bigint; -} function createBaseParamsRequest(): ParamsRequest { return {}; } @@ -263,364 +152,4 @@ export const ParamsResponse = { value: ParamsResponse.encode(message).finish() }; } -}; -function createBasePoolsRequest(): PoolsRequest { - return { - pagination: PageRequest.fromPartial({}) - }; -} -export const PoolsRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest", - encode(message: PoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolsRequest { - const message = createBasePoolsRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: PoolsRequest): PoolsRequestAmino { - const obj: any = {}; - obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: PoolsRequestAminoMsg): PoolsRequest { - return PoolsRequest.fromAmino(object.value); - }, - toAminoMsg(message: PoolsRequest): PoolsRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/pools-request", - value: PoolsRequest.toAmino(message) - }; - }, - fromProtoMsg(message: PoolsRequestProtoMsg): PoolsRequest { - return PoolsRequest.decode(message.value); - }, - toProto(message: PoolsRequest): Uint8Array { - return PoolsRequest.encode(message).finish(); - }, - toProtoMsg(message: PoolsRequest): PoolsRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest", - value: PoolsRequest.encode(message).finish() - }; - } -}; -function createBasePoolsResponse(): PoolsResponse { - return { - pools: [], - pagination: PageResponse.fromPartial({}) - }; -} -export const PoolsResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse", - encode(message: PoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolsResponse { - const message = createBasePoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; - }, - toAmino(message: PoolsResponse): PoolsResponseAmino { - const obj: any = {}; - if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); - } else { - obj.pools = []; - } - obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; - return obj; - }, - fromAminoMsg(object: PoolsResponseAminoMsg): PoolsResponse { - return PoolsResponse.fromAmino(object.value); - }, - toAminoMsg(message: PoolsResponse): PoolsResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/pools-response", - value: PoolsResponse.toAmino(message) - }; - }, - fromProtoMsg(message: PoolsResponseProtoMsg): PoolsResponse { - return PoolsResponse.decode(message.value); - }, - toProto(message: PoolsResponse): Uint8Array { - return PoolsResponse.encode(message).finish(); - }, - toProtoMsg(message: PoolsResponse): PoolsResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse", - value: PoolsResponse.encode(message).finish() - }; - } -}; -function createBaseContractInfoByPoolIdRequest(): ContractInfoByPoolIdRequest { - return { - poolId: BigInt(0) - }; -} -export const ContractInfoByPoolIdRequest = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdRequest", - encode(message: ContractInfoByPoolIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ContractInfoByPoolIdRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContractInfoByPoolIdRequest(); - 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): ContractInfoByPoolIdRequest { - const message = createBaseContractInfoByPoolIdRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: ContractInfoByPoolIdRequestAmino): ContractInfoByPoolIdRequest { - return { - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: ContractInfoByPoolIdRequest): ContractInfoByPoolIdRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ContractInfoByPoolIdRequestAminoMsg): ContractInfoByPoolIdRequest { - return ContractInfoByPoolIdRequest.fromAmino(object.value); - }, - toAminoMsg(message: ContractInfoByPoolIdRequest): ContractInfoByPoolIdRequestAminoMsg { - return { - type: "osmosis/cosmwasmpool/contract-info-by-pool-id-request", - value: ContractInfoByPoolIdRequest.toAmino(message) - }; - }, - fromProtoMsg(message: ContractInfoByPoolIdRequestProtoMsg): ContractInfoByPoolIdRequest { - return ContractInfoByPoolIdRequest.decode(message.value); - }, - toProto(message: ContractInfoByPoolIdRequest): Uint8Array { - return ContractInfoByPoolIdRequest.encode(message).finish(); - }, - toProtoMsg(message: ContractInfoByPoolIdRequest): ContractInfoByPoolIdRequestProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdRequest", - value: ContractInfoByPoolIdRequest.encode(message).finish() - }; - } -}; -function createBaseContractInfoByPoolIdResponse(): ContractInfoByPoolIdResponse { - return { - contractAddress: "", - codeId: BigInt(0) - }; -} -export const ContractInfoByPoolIdResponse = { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdResponse", - encode(message: ContractInfoByPoolIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.contractAddress !== "") { - writer.uint32(10).string(message.contractAddress); - } - if (message.codeId !== BigInt(0)) { - writer.uint32(16).uint64(message.codeId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ContractInfoByPoolIdResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContractInfoByPoolIdResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractAddress = reader.string(); - break; - case 2: - message.codeId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ContractInfoByPoolIdResponse { - const message = createBaseContractInfoByPoolIdResponse(); - message.contractAddress = object.contractAddress ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: ContractInfoByPoolIdResponseAmino): ContractInfoByPoolIdResponse { - return { - contractAddress: object.contract_address, - codeId: BigInt(object.code_id) - }; - }, - toAmino(message: ContractInfoByPoolIdResponse): ContractInfoByPoolIdResponseAmino { - const obj: any = {}; - obj.contract_address = message.contractAddress; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ContractInfoByPoolIdResponseAminoMsg): ContractInfoByPoolIdResponse { - return ContractInfoByPoolIdResponse.fromAmino(object.value); - }, - toAminoMsg(message: ContractInfoByPoolIdResponse): ContractInfoByPoolIdResponseAminoMsg { - return { - type: "osmosis/cosmwasmpool/contract-info-by-pool-id-response", - value: ContractInfoByPoolIdResponse.toAmino(message) - }; - }, - fromProtoMsg(message: ContractInfoByPoolIdResponseProtoMsg): ContractInfoByPoolIdResponse { - return ContractInfoByPoolIdResponse.decode(message.value); - }, - toProto(message: ContractInfoByPoolIdResponse): Uint8Array { - return ContractInfoByPoolIdResponse.encode(message).finish(); - }, - toProtoMsg(message: ContractInfoByPoolIdResponse): ContractInfoByPoolIdResponseProtoMsg { - return { - typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdResponse", - value: ContractInfoByPoolIdResponse.encode(message).finish() - }; - } -}; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts index e5d424945..c7089e35f 100644 --- a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts @@ -48,7 +48,7 @@ export interface GenesisStateSDKType { function createBaseGenesisDowntimeEntry(): GenesisDowntimeEntry { return { duration: 0, - lastDowntime: undefined + lastDowntime: new Date() }; } export const GenesisDowntimeEntry = { @@ -125,7 +125,7 @@ export const GenesisDowntimeEntry = { function createBaseGenesisState(): GenesisState { return { downtimes: [], - lastBlockTime: undefined + lastBlockTime: new Date() }; } export const GenesisState = { diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts index c950487d2..7a2980e27 100644 --- a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts @@ -54,7 +54,7 @@ export interface RecoveredSinceDowntimeOfLengthResponseSDKType { function createBaseRecoveredSinceDowntimeOfLengthRequest(): RecoveredSinceDowntimeOfLengthRequest { return { downtime: 0, - recovery: undefined + recovery: Duration.fromPartial({}) }; } export const RecoveredSinceDowntimeOfLengthRequest = { diff --git a/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts b/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts index 63514f26d..f4a6e5ccf 100644 --- a/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts @@ -162,10 +162,10 @@ export interface GenesisStateSDKType { function createBaseEpochInfo(): EpochInfo { return { identifier: "", - startTime: undefined, - duration: undefined, + startTime: new Date(), + duration: Duration.fromPartial({}), currentEpoch: BigInt(0), - currentEpochStartTime: undefined, + currentEpochStartTime: new Date(), epochCountingStarted: false, currentEpochStartHeight: BigInt(0) }; diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts index 68027c7f4..753dc748c 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -279,8 +279,8 @@ export interface PoolSDKType { } function createBaseSmoothWeightChangeParams(): SmoothWeightChangeParams { return { - startTime: undefined, - duration: undefined, + startTime: new Date(), + duration: Duration.fromPartial({}), initialPoolWeights: [], targetPoolWeights: [] }; @@ -471,7 +471,7 @@ export const PoolParams = { }; function createBasePoolAsset(): PoolAsset { return { - token: undefined, + token: Coin.fromPartial({}), weight: "" }; } @@ -553,7 +553,7 @@ function createBasePool(): Pool { id: BigInt(0), poolParams: PoolParams.fromPartial({}), futurePoolGovernor: "", - totalShares: undefined, + totalShares: Coin.fromPartial({}), poolAssets: [], totalWeight: "" }; diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts index 6ee9bd51c..8d0eeb6f6 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts @@ -1,9 +1,14 @@ //@ts-nocheck -import { MsgCreateBalancerPool } from "./tx"; +import { MsgCreateBalancerPool, MsgMigrateSharesToFullRangeConcentratedPosition } from "./tx"; export const AminoConverter = { "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool": { aminoType: "osmosis/gamm/create-balancer-pool", toAmino: MsgCreateBalancerPool.toAmino, fromAmino: MsgCreateBalancerPool.fromAmino + }, + "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition": { + aminoType: "osmosis/gamm/poolmodels/balancer/migrate-shares-to-full-range-concentrated-position", + toAmino: MsgMigrateSharesToFullRangeConcentratedPosition.toAmino, + fromAmino: MsgMigrateSharesToFullRangeConcentratedPosition.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts index ded2bd788..e0eaa1b8e 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts @@ -1,7 +1,7 @@ //@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]]; +import { MsgCreateBalancerPool, MsgMigrateSharesToFullRangeConcentratedPosition } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", MsgCreateBalancerPool], ["/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", MsgMigrateSharesToFullRangeConcentratedPosition]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -14,6 +14,12 @@ export const MessageComposer = { typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", value: MsgCreateBalancerPool.encode(value).finish() }; + }, + migrateSharesToFullRangeConcentratedPosition(value: MsgMigrateSharesToFullRangeConcentratedPosition) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", + value: MsgMigrateSharesToFullRangeConcentratedPosition.encode(value).finish() + }; } }, withTypeUrl: { @@ -22,6 +28,12 @@ export const MessageComposer = { typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", value }; + }, + migrateSharesToFullRangeConcentratedPosition(value: MsgMigrateSharesToFullRangeConcentratedPosition) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", + value + }; } }, fromPartial: { @@ -30,6 +42,12 @@ export const MessageComposer = { typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", value: MsgCreateBalancerPool.fromPartial(value) }; + }, + migrateSharesToFullRangeConcentratedPosition(value: MsgMigrateSharesToFullRangeConcentratedPosition) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", + value: MsgMigrateSharesToFullRangeConcentratedPosition.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts index 049dae353..dfa0c7250 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts @@ -1,18 +1,25 @@ import { Rpc } from "../../../../../helpers"; import { BinaryReader } from "../../../../../binary"; -import { MsgCreateBalancerPool, MsgCreateBalancerPoolResponse } from "./tx"; +import { MsgCreateBalancerPool, MsgCreateBalancerPoolResponse, MsgMigrateSharesToFullRangeConcentratedPosition, MsgMigrateSharesToFullRangeConcentratedPositionResponse } from "./tx"; export interface Msg { createBalancerPool(request: MsgCreateBalancerPool): Promise; + migrateSharesToFullRangeConcentratedPosition(request: MsgMigrateSharesToFullRangeConcentratedPosition): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.createBalancerPool = this.createBalancerPool.bind(this); + this.migrateSharesToFullRangeConcentratedPosition = this.migrateSharesToFullRangeConcentratedPosition.bind(this); } createBalancerPool(request: MsgCreateBalancerPool): Promise { const data = MsgCreateBalancerPool.encode(request).finish(); const promise = this.rpc.request("osmosis.gamm.poolmodels.balancer.v1beta1.Msg", "CreateBalancerPool", data); return promise.then(data => MsgCreateBalancerPoolResponse.decode(new BinaryReader(data))); } + migrateSharesToFullRangeConcentratedPosition(request: MsgMigrateSharesToFullRangeConcentratedPosition): Promise { + const data = MsgMigrateSharesToFullRangeConcentratedPosition.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.poolmodels.balancer.v1beta1.Msg", "MigrateSharesToFullRangeConcentratedPosition", data); + return promise.then(data => MsgMigrateSharesToFullRangeConcentratedPositionResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts index 3d78e1c37..2f9971897 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts @@ -1,5 +1,9 @@ import { PoolParams, PoolParamsAmino, PoolParamsSDKType, PoolAsset, PoolAssetAmino, PoolAssetSDKType } from "../balancerPool"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../../../helpers"; /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPool { sender: string; @@ -49,6 +53,55 @@ export interface MsgCreateBalancerPoolResponseAminoMsg { export interface MsgCreateBalancerPoolResponseSDKType { pool_id: bigint; } +/** ===================== MsgMigrateSharesToFullRangeConcentratedPosition */ +export interface MsgMigrateSharesToFullRangeConcentratedPosition { + sender: string; + sharesToMigrate: Coin; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionProtoMsg { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition"; + value: Uint8Array; +} +/** ===================== MsgMigrateSharesToFullRangeConcentratedPosition */ +export interface MsgMigrateSharesToFullRangeConcentratedPositionAmino { + sender: string; + shares_to_migrate?: CoinAmino; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionAminoMsg { + type: "osmosis/gamm/poolmodels/balancer/migrate-shares-to-full-range-concentrated-position"; + value: MsgMigrateSharesToFullRangeConcentratedPositionAmino; +} +/** ===================== MsgMigrateSharesToFullRangeConcentratedPosition */ +export interface MsgMigrateSharesToFullRangeConcentratedPositionSDKType { + sender: string; + shares_to_migrate: CoinSDKType; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionResponse { + amount0: string; + amount1: string; + liquidityCreated: string; + joinTime: Date; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPositionResponse"; + value: Uint8Array; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionResponseAmino { + amount0: string; + amount1: string; + liquidity_created: string; + join_time?: Date; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { + type: "osmosis/gamm/poolmodels/balancer/migrate-shares-to-full-range-concentrated-position-response"; + value: MsgMigrateSharesToFullRangeConcentratedPositionResponseAmino; +} +export interface MsgMigrateSharesToFullRangeConcentratedPositionResponseSDKType { + amount0: string; + amount1: string; + liquidity_created: string; + join_time: Date; +} function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { return { sender: "", @@ -216,4 +269,178 @@ export const MsgCreateBalancerPoolResponse = { value: MsgCreateBalancerPoolResponse.encode(message).finish() }; } +}; +function createBaseMsgMigrateSharesToFullRangeConcentratedPosition(): MsgMigrateSharesToFullRangeConcentratedPosition { + return { + sender: "", + sharesToMigrate: Coin.fromPartial({}) + }; +} +export const MsgMigrateSharesToFullRangeConcentratedPosition = { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", + encode(message: MsgMigrateSharesToFullRangeConcentratedPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.sharesToMigrate !== undefined) { + Coin.encode(message.sharesToMigrate, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateSharesToFullRangeConcentratedPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateSharesToFullRangeConcentratedPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.sharesToMigrate = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateSharesToFullRangeConcentratedPosition { + const message = createBaseMsgMigrateSharesToFullRangeConcentratedPosition(); + message.sender = object.sender ?? ""; + message.sharesToMigrate = object.sharesToMigrate !== undefined && object.sharesToMigrate !== null ? Coin.fromPartial(object.sharesToMigrate) : undefined; + return message; + }, + fromAmino(object: MsgMigrateSharesToFullRangeConcentratedPositionAmino): MsgMigrateSharesToFullRangeConcentratedPosition { + return { + sender: object.sender, + sharesToMigrate: object?.shares_to_migrate ? Coin.fromAmino(object.shares_to_migrate) : undefined + }; + }, + toAmino(message: MsgMigrateSharesToFullRangeConcentratedPosition): MsgMigrateSharesToFullRangeConcentratedPositionAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.shares_to_migrate = message.sharesToMigrate ? Coin.toAmino(message.sharesToMigrate) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateSharesToFullRangeConcentratedPositionAminoMsg): MsgMigrateSharesToFullRangeConcentratedPosition { + return MsgMigrateSharesToFullRangeConcentratedPosition.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateSharesToFullRangeConcentratedPosition): MsgMigrateSharesToFullRangeConcentratedPositionAminoMsg { + return { + type: "osmosis/gamm/poolmodels/balancer/migrate-shares-to-full-range-concentrated-position", + value: MsgMigrateSharesToFullRangeConcentratedPosition.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateSharesToFullRangeConcentratedPositionProtoMsg): MsgMigrateSharesToFullRangeConcentratedPosition { + return MsgMigrateSharesToFullRangeConcentratedPosition.decode(message.value); + }, + toProto(message: MsgMigrateSharesToFullRangeConcentratedPosition): Uint8Array { + return MsgMigrateSharesToFullRangeConcentratedPosition.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateSharesToFullRangeConcentratedPosition): MsgMigrateSharesToFullRangeConcentratedPositionProtoMsg { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPosition", + value: MsgMigrateSharesToFullRangeConcentratedPosition.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateSharesToFullRangeConcentratedPositionResponse(): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + return { + amount0: "", + amount1: "", + liquidityCreated: "", + joinTime: new Date() + }; +} +export const MsgMigrateSharesToFullRangeConcentratedPositionResponse = { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPositionResponse", + encode(message: MsgMigrateSharesToFullRangeConcentratedPositionResponse, 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): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateSharesToFullRangeConcentratedPositionResponse(); + 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): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + const message = createBaseMsgMigrateSharesToFullRangeConcentratedPositionResponse(); + message.amount0 = object.amount0 ?? ""; + message.amount1 = object.amount1 ?? ""; + message.liquidityCreated = object.liquidityCreated ?? ""; + message.joinTime = object.joinTime ?? undefined; + return message; + }, + fromAmino(object: MsgMigrateSharesToFullRangeConcentratedPositionResponseAmino): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + return { + amount0: object.amount0, + amount1: object.amount1, + liquidityCreated: object.liquidity_created, + joinTime: object.join_time + }; + }, + toAmino(message: MsgMigrateSharesToFullRangeConcentratedPositionResponse): MsgMigrateSharesToFullRangeConcentratedPositionResponseAmino { + const obj: any = {}; + obj.amount0 = message.amount0; + obj.amount1 = message.amount1; + obj.liquidity_created = message.liquidityCreated; + obj.join_time = message.joinTime; + return obj; + }, + fromAminoMsg(object: MsgMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgMigrateSharesToFullRangeConcentratedPositionResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateSharesToFullRangeConcentratedPositionResponse): MsgMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { + return { + type: "osmosis/gamm/poolmodels/balancer/migrate-shares-to-full-range-concentrated-position-response", + value: MsgMigrateSharesToFullRangeConcentratedPositionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg): MsgMigrateSharesToFullRangeConcentratedPositionResponse { + return MsgMigrateSharesToFullRangeConcentratedPositionResponse.decode(message.value); + }, + toProto(message: MsgMigrateSharesToFullRangeConcentratedPositionResponse): Uint8Array { + return MsgMigrateSharesToFullRangeConcentratedPositionResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateSharesToFullRangeConcentratedPositionResponse): MsgMigrateSharesToFullRangeConcentratedPositionResponseProtoMsg { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgMigrateSharesToFullRangeConcentratedPositionResponse", + value: MsgMigrateSharesToFullRangeConcentratedPositionResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts index 6b55d4606..cc9695e2a 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts @@ -204,7 +204,7 @@ function createBasePool(): Pool { id: BigInt(0), poolParams: PoolParams.fromPartial({}), futurePoolGovernor: "", - totalShares: undefined, + totalShares: Coin.fromPartial({}), poolLiquidity: [], scalingFactors: [], scalingFactorController: "" diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts index 0c6a0da1b..ab407dc3c 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts @@ -1,6 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType } from "./shared"; import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; @@ -66,6 +65,79 @@ export interface GenesisStateSDKType { params: ParamsSDKType; migration_records: MigrationRecordsSDKType; } +/** + * 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 createBaseParams(): Params { return { poolCreationFee: [] @@ -238,6 +310,154 @@ export const GenesisState = { }; } }; +function createBaseMigrationRecords(): MigrationRecords { + return { + balancerToConcentratedPoolLinks: [] + }; +} +export const MigrationRecords = { + typeUrl: "/osmosis.gamm.v1beta1.MigrationRecords", + 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 { + return { + balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] + }; + }, + 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 = []; + } + 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() + }; + } +}; +function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { + return { + balancerPoolId: BigInt(0), + clPoolId: BigInt(0) + }; +} +export const BalancerToConcentratedPoolLink = { + typeUrl: "/osmosis.gamm.v1beta1.BalancerToConcentratedPoolLink", + 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 { + return { + balancerPoolId: BigInt(object.balancer_pool_id), + clPoolId: BigInt(object.cl_pool_id) + }; + }, + toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { + const obj: any = {}; + obj.balancer_pool_id = message.balancerPoolId ? message.balancerPoolId.toString() : undefined; + obj.cl_pool_id = message.clPoolId ? 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() + }; + } +}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts index ea11c5f81..b8eb76031 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts @@ -1,4 +1,4 @@ -import { BalancerToConcentratedPoolLink, BalancerToConcentratedPoolLinkAmino, BalancerToConcentratedPoolLinkSDKType } from "./shared"; +import { BalancerToConcentratedPoolLink, BalancerToConcentratedPoolLinkAmino, BalancerToConcentratedPoolLinkSDKType } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * ReplaceMigrationRecordsProposal is a gov Content type for updating the @@ -8,7 +8,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposal { - $typeUrl?: string; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -30,7 +29,7 @@ export interface ReplaceMigrationRecordsProposalAmino { records: BalancerToConcentratedPoolLinkAmino[]; } export interface ReplaceMigrationRecordsProposalAminoMsg { - type: "osmosis/ReplaceMigrationRecordsProposal"; + type: "osmosis/gamm/replace-migration-records-proposal"; value: ReplaceMigrationRecordsProposalAmino; } /** @@ -41,7 +40,6 @@ export interface ReplaceMigrationRecordsProposalAminoMsg { * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposalSDKType { - $typeUrl?: string; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; @@ -57,7 +55,6 @@ export interface ReplaceMigrationRecordsProposalSDKType { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposal { - $typeUrl?: string; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -82,7 +79,7 @@ export interface UpdateMigrationRecordsProposalAmino { records: BalancerToConcentratedPoolLinkAmino[]; } export interface UpdateMigrationRecordsProposalAminoMsg { - type: "osmosis/UpdateMigrationRecordsProposal"; + type: "osmosis/gamm/update-migration-records-proposal"; value: UpdateMigrationRecordsProposalAmino; } /** @@ -96,14 +93,12 @@ export interface UpdateMigrationRecordsProposalAminoMsg { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposalSDKType { - $typeUrl?: string; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; } function createBaseReplaceMigrationRecordsProposal(): ReplaceMigrationRecordsProposal { return { - $typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", title: "", description: "", records: [] @@ -176,7 +171,7 @@ export const ReplaceMigrationRecordsProposal = { }, toAminoMsg(message: ReplaceMigrationRecordsProposal): ReplaceMigrationRecordsProposalAminoMsg { return { - type: "osmosis/ReplaceMigrationRecordsProposal", + type: "osmosis/gamm/replace-migration-records-proposal", value: ReplaceMigrationRecordsProposal.toAmino(message) }; }, @@ -195,7 +190,6 @@ export const ReplaceMigrationRecordsProposal = { }; function createBaseUpdateMigrationRecordsProposal(): UpdateMigrationRecordsProposal { return { - $typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", title: "", description: "", records: [] @@ -268,7 +262,7 @@ export const UpdateMigrationRecordsProposal = { }, toAminoMsg(message: UpdateMigrationRecordsProposal): UpdateMigrationRecordsProposalAminoMsg { return { - type: "osmosis/UpdateMigrationRecordsProposal", + type: "osmosis/gamm/update-migration-records-proposal", value: UpdateMigrationRecordsProposal.toAmino(message) }; }, diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts index fe3524817..28e40c7f9 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponseSDKType } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -23,7 +23,6 @@ export class LCDQueryClient { this.spotPrice = this.spotPrice.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); - this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); } /* Pools */ async pools(params: QueryPoolsRequest = { @@ -105,7 +104,7 @@ export class LCDQueryClient { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/params`; return await this.req.get(endpoint); } - /* Deprecated: please use the alternative in x/poolmanager */ + /* TotalPoolLiquidity */ async totalPoolLiquidity(params: QueryTotalPoolLiquidityRequest): Promise { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/total_pool_liquidity`; return await this.req.get(endpoint); @@ -164,10 +163,4 @@ export class LCDQueryClient { const endpoint = `osmosis/gamm/v1beta1/${params.poolId}/estimate/swap_exact_amount_out`; return await this.req.get(endpoint, options); } - /* ConcentratedPoolIdLinkFromBalancer returns the pool id of the concentrated - pool that is linked with the given CFMM pool. */ - async concentratedPoolIdLinkFromCFMM(params: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise { - const endpoint = `osmosis/gamm/v1beta1/concentrated_pool_id_link_from_cfmm/${params.cfmmPoolId}`; - return await this.req.get(endpoint); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts index dcf490d8b..85c26481a 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponse } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse } from "./query"; export interface Query { pools(request?: QueryPoolsRequest): Promise; /** Deprecated: please use the alternative in x/poolmanager */ @@ -28,7 +28,6 @@ export interface Query { calcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise; calcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise; poolParams(request: QueryPoolParamsRequest): Promise; - /** Deprecated: please use the alternative in x/poolmanager */ totalPoolLiquidity(request: QueryTotalPoolLiquidityRequest): Promise; totalShares(request: QueryTotalSharesRequest): Promise; /** @@ -40,11 +39,6 @@ export interface Query { estimateSwapExactAmountIn(request: QuerySwapExactAmountInRequest): Promise; /** Deprecated: please use the alternative in x/poolmanager */ estimateSwapExactAmountOut(request: QuerySwapExactAmountOutRequest): Promise; - /** - * ConcentratedPoolIdLinkFromBalancer returns the pool id of the concentrated - * pool that is linked with the given CFMM pool. - */ - concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -65,7 +59,6 @@ export class QueryClientImpl implements Query { this.spotPrice = this.spotPrice.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); - this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); } pools(request: QueryPoolsRequest = { pagination: undefined @@ -144,11 +137,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "EstimateSwapExactAmountOut", data); return promise.then(data => QuerySwapExactAmountOutResponse.decode(new BinaryReader(data))); } - concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise { - const data = QueryConcentratedPoolIdLinkFromCFMMRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "ConcentratedPoolIdLinkFromCFMM", data); - return promise.then(data => QueryConcentratedPoolIdLinkFromCFMMResponse.decode(new BinaryReader(data))); - } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -198,9 +186,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, estimateSwapExactAmountOut(request: QuerySwapExactAmountOutRequest): Promise { return queryService.estimateSwapExactAmountOut(request); - }, - concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise { - return queryService.concentratedPoolIdLinkFromCFMM(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts index 7fa779ad9..cb32dccb2 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts @@ -312,11 +312,7 @@ export interface QueryPoolParamsResponseAminoMsg { export interface QueryPoolParamsResponseSDKType { params: AnySDKType; } -/** - * =============================== PoolLiquidity - * Deprecated: please use the alternative in x/poolmanager - */ -/** @deprecated */ +/** =============================== PoolLiquidity */ export interface QueryTotalPoolLiquidityRequest { poolId: bigint; } @@ -324,11 +320,7 @@ export interface QueryTotalPoolLiquidityRequestProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalPoolLiquidityRequest"; value: Uint8Array; } -/** - * =============================== PoolLiquidity - * Deprecated: please use the alternative in x/poolmanager - */ -/** @deprecated */ +/** =============================== PoolLiquidity */ export interface QueryTotalPoolLiquidityRequestAmino { pool_id: string; } @@ -336,16 +328,10 @@ export interface QueryTotalPoolLiquidityRequestAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-request"; value: QueryTotalPoolLiquidityRequestAmino; } -/** - * =============================== PoolLiquidity - * Deprecated: please use the alternative in x/poolmanager - */ -/** @deprecated */ +/** =============================== PoolLiquidity */ export interface QueryTotalPoolLiquidityRequestSDKType { pool_id: bigint; } -/** Deprecated: please use the alternative in x/poolmanager */ -/** @deprecated */ export interface QueryTotalPoolLiquidityResponse { liquidity: Coin[]; } @@ -353,8 +339,6 @@ export interface QueryTotalPoolLiquidityResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalPoolLiquidityResponse"; value: Uint8Array; } -/** Deprecated: please use the alternative in x/poolmanager */ -/** @deprecated */ export interface QueryTotalPoolLiquidityResponseAmino { liquidity: CoinAmino[]; } @@ -362,8 +346,6 @@ export interface QueryTotalPoolLiquidityResponseAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-response"; value: QueryTotalPoolLiquidityResponseAmino; } -/** Deprecated: please use the alternative in x/poolmanager */ -/** @deprecated */ export interface QueryTotalPoolLiquidityResponseSDKType { liquidity: CoinSDKType[]; } @@ -707,43 +689,6 @@ export interface QueryTotalLiquidityResponseAminoMsg { export interface QueryTotalLiquidityResponseSDKType { liquidity: CoinSDKType[]; } -/** =============================== QueryConcentratedPoolIdLinkFromCFMM */ -export interface QueryConcentratedPoolIdLinkFromCFMMRequest { - cfmmPoolId: bigint; -} -export interface QueryConcentratedPoolIdLinkFromCFMMRequestProtoMsg { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMRequest"; - value: Uint8Array; -} -/** =============================== QueryConcentratedPoolIdLinkFromCFMM */ -export interface QueryConcentratedPoolIdLinkFromCFMMRequestAmino { - cfmm_pool_id: string; -} -export interface QueryConcentratedPoolIdLinkFromCFMMRequestAminoMsg { - type: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-request"; - value: QueryConcentratedPoolIdLinkFromCFMMRequestAmino; -} -/** =============================== QueryConcentratedPoolIdLinkFromCFMM */ -export interface QueryConcentratedPoolIdLinkFromCFMMRequestSDKType { - cfmm_pool_id: bigint; -} -export interface QueryConcentratedPoolIdLinkFromCFMMResponse { - concentratedPoolId: bigint; -} -export interface QueryConcentratedPoolIdLinkFromCFMMResponseProtoMsg { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMResponse"; - value: Uint8Array; -} -export interface QueryConcentratedPoolIdLinkFromCFMMResponseAmino { - concentrated_pool_id: string; -} -export interface QueryConcentratedPoolIdLinkFromCFMMResponseAminoMsg { - type: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-response"; - value: QueryConcentratedPoolIdLinkFromCFMMResponseAmino; -} -export interface QueryConcentratedPoolIdLinkFromCFMMResponseSDKType { - concentrated_pool_id: bigint; -} function createBaseQueryPoolRequest(): QueryPoolRequest { return { poolId: BigInt(0) @@ -813,7 +758,7 @@ export const QueryPoolRequest = { }; function createBaseQueryPoolResponse(): QueryPoolResponse { return { - pool: undefined + pool: Any.fromPartial({}) }; } export const QueryPoolResponse = { @@ -1661,7 +1606,7 @@ export const QueryPoolParamsRequest = { }; function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { return { - params: undefined + params: Any.fromPartial({}) }; } export const QueryPoolParamsResponse = { @@ -1933,7 +1878,7 @@ export const QueryTotalSharesRequest = { }; function createBaseQueryTotalSharesResponse(): QueryTotalSharesResponse { return { - totalShares: undefined + totalShares: Coin.fromPartial({}) }; } export const QueryTotalSharesResponse = { @@ -2944,140 +2889,6 @@ export const QueryTotalLiquidityResponse = { }; } }; -function createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(): QueryConcentratedPoolIdLinkFromCFMMRequest { - return { - cfmmPoolId: BigInt(0) - }; -} -export const QueryConcentratedPoolIdLinkFromCFMMRequest = { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMRequest", - encode(message: QueryConcentratedPoolIdLinkFromCFMMRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.cfmmPoolId !== BigInt(0)) { - writer.uint32(8).uint64(message.cfmmPoolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryConcentratedPoolIdLinkFromCFMMRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cfmmPoolId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): QueryConcentratedPoolIdLinkFromCFMMRequest { - const message = createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(); - message.cfmmPoolId = object.cfmmPoolId !== undefined && object.cfmmPoolId !== null ? BigInt(object.cfmmPoolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMRequestAmino): QueryConcentratedPoolIdLinkFromCFMMRequest { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; - }, - toAmino(message: QueryConcentratedPoolIdLinkFromCFMMRequest): QueryConcentratedPoolIdLinkFromCFMMRequestAmino { - const obj: any = {}; - obj.cfmm_pool_id = message.cfmmPoolId ? message.cfmmPoolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: QueryConcentratedPoolIdLinkFromCFMMRequestAminoMsg): QueryConcentratedPoolIdLinkFromCFMMRequest { - return QueryConcentratedPoolIdLinkFromCFMMRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryConcentratedPoolIdLinkFromCFMMRequest): QueryConcentratedPoolIdLinkFromCFMMRequestAminoMsg { - return { - type: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-request", - value: QueryConcentratedPoolIdLinkFromCFMMRequest.toAmino(message) - }; - }, - fromProtoMsg(message: QueryConcentratedPoolIdLinkFromCFMMRequestProtoMsg): QueryConcentratedPoolIdLinkFromCFMMRequest { - return QueryConcentratedPoolIdLinkFromCFMMRequest.decode(message.value); - }, - toProto(message: QueryConcentratedPoolIdLinkFromCFMMRequest): Uint8Array { - return QueryConcentratedPoolIdLinkFromCFMMRequest.encode(message).finish(); - }, - toProtoMsg(message: QueryConcentratedPoolIdLinkFromCFMMRequest): QueryConcentratedPoolIdLinkFromCFMMRequestProtoMsg { - return { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMRequest", - value: QueryConcentratedPoolIdLinkFromCFMMRequest.encode(message).finish() - }; - } -}; -function createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(): QueryConcentratedPoolIdLinkFromCFMMResponse { - return { - concentratedPoolId: BigInt(0) - }; -} -export const QueryConcentratedPoolIdLinkFromCFMMResponse = { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMResponse", - encode(message: QueryConcentratedPoolIdLinkFromCFMMResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.concentratedPoolId !== BigInt(0)) { - writer.uint32(8).uint64(message.concentratedPoolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryConcentratedPoolIdLinkFromCFMMResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concentratedPoolId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): QueryConcentratedPoolIdLinkFromCFMMResponse { - const message = createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(); - message.concentratedPoolId = object.concentratedPoolId !== undefined && object.concentratedPoolId !== null ? BigInt(object.concentratedPoolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMResponseAmino): QueryConcentratedPoolIdLinkFromCFMMResponse { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; - }, - toAmino(message: QueryConcentratedPoolIdLinkFromCFMMResponse): QueryConcentratedPoolIdLinkFromCFMMResponseAmino { - const obj: any = {}; - obj.concentrated_pool_id = message.concentratedPoolId ? message.concentratedPoolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: QueryConcentratedPoolIdLinkFromCFMMResponseAminoMsg): QueryConcentratedPoolIdLinkFromCFMMResponse { - return QueryConcentratedPoolIdLinkFromCFMMResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryConcentratedPoolIdLinkFromCFMMResponse): QueryConcentratedPoolIdLinkFromCFMMResponseAminoMsg { - return { - type: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-response", - value: QueryConcentratedPoolIdLinkFromCFMMResponse.toAmino(message) - }; - }, - fromProtoMsg(message: QueryConcentratedPoolIdLinkFromCFMMResponseProtoMsg): QueryConcentratedPoolIdLinkFromCFMMResponse { - return QueryConcentratedPoolIdLinkFromCFMMResponse.decode(message.value); - }, - toProto(message: QueryConcentratedPoolIdLinkFromCFMMResponse): Uint8Array { - return QueryConcentratedPoolIdLinkFromCFMMResponse.encode(message).finish(); - }, - toProtoMsg(message: QueryConcentratedPoolIdLinkFromCFMMResponse): QueryConcentratedPoolIdLinkFromCFMMResponseProtoMsg { - return { - typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMResponse", - value: QueryConcentratedPoolIdLinkFromCFMMResponse.encode(message).finish() - }; - } -}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts deleted file mode 100644 index 006b80678..000000000 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../binary"; -/** - * 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", - 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 { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; - }, - 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 = []; - } - 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() - }; - } -}; -function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(0), - clPoolId: BigInt(0) - }; -} -export const BalancerToConcentratedPoolLink = { - typeUrl: "/osmosis.gamm.v1beta1.BalancerToConcentratedPoolLink", - 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 { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; - }, - toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { - const obj: any = {}; - obj.balancer_pool_id = message.balancerPoolId ? message.balancerPoolId.toString() : undefined; - obj.cl_pool_id = message.clPoolId ? 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() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts index d0a7d7f90..8720d4652 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts @@ -751,7 +751,7 @@ function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { sender: "", routes: [], - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutMinAmount: "" }; } @@ -920,7 +920,7 @@ function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { sender: "", routes: [], tokenInMaxAmount: "", - tokenOut: undefined + tokenOut: Coin.fromPartial({}) }; } export const MsgSwapExactAmountOut = { @@ -1087,7 +1087,7 @@ function createBaseMsgJoinSwapExternAmountIn(): MsgJoinSwapExternAmountIn { return { sender: "", poolId: BigInt(0), - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), shareOutMinAmount: "" }; } @@ -1599,7 +1599,7 @@ function createBaseMsgExitSwapExternAmountOut(): MsgExitSwapExternAmountOut { return { sender: "", poolId: BigInt(0), - tokenOut: undefined, + tokenOut: Coin.fromPartial({}), shareInMaxAmount: "" }; } diff --git a/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts b/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts index e1251c1ab..4f14c9313 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts @@ -134,7 +134,7 @@ function createBaseGauge(): Gauge { isPerpetual: false, distributeTo: QueryCondition.fromPartial({}), coins: [], - startTime: undefined, + startTime: new Date(), numEpochsPaidOver: BigInt(0), filledEpochs: BigInt(0), distributedCoins: [] diff --git a/packages/osmojs/src/codegen/osmosis/incentives/tx.ts b/packages/osmojs/src/codegen/osmosis/incentives/tx.ts index 085e88298..ccc5b81de 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/tx.ts @@ -29,16 +29,6 @@ export interface MsgCreateGauge { * 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"; @@ -70,16 +60,6 @@ export interface MsgCreateGaugeAmino { * 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"; @@ -93,7 +73,6 @@ export interface MsgCreateGaugeSDKType { coins: CoinSDKType[]; start_time: Date; num_epochs_paid_over: bigint; - pool_id: bigint; } export interface MsgCreateGaugeResponse {} export interface MsgCreateGaugeResponseProtoMsg { @@ -155,9 +134,8 @@ function createBaseMsgCreateGauge(): MsgCreateGauge { owner: "", distributeTo: QueryCondition.fromPartial({}), coins: [], - startTime: undefined, - numEpochsPaidOver: BigInt(0), - poolId: BigInt(0) + startTime: new Date(), + numEpochsPaidOver: BigInt(0) }; } export const MsgCreateGauge = { @@ -181,9 +159,6 @@ export const MsgCreateGauge = { 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 { @@ -211,9 +186,6 @@ export const MsgCreateGauge = { case 6: message.numEpochsPaidOver = reader.uint64(); break; - case 7: - message.poolId = reader.uint64(); - break; default: reader.skipType(tag & 7); break; @@ -229,7 +201,6 @@ export const MsgCreateGauge = { 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 { @@ -239,8 +210,7 @@ export const MsgCreateGauge = { distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], startTime: object.start_time, - numEpochsPaidOver: BigInt(object.num_epochs_paid_over), - poolId: BigInt(object.pool_id) + numEpochsPaidOver: BigInt(object.num_epochs_paid_over) }; }, toAmino(message: MsgCreateGauge): MsgCreateGaugeAmino { @@ -255,7 +225,6 @@ export const MsgCreateGauge = { } obj.start_time = message.startTime; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgCreateGaugeAminoMsg): MsgCreateGauge { diff --git a/packages/osmojs/src/codegen/osmosis/lcd.ts b/packages/osmojs/src/codegen/osmosis/lcd.ts index cb05bd9da..98c26ee4f 100644 --- a/packages/osmojs/src/codegen/osmosis/lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/lcd.ts @@ -59,7 +59,7 @@ export const createLCDClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: new (await import("./concentrated-liquidity/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./concentrated-liquidity/pool-model/query.lcd")).LCDQueryClient({ requestClient }) }, diff --git a/packages/osmojs/src/codegen/osmosis/lockup/lock.ts b/packages/osmojs/src/codegen/osmosis/lockup/lock.ts index a4c37ad86..c9dd22497 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/lock.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/lock.ts @@ -10,7 +10,6 @@ import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; export enum LockQueryType { ByDuration = 0, ByTime = 1, - NoLock = 2, UNRECOGNIZED = -1, } export const LockQueryTypeSDKType = LockQueryType; @@ -23,9 +22,6 @@ export function lockQueryTypeFromJSON(object: any): LockQueryType { case 1: case "ByTime": return LockQueryType.ByTime; - case 2: - case "NoLock": - return LockQueryType.NoLock; case -1: case "UNRECOGNIZED": default: @@ -38,8 +34,6 @@ export function lockQueryTypeToJSON(object: LockQueryType): string { return "ByDuration"; case LockQueryType.ByTime: return "ByTime"; - case LockQueryType.NoLock: - return "NoLock"; case LockQueryType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -77,12 +71,6 @@ export interface PeriodLock { 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"; @@ -120,12 +108,6 @@ export interface PeriodLockAmino { end_time?: Date; /** 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"; @@ -144,7 +126,6 @@ export interface PeriodLockSDKType { duration: DurationSDKType; end_time: Date; coins: CoinSDKType[]; - reward_receiver_address: string; } /** * QueryCondition is a struct used for querying locks upon different conditions. @@ -291,10 +272,9 @@ function createBasePeriodLock(): PeriodLock { return { ID: BigInt(0), owner: "", - duration: undefined, - endTime: undefined, - coins: [], - rewardReceiverAddress: "" + duration: Duration.fromPartial({}), + endTime: new Date(), + coins: [] }; } export const PeriodLock = { @@ -315,9 +295,6 @@ export const PeriodLock = { 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 { @@ -342,9 +319,6 @@ export const PeriodLock = { case 5: message.coins.push(Coin.decode(reader, reader.uint32())); break; - case 6: - message.rewardReceiverAddress = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -359,7 +333,6 @@ export const PeriodLock = { 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 { @@ -368,8 +341,7 @@ export const PeriodLock = { owner: object.owner, duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, endTime: object.end_time, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - rewardReceiverAddress: object.reward_receiver_address + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] }; }, toAmino(message: PeriodLock): PeriodLockAmino { @@ -383,7 +355,6 @@ export const PeriodLock = { } else { obj.coins = []; } - obj.reward_receiver_address = message.rewardReceiverAddress; return obj; }, fromAminoMsg(object: PeriodLockAminoMsg): PeriodLock { @@ -412,8 +383,8 @@ function createBaseQueryCondition(): QueryCondition { return { lockQueryType: 0, denom: "", - duration: undefined, - timestamp: undefined + duration: Duration.fromPartial({}), + timestamp: new Date() }; } export const QueryCondition = { @@ -509,8 +480,8 @@ function createBaseSyntheticLock(): SyntheticLock { return { underlyingLockId: BigInt(0), synthDenom: "", - endTime: undefined, - duration: undefined + endTime: new Date(), + duration: Duration.fromPartial({}) }; } export const SyntheticLock = { diff --git a/packages/osmojs/src/codegen/osmosis/lockup/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/lockup/query.lcd.ts index 25a085ced..73301b40b 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { ModuleBalanceRequest, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomResponseSDKType, LockedRequest, LockedResponseSDKType, LockRewardReceiverRequest, LockRewardReceiverResponseSDKType, NextLockIDRequest, NextLockIDResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponseSDKType, SyntheticLockupByLockupIDRequest, SyntheticLockupByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +import { ModuleBalanceRequest, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomResponseSDKType, LockedRequest, LockedResponseSDKType, NextLockIDRequest, NextLockIDResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -19,10 +19,8 @@ export class LCDQueryClient { this.accountLockedPastTimeDenom = this.accountLockedPastTimeDenom.bind(this); this.lockedDenom = this.lockedDenom.bind(this); this.lockedByID = this.lockedByID.bind(this); - this.lockRewardReceiver = this.lockRewardReceiver.bind(this); this.nextLockID = this.nextLockID.bind(this); this.syntheticLockupsByLockupID = this.syntheticLockupsByLockupID.bind(this); - this.syntheticLockupByLockupID = this.syntheticLockupByLockupID.bind(this); this.accountLockedLongerDuration = this.accountLockedLongerDuration.bind(this); this.accountLockedDuration = this.accountLockedDuration.bind(this); this.accountLockedLongerDurationNotUnlockingOnly = this.accountLockedLongerDurationNotUnlockingOnly.bind(this); @@ -121,27 +119,16 @@ export class LCDQueryClient { const endpoint = `osmosis/lockup/v1beta1/locked_by_id/${params.lockId}`; return await this.req.get(endpoint); } - /* Returns lock record by id */ - async lockRewardReceiver(params: LockRewardReceiverRequest): Promise { - const endpoint = `osmosis/lockup/v1beta1/lock_reward_receiver/${params.lockId}`; - return await this.req.get(endpoint); - } /* Returns next lock ID */ async nextLockID(_params: NextLockIDRequest = {}): Promise { const endpoint = `osmosis/lockup/v1beta1/next_lock_id`; return await this.req.get(endpoint); } - /* Returns synthetic lockup by native lockup id - Deprecated: use SyntheticLockupByLockupID instead */ + /* Returns synthetic lockups by native lockup id */ async syntheticLockupsByLockupID(params: SyntheticLockupsByLockupIDRequest): Promise { const endpoint = `osmosis/lockup/v1beta1/synthetic_lockups_by_lock_id/${params.lockId}`; return await this.req.get(endpoint); } - /* Returns synthetic lockup by native lockup id */ - async syntheticLockupByLockupID(params: SyntheticLockupByLockupIDRequest): Promise { - const endpoint = `osmosis/lockup/v1beta1/synthetic_lockup_by_lock_id/${params.lockId}`; - return await this.req.get(endpoint); - } /* Returns account locked records with longer duration */ async accountLockedLongerDuration(params: AccountLockedLongerDurationRequest): Promise { const options: any = { diff --git a/packages/osmojs/src/codegen/osmosis/lockup/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/lockup/query.rpc.Query.ts index 8e4b3eb8e..bea9d6771 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ModuleBalanceRequest, ModuleBalanceResponse, ModuleLockedAmountRequest, ModuleLockedAmountResponse, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponse, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponse, AccountLockedCoinsRequest, AccountLockedCoinsResponse, AccountLockedPastTimeRequest, AccountLockedPastTimeResponse, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponse, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponse, LockedDenomRequest, LockedDenomResponse, LockedRequest, LockedResponse, LockRewardReceiverRequest, LockRewardReceiverResponse, NextLockIDRequest, NextLockIDResponse, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponse, SyntheticLockupByLockupIDRequest, SyntheticLockupByLockupIDResponse, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponse, AccountLockedDurationRequest, AccountLockedDurationResponse, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { ModuleBalanceRequest, ModuleBalanceResponse, ModuleLockedAmountRequest, ModuleLockedAmountResponse, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponse, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponse, AccountLockedCoinsRequest, AccountLockedCoinsResponse, AccountLockedPastTimeRequest, AccountLockedPastTimeResponse, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponse, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponse, LockedDenomRequest, LockedDenomResponse, LockedRequest, LockedResponse, NextLockIDRequest, NextLockIDResponse, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponse, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponse, AccountLockedDurationRequest, AccountLockedDurationResponse, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Return full balance of the module */ @@ -29,17 +29,10 @@ export interface Query { lockedDenom(request: LockedDenomRequest): Promise; /** Returns lock record by id */ lockedByID(request: LockedRequest): Promise; - /** Returns lock record by id */ - lockRewardReceiver(request: LockRewardReceiverRequest): Promise; /** Returns next lock ID */ nextLockID(request?: NextLockIDRequest): Promise; - /** - * Returns synthetic lockup by native lockup id - * Deprecated: use SyntheticLockupByLockupID instead - */ + /** Returns synthetic lockups by native lockup id */ syntheticLockupsByLockupID(request: SyntheticLockupsByLockupIDRequest): Promise; - /** Returns synthetic lockup by native lockup id */ - syntheticLockupByLockupID(request: SyntheticLockupByLockupIDRequest): Promise; /** Returns account locked records with longer duration */ accountLockedLongerDuration(request: AccountLockedLongerDurationRequest): Promise; /** Returns account locked records with a specific duration */ @@ -69,10 +62,8 @@ export class QueryClientImpl implements Query { this.accountLockedPastTimeDenom = this.accountLockedPastTimeDenom.bind(this); this.lockedDenom = this.lockedDenom.bind(this); this.lockedByID = this.lockedByID.bind(this); - this.lockRewardReceiver = this.lockRewardReceiver.bind(this); this.nextLockID = this.nextLockID.bind(this); this.syntheticLockupsByLockupID = this.syntheticLockupsByLockupID.bind(this); - this.syntheticLockupByLockupID = this.syntheticLockupByLockupID.bind(this); this.accountLockedLongerDuration = this.accountLockedLongerDuration.bind(this); this.accountLockedDuration = this.accountLockedDuration.bind(this); this.accountLockedLongerDurationNotUnlockingOnly = this.accountLockedLongerDurationNotUnlockingOnly.bind(this); @@ -134,11 +125,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.lockup.Query", "LockedByID", data); return promise.then(data => LockedResponse.decode(new BinaryReader(data))); } - lockRewardReceiver(request: LockRewardReceiverRequest): Promise { - const data = LockRewardReceiverRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.lockup.Query", "LockRewardReceiver", data); - return promise.then(data => LockRewardReceiverResponse.decode(new BinaryReader(data))); - } nextLockID(request: NextLockIDRequest = {}): Promise { const data = NextLockIDRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.lockup.Query", "NextLockID", data); @@ -149,11 +135,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.lockup.Query", "SyntheticLockupsByLockupID", data); return promise.then(data => SyntheticLockupsByLockupIDResponse.decode(new BinaryReader(data))); } - syntheticLockupByLockupID(request: SyntheticLockupByLockupIDRequest): Promise { - const data = SyntheticLockupByLockupIDRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.lockup.Query", "SyntheticLockupByLockupID", data); - return promise.then(data => SyntheticLockupByLockupIDResponse.decode(new BinaryReader(data))); - } accountLockedLongerDuration(request: AccountLockedLongerDurationRequest): Promise { const data = AccountLockedLongerDurationRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.lockup.Query", "AccountLockedLongerDuration", data); @@ -217,18 +198,12 @@ export const createRpcQueryExtension = (base: QueryClient) => { lockedByID(request: LockedRequest): Promise { return queryService.lockedByID(request); }, - lockRewardReceiver(request: LockRewardReceiverRequest): Promise { - return queryService.lockRewardReceiver(request); - }, nextLockID(request?: NextLockIDRequest): Promise { return queryService.nextLockID(request); }, syntheticLockupsByLockupID(request: SyntheticLockupsByLockupIDRequest): Promise { return queryService.syntheticLockupsByLockupID(request); }, - syntheticLockupByLockupID(request: SyntheticLockupByLockupIDRequest): Promise { - return queryService.syntheticLockupByLockupID(request); - }, accountLockedLongerDuration(request: AccountLockedLongerDurationRequest): Promise { return queryService.accountLockedLongerDuration(request); }, diff --git a/packages/osmojs/src/codegen/osmosis/lockup/query.ts b/packages/osmojs/src/codegen/osmosis/lockup/query.ts index 2af815373..7c293b8ce 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/query.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/query.ts @@ -385,40 +385,6 @@ export interface LockedResponseAminoMsg { export interface LockedResponseSDKType { lock: PeriodLockSDKType; } -export interface LockRewardReceiverRequest { - lockId: bigint; -} -export interface LockRewardReceiverRequestProtoMsg { - typeUrl: "/osmosis.lockup.LockRewardReceiverRequest"; - value: Uint8Array; -} -export interface LockRewardReceiverRequestAmino { - lock_id: string; -} -export interface LockRewardReceiverRequestAminoMsg { - type: "osmosis/lockup/lock-reward-receiver-request"; - value: LockRewardReceiverRequestAmino; -} -export interface LockRewardReceiverRequestSDKType { - lock_id: bigint; -} -export interface LockRewardReceiverResponse { - rewardReceiver: string; -} -export interface LockRewardReceiverResponseProtoMsg { - typeUrl: "/osmosis.lockup.LockRewardReceiverResponse"; - value: Uint8Array; -} -export interface LockRewardReceiverResponseAmino { - reward_receiver: string; -} -export interface LockRewardReceiverResponseAminoMsg { - type: "osmosis/lockup/lock-reward-receiver-response"; - value: LockRewardReceiverResponseAmino; -} -export interface LockRewardReceiverResponseSDKType { - reward_receiver: string; -} export interface NextLockIDRequest {} export interface NextLockIDRequestProtoMsg { typeUrl: "/osmosis.lockup.NextLockIDRequest"; @@ -447,7 +413,6 @@ export interface NextLockIDResponseAminoMsg { export interface NextLockIDResponseSDKType { lock_id: bigint; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDRequest { lockId: bigint; } @@ -455,7 +420,6 @@ export interface SyntheticLockupsByLockupIDRequestProtoMsg { typeUrl: "/osmosis.lockup.SyntheticLockupsByLockupIDRequest"; value: Uint8Array; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDRequestAmino { lock_id: string; } @@ -463,11 +427,9 @@ export interface SyntheticLockupsByLockupIDRequestAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-request"; value: SyntheticLockupsByLockupIDRequestAmino; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDRequestSDKType { lock_id: bigint; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDResponse { syntheticLocks: SyntheticLock[]; } @@ -475,7 +437,6 @@ export interface SyntheticLockupsByLockupIDResponseProtoMsg { typeUrl: "/osmosis.lockup.SyntheticLockupsByLockupIDResponse"; value: Uint8Array; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDResponseAmino { synthetic_locks: SyntheticLockAmino[]; } @@ -483,44 +444,9 @@ export interface SyntheticLockupsByLockupIDResponseAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-response"; value: SyntheticLockupsByLockupIDResponseAmino; } -/** @deprecated */ export interface SyntheticLockupsByLockupIDResponseSDKType { synthetic_locks: SyntheticLockSDKType[]; } -export interface SyntheticLockupByLockupIDRequest { - lockId: bigint; -} -export interface SyntheticLockupByLockupIDRequestProtoMsg { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDRequest"; - value: Uint8Array; -} -export interface SyntheticLockupByLockupIDRequestAmino { - lock_id: string; -} -export interface SyntheticLockupByLockupIDRequestAminoMsg { - type: "osmosis/lockup/synthetic-lockup-by-lockup-id-request"; - value: SyntheticLockupByLockupIDRequestAmino; -} -export interface SyntheticLockupByLockupIDRequestSDKType { - lock_id: bigint; -} -export interface SyntheticLockupByLockupIDResponse { - syntheticLock: SyntheticLock; -} -export interface SyntheticLockupByLockupIDResponseProtoMsg { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDResponse"; - value: Uint8Array; -} -export interface SyntheticLockupByLockupIDResponseAmino { - synthetic_lock?: SyntheticLockAmino; -} -export interface SyntheticLockupByLockupIDResponseAminoMsg { - type: "osmosis/lockup/synthetic-lockup-by-lockup-id-response"; - value: SyntheticLockupByLockupIDResponseAmino; -} -export interface SyntheticLockupByLockupIDResponseSDKType { - synthetic_lock: SyntheticLockSDKType; -} export interface AccountLockedLongerDurationRequest { owner: string; duration: Duration; @@ -1369,7 +1295,7 @@ export const AccountLockedCoinsResponse = { function createBaseAccountLockedPastTimeRequest(): AccountLockedPastTimeRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountLockedPastTimeRequest = { @@ -1517,7 +1443,7 @@ export const AccountLockedPastTimeResponse = { function createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountLockedPastTimeNotUnlockingOnlyRequest = { @@ -1665,7 +1591,7 @@ export const AccountLockedPastTimeNotUnlockingOnlyResponse = { function createBaseAccountUnlockedBeforeTimeRequest(): AccountUnlockedBeforeTimeRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountUnlockedBeforeTimeRequest = { @@ -1813,7 +1739,7 @@ export const AccountUnlockedBeforeTimeResponse = { function createBaseAccountLockedPastTimeDenomRequest(): AccountLockedPastTimeDenomRequest { return { owner: "", - timestamp: undefined, + timestamp: new Date(), denom: "" }; } @@ -1971,7 +1897,7 @@ export const AccountLockedPastTimeDenomResponse = { function createBaseLockedDenomRequest(): LockedDenomRequest { return { denom: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const LockedDenomRequest = { @@ -2246,140 +2172,6 @@ export const LockedResponse = { }; } }; -function createBaseLockRewardReceiverRequest(): LockRewardReceiverRequest { - return { - lockId: BigInt(0) - }; -} -export const LockRewardReceiverRequest = { - typeUrl: "/osmosis.lockup.LockRewardReceiverRequest", - encode(message: LockRewardReceiverRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.lockId !== BigInt(0)) { - writer.uint32(8).uint64(message.lockId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LockRewardReceiverRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLockRewardReceiverRequest(); - 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): LockRewardReceiverRequest { - const message = createBaseLockRewardReceiverRequest(); - message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: LockRewardReceiverRequestAmino): LockRewardReceiverRequest { - return { - lockId: BigInt(object.lock_id) - }; - }, - toAmino(message: LockRewardReceiverRequest): LockRewardReceiverRequestAmino { - const obj: any = {}; - obj.lock_id = message.lockId ? message.lockId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: LockRewardReceiverRequestAminoMsg): LockRewardReceiverRequest { - return LockRewardReceiverRequest.fromAmino(object.value); - }, - toAminoMsg(message: LockRewardReceiverRequest): LockRewardReceiverRequestAminoMsg { - return { - type: "osmosis/lockup/lock-reward-receiver-request", - value: LockRewardReceiverRequest.toAmino(message) - }; - }, - fromProtoMsg(message: LockRewardReceiverRequestProtoMsg): LockRewardReceiverRequest { - return LockRewardReceiverRequest.decode(message.value); - }, - toProto(message: LockRewardReceiverRequest): Uint8Array { - return LockRewardReceiverRequest.encode(message).finish(); - }, - toProtoMsg(message: LockRewardReceiverRequest): LockRewardReceiverRequestProtoMsg { - return { - typeUrl: "/osmosis.lockup.LockRewardReceiverRequest", - value: LockRewardReceiverRequest.encode(message).finish() - }; - } -}; -function createBaseLockRewardReceiverResponse(): LockRewardReceiverResponse { - return { - rewardReceiver: "" - }; -} -export const LockRewardReceiverResponse = { - typeUrl: "/osmosis.lockup.LockRewardReceiverResponse", - encode(message: LockRewardReceiverResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.rewardReceiver !== "") { - writer.uint32(10).string(message.rewardReceiver); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LockRewardReceiverResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLockRewardReceiverResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rewardReceiver = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LockRewardReceiverResponse { - const message = createBaseLockRewardReceiverResponse(); - message.rewardReceiver = object.rewardReceiver ?? ""; - return message; - }, - fromAmino(object: LockRewardReceiverResponseAmino): LockRewardReceiverResponse { - return { - rewardReceiver: object.reward_receiver - }; - }, - toAmino(message: LockRewardReceiverResponse): LockRewardReceiverResponseAmino { - const obj: any = {}; - obj.reward_receiver = message.rewardReceiver; - return obj; - }, - fromAminoMsg(object: LockRewardReceiverResponseAminoMsg): LockRewardReceiverResponse { - return LockRewardReceiverResponse.fromAmino(object.value); - }, - toAminoMsg(message: LockRewardReceiverResponse): LockRewardReceiverResponseAminoMsg { - return { - type: "osmosis/lockup/lock-reward-receiver-response", - value: LockRewardReceiverResponse.toAmino(message) - }; - }, - fromProtoMsg(message: LockRewardReceiverResponseProtoMsg): LockRewardReceiverResponse { - return LockRewardReceiverResponse.decode(message.value); - }, - toProto(message: LockRewardReceiverResponse): Uint8Array { - return LockRewardReceiverResponse.encode(message).finish(); - }, - toProtoMsg(message: LockRewardReceiverResponse): LockRewardReceiverResponseProtoMsg { - return { - typeUrl: "/osmosis.lockup.LockRewardReceiverResponse", - value: LockRewardReceiverResponse.encode(message).finish() - }; - } -}; function createBaseNextLockIDRequest(): NextLockIDRequest { return {}; } @@ -2640,144 +2432,10 @@ export const SyntheticLockupsByLockupIDResponse = { }; } }; -function createBaseSyntheticLockupByLockupIDRequest(): SyntheticLockupByLockupIDRequest { - return { - lockId: BigInt(0) - }; -} -export const SyntheticLockupByLockupIDRequest = { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDRequest", - encode(message: SyntheticLockupByLockupIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.lockId !== BigInt(0)) { - writer.uint32(8).uint64(message.lockId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SyntheticLockupByLockupIDRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSyntheticLockupByLockupIDRequest(); - 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): SyntheticLockupByLockupIDRequest { - const message = createBaseSyntheticLockupByLockupIDRequest(); - message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: SyntheticLockupByLockupIDRequestAmino): SyntheticLockupByLockupIDRequest { - return { - lockId: BigInt(object.lock_id) - }; - }, - toAmino(message: SyntheticLockupByLockupIDRequest): SyntheticLockupByLockupIDRequestAmino { - const obj: any = {}; - obj.lock_id = message.lockId ? message.lockId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: SyntheticLockupByLockupIDRequestAminoMsg): SyntheticLockupByLockupIDRequest { - return SyntheticLockupByLockupIDRequest.fromAmino(object.value); - }, - toAminoMsg(message: SyntheticLockupByLockupIDRequest): SyntheticLockupByLockupIDRequestAminoMsg { - return { - type: "osmosis/lockup/synthetic-lockup-by-lockup-id-request", - value: SyntheticLockupByLockupIDRequest.toAmino(message) - }; - }, - fromProtoMsg(message: SyntheticLockupByLockupIDRequestProtoMsg): SyntheticLockupByLockupIDRequest { - return SyntheticLockupByLockupIDRequest.decode(message.value); - }, - toProto(message: SyntheticLockupByLockupIDRequest): Uint8Array { - return SyntheticLockupByLockupIDRequest.encode(message).finish(); - }, - toProtoMsg(message: SyntheticLockupByLockupIDRequest): SyntheticLockupByLockupIDRequestProtoMsg { - return { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDRequest", - value: SyntheticLockupByLockupIDRequest.encode(message).finish() - }; - } -}; -function createBaseSyntheticLockupByLockupIDResponse(): SyntheticLockupByLockupIDResponse { - return { - syntheticLock: SyntheticLock.fromPartial({}) - }; -} -export const SyntheticLockupByLockupIDResponse = { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDResponse", - encode(message: SyntheticLockupByLockupIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.syntheticLock !== undefined) { - SyntheticLock.encode(message.syntheticLock, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): SyntheticLockupByLockupIDResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSyntheticLockupByLockupIDResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.syntheticLock = SyntheticLock.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): SyntheticLockupByLockupIDResponse { - const message = createBaseSyntheticLockupByLockupIDResponse(); - message.syntheticLock = object.syntheticLock !== undefined && object.syntheticLock !== null ? SyntheticLock.fromPartial(object.syntheticLock) : undefined; - return message; - }, - fromAmino(object: SyntheticLockupByLockupIDResponseAmino): SyntheticLockupByLockupIDResponse { - return { - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined - }; - }, - toAmino(message: SyntheticLockupByLockupIDResponse): SyntheticLockupByLockupIDResponseAmino { - const obj: any = {}; - obj.synthetic_lock = message.syntheticLock ? SyntheticLock.toAmino(message.syntheticLock) : undefined; - return obj; - }, - fromAminoMsg(object: SyntheticLockupByLockupIDResponseAminoMsg): SyntheticLockupByLockupIDResponse { - return SyntheticLockupByLockupIDResponse.fromAmino(object.value); - }, - toAminoMsg(message: SyntheticLockupByLockupIDResponse): SyntheticLockupByLockupIDResponseAminoMsg { - return { - type: "osmosis/lockup/synthetic-lockup-by-lockup-id-response", - value: SyntheticLockupByLockupIDResponse.toAmino(message) - }; - }, - fromProtoMsg(message: SyntheticLockupByLockupIDResponseProtoMsg): SyntheticLockupByLockupIDResponse { - return SyntheticLockupByLockupIDResponse.decode(message.value); - }, - toProto(message: SyntheticLockupByLockupIDResponse): Uint8Array { - return SyntheticLockupByLockupIDResponse.encode(message).finish(); - }, - toProtoMsg(message: SyntheticLockupByLockupIDResponse): SyntheticLockupByLockupIDResponseProtoMsg { - return { - typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDResponse", - value: SyntheticLockupByLockupIDResponse.encode(message).finish() - }; - } -}; function createBaseAccountLockedLongerDurationRequest(): AccountLockedLongerDurationRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedLongerDurationRequest = { @@ -2925,7 +2583,7 @@ export const AccountLockedLongerDurationResponse = { function createBaseAccountLockedDurationRequest(): AccountLockedDurationRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedDurationRequest = { @@ -3073,7 +2731,7 @@ export const AccountLockedDurationResponse = { function createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(): AccountLockedLongerDurationNotUnlockingOnlyRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { @@ -3221,7 +2879,7 @@ export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { function createBaseAccountLockedLongerDurationDenomRequest(): AccountLockedLongerDurationDenomRequest { return { owner: "", - duration: undefined, + duration: Duration.fromPartial({}), denom: "" }; } diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts index 0fa595081..7ddf0f7c1 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking, MsgExtendLockup, MsgForceUnlock, MsgSetRewardReceiverAddress } from "./tx"; +import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking, MsgExtendLockup, MsgForceUnlock } from "./tx"; export const AminoConverter = { "/osmosis.lockup.MsgLockTokens": { aminoType: "osmosis/lockup/lock-tokens", @@ -25,10 +25,5 @@ export const AminoConverter = { aminoType: "osmosis/lockup/force-unlock", toAmino: MsgForceUnlock.toAmino, fromAmino: MsgForceUnlock.fromAmino - }, - "/osmosis.lockup.MsgSetRewardReceiverAddress": { - aminoType: "osmosis/lockup/set-reward-receiver-address", - toAmino: MsgSetRewardReceiverAddress.toAmino, - fromAmino: MsgSetRewardReceiverAddress.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts index a21a02abf..1a014bbd2 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts @@ -1,7 +1,7 @@ //@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]]; +import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking, MsgExtendLockup, MsgForceUnlock } 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]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -38,12 +38,6 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgForceUnlock", value: MsgForceUnlock.encode(value).finish() }; - }, - setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { - return { - typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", - value: MsgSetRewardReceiverAddress.encode(value).finish() - }; } }, withTypeUrl: { @@ -76,12 +70,6 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgForceUnlock", value }; - }, - setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { - return { - typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", - value - }; } }, fromPartial: { @@ -114,12 +102,6 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgForceUnlock", value: MsgForceUnlock.fromPartial(value) }; - }, - setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { - return { - typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", - value: MsgSetRewardReceiverAddress.fromPartial(value) - }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts index 1fbf59347..ea0398b1f 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgLockTokens, MsgLockTokensResponse, MsgBeginUnlockingAll, MsgBeginUnlockingAllResponse, MsgBeginUnlocking, MsgBeginUnlockingResponse, MsgExtendLockup, MsgExtendLockupResponse, MsgForceUnlock, MsgForceUnlockResponse, MsgSetRewardReceiverAddress, MsgSetRewardReceiverAddressResponse } from "./tx"; +import { MsgLockTokens, MsgLockTokensResponse, MsgBeginUnlockingAll, MsgBeginUnlockingAllResponse, MsgBeginUnlocking, MsgBeginUnlockingResponse, MsgExtendLockup, MsgExtendLockupResponse, MsgForceUnlock, MsgForceUnlockResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { /** LockTokens lock tokens */ @@ -12,8 +12,6 @@ export interface Msg { /** MsgEditLockup edits the existing lockups by lock ID */ extendLockup(request: MsgExtendLockup): Promise; forceUnlock(request: MsgForceUnlock): Promise; - /** SetRewardReceiverAddress edits the reward receiver for the given lock ID */ - setRewardReceiverAddress(request: MsgSetRewardReceiverAddress): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -24,7 +22,6 @@ export class MsgClientImpl implements Msg { this.beginUnlocking = this.beginUnlocking.bind(this); this.extendLockup = this.extendLockup.bind(this); this.forceUnlock = this.forceUnlock.bind(this); - this.setRewardReceiverAddress = this.setRewardReceiverAddress.bind(this); } lockTokens(request: MsgLockTokens): Promise { const data = MsgLockTokens.encode(request).finish(); @@ -51,9 +48,4 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.lockup.Msg", "ForceUnlock", data); return promise.then(data => MsgForceUnlockResponse.decode(new BinaryReader(data))); } - setRewardReceiverAddress(request: MsgSetRewardReceiverAddress): Promise { - const data = MsgSetRewardReceiverAddress.encode(request).finish(); - const promise = this.rpc.request("osmosis.lockup.Msg", "SetRewardReceiverAddress", data); - return promise.then(data => MsgSetRewardReceiverAddressResponse.decode(new BinaryReader(data))); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.ts index 8e7742995..e7e436bfd 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.ts @@ -235,50 +235,10 @@ export interface MsgForceUnlockResponseAminoMsg { 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: undefined, + duration: Duration.fromPartial({}), coins: [] }; } @@ -743,7 +703,7 @@ function createBaseMsgExtendLockup(): MsgExtendLockup { return { owner: "", ID: BigInt(0), - duration: undefined + duration: Duration.fromPartial({}) }; } export const MsgExtendLockup = { @@ -1050,158 +1010,4 @@ export const MsgForceUnlockResponse = { value: MsgForceUnlockResponse.encode(message).finish() }; } -}; -function createBaseMsgSetRewardReceiverAddress(): MsgSetRewardReceiverAddress { - return { - owner: "", - lockID: BigInt(0), - rewardReceiver: "" - }; -} -export const MsgSetRewardReceiverAddress = { - typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", - 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 { - return { - owner: object.owner, - lockID: BigInt(object.lockID), - rewardReceiver: object.reward_receiver - }; - }, - toAmino(message: MsgSetRewardReceiverAddress): MsgSetRewardReceiverAddressAmino { - const obj: any = {}; - obj.owner = message.owner; - obj.lockID = message.lockID ? message.lockID.toString() : undefined; - obj.reward_receiver = 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() - }; - } -}; -function createBaseMsgSetRewardReceiverAddressResponse(): MsgSetRewardReceiverAddressResponse { - return { - success: false - }; -} -export const MsgSetRewardReceiverAddressResponse = { - typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddressResponse", - 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 { - return { - success: object.success - }; - }, - toAmino(message: MsgSetRewardReceiverAddressResponse): MsgSetRewardReceiverAddressResponseAmino { - const obj: any = {}; - obj.success = 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() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts index 14194d17d..3039f3425 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts @@ -34,7 +34,7 @@ export interface ReplacePoolIncentivesProposalAmino { records: DistrRecordAmino[]; } export interface ReplacePoolIncentivesProposalAminoMsg { - type: "osmosis/ReplacePoolIncentivesProposal"; + type: "osmosis/poolincentives/replace-pool-incentives-proposal"; value: ReplacePoolIncentivesProposalAmino; } /** @@ -179,7 +179,7 @@ export const ReplacePoolIncentivesProposal = { }, toAminoMsg(message: ReplacePoolIncentivesProposal): ReplacePoolIncentivesProposalAminoMsg { return { - type: "osmosis/ReplacePoolIncentivesProposal", + type: "osmosis/poolincentives/replace-pool-incentives-proposal", value: ReplacePoolIncentivesProposal.toAmino(message) }; }, diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts index 8dac18276..f513a223a 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts +++ b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts @@ -426,7 +426,7 @@ function createBasePoolToGauge(): PoolToGauge { return { poolId: BigInt(0), gaugeId: BigInt(0), - duration: undefined + duration: Duration.fromPartial({}) }; } export const PoolToGauge = { diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts index de37cc2d4..f9bc78851 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts @@ -363,7 +363,7 @@ export const QueryGaugeIdsResponse = { function createBaseQueryGaugeIdsResponse_GaugeIdWithDuration(): QueryGaugeIdsResponse_GaugeIdWithDuration { return { gaugeId: BigInt(0), - duration: undefined, + duration: Duration.fromPartial({}), gaugeIncentivePercentage: "" }; } @@ -875,7 +875,7 @@ export const QueryIncentivizedPoolsRequest = { function createBaseIncentivizedPool(): IncentivizedPool { return { poolId: BigInt(0), - lockableDuration: undefined, + lockableDuration: Duration.fromPartial({}), gaugeId: BigInt(0) }; } diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts deleted file mode 100644 index b6274a302..000000000 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts +++ /dev/null @@ -1,240 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../../binary"; -/** - * MigrationRecords contains all the links between balancer and concentrated - * pools. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -export interface MigrationRecords { - balancerToConcentratedPoolLinks: BalancerToConcentratedPoolLink[]; -} -export interface MigrationRecordsProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.MigrationRecords"; - value: Uint8Array; -} -/** - * MigrationRecords contains all the links between balancer and concentrated - * pools. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -export interface MigrationRecordsAmino { - balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkAmino[]; -} -export interface MigrationRecordsAminoMsg { - type: "osmosis/poolincentives/migration-records"; - value: MigrationRecordsAmino; -} -/** - * MigrationRecords contains all the links between balancer and concentrated - * pools. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -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. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -export interface BalancerToConcentratedPoolLink { - balancerPoolId: bigint; - clPoolId: bigint; -} -export interface BalancerToConcentratedPoolLinkProtoMsg { - typeUrl: "/osmosis.poolincentives.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. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -export interface BalancerToConcentratedPoolLinkAmino { - balancer_pool_id: string; - cl_pool_id: string; -} -export interface BalancerToConcentratedPoolLinkAminoMsg { - type: "osmosis/poolincentives/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. - * - * This is copied over from the gamm proto file in order to circumnavigate - * the circular dependency between the two modules. - */ -export interface BalancerToConcentratedPoolLinkSDKType { - balancer_pool_id: bigint; - cl_pool_id: bigint; -} -function createBaseMigrationRecords(): MigrationRecords { - return { - balancerToConcentratedPoolLinks: [] - }; -} -export const MigrationRecords = { - typeUrl: "/osmosis.poolincentives.v1beta1.MigrationRecords", - 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 { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; - }, - 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 = []; - } - return obj; - }, - fromAminoMsg(object: MigrationRecordsAminoMsg): MigrationRecords { - return MigrationRecords.fromAmino(object.value); - }, - toAminoMsg(message: MigrationRecords): MigrationRecordsAminoMsg { - return { - type: "osmosis/poolincentives/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.poolincentives.v1beta1.MigrationRecords", - value: MigrationRecords.encode(message).finish() - }; - } -}; -function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(0), - clPoolId: BigInt(0) - }; -} -export const BalancerToConcentratedPoolLink = { - typeUrl: "/osmosis.poolincentives.v1beta1.BalancerToConcentratedPoolLink", - 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 { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; - }, - toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { - const obj: any = {}; - obj.balancer_pool_id = message.balancerPoolId ? message.balancerPoolId.toString() : undefined; - obj.cl_pool_id = message.clPoolId ? message.clPoolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: BalancerToConcentratedPoolLinkAminoMsg): BalancerToConcentratedPoolLink { - return BalancerToConcentratedPoolLink.fromAmino(object.value); - }, - toAminoMsg(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAminoMsg { - return { - type: "osmosis/poolincentives/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.poolincentives.v1beta1.BalancerToConcentratedPoolLink", - value: BalancerToConcentratedPoolLink.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts index 1fe285062..ef3361e0a 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType, TotalPoolLiquidityRequest, TotalPoolLiquidityResponseSDKType, TotalLiquidityRequest, TotalLiquidityResponseSDKType } from "./query"; +import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -17,8 +17,6 @@ export class LCDQueryClient { this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); this.spotPrice = this.spotPrice.bind(this); - this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); - this.totalLiquidity = this.totalLiquidity.bind(this); } /* Params */ async params(_params: ParamsRequest = {}): Promise { @@ -92,9 +90,15 @@ export class LCDQueryClient { return await this.req.get(endpoint); } /* AllPools returns all pools on the Osmosis chain sorted by IDs. */ - async allPools(_params: AllPoolsRequest = {}): Promise { + async allPools(params: AllPoolsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } const endpoint = `osmosis/poolmanager/v1beta1/all-pools`; - return await this.req.get(endpoint); + return await this.req.get(endpoint, options); } /* SpotPrice defines a gRPC query handler that returns the spot price given a base denomination and a quote denomination. */ @@ -111,14 +115,4 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/pools/${params.poolId}/prices`; return await this.req.get(endpoint, options); } - /* TotalPoolLiquidity returns the total liquidity of the specified pool. */ - async totalPoolLiquidity(params: TotalPoolLiquidityRequest): Promise { - const endpoint = `osmosis/poolmanager/v1beta1/pools/${params.poolId}/total_pool_liquidity`; - return await this.req.get(endpoint); - } - /* TotalLiquidity returns the total liquidity across all pools. */ - async totalLiquidity(_params: TotalLiquidityRequest = {}): Promise { - const endpoint = `osmosis/poolmanager/v1beta1/pools/total_liquidity`; - return await this.req.get(endpoint); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts index d310f1aba..ff9dac6de 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, SpotPriceRequest, SpotPriceResponse, TotalPoolLiquidityRequest, TotalPoolLiquidityResponse, TotalLiquidityRequest, TotalLiquidityResponse } from "./query"; +import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, SpotPriceRequest, SpotPriceResponse } from "./query"; export interface Query { params(request?: ParamsRequest): Promise; /** Estimates swap amount out given in. */ @@ -15,16 +15,12 @@ export interface Query { /** Pool returns the Pool specified by the pool id */ pool(request: PoolRequest): Promise; /** AllPools returns all pools on the Osmosis chain sorted by IDs. */ - allPools(request?: AllPoolsRequest): Promise; + allPools(request: AllPoolsRequest): Promise; /** * SpotPrice defines a gRPC query handler that returns the spot price given * a base denomination and a quote denomination. */ spotPrice(request: SpotPriceRequest): Promise; - /** TotalPoolLiquidity returns the total liquidity of the specified pool. */ - totalPoolLiquidity(request: TotalPoolLiquidityRequest): Promise; - /** TotalLiquidity returns the total liquidity across all pools. */ - totalLiquidity(request?: TotalLiquidityRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -39,8 +35,6 @@ export class QueryClientImpl implements Query { this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); this.spotPrice = this.spotPrice.bind(this); - this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); - this.totalLiquidity = this.totalLiquidity.bind(this); } params(request: ParamsRequest = {}): Promise { const data = ParamsRequest.encode(request).finish(); @@ -77,7 +71,7 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "Pool", data); return promise.then(data => PoolResponse.decode(new BinaryReader(data))); } - allPools(request: AllPoolsRequest = {}): Promise { + allPools(request: AllPoolsRequest): Promise { const data = AllPoolsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "AllPools", data); return promise.then(data => AllPoolsResponse.decode(new BinaryReader(data))); @@ -87,16 +81,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "SpotPrice", data); return promise.then(data => SpotPriceResponse.decode(new BinaryReader(data))); } - totalPoolLiquidity(request: TotalPoolLiquidityRequest): Promise { - const data = TotalPoolLiquidityRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalPoolLiquidity", data); - return promise.then(data => TotalPoolLiquidityResponse.decode(new BinaryReader(data))); - } - totalLiquidity(request: TotalLiquidityRequest = {}): Promise { - const data = TotalLiquidityRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalLiquidity", data); - return promise.then(data => TotalLiquidityResponse.decode(new BinaryReader(data))); - } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -123,17 +107,11 @@ export const createRpcQueryExtension = (base: QueryClient) => { pool(request: PoolRequest): Promise { return queryService.pool(request); }, - allPools(request?: AllPoolsRequest): Promise { + allPools(request: AllPoolsRequest): Promise { return queryService.allPools(request); }, spotPrice(request: SpotPriceRequest): Promise { return queryService.spotPrice(request); - }, - totalPoolLiquidity(request: TotalPoolLiquidityRequest): Promise { - return queryService.totalPoolLiquidity(request); - }, - totalLiquidity(request?: TotalLiquidityRequest): Promise { - return queryService.totalLiquidity(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts index c19731c56..b450397af 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts @@ -1,7 +1,6 @@ import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "./swap_route"; import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; @@ -248,19 +247,25 @@ export interface PoolResponseSDKType { pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; } /** =============================== AllPools */ -export interface AllPoolsRequest {} +export interface AllPoolsRequest { + poolId: bigint; +} export interface AllPoolsRequestProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.AllPoolsRequest"; value: Uint8Array; } /** =============================== AllPools */ -export interface AllPoolsRequestAmino {} +export interface AllPoolsRequestAmino { + pool_id: string; +} export interface AllPoolsRequestAminoMsg { type: "osmosis/poolmanager/all-pools-request"; value: AllPoolsRequestAmino; } /** =============================== AllPools */ -export interface AllPoolsRequestSDKType {} +export interface AllPoolsRequestSDKType { + pool_id: bigint; +} export interface AllPoolsResponse { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; } @@ -347,74 +352,6 @@ export interface SpotPriceResponseAminoMsg { export interface SpotPriceResponseSDKType { spot_price: string; } -/** =============================== TotalPoolLiquidity */ -export interface TotalPoolLiquidityRequest { - poolId: bigint; -} -export interface TotalPoolLiquidityRequestProtoMsg { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityRequest"; - value: Uint8Array; -} -/** =============================== TotalPoolLiquidity */ -export interface TotalPoolLiquidityRequestAmino { - pool_id: string; -} -export interface TotalPoolLiquidityRequestAminoMsg { - type: "osmosis/poolmanager/total-pool-liquidity-request"; - value: TotalPoolLiquidityRequestAmino; -} -/** =============================== TotalPoolLiquidity */ -export interface TotalPoolLiquidityRequestSDKType { - pool_id: bigint; -} -export interface TotalPoolLiquidityResponse { - liquidity: Coin[]; -} -export interface TotalPoolLiquidityResponseProtoMsg { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityResponse"; - value: Uint8Array; -} -export interface TotalPoolLiquidityResponseAmino { - liquidity: CoinAmino[]; -} -export interface TotalPoolLiquidityResponseAminoMsg { - type: "osmosis/poolmanager/total-pool-liquidity-response"; - value: TotalPoolLiquidityResponseAmino; -} -export interface TotalPoolLiquidityResponseSDKType { - liquidity: CoinSDKType[]; -} -/** =============================== TotalLiquidity */ -export interface TotalLiquidityRequest {} -export interface TotalLiquidityRequestProtoMsg { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityRequest"; - value: Uint8Array; -} -/** =============================== TotalLiquidity */ -export interface TotalLiquidityRequestAmino {} -export interface TotalLiquidityRequestAminoMsg { - type: "osmosis/poolmanager/total-liquidity-request"; - value: TotalLiquidityRequestAmino; -} -/** =============================== TotalLiquidity */ -export interface TotalLiquidityRequestSDKType {} -export interface TotalLiquidityResponse { - liquidity: Coin[]; -} -export interface TotalLiquidityResponseProtoMsg { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityResponse"; - value: Uint8Array; -} -export interface TotalLiquidityResponseAmino { - liquidity: CoinAmino[]; -} -export interface TotalLiquidityResponseAminoMsg { - type: "osmosis/poolmanager/total-liquidity-response"; - value: TotalLiquidityResponseAmino; -} -export interface TotalLiquidityResponseSDKType { - liquidity: CoinSDKType[]; -} function createBaseParamsRequest(): ParamsRequest { return {}; } @@ -1218,7 +1155,7 @@ export const PoolRequest = { }; function createBasePoolResponse(): PoolResponse { return { - pool: undefined + pool: Any.fromPartial({}) }; } export const PoolResponse = { @@ -1284,11 +1221,16 @@ export const PoolResponse = { } }; function createBaseAllPoolsRequest(): AllPoolsRequest { - return {}; + return { + poolId: BigInt(0) + }; } export const AllPoolsRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.AllPoolsRequest", - encode(_: AllPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: AllPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AllPoolsRequest { @@ -1298,6 +1240,9 @@ export const AllPoolsRequest = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -1305,15 +1250,19 @@ export const AllPoolsRequest = { } return message; }, - fromPartial(_: Partial): AllPoolsRequest { + fromPartial(object: Partial): AllPoolsRequest { const message = createBaseAllPoolsRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, - fromAmino(_: AllPoolsRequestAmino): AllPoolsRequest { - return {}; + fromAmino(object: AllPoolsRequestAmino): AllPoolsRequest { + return { + poolId: BigInt(object.pool_id) + }; }, - toAmino(_: AllPoolsRequest): AllPoolsRequestAmino { + toAmino(message: AllPoolsRequest): AllPoolsRequestAmino { const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; }, fromAminoMsg(object: AllPoolsRequestAminoMsg): AllPoolsRequest { @@ -1563,270 +1512,6 @@ export const SpotPriceResponse = { }; } }; -function createBaseTotalPoolLiquidityRequest(): TotalPoolLiquidityRequest { - return { - poolId: BigInt(0) - }; -} -export const TotalPoolLiquidityRequest = { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityRequest", - encode(message: TotalPoolLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TotalPoolLiquidityRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTotalPoolLiquidityRequest(); - 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): TotalPoolLiquidityRequest { - const message = createBaseTotalPoolLiquidityRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: TotalPoolLiquidityRequestAmino): TotalPoolLiquidityRequest { - return { - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: TotalPoolLiquidityRequest): TotalPoolLiquidityRequestAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: TotalPoolLiquidityRequestAminoMsg): TotalPoolLiquidityRequest { - return TotalPoolLiquidityRequest.fromAmino(object.value); - }, - toAminoMsg(message: TotalPoolLiquidityRequest): TotalPoolLiquidityRequestAminoMsg { - return { - type: "osmosis/poolmanager/total-pool-liquidity-request", - value: TotalPoolLiquidityRequest.toAmino(message) - }; - }, - fromProtoMsg(message: TotalPoolLiquidityRequestProtoMsg): TotalPoolLiquidityRequest { - return TotalPoolLiquidityRequest.decode(message.value); - }, - toProto(message: TotalPoolLiquidityRequest): Uint8Array { - return TotalPoolLiquidityRequest.encode(message).finish(); - }, - toProtoMsg(message: TotalPoolLiquidityRequest): TotalPoolLiquidityRequestProtoMsg { - return { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityRequest", - value: TotalPoolLiquidityRequest.encode(message).finish() - }; - } -}; -function createBaseTotalPoolLiquidityResponse(): TotalPoolLiquidityResponse { - return { - liquidity: [] - }; -} -export const TotalPoolLiquidityResponse = { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityResponse", - encode(message: TotalPoolLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.liquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TotalPoolLiquidityResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTotalPoolLiquidityResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidity.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TotalPoolLiquidityResponse { - const message = createBaseTotalPoolLiquidityResponse(); - message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: TotalPoolLiquidityResponseAmino): TotalPoolLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: TotalPoolLiquidityResponse): TotalPoolLiquidityResponseAmino { - const obj: any = {}; - if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.liquidity = []; - } - return obj; - }, - fromAminoMsg(object: TotalPoolLiquidityResponseAminoMsg): TotalPoolLiquidityResponse { - return TotalPoolLiquidityResponse.fromAmino(object.value); - }, - toAminoMsg(message: TotalPoolLiquidityResponse): TotalPoolLiquidityResponseAminoMsg { - return { - type: "osmosis/poolmanager/total-pool-liquidity-response", - value: TotalPoolLiquidityResponse.toAmino(message) - }; - }, - fromProtoMsg(message: TotalPoolLiquidityResponseProtoMsg): TotalPoolLiquidityResponse { - return TotalPoolLiquidityResponse.decode(message.value); - }, - toProto(message: TotalPoolLiquidityResponse): Uint8Array { - return TotalPoolLiquidityResponse.encode(message).finish(); - }, - toProtoMsg(message: TotalPoolLiquidityResponse): TotalPoolLiquidityResponseProtoMsg { - return { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityResponse", - value: TotalPoolLiquidityResponse.encode(message).finish() - }; - } -}; -function createBaseTotalLiquidityRequest(): TotalLiquidityRequest { - return {}; -} -export const TotalLiquidityRequest = { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityRequest", - encode(_: TotalLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TotalLiquidityRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTotalLiquidityRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): TotalLiquidityRequest { - const message = createBaseTotalLiquidityRequest(); - return message; - }, - fromAmino(_: TotalLiquidityRequestAmino): TotalLiquidityRequest { - return {}; - }, - toAmino(_: TotalLiquidityRequest): TotalLiquidityRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: TotalLiquidityRequestAminoMsg): TotalLiquidityRequest { - return TotalLiquidityRequest.fromAmino(object.value); - }, - toAminoMsg(message: TotalLiquidityRequest): TotalLiquidityRequestAminoMsg { - return { - type: "osmosis/poolmanager/total-liquidity-request", - value: TotalLiquidityRequest.toAmino(message) - }; - }, - fromProtoMsg(message: TotalLiquidityRequestProtoMsg): TotalLiquidityRequest { - return TotalLiquidityRequest.decode(message.value); - }, - toProto(message: TotalLiquidityRequest): Uint8Array { - return TotalLiquidityRequest.encode(message).finish(); - }, - toProtoMsg(message: TotalLiquidityRequest): TotalLiquidityRequestProtoMsg { - return { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityRequest", - value: TotalLiquidityRequest.encode(message).finish() - }; - } -}; -function createBaseTotalLiquidityResponse(): TotalLiquidityResponse { - return { - liquidity: [] - }; -} -export const TotalLiquidityResponse = { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityResponse", - encode(message: TotalLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.liquidity) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): TotalLiquidityResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTotalLiquidityResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.liquidity.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): TotalLiquidityResponse { - const message = createBaseTotalLiquidityResponse(); - message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: TotalLiquidityResponseAmino): TotalLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; - }, - toAmino(message: TotalLiquidityResponse): TotalLiquidityResponseAmino { - const obj: any = {}; - if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.liquidity = []; - } - return obj; - }, - fromAminoMsg(object: TotalLiquidityResponseAminoMsg): TotalLiquidityResponse { - return TotalLiquidityResponse.fromAmino(object.value); - }, - toAminoMsg(message: TotalLiquidityResponse): TotalLiquidityResponseAminoMsg { - return { - type: "osmosis/poolmanager/total-liquidity-response", - value: TotalLiquidityResponse.toAmino(message) - }; - }, - fromProtoMsg(message: TotalLiquidityResponseProtoMsg): TotalLiquidityResponse { - return TotalLiquidityResponse.decode(message.value); - }, - toProto(message: TotalLiquidityResponse): Uint8Array { - return TotalLiquidityResponse.encode(message).finish(); - }, - toProtoMsg(message: TotalLiquidityResponse): TotalLiquidityResponseProtoMsg { - return { - typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityResponse", - value: TotalLiquidityResponse.encode(message).finish() - }; - } -}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32()); diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts index c5f2a9082..99bb1798b 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts @@ -39,46 +39,6 @@ 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), @@ -232,166 +192,4 @@ export const SwapAmountOutRoute = { value: SwapAmountOutRoute.encode(message).finish() }; } -}; -function createBaseSwapAmountInSplitRoute(): SwapAmountInSplitRoute { - return { - pools: [], - tokenInAmount: "" - }; -} -export const SwapAmountInSplitRoute = { - typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute", - 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 { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenInAmount: object.token_in_amount - }; - }, - toAmino(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAmino { - const obj: any = {}; - if (message.pools) { - obj.pools = message.pools.map(e => e ? SwapAmountInRoute.toAmino(e) : undefined); - } else { - obj.pools = []; - } - obj.token_in_amount = 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() - }; - } -}; -function createBaseSwapAmountOutSplitRoute(): SwapAmountOutSplitRoute { - return { - pools: [], - tokenOutAmount: "" - }; -} -export const SwapAmountOutSplitRoute = { - typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute", - 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 { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOutAmount: object.token_out_amount - }; - }, - toAmino(message: SwapAmountOutSplitRoute): SwapAmountOutSplitRouteAmino { - const obj: any = {}; - if (message.pools) { - obj.pools = message.pools.map(e => e ? SwapAmountOutRoute.toAmino(e) : undefined); - } else { - obj.pools = []; - } - obj.token_out_amount = 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() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts index 4f2b575f0..6a439d496 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut } from "./tx"; export const AminoConverter = { "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn": { aminoType: "osmosis/poolmanager/swap-exact-amount-in", @@ -10,15 +10,5 @@ export const AminoConverter = { aminoType: "osmosis/poolmanager/swap-exact-amount-out", toAmino: MsgSwapExactAmountOut.toAmino, fromAmino: MsgSwapExactAmountOut.fromAmino - }, - "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-in", - toAmino: MsgSplitRouteSwapExactAmountIn.toAmino, - fromAmino: MsgSplitRouteSwapExactAmountIn.fromAmino - }, - "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-out", - toAmino: MsgSplitRouteSwapExactAmountOut.toAmino, - fromAmino: MsgSplitRouteSwapExactAmountOut.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts index 116db1f7f..3a9380f6e 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", MsgSplitRouteSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", MsgSplitRouteSwapExactAmountOut]]; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,18 +20,6 @@ export const MessageComposer = { 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() - }; } }, withTypeUrl: { @@ -46,18 +34,6 @@ export const MessageComposer = { 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 - }; } }, fromPartial: { @@ -72,18 +48,6 @@ export const MessageComposer = { 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) - }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts index ba18a7f89..66dea2c3c 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts @@ -1,11 +1,9 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountInResponse, MsgSplitRouteSwapExactAmountOut, MsgSplitRouteSwapExactAmountOutResponse } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse } from "./tx"; export interface Msg { swapExactAmountIn(request: MsgSwapExactAmountIn): Promise; swapExactAmountOut(request: MsgSwapExactAmountOut): Promise; - splitRouteSwapExactAmountIn(request: MsgSplitRouteSwapExactAmountIn): Promise; - splitRouteSwapExactAmountOut(request: MsgSplitRouteSwapExactAmountOut): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -13,8 +11,6 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.swapExactAmountIn = this.swapExactAmountIn.bind(this); this.swapExactAmountOut = this.swapExactAmountOut.bind(this); - this.splitRouteSwapExactAmountIn = this.splitRouteSwapExactAmountIn.bind(this); - this.splitRouteSwapExactAmountOut = this.splitRouteSwapExactAmountOut.bind(this); } swapExactAmountIn(request: MsgSwapExactAmountIn): Promise { const data = MsgSwapExactAmountIn.encode(request).finish(); @@ -26,14 +22,4 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SwapExactAmountOut", data); return promise.then(data => MsgSwapExactAmountOutResponse.decode(new BinaryReader(data))); } - splitRouteSwapExactAmountIn(request: MsgSplitRouteSwapExactAmountIn): Promise { - const data = MsgSplitRouteSwapExactAmountIn.encode(request).finish(); - const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SplitRouteSwapExactAmountIn", data); - return promise.then(data => MsgSplitRouteSwapExactAmountInResponse.decode(new BinaryReader(data))); - } - splitRouteSwapExactAmountOut(request: MsgSplitRouteSwapExactAmountOut): Promise { - const data = MsgSplitRouteSwapExactAmountOut.encode(request).finish(); - const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SplitRouteSwapExactAmountOut", data); - return promise.then(data => MsgSplitRouteSwapExactAmountOutResponse.decode(new BinaryReader(data))); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts index ff57fe6e9..5a46fbf1d 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType, SwapAmountInSplitRoute, SwapAmountInSplitRouteAmino, SwapAmountInSplitRouteSDKType, SwapAmountOutSplitRoute, SwapAmountOutSplitRouteAmino, SwapAmountOutSplitRouteSDKType } from "./swap_route"; +import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "./swap_route"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** ===================== MsgSwapExactAmountIn */ @@ -47,52 +47,6 @@ export interface MsgSwapExactAmountInResponseAminoMsg { 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-route-swap-exact-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; @@ -139,57 +93,11 @@ export interface MsgSwapExactAmountOutResponseAminoMsg { 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-route-swap-exact-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; -} function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { sender: "", routes: [], - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutMinAmount: "" }; } @@ -353,180 +261,12 @@ export const MsgSwapExactAmountInResponse = { }; } }; -function createBaseMsgSplitRouteSwapExactAmountIn(): MsgSplitRouteSwapExactAmountIn { - return { - sender: "", - routes: [], - tokenInDenom: "", - tokenOutMinAmount: "" - }; -} -export const MsgSplitRouteSwapExactAmountIn = { - typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", - 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 { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInSplitRoute.fromAmino(e)) : [], - tokenInDenom: object.token_in_denom, - tokenOutMinAmount: object.token_out_min_amount - }; - }, - toAmino(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAmino { - const obj: any = {}; - obj.sender = message.sender; - if (message.routes) { - obj.routes = message.routes.map(e => e ? SwapAmountInSplitRoute.toAmino(e) : undefined); - } else { - obj.routes = []; - } - obj.token_in_denom = message.tokenInDenom; - obj.token_out_min_amount = message.tokenOutMinAmount; - return obj; - }, - fromAminoMsg(object: MsgSplitRouteSwapExactAmountInAminoMsg): MsgSplitRouteSwapExactAmountIn { - return MsgSplitRouteSwapExactAmountIn.fromAmino(object.value); - }, - toAminoMsg(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAminoMsg { - return { - type: "osmosis/poolmanager/split-route-swap-exact-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() - }; - } -}; -function createBaseMsgSplitRouteSwapExactAmountInResponse(): MsgSplitRouteSwapExactAmountInResponse { - return { - tokenOutAmount: "" - }; -} -export const MsgSplitRouteSwapExactAmountInResponse = { - typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse", - 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 { - return { - tokenOutAmount: object.token_out_amount - }; - }, - toAmino(message: MsgSplitRouteSwapExactAmountInResponse): MsgSplitRouteSwapExactAmountInResponseAmino { - const obj: any = {}; - obj.token_out_amount = 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() - }; - } -}; function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { return { sender: "", routes: [], tokenInMaxAmount: "", - tokenOut: undefined + tokenOut: Coin.fromPartial({}) }; } export const MsgSwapExactAmountOut = { @@ -688,172 +428,4 @@ export const MsgSwapExactAmountOutResponse = { value: MsgSwapExactAmountOutResponse.encode(message).finish() }; } -}; -function createBaseMsgSplitRouteSwapExactAmountOut(): MsgSplitRouteSwapExactAmountOut { - return { - sender: "", - routes: [], - tokenOutDenom: "", - tokenInMaxAmount: "" - }; -} -export const MsgSplitRouteSwapExactAmountOut = { - typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", - 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 { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutSplitRoute.fromAmino(e)) : [], - tokenOutDenom: object.token_out_denom, - tokenInMaxAmount: object.token_in_max_amount - }; - }, - toAmino(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAmino { - const obj: any = {}; - obj.sender = message.sender; - if (message.routes) { - obj.routes = message.routes.map(e => e ? SwapAmountOutSplitRoute.toAmino(e) : undefined); - } else { - obj.routes = []; - } - obj.token_out_denom = message.tokenOutDenom; - obj.token_in_max_amount = message.tokenInMaxAmount; - return obj; - }, - fromAminoMsg(object: MsgSplitRouteSwapExactAmountOutAminoMsg): MsgSplitRouteSwapExactAmountOut { - return MsgSplitRouteSwapExactAmountOut.fromAmino(object.value); - }, - toAminoMsg(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAminoMsg { - return { - type: "osmosis/poolmanager/split-route-swap-exact-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() - }; - } -}; -function createBaseMsgSplitRouteSwapExactAmountOutResponse(): MsgSplitRouteSwapExactAmountOutResponse { - return { - tokenInAmount: "" - }; -} -export const MsgSplitRouteSwapExactAmountOutResponse = { - typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse", - 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 { - return { - tokenInAmount: object.token_in_amount - }; - }, - toAmino(message: MsgSplitRouteSwapExactAmountOutResponse): MsgSplitRouteSwapExactAmountOutResponseAmino { - const obj: any = {}; - obj.token_in_amount = 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() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts index 4bff481b6..7a28ad7e0 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts @@ -38,8 +38,6 @@ export interface GenesisState { maxPoolPointsPerTx: bigint; /** The number of pool points that have been consumed in the current block. */ pointCountForBlock: bigint; - /** All of the profits that have been accumulated by the module. */ - profits: Coin[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.GenesisState"; @@ -81,8 +79,6 @@ export interface GenesisStateAmino { max_pool_points_per_tx: string; /** The number of pool points that have been consumed in the current block. */ point_count_for_block: string; - /** All of the profits that have been accumulated by the module. */ - profits: CoinAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/protorev/genesis-state"; @@ -101,7 +97,6 @@ export interface GenesisStateSDKType { max_pool_points_per_block: bigint; max_pool_points_per_tx: bigint; point_count_for_block: bigint; - profits: CoinSDKType[]; } function createBaseGenesisState(): GenesisState { return { @@ -115,8 +110,7 @@ function createBaseGenesisState(): GenesisState { developerAddress: "", maxPoolPointsPerBlock: BigInt(0), maxPoolPointsPerTx: BigInt(0), - pointCountForBlock: BigInt(0), - profits: [] + pointCountForBlock: BigInt(0) }; } export const GenesisState = { @@ -155,9 +149,6 @@ export const GenesisState = { if (message.pointCountForBlock !== BigInt(0)) { writer.uint32(88).uint64(message.pointCountForBlock); } - for (const v of message.profits) { - Coin.encode(v!, writer.uint32(98).fork()).ldelim(); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -200,9 +191,6 @@ export const GenesisState = { case 11: message.pointCountForBlock = reader.uint64(); break; - case 12: - message.profits.push(Coin.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -223,7 +211,6 @@ export const GenesisState = { message.maxPoolPointsPerBlock = object.maxPoolPointsPerBlock !== undefined && object.maxPoolPointsPerBlock !== null ? BigInt(object.maxPoolPointsPerBlock.toString()) : BigInt(0); message.maxPoolPointsPerTx = object.maxPoolPointsPerTx !== undefined && object.maxPoolPointsPerTx !== null ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0); message.pointCountForBlock = object.pointCountForBlock !== undefined && object.pointCountForBlock !== null ? BigInt(object.pointCountForBlock.toString()) : BigInt(0); - message.profits = object.profits?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { @@ -238,8 +225,7 @@ export const GenesisState = { developerAddress: object.developer_address, maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block), maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx), - pointCountForBlock: BigInt(object.point_count_for_block), - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [] + pointCountForBlock: BigInt(object.point_count_for_block) }; }, toAmino(message: GenesisState): GenesisStateAmino { @@ -267,11 +253,6 @@ export const GenesisState = { obj.max_pool_points_per_block = message.maxPoolPointsPerBlock ? message.maxPoolPointsPerBlock.toString() : undefined; obj.max_pool_points_per_tx = message.maxPoolPointsPerTx ? message.maxPoolPointsPerTx.toString() : undefined; obj.point_count_for_block = message.pointCountForBlock ? message.pointCountForBlock.toString() : undefined; - if (message.profits) { - obj.profits = message.profits.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.profits = []; - } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts index f1f3b20f9..5d8ec8dd6 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts @@ -23,7 +23,7 @@ export interface SetProtoRevEnabledProposalAmino { enabled: boolean; } export interface SetProtoRevEnabledProposalAminoMsg { - type: "osmosis/SetProtoRevEnabledProposal"; + type: "osmosis/protorev/set-proto-rev-enabled-proposal"; value: SetProtoRevEnabledProposalAmino; } /** @@ -62,7 +62,7 @@ export interface SetProtoRevAdminAccountProposalAmino { account: string; } export interface SetProtoRevAdminAccountProposalAminoMsg { - type: "osmosis/SetProtoRevAdminAccountProposal"; + type: "osmosis/protorev/set-proto-rev-admin-account-proposal"; value: SetProtoRevAdminAccountProposalAmino; } /** @@ -147,7 +147,7 @@ export const SetProtoRevEnabledProposal = { }, toAminoMsg(message: SetProtoRevEnabledProposal): SetProtoRevEnabledProposalAminoMsg { return { - type: "osmosis/SetProtoRevEnabledProposal", + type: "osmosis/protorev/set-proto-rev-enabled-proposal", value: SetProtoRevEnabledProposal.toAmino(message) }; }, @@ -235,7 +235,7 @@ export const SetProtoRevAdminAccountProposal = { }, toAminoMsg(message: SetProtoRevAdminAccountProposal): SetProtoRevAdminAccountProposalAminoMsg { return { - type: "osmosis/SetProtoRevAdminAccountProposal", + type: "osmosis/protorev/set-proto-rev-admin-account-proposal", value: SetProtoRevAdminAccountProposal.toAmino(message) }; }, diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts index a24f9782f..73088a69d 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -22,7 +22,6 @@ export class LCDQueryClient { this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); - this.getProtoRevPool = this.getProtoRevPool.bind(this); } /* Params queries the parameters of the module. */ async params(_params: QueryParamsRequest = {}): Promise { @@ -115,19 +114,4 @@ export class LCDQueryClient { const endpoint = `osmosis/v14/protorev/enabled`; return await this.req.get(endpoint); } - /* GetProtoRevPool queries the pool id used via the highest liquidity method - for arbitrage route building given a pair of denominations */ - async getProtoRevPool(params: QueryGetProtoRevPoolRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.baseDenom !== "undefined") { - options.params.base_denom = params.baseDenom; - } - if (typeof params?.otherDenom !== "undefined") { - options.params.other_denom = params.otherDenom; - } - const endpoint = `osmosis/v14/protorev/pool`; - return await this.req.get(endpoint, options); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts index af6c21fc5..dde0ffc14 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params queries the parameters of the module. */ @@ -57,11 +57,6 @@ export interface Query { getProtoRevBaseDenoms(request?: QueryGetProtoRevBaseDenomsRequest): Promise; /** GetProtoRevEnabled queries whether the module is enabled or not */ getProtoRevEnabled(request?: QueryGetProtoRevEnabledRequest): Promise; - /** - * GetProtoRevPool queries the pool id used via the highest liquidity method - * for arbitrage route building given a pair of denominations - */ - getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -81,7 +76,6 @@ export class QueryClientImpl implements Query { this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); - this.getProtoRevPool = this.getProtoRevPool.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -153,11 +147,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevEnabled", data); return promise.then(data => QueryGetProtoRevEnabledResponse.decode(new BinaryReader(data))); } - getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise { - const data = QueryGetProtoRevPoolRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevPool", data); - return promise.then(data => QueryGetProtoRevPoolResponse.decode(new BinaryReader(data))); - } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -204,9 +193,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getProtoRevEnabled(request?: QueryGetProtoRevEnabledRequest): Promise { return queryService.getProtoRevEnabled(request); - }, - getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise { - return queryService.getProtoRevPool(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts index 9c15dd252..8932ad81e 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts @@ -786,79 +786,6 @@ export interface QueryGetProtoRevEnabledResponseAminoMsg { export interface QueryGetProtoRevEnabledResponseSDKType { enabled: boolean; } -/** - * QueryGetProtoRevPoolRequest is request type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolRequest { - /** - * base_denom is the base denom set in protorev for the denom pair to pool - * mapping - */ - baseDenom: string; - /** other_denom is the other denom for the denom pair to pool mapping */ - otherDenom: string; -} -export interface QueryGetProtoRevPoolRequestProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest"; - value: Uint8Array; -} -/** - * QueryGetProtoRevPoolRequest is request type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolRequestAmino { - /** - * base_denom is the base denom set in protorev for the denom pair to pool - * mapping - */ - base_denom: string; - /** other_denom is the other denom for the denom pair to pool mapping */ - other_denom: string; -} -export interface QueryGetProtoRevPoolRequestAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-request"; - value: QueryGetProtoRevPoolRequestAmino; -} -/** - * QueryGetProtoRevPoolRequest is request type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolRequestSDKType { - base_denom: string; - other_denom: string; -} -/** - * QueryGetProtoRevPoolResponse is response type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolResponse { - /** pool_id is the pool_id stored for the denom pair */ - poolId: bigint; -} -export interface QueryGetProtoRevPoolResponseProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse"; - value: Uint8Array; -} -/** - * QueryGetProtoRevPoolResponse is response type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolResponseAmino { - /** pool_id is the pool_id stored for the denom pair */ - pool_id: string; -} -export interface QueryGetProtoRevPoolResponseAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-response"; - value: QueryGetProtoRevPoolResponseAmino; -} -/** - * QueryGetProtoRevPoolResponse is response type for the - * Query/GetProtoRevPool RPC method. - */ -export interface QueryGetProtoRevPoolResponseSDKType { - pool_id: bigint; -} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -1172,7 +1099,7 @@ export const QueryGetProtoRevProfitsByDenomRequest = { }; function createBaseQueryGetProtoRevProfitsByDenomResponse(): QueryGetProtoRevProfitsByDenomResponse { return { - profit: undefined + profit: Coin.fromPartial({}) }; } export const QueryGetProtoRevProfitsByDenomResponse = { @@ -2619,148 +2546,4 @@ export const QueryGetProtoRevEnabledResponse = { value: QueryGetProtoRevEnabledResponse.encode(message).finish() }; } -}; -function createBaseQueryGetProtoRevPoolRequest(): QueryGetProtoRevPoolRequest { - return { - baseDenom: "", - otherDenom: "" - }; -} -export const QueryGetProtoRevPoolRequest = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest", - encode(message: QueryGetProtoRevPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.baseDenom !== "") { - writer.uint32(10).string(message.baseDenom); - } - if (message.otherDenom !== "") { - writer.uint32(18).string(message.otherDenom); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.baseDenom = reader.string(); - break; - case 2: - message.otherDenom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): QueryGetProtoRevPoolRequest { - const message = createBaseQueryGetProtoRevPoolRequest(); - message.baseDenom = object.baseDenom ?? ""; - message.otherDenom = object.otherDenom ?? ""; - return message; - }, - fromAmino(object: QueryGetProtoRevPoolRequestAmino): QueryGetProtoRevPoolRequest { - return { - baseDenom: object.base_denom, - otherDenom: object.other_denom - }; - }, - toAmino(message: QueryGetProtoRevPoolRequest): QueryGetProtoRevPoolRequestAmino { - const obj: any = {}; - obj.base_denom = message.baseDenom; - obj.other_denom = message.otherDenom; - return obj; - }, - fromAminoMsg(object: QueryGetProtoRevPoolRequestAminoMsg): QueryGetProtoRevPoolRequest { - return QueryGetProtoRevPoolRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryGetProtoRevPoolRequest): QueryGetProtoRevPoolRequestAminoMsg { - return { - type: "osmosis/protorev/query-get-proto-rev-pool-request", - value: QueryGetProtoRevPoolRequest.toAmino(message) - }; - }, - fromProtoMsg(message: QueryGetProtoRevPoolRequestProtoMsg): QueryGetProtoRevPoolRequest { - return QueryGetProtoRevPoolRequest.decode(message.value); - }, - toProto(message: QueryGetProtoRevPoolRequest): Uint8Array { - return QueryGetProtoRevPoolRequest.encode(message).finish(); - }, - toProtoMsg(message: QueryGetProtoRevPoolRequest): QueryGetProtoRevPoolRequestProtoMsg { - return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest", - value: QueryGetProtoRevPoolRequest.encode(message).finish() - }; - } -}; -function createBaseQueryGetProtoRevPoolResponse(): QueryGetProtoRevPoolResponse { - return { - poolId: BigInt(0) - }; -} -export const QueryGetProtoRevPoolResponse = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse", - encode(message: QueryGetProtoRevPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolResponse(); - 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): QueryGetProtoRevPoolResponse { - const message = createBaseQueryGetProtoRevPoolResponse(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: QueryGetProtoRevPoolResponseAmino): QueryGetProtoRevPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: QueryGetProtoRevPoolResponse): QueryGetProtoRevPoolResponseAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: QueryGetProtoRevPoolResponseAminoMsg): QueryGetProtoRevPoolResponse { - return QueryGetProtoRevPoolResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryGetProtoRevPoolResponse): QueryGetProtoRevPoolResponseAminoMsg { - return { - type: "osmosis/protorev/query-get-proto-rev-pool-response", - value: QueryGetProtoRevPoolResponse.toAmino(message) - }; - }, - fromProtoMsg(message: QueryGetProtoRevPoolResponseProtoMsg): QueryGetProtoRevPoolResponse { - return QueryGetProtoRevPoolResponse.decode(message.value); - }, - toProto(message: QueryGetProtoRevPoolResponse): Uint8Array { - return QueryGetProtoRevPoolResponse.encode(message).finish(); - }, - toProtoMsg(message: QueryGetProtoRevPoolResponse): QueryGetProtoRevPoolResponseProtoMsg { - return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse", - value: QueryGetProtoRevPoolResponse.encode(message).finish() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/rpc.query.ts b/packages/osmojs/src/codegen/osmosis/rpc.query.ts index 78e922a52..94e4fde92 100644 --- a/packages/osmojs/src/codegen/osmosis/rpc.query.ts +++ b/packages/osmojs/src/codegen/osmosis/rpc.query.ts @@ -41,7 +41,7 @@ export const createRPCQueryClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: (await import("./concentrated-liquidity/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./concentrated-liquidity/pool-model/query.rpc.Query")).createRpcQueryExtension(client) }, cosmwasmpool: { v1beta1: (await import("./cosmwasmpool/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/osmojs/src/codegen/osmosis/rpc.tx.ts b/packages/osmojs/src/codegen/osmosis/rpc.tx.ts index 7e4bb7a97..cd843cb07 100644 --- a/packages/osmojs/src/codegen/osmosis/rpc.tx.ts +++ b/packages/osmojs/src/codegen/osmosis/rpc.tx.ts @@ -23,11 +23,6 @@ export const createRPCMsgClient = async ({ }, osmosis: { concentratedliquidity: { - poolmodel: { - concentrated: { - v1beta1: new (await import("./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, v1beta1: new (await import("./concentrated-liquidity/tx.rpc.msg")).MsgClientImpl(rpc) }, gamm: { diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts index e29bf9d12..22089c1c4 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponseSDKType, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -23,8 +23,6 @@ export class LCDQueryClient { this.estimateSuperfluidDelegatedAmountByValidatorDenom = this.estimateSuperfluidDelegatedAmountByValidatorDenom.bind(this); this.totalDelegationByDelegator = this.totalDelegationByDelegator.bind(this); this.unpoolWhitelist = this.unpoolWhitelist.bind(this); - this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); - this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); } /* Params returns the total set of superfluid parameters. */ async params(_params: QueryParamsRequest = {}): Promise { @@ -158,14 +156,4 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/unpool_whitelist`; return await this.req.get(endpoint); } - /* UserConcentratedSuperfluidPositionsDelegated */ - async userConcentratedSuperfluidPositionsDelegated(params: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise { - const endpoint = `osmosis/superfluid/v1beta1/account_delegated_cl_positions/${params.delegatorAddress}`; - return await this.req.get(endpoint); - } - /* UserConcentratedSuperfluidPositionsUndelegating */ - async userConcentratedSuperfluidPositionsUndelegating(params: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise { - const endpoint = `osmosis/superfluid/v1beta1/account_undelegating_cl_positions/${params.delegatorAddress}`; - return await this.req.get(endpoint); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts index 093294a6d..8c7739a76 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponse, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params returns the total set of superfluid parameters. */ @@ -50,8 +50,6 @@ export interface Query { totalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise; /** Returns a list of whitelisted pool ids to unpool. */ unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise; - userConcentratedSuperfluidPositionsDelegated(request: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise; - userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -72,8 +70,6 @@ export class QueryClientImpl implements Query { this.estimateSuperfluidDelegatedAmountByValidatorDenom = this.estimateSuperfluidDelegatedAmountByValidatorDenom.bind(this); this.totalDelegationByDelegator = this.totalDelegationByDelegator.bind(this); this.unpoolWhitelist = this.unpoolWhitelist.bind(this); - this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); - this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -152,16 +148,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.superfluid.Query", "UnpoolWhitelist", data); return promise.then(data => QueryUnpoolWhitelistResponse.decode(new BinaryReader(data))); } - userConcentratedSuperfluidPositionsDelegated(request: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise { - const data = UserConcentratedSuperfluidPositionsDelegatedRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.superfluid.Query", "UserConcentratedSuperfluidPositionsDelegated", data); - return promise.then(data => UserConcentratedSuperfluidPositionsDelegatedResponse.decode(new BinaryReader(data))); - } - userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise { - const data = UserConcentratedSuperfluidPositionsUndelegatingRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.superfluid.Query", "UserConcentratedSuperfluidPositionsUndelegating", data); - return promise.then(data => UserConcentratedSuperfluidPositionsUndelegatingResponse.decode(new BinaryReader(data))); - } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -211,12 +197,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise { return queryService.unpoolWhitelist(request); - }, - userConcentratedSuperfluidPositionsDelegated(request: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise { - return queryService.userConcentratedSuperfluidPositionsDelegated(request); - }, - userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise { - return queryService.userConcentratedSuperfluidPositionsUndelegating(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.ts index fba385581..941b4aa76 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, ConcentratedPoolUserPositionRecord, ConcentratedPoolUserPositionRecordAmino, ConcentratedPoolUserPositionRecordSDKType, superfluidAssetTypeFromJSON } from "./superfluid"; +import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, superfluidAssetTypeFromJSON } from "./superfluid"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; import { DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType } from "../../cosmos/staking/v1beta1/staking"; @@ -582,74 +582,6 @@ export interface QueryUnpoolWhitelistResponseAminoMsg { export interface QueryUnpoolWhitelistResponseSDKType { pool_ids: bigint[]; } -export interface UserConcentratedSuperfluidPositionsDelegatedRequest { - delegatorAddress: string; -} -export interface UserConcentratedSuperfluidPositionsDelegatedRequestProtoMsg { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedRequest"; - value: Uint8Array; -} -export interface UserConcentratedSuperfluidPositionsDelegatedRequestAmino { - delegator_address: string; -} -export interface UserConcentratedSuperfluidPositionsDelegatedRequestAminoMsg { - type: "osmosis/user-concentrated-superfluid-positions-delegated-request"; - value: UserConcentratedSuperfluidPositionsDelegatedRequestAmino; -} -export interface UserConcentratedSuperfluidPositionsDelegatedRequestSDKType { - delegator_address: string; -} -export interface UserConcentratedSuperfluidPositionsDelegatedResponse { - clPoolUserPositionRecords: ConcentratedPoolUserPositionRecord[]; -} -export interface UserConcentratedSuperfluidPositionsDelegatedResponseProtoMsg { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedResponse"; - value: Uint8Array; -} -export interface UserConcentratedSuperfluidPositionsDelegatedResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; -} -export interface UserConcentratedSuperfluidPositionsDelegatedResponseAminoMsg { - type: "osmosis/user-concentrated-superfluid-positions-delegated-response"; - value: UserConcentratedSuperfluidPositionsDelegatedResponseAmino; -} -export interface UserConcentratedSuperfluidPositionsDelegatedResponseSDKType { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordSDKType[]; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingRequest { - delegatorAddress: string; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingRequestProtoMsg { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingRequest"; - value: Uint8Array; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { - delegator_address: string; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAminoMsg { - type: "osmosis/user-concentrated-superfluid-positions-undelegating-request"; - value: UserConcentratedSuperfluidPositionsUndelegatingRequestAmino; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingRequestSDKType { - delegator_address: string; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingResponse { - clPoolUserPositionRecords: ConcentratedPoolUserPositionRecord[]; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingResponseProtoMsg { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingResponse"; - value: Uint8Array; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg { - type: "osmosis/user-concentrated-superfluid-positions-undelegating-response"; - value: UserConcentratedSuperfluidPositionsUndelegatingResponseAmino; -} -export interface UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordSDKType[]; -} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -2121,7 +2053,7 @@ function createBaseSuperfluidDelegationsByDelegatorResponse(): SuperfluidDelegat return { superfluidDelegationRecords: [], totalDelegatedCoins: [], - totalEquivalentStakedAmount: undefined + totalEquivalentStakedAmount: Coin.fromPartial({}) }; } export const SuperfluidDelegationsByDelegatorResponse = { @@ -2756,7 +2688,7 @@ function createBaseQueryTotalDelegationByDelegatorResponse(): QueryTotalDelegati superfluidDelegationRecords: [], delegationResponse: [], totalDelegatedCoins: [], - totalEquivalentStakedAmount: undefined + totalEquivalentStakedAmount: Coin.fromPartial({}) }; } export const QueryTotalDelegationByDelegatorResponse = { @@ -2994,280 +2926,4 @@ export const QueryUnpoolWhitelistResponse = { value: QueryUnpoolWhitelistResponse.encode(message).finish() }; } -}; -function createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(): UserConcentratedSuperfluidPositionsDelegatedRequest { - return { - delegatorAddress: "" - }; -} -export const UserConcentratedSuperfluidPositionsDelegatedRequest = { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedRequest", - encode(message: UserConcentratedSuperfluidPositionsDelegatedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserConcentratedSuperfluidPositionsDelegatedRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegatorAddress = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserConcentratedSuperfluidPositionsDelegatedRequest { - const message = createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - return message; - }, - fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedRequestAmino): UserConcentratedSuperfluidPositionsDelegatedRequest { - return { - delegatorAddress: object.delegator_address - }; - }, - toAmino(message: UserConcentratedSuperfluidPositionsDelegatedRequest): UserConcentratedSuperfluidPositionsDelegatedRequestAmino { - const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - return obj; - }, - fromAminoMsg(object: UserConcentratedSuperfluidPositionsDelegatedRequestAminoMsg): UserConcentratedSuperfluidPositionsDelegatedRequest { - return UserConcentratedSuperfluidPositionsDelegatedRequest.fromAmino(object.value); - }, - toAminoMsg(message: UserConcentratedSuperfluidPositionsDelegatedRequest): UserConcentratedSuperfluidPositionsDelegatedRequestAminoMsg { - return { - type: "osmosis/user-concentrated-superfluid-positions-delegated-request", - value: UserConcentratedSuperfluidPositionsDelegatedRequest.toAmino(message) - }; - }, - fromProtoMsg(message: UserConcentratedSuperfluidPositionsDelegatedRequestProtoMsg): UserConcentratedSuperfluidPositionsDelegatedRequest { - return UserConcentratedSuperfluidPositionsDelegatedRequest.decode(message.value); - }, - toProto(message: UserConcentratedSuperfluidPositionsDelegatedRequest): Uint8Array { - return UserConcentratedSuperfluidPositionsDelegatedRequest.encode(message).finish(); - }, - toProtoMsg(message: UserConcentratedSuperfluidPositionsDelegatedRequest): UserConcentratedSuperfluidPositionsDelegatedRequestProtoMsg { - return { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedRequest", - value: UserConcentratedSuperfluidPositionsDelegatedRequest.encode(message).finish() - }; - } -}; -function createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(): UserConcentratedSuperfluidPositionsDelegatedResponse { - return { - clPoolUserPositionRecords: [] - }; -} -export const UserConcentratedSuperfluidPositionsDelegatedResponse = { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedResponse", - encode(message: UserConcentratedSuperfluidPositionsDelegatedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.clPoolUserPositionRecords) { - ConcentratedPoolUserPositionRecord.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserConcentratedSuperfluidPositionsDelegatedResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.clPoolUserPositionRecords.push(ConcentratedPoolUserPositionRecord.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserConcentratedSuperfluidPositionsDelegatedResponse { - const message = createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(); - message.clPoolUserPositionRecords = object.clPoolUserPositionRecords?.map(e => ConcentratedPoolUserPositionRecord.fromPartial(e)) || []; - return message; - }, - fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedResponseAmino): UserConcentratedSuperfluidPositionsDelegatedResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; - }, - toAmino(message: UserConcentratedSuperfluidPositionsDelegatedResponse): UserConcentratedSuperfluidPositionsDelegatedResponseAmino { - const obj: any = {}; - if (message.clPoolUserPositionRecords) { - obj.cl_pool_user_position_records = message.clPoolUserPositionRecords.map(e => e ? ConcentratedPoolUserPositionRecord.toAmino(e) : undefined); - } else { - obj.cl_pool_user_position_records = []; - } - return obj; - }, - fromAminoMsg(object: UserConcentratedSuperfluidPositionsDelegatedResponseAminoMsg): UserConcentratedSuperfluidPositionsDelegatedResponse { - return UserConcentratedSuperfluidPositionsDelegatedResponse.fromAmino(object.value); - }, - toAminoMsg(message: UserConcentratedSuperfluidPositionsDelegatedResponse): UserConcentratedSuperfluidPositionsDelegatedResponseAminoMsg { - return { - type: "osmosis/user-concentrated-superfluid-positions-delegated-response", - value: UserConcentratedSuperfluidPositionsDelegatedResponse.toAmino(message) - }; - }, - fromProtoMsg(message: UserConcentratedSuperfluidPositionsDelegatedResponseProtoMsg): UserConcentratedSuperfluidPositionsDelegatedResponse { - return UserConcentratedSuperfluidPositionsDelegatedResponse.decode(message.value); - }, - toProto(message: UserConcentratedSuperfluidPositionsDelegatedResponse): Uint8Array { - return UserConcentratedSuperfluidPositionsDelegatedResponse.encode(message).finish(); - }, - toProtoMsg(message: UserConcentratedSuperfluidPositionsDelegatedResponse): UserConcentratedSuperfluidPositionsDelegatedResponseProtoMsg { - return { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedResponse", - value: UserConcentratedSuperfluidPositionsDelegatedResponse.encode(message).finish() - }; - } -}; -function createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return { - delegatorAddress: "" - }; -} -export const UserConcentratedSuperfluidPositionsUndelegatingRequest = { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingRequest", - encode(message: UserConcentratedSuperfluidPositionsUndelegatingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.delegatorAddress !== "") { - writer.uint32(10).string(message.delegatorAddress); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserConcentratedSuperfluidPositionsUndelegatingRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.delegatorAddress = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserConcentratedSuperfluidPositionsUndelegatingRequest { - const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(); - message.delegatorAddress = object.delegatorAddress ?? ""; - return message; - }, - fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingRequestAmino): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return { - delegatorAddress: object.delegator_address - }; - }, - toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { - const obj: any = {}; - obj.delegator_address = message.delegatorAddress; - return obj; - }, - fromAminoMsg(object: UserConcentratedSuperfluidPositionsUndelegatingRequestAminoMsg): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return UserConcentratedSuperfluidPositionsUndelegatingRequest.fromAmino(object.value); - }, - toAminoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): UserConcentratedSuperfluidPositionsUndelegatingRequestAminoMsg { - return { - type: "osmosis/user-concentrated-superfluid-positions-undelegating-request", - value: UserConcentratedSuperfluidPositionsUndelegatingRequest.toAmino(message) - }; - }, - fromProtoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingRequestProtoMsg): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return UserConcentratedSuperfluidPositionsUndelegatingRequest.decode(message.value); - }, - toProto(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): Uint8Array { - return UserConcentratedSuperfluidPositionsUndelegatingRequest.encode(message).finish(); - }, - toProtoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): UserConcentratedSuperfluidPositionsUndelegatingRequestProtoMsg { - return { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingRequest", - value: UserConcentratedSuperfluidPositionsUndelegatingRequest.encode(message).finish() - }; - } -}; -function createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return { - clPoolUserPositionRecords: [] - }; -} -export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingResponse", - encode(message: UserConcentratedSuperfluidPositionsUndelegatingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.clPoolUserPositionRecords) { - ConcentratedPoolUserPositionRecord.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): UserConcentratedSuperfluidPositionsUndelegatingResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.clPoolUserPositionRecords.push(ConcentratedPoolUserPositionRecord.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): UserConcentratedSuperfluidPositionsUndelegatingResponse { - const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(); - message.clPoolUserPositionRecords = object.clPoolUserPositionRecords?.map(e => ConcentratedPoolUserPositionRecord.fromPartial(e)) || []; - return message; - }, - fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingResponseAmino): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; - }, - toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { - const obj: any = {}; - if (message.clPoolUserPositionRecords) { - obj.cl_pool_user_position_records = message.clPoolUserPositionRecords.map(e => e ? ConcentratedPoolUserPositionRecord.toAmino(e) : undefined); - } else { - obj.cl_pool_user_position_records = []; - } - return obj; - }, - fromAminoMsg(object: UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return UserConcentratedSuperfluidPositionsUndelegatingResponse.fromAmino(object.value); - }, - toAminoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg { - return { - type: "osmosis/user-concentrated-superfluid-positions-undelegating-response", - value: UserConcentratedSuperfluidPositionsUndelegatingResponse.toAmino(message) - }; - }, - fromProtoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingResponseProtoMsg): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return UserConcentratedSuperfluidPositionsUndelegatingResponse.decode(message.value); - }, - toProto(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): Uint8Array { - return UserConcentratedSuperfluidPositionsUndelegatingResponse.encode(message).finish(); - }, - toProtoMsg(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): UserConcentratedSuperfluidPositionsUndelegatingResponseProtoMsg { - return { - typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingResponse", - value: UserConcentratedSuperfluidPositionsUndelegatingResponse.encode(message).finish() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts b/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts index 9c7edb5a9..d15009b71 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts @@ -1,16 +1,14 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet } from "../../helpers"; import { Decimal } from "@cosmjs/math"; /** * SuperfluidAssetType indicates whether the superfluid asset is - * a native token, lp share of a pool, or concentrated share of a pool + * a native token itself or the lp share of a pool. */ export enum SuperfluidAssetType { SuperfluidAssetTypeNative = 0, SuperfluidAssetTypeLPShare = 1, - SuperfluidAssetTypeConcentratedShare = 2, UNRECOGNIZED = -1, } export const SuperfluidAssetTypeSDKType = SuperfluidAssetType; @@ -23,9 +21,6 @@ export function superfluidAssetTypeFromJSON(object: any): SuperfluidAssetType { case 1: case "SuperfluidAssetTypeLPShare": return SuperfluidAssetType.SuperfluidAssetTypeLPShare; - case 2: - case "SuperfluidAssetTypeConcentratedShare": - return SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare; case -1: case "UNRECOGNIZED": default: @@ -38,8 +33,6 @@ export function superfluidAssetTypeToJSON(object: SuperfluidAssetType): string { return "SuperfluidAssetTypeNative"; case SuperfluidAssetType.SuperfluidAssetTypeLPShare: return "SuperfluidAssetTypeLPShare"; - case SuperfluidAssetType.SuperfluidAssetTypeConcentratedShare: - return "SuperfluidAssetTypeConcentratedShare"; case SuperfluidAssetType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -260,38 +253,6 @@ export interface UnpoolWhitelistedPoolsAminoMsg { 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: "", @@ -547,8 +508,8 @@ function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { return { delegatorAddress: "", validatorAddress: "", - delegationAmount: undefined, - equivalentStakedAmount: undefined + delegationAmount: Coin.fromPartial({}), + equivalentStakedAmount: Coin.fromPartial({}) }; } export const SuperfluidDelegationRecord = { @@ -796,121 +757,4 @@ export const UnpoolWhitelistedPools = { value: UnpoolWhitelistedPools.encode(message).finish() }; } -}; -function createBaseConcentratedPoolUserPositionRecord(): ConcentratedPoolUserPositionRecord { - return { - validatorAddress: "", - positionId: BigInt(0), - lockId: BigInt(0), - syntheticLock: SyntheticLock.fromPartial({}), - delegationAmount: undefined, - equivalentStakedAmount: undefined - }; -} -export const ConcentratedPoolUserPositionRecord = { - typeUrl: "/osmosis.superfluid.ConcentratedPoolUserPositionRecord", - 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 { - return { - validatorAddress: object.validator_address, - positionId: BigInt(object.position_id), - lockId: BigInt(object.lock_id), - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined, - delegationAmount: object?.delegation_amount ? Coin.fromAmino(object.delegation_amount) : undefined, - equivalentStakedAmount: object?.equivalent_staked_amount ? Coin.fromAmino(object.equivalent_staked_amount) : undefined - }; - }, - toAmino(message: ConcentratedPoolUserPositionRecord): ConcentratedPoolUserPositionRecordAmino { - const obj: any = {}; - obj.validator_address = message.validatorAddress; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - obj.lock_id = message.lockId ? 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() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts index 158de5f58..637afee1f 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition } from "./tx"; export const AminoConverter = { "/osmosis.superfluid.MsgSuperfluidDelegate": { aminoType: "osmosis/superfluid-delegate", @@ -26,11 +26,6 @@ export const AminoConverter = { toAmino: MsgLockAndSuperfluidDelegate.toAmino, fromAmino: MsgLockAndSuperfluidDelegate.fromAmino }, - "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate": { - aminoType: "osmosis/create-full-range-position-and-superfluid-delegate", - toAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino, - fromAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino - }, "/osmosis.superfluid.MsgUnPoolWhitelistedPool": { aminoType: "osmosis/unpool-whitelisted-pool", toAmino: MsgUnPoolWhitelistedPool.toAmino, @@ -40,10 +35,5 @@ export const AminoConverter = { aminoType: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position", toAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino, fromAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino - }, - "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition": { - aminoType: "osmosis/add-to-concentrated-liquidity-superfluid-position", - toAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino, - fromAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts index fe3b6c01b..02a7db37d 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", MsgSuperfluidUndelegateAndUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", MsgCreateFullRangePositionAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition], ["/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", MsgAddToConcentratedLiquiditySuperfluidPosition]]; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition } 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.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -39,12 +39,6 @@ export const MessageComposer = { 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", @@ -56,12 +50,6 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.encode(value).finish() }; - }, - addToConcentratedLiquiditySuperfluidPosition(value: MsgAddToConcentratedLiquiditySuperfluidPosition) { - return { - typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", - value: MsgAddToConcentratedLiquiditySuperfluidPosition.encode(value).finish() - }; } }, withTypeUrl: { @@ -95,12 +83,6 @@ export const MessageComposer = { value }; }, - createFullRangePositionAndSuperfluidDelegate(value: MsgCreateFullRangePositionAndSuperfluidDelegate) { - return { - typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", - value - }; - }, unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { return { typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", @@ -112,12 +94,6 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", value }; - }, - addToConcentratedLiquiditySuperfluidPosition(value: MsgAddToConcentratedLiquiditySuperfluidPosition) { - return { - typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", - value - }; } }, fromPartial: { @@ -151,12 +127,6 @@ export const MessageComposer = { value: MsgLockAndSuperfluidDelegate.fromPartial(value) }; }, - createFullRangePositionAndSuperfluidDelegate(value: MsgCreateFullRangePositionAndSuperfluidDelegate) { - return { - typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", - value: MsgCreateFullRangePositionAndSuperfluidDelegate.fromPartial(value) - }; - }, unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { return { typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", @@ -168,12 +138,6 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromPartial(value) }; - }, - addToConcentratedLiquiditySuperfluidPosition(value: MsgAddToConcentratedLiquiditySuperfluidPosition) { - return { - typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", - value: MsgAddToConcentratedLiquiditySuperfluidPosition.fromPartial(value) - }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts index e4f591bc2..de736a532 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgAddToConcentratedLiquiditySuperfluidPositionResponse } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { /** Execute superfluid delegation for a lockup */ @@ -16,10 +16,8 @@ export interface Msg { superfluidUndelegateAndUnbondLock(request: MsgSuperfluidUndelegateAndUnbondLock): Promise; /** Execute lockup lock and superfluid delegation in a single msg */ lockAndSuperfluidDelegate(request: MsgLockAndSuperfluidDelegate): Promise; - createFullRangePositionAndSuperfluidDelegate(request: MsgCreateFullRangePositionAndSuperfluidDelegate): Promise; unPoolWhitelistedPool(request: MsgUnPoolWhitelistedPool): Promise; unlockAndMigrateSharesToFullRangeConcentratedPosition(request: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): Promise; - addToConcentratedLiquiditySuperfluidPosition(request: MsgAddToConcentratedLiquiditySuperfluidPosition): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -30,10 +28,8 @@ export class MsgClientImpl implements Msg { this.superfluidUnbondLock = this.superfluidUnbondLock.bind(this); this.superfluidUndelegateAndUnbondLock = this.superfluidUndelegateAndUnbondLock.bind(this); this.lockAndSuperfluidDelegate = this.lockAndSuperfluidDelegate.bind(this); - this.createFullRangePositionAndSuperfluidDelegate = this.createFullRangePositionAndSuperfluidDelegate.bind(this); this.unPoolWhitelistedPool = this.unPoolWhitelistedPool.bind(this); this.unlockAndMigrateSharesToFullRangeConcentratedPosition = this.unlockAndMigrateSharesToFullRangeConcentratedPosition.bind(this); - this.addToConcentratedLiquiditySuperfluidPosition = this.addToConcentratedLiquiditySuperfluidPosition.bind(this); } superfluidDelegate(request: MsgSuperfluidDelegate): Promise { const data = MsgSuperfluidDelegate.encode(request).finish(); @@ -60,11 +56,6 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.superfluid.Msg", "LockAndSuperfluidDelegate", data); return promise.then(data => MsgLockAndSuperfluidDelegateResponse.decode(new BinaryReader(data))); } - createFullRangePositionAndSuperfluidDelegate(request: MsgCreateFullRangePositionAndSuperfluidDelegate): Promise { - const data = MsgCreateFullRangePositionAndSuperfluidDelegate.encode(request).finish(); - const promise = this.rpc.request("osmosis.superfluid.Msg", "CreateFullRangePositionAndSuperfluidDelegate", data); - return promise.then(data => MsgCreateFullRangePositionAndSuperfluidDelegateResponse.decode(new BinaryReader(data))); - } unPoolWhitelistedPool(request: MsgUnPoolWhitelistedPool): Promise { const data = MsgUnPoolWhitelistedPool.encode(request).finish(); const promise = this.rpc.request("osmosis.superfluid.Msg", "UnPoolWhitelistedPool", data); @@ -75,9 +66,4 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.superfluid.Msg", "UnlockAndMigrateSharesToFullRangeConcentratedPosition", data); return promise.then(data => MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.decode(new BinaryReader(data))); } - addToConcentratedLiquiditySuperfluidPosition(request: MsgAddToConcentratedLiquiditySuperfluidPosition): Promise { - const data = MsgAddToConcentratedLiquiditySuperfluidPosition.encode(request).finish(); - const promise = this.rpc.request("osmosis.superfluid.Msg", "AddToConcentratedLiquiditySuperfluidPosition", data); - return promise.then(data => MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode(new BinaryReader(data))); - } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts index e1d6ba236..0e7d8afae 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts @@ -124,33 +124,17 @@ export interface MsgSuperfluidUndelegateAndUnbondLockSDKType { 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 MsgSuperfluidUndelegateAndUnbondLockResponse {} 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 MsgSuperfluidUndelegateAndUnbondLockResponseAmino {} export interface MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { type: "osmosis/superfluid-undelegate-and-unbond-lock-response"; value: MsgSuperfluidUndelegateAndUnbondLockResponseAmino; } -export interface MsgSuperfluidUndelegateAndUnbondLockResponseSDKType { - lock_id: bigint; -} +export interface MsgSuperfluidUndelegateAndUnbondLockResponseSDKType {} /** * MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration, * and then does a superfluid lock from the newly created lockup, to the @@ -206,64 +190,6 @@ export interface MsgLockAndSuperfluidDelegateResponseAminoMsg { 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/create-full-range-position-and-superfluid-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 @@ -339,8 +265,6 @@ 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"; @@ -354,8 +278,6 @@ 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-shares-to-full-range-concentrated-position"; @@ -369,7 +291,6 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionSDKType sender: string; lock_id: bigint; shares_to_migrate: CoinSDKType; - token_out_mins: CoinSDKType[]; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { amount0: string; @@ -397,74 +318,6 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionRespons 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-concentrated-liquidity-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; -} function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { return { sender: "", @@ -875,7 +728,7 @@ function createBaseMsgSuperfluidUndelegateAndUnbondLock(): MsgSuperfluidUndelega return { sender: "", lockId: BigInt(0), - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgSuperfluidUndelegateAndUnbondLock = { @@ -959,16 +812,11 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { } }; function createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(): MsgSuperfluidUndelegateAndUnbondLockResponse { - return { - lockId: BigInt(0) - }; + return {}; } export const MsgSuperfluidUndelegateAndUnbondLockResponse = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse", - encode(message: MsgSuperfluidUndelegateAndUnbondLockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.lockId !== BigInt(0)) { - writer.uint32(8).uint64(message.lockId); - } + encode(_: MsgSuperfluidUndelegateAndUnbondLockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgSuperfluidUndelegateAndUnbondLockResponse { @@ -978,9 +826,6 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.lockId = reader.uint64(); - break; default: reader.skipType(tag & 7); break; @@ -988,19 +833,15 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { } return message; }, - fromPartial(object: Partial): MsgSuperfluidUndelegateAndUnbondLockResponse { + fromPartial(_: Partial): MsgSuperfluidUndelegateAndUnbondLockResponse { const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); - message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, - fromAmino(object: MsgSuperfluidUndelegateAndUnbondLockResponseAmino): MsgSuperfluidUndelegateAndUnbondLockResponse { - return { - lockId: BigInt(object.lock_id) - }; + fromAmino(_: MsgSuperfluidUndelegateAndUnbondLockResponseAmino): MsgSuperfluidUndelegateAndUnbondLockResponse { + return {}; }, - toAmino(message: MsgSuperfluidUndelegateAndUnbondLockResponse): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + toAmino(_: MsgSuperfluidUndelegateAndUnbondLockResponse): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { const obj: any = {}; - obj.lock_id = message.lockId ? message.lockId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg): MsgSuperfluidUndelegateAndUnbondLockResponse { @@ -1183,184 +1024,6 @@ export const MsgLockAndSuperfluidDelegateResponse = { }; } }; -function createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(): MsgCreateFullRangePositionAndSuperfluidDelegate { - return { - sender: "", - coins: [], - valAddr: "", - poolId: BigInt(0) - }; -} -export const MsgCreateFullRangePositionAndSuperfluidDelegate = { - typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", - 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 { - return { - sender: object.sender, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - valAddr: object.val_addr, - poolId: BigInt(object.pool_id) - }; - }, - toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAmino { - const obj: any = {}; - obj.sender = message.sender; - if (message.coins) { - obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.coins = []; - } - obj.val_addr = message.valAddr; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg): MsgCreateFullRangePositionAndSuperfluidDelegate { - return MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino(object.value); - }, - toAminoMsg(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { - return { - type: "osmosis/create-full-range-position-and-superfluid-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() - }; - } -}; -function createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { - return { - lockID: BigInt(0), - positionID: BigInt(0) - }; -} -export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { - typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse", - 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 { - return { - lockID: BigInt(object.lockID), - positionID: BigInt(object.positionID) - }; - }, - toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { - const obj: any = {}; - obj.lockID = message.lockID ? message.lockID.toString() : undefined; - obj.positionID = message.positionID ? 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() - }; - } -}; function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { return { sender: "", @@ -1522,8 +1185,7 @@ function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(): M return { sender: "", lockId: BigInt(0), - sharesToMigrate: undefined, - tokenOutMins: [] + sharesToMigrate: Coin.fromPartial({}) }; } export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { @@ -1533,14 +1195,11 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { writer.uint32(10).string(message.sender); } if (message.lockId !== BigInt(0)) { - writer.uint32(16).int64(message.lockId); + writer.uint32(16).uint64(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 { @@ -1554,14 +1213,11 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { message.sender = reader.string(); break; case 2: - message.lockId = reader.int64(); + message.lockId = reader.uint64(); 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; @@ -1574,15 +1230,13 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { 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 { return { sender: object.sender, lockId: BigInt(object.lock_id), - sharesToMigrate: object?.shares_to_migrate ? Coin.fromAmino(object.shares_to_migrate) : undefined, - tokenOutMins: Array.isArray(object?.token_out_mins) ? object.token_out_mins.map((e: any) => Coin.fromAmino(e)) : [] + sharesToMigrate: object?.shares_to_migrate ? Coin.fromAmino(object.shares_to_migrate) : undefined }; }, toAmino(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { @@ -1590,11 +1244,6 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { obj.sender = message.sender; obj.lock_id = message.lockId ? 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 = []; - } return obj; }, fromAminoMsg(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { @@ -1624,7 +1273,7 @@ function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionRespo amount0: "", amount1: "", liquidityCreated: "", - joinTime: undefined + joinTime: new Date() }; } export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = { @@ -1715,208 +1364,4 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.encode(message).finish() }; } -}; -function createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(): MsgAddToConcentratedLiquiditySuperfluidPosition { - return { - positionId: BigInt(0), - sender: "", - tokenDesired0: undefined, - tokenDesired1: undefined - }; -} -export const MsgAddToConcentratedLiquiditySuperfluidPosition = { - typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", - 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 { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - tokenDesired0: object?.token_desired0 ? Coin.fromAmino(object.token_desired0) : undefined, - tokenDesired1: object?.token_desired1 ? Coin.fromAmino(object.token_desired1) : undefined - }; - }, - toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPosition): MsgAddToConcentratedLiquiditySuperfluidPositionAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - obj.sender = 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-concentrated-liquidity-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() - }; - } -}; -function createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { - return { - positionId: BigInt(0), - amount0: "", - amount1: "", - newLiquidity: "", - lockId: BigInt(0) - }; -} -export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { - typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse", - 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 { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1, - newLiquidity: object.new_liquidity, - lockId: BigInt(object.lock_id) - }; - }, - toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { - const obj: any = {}; - obj.position_id = message.positionId ? message.positionId.toString() : undefined; - obj.amount0 = message.amount0; - obj.amount1 = message.amount1; - obj.new_liquidity = message.newLiquidity; - obj.lock_id = message.lockId ? 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() - }; - } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts index ad395087e..b33b536e9 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts @@ -2,19 +2,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin" import { BinaryReader, BinaryWriter } from "../../../binary"; /** Params defines the parameters for the tokenfactory module. */ export interface Params { - /** - * DenomCreationFee defines the fee to be charged on the creation of a new - * denom. The fee is drawn from the MsgCreateDenom's sender account, and - * transferred to the community pool. - */ denomCreationFee: Coin[]; - /** - * DenomCreationGasConsume defines the gas cost for creating a new denom. - * This is intended as a spam deterrence mechanism. - * - * See: https://github.com/CosmWasm/token-factory/issues/11 - */ - denomCreationGasConsume?: bigint; } export interface ParamsProtoMsg { typeUrl: "/osmosis.tokenfactory.v1beta1.Params"; @@ -22,19 +10,7 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the tokenfactory module. */ export interface ParamsAmino { - /** - * DenomCreationFee defines the fee to be charged on the creation of a new - * denom. The fee is drawn from the MsgCreateDenom's sender account, and - * transferred to the community pool. - */ denom_creation_fee: CoinAmino[]; - /** - * DenomCreationGasConsume defines the gas cost for creating a new denom. - * This is intended as a spam deterrence mechanism. - * - * See: https://github.com/CosmWasm/token-factory/issues/11 - */ - denom_creation_gas_consume: string; } export interface ParamsAminoMsg { type: "osmosis/tokenfactory/params"; @@ -43,12 +19,10 @@ export interface ParamsAminoMsg { /** Params defines the parameters for the tokenfactory module. */ export interface ParamsSDKType { denom_creation_fee: CoinSDKType[]; - denom_creation_gas_consume?: bigint; } function createBaseParams(): Params { return { - denomCreationFee: [], - denomCreationGasConsume: undefined + denomCreationFee: [] }; } export const Params = { @@ -57,9 +31,6 @@ export const Params = { for (const v of message.denomCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.denomCreationGasConsume !== undefined) { - writer.uint32(16).uint64(message.denomCreationGasConsume); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -72,9 +43,6 @@ export const Params = { case 1: message.denomCreationFee.push(Coin.decode(reader, reader.uint32())); break; - case 2: - message.denomCreationGasConsume = reader.uint64(); - break; default: reader.skipType(tag & 7); break; @@ -85,13 +53,11 @@ export const Params = { fromPartial(object: Partial): Params { const message = createBaseParams(); message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; - message.denomCreationGasConsume = object.denomCreationGasConsume !== undefined && object.denomCreationGasConsume !== null ? BigInt(object.denomCreationGasConsume.toString()) : undefined; return message; }, fromAmino(object: ParamsAmino): Params { return { - denomCreationFee: Array.isArray(object?.denom_creation_fee) ? object.denom_creation_fee.map((e: any) => Coin.fromAmino(e)) : [], - denomCreationGasConsume: object?.denom_creation_gas_consume ? BigInt(object.denom_creation_gas_consume) : undefined + denomCreationFee: Array.isArray(object?.denom_creation_fee) ? object.denom_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] }; }, toAmino(message: Params): ParamsAmino { @@ -101,7 +67,6 @@ export const Params = { } else { obj.denom_creation_fee = []; } - obj.denom_creation_gas_consume = message.denomCreationGasConsume ? message.denomCreationGasConsume.toString() : undefined; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts index 45d81527e..3b278af95 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,7 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } /* Params defines a gRPC query method that returns the tokenfactory module's parameters. */ @@ -30,4 +31,10 @@ export class LCDQueryClient { const endpoint = `osmosis/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; return await this.req.get(endpoint); } + /* BeforeSendHookAddress defines a gRPC query method for + getting the address registered for the before send hook. */ + async beforeSendHookAddress(params: QueryBeforeSendHookAddressRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/before_send_hook`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts index 26a7ecd0f..2d908dbf7 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** @@ -19,6 +19,11 @@ export interface Query { * denominations created by a specific admin/creator. */ denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -27,6 +32,7 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -43,6 +49,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data))); } + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + const data = QueryBeforeSendHookAddressRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "BeforeSendHookAddress", data); + return promise.then(data => QueryBeforeSendHookAddressResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -56,6 +67,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { return queryService.denomsFromCreator(request); + }, + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + return queryService.beforeSendHookAddress(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts index b699f367d..272ecf736 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts @@ -153,6 +153,52 @@ export interface QueryDenomsFromCreatorResponseAminoMsg { export interface QueryDenomsFromCreatorResponseSDKType { denoms: string[]; } +export interface QueryBeforeSendHookAddressRequest { + denom: string; +} +export interface QueryBeforeSendHookAddressRequestProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest"; + value: Uint8Array; +} +export interface QueryBeforeSendHookAddressRequestAmino { + denom: string; +} +export interface QueryBeforeSendHookAddressRequestAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-request"; + value: QueryBeforeSendHookAddressRequestAmino; +} +export interface QueryBeforeSendHookAddressRequestSDKType { + denom: string; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponse { + cosmwasmAddress: string; +} +export interface QueryBeforeSendHookAddressResponseProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse"; + value: Uint8Array; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseAmino { + cosmwasm_address: string; +} +export interface QueryBeforeSendHookAddressResponseAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-response"; + value: QueryBeforeSendHookAddressResponseAmino; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseSDKType { + cosmwasm_address: string; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -546,4 +592,138 @@ export const QueryDenomsFromCreatorResponse = { value: QueryDenomsFromCreatorResponse.encode(message).finish() }; } +}; +function createBaseQueryBeforeSendHookAddressRequest(): QueryBeforeSendHookAddressRequest { + return { + denom: "" + }; +} +export const QueryBeforeSendHookAddressRequest = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + encode(message: QueryBeforeSendHookAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressRequestAmino): QueryBeforeSendHookAddressRequest { + return { + denom: object.denom + }; + }, + toAmino(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressRequestAminoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-request", + value: QueryBeforeSendHookAddressRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressRequestProtoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressRequest): Uint8Array { + return QueryBeforeSendHookAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + value: QueryBeforeSendHookAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBeforeSendHookAddressResponse(): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: "" + }; +} +export const QueryBeforeSendHookAddressResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + encode(message: QueryBeforeSendHookAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cosmwasmAddress !== "") { + writer.uint32(10).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressResponseAmino): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: object.cosmwasm_address + }; + }, + toAmino(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAmino { + const obj: any = {}; + obj.cosmwasm_address = message.cosmwasmAddress; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressResponseAminoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-response", + value: QueryBeforeSendHookAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressResponseProtoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressResponse): Uint8Array { + return QueryBeforeSendHookAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + value: QueryBeforeSendHookAddressResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts index fba1678c3..127c07d28 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; export const AminoConverter = { "/osmosis.tokenfactory.v1beta1.MsgCreateDenom": { aminoType: "osmosis/tokenfactory/create-denom", @@ -26,6 +26,11 @@ export const AminoConverter = { toAmino: MsgSetDenomMetadata.toAmino, fromAmino: MsgSetDenomMetadata.fromAmino }, + "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook": { + aminoType: "osmosis/tokenfactory/set-before-send-hook", + toAmino: MsgSetBeforeSendHook.toAmino, + fromAmino: MsgSetBeforeSendHook.fromAmino + }, "/osmosis.tokenfactory.v1beta1.MsgForceTransfer": { aminoType: "osmosis/tokenfactory/force-transfer", toAmino: MsgForceTransfer.toAmino, diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts index b5338c034..9da606aeb 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", MsgSetBeforeSendHook], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -39,6 +39,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.encode(value).finish() }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(value).finish() + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -77,6 +83,12 @@ export const MessageComposer = { value }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -115,6 +127,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.fromPartial(value) }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.fromPartial(value) + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts index 2e3eb27f2..ccf13d751 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgSetBeforeSendHook, MsgSetBeforeSendHookResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; /** Msg defines the tokefactory module's gRPC message service. */ export interface Msg { createDenom(request: MsgCreateDenom): Promise; @@ -8,6 +8,7 @@ export interface Msg { burn(request: MsgBurn): Promise; changeAdmin(request: MsgChangeAdmin): Promise; setDenomMetadata(request: MsgSetDenomMetadata): Promise; + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise; forceTransfer(request: MsgForceTransfer): Promise; } export class MsgClientImpl implements Msg { @@ -19,6 +20,7 @@ export class MsgClientImpl implements Msg { this.burn = this.burn.bind(this); this.changeAdmin = this.changeAdmin.bind(this); this.setDenomMetadata = this.setDenomMetadata.bind(this); + this.setBeforeSendHook = this.setBeforeSendHook.bind(this); this.forceTransfer = this.forceTransfer.bind(this); } createDenom(request: MsgCreateDenom): Promise { @@ -46,6 +48,11 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); return promise.then(data => MsgSetDenomMetadataResponse.decode(new BinaryReader(data))); } + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise { + const data = MsgSetBeforeSendHook.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetBeforeSendHook", data); + return promise.then(data => MsgSetBeforeSendHookResponse.decode(new BinaryReader(data))); + } forceTransfer(request: MsgForceTransfer): Promise { const data = MsgForceTransfer.encode(request).finish(); const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "ForceTransfer", data); diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts index 00d5be522..27fff3919 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts @@ -235,6 +235,64 @@ export interface MsgChangeAdminResponseAminoMsg { * MsgChangeAdmin message. */ export interface MsgChangeAdminResponseSDKType {} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHook { + sender: string; + denom: string; + cosmwasmAddress: string; +} +export interface MsgSetBeforeSendHookProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook"; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookAmino { + sender: string; + denom: string; + cosmwasm_address: string; +} +export interface MsgSetBeforeSendHookAminoMsg { + type: "osmosis/tokenfactory/set-before-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 @@ -474,7 +532,7 @@ export const MsgCreateDenomResponse = { function createBaseMsgMint(): MsgMint { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), mintToAddress: "" }; } @@ -616,7 +674,7 @@ export const MsgMintResponse = { function createBaseMsgBurn(): MsgBurn { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), burnFromAddress: "" }; } @@ -897,6 +955,148 @@ export const MsgChangeAdminResponse = { }; } }; +function createBaseMsgSetBeforeSendHook(): MsgSetBeforeSendHook { + return { + sender: "", + denom: "", + cosmwasmAddress: "" + }; +} +export const MsgSetBeforeSendHook = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + encode(message: MsgSetBeforeSendHook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.cosmwasmAddress !== "") { + writer.uint32(26).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetBeforeSendHookAmino): MsgSetBeforeSendHook { + return { + sender: object.sender, + denom: object.denom, + cosmwasmAddress: object.cosmwasm_address + }; + }, + toAmino(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.denom = message.denom; + obj.cosmwasm_address = message.cosmwasmAddress; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookAminoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAminoMsg { + return { + type: "osmosis/tokenfactory/set-before-send-hook", + value: MsgSetBeforeSendHook.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookProtoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHook): Uint8Array { + return MsgSetBeforeSendHook.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(message).finish() + }; + } +}; +function createBaseMsgSetBeforeSendHookResponse(): MsgSetBeforeSendHookResponse { + return {}; +} +export const MsgSetBeforeSendHookResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + encode(_: MsgSetBeforeSendHookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + fromAmino(_: MsgSetBeforeSendHookResponseAmino): MsgSetBeforeSendHookResponse { + return {}; + }, + toAmino(_: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookResponseAminoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAminoMsg { + return { + type: "osmosis/tokenfactory/set-before-send-hook-response", + value: MsgSetBeforeSendHookResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookResponseProtoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHookResponse): Uint8Array { + return MsgSetBeforeSendHookResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + value: MsgSetBeforeSendHookResponse.encode(message).finish() + }; + } +}; function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { return { sender: "", @@ -1032,7 +1232,7 @@ export const MsgSetDenomMetadataResponse = { function createBaseMsgForceTransfer(): MsgForceTransfer { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), transferFromAddress: "", transferToAddress: "" }; diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts index 8110682b1..c546dd77c 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts @@ -54,7 +54,7 @@ export interface GenesisStateSDKType { function createBaseParams(): Params { return { pruneEpochIdentifier: "", - recordHistoryKeepPeriod: undefined + recordHistoryKeepPeriod: Duration.fromPartial({}) }; } export const Params = { diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts index c41f5ab78..7ff42b1fc 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts @@ -214,7 +214,7 @@ function createBaseArithmeticTwapRequest(): ArithmeticTwapRequest { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined, + startTime: new Date(), endTime: undefined }; } @@ -388,7 +388,7 @@ function createBaseArithmeticTwapToNowRequest(): ArithmeticTwapToNowRequest { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined + startTime: new Date() }; } export const ArithmeticTwapToNowRequest = { @@ -552,7 +552,7 @@ function createBaseGeometricTwapRequest(): GeometricTwapRequest { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined, + startTime: new Date(), endTime: undefined }; } @@ -726,7 +726,7 @@ function createBaseGeometricTwapToNowRequest(): GeometricTwapToNowRequest { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined + startTime: new Date() }; } export const GeometricTwapToNowRequest = { diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts index 5f49a13cd..cb430c3a5 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts @@ -114,13 +114,13 @@ function createBaseTwapRecord(): TwapRecord { asset0Denom: "", asset1Denom: "", height: BigInt(0), - time: undefined, + time: new Date(), p0LastSpotPrice: "", p1LastSpotPrice: "", p0ArithmeticTwapAccumulator: "", p1ArithmeticTwapAccumulator: "", geometricTwapAccumulator: "", - lastErrorTime: undefined + lastErrorTime: new Date() }; } export const TwapRecord = { diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts index 615a09480..e65db5f1c 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts @@ -1,57 +1,57 @@ import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** - * 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. + * UpdateFeeTokenProposal is a gov Content type for adding a new whitelisted fee + * token. It must specify a denom along with gamm pool ID to use as a spot price + * calculator. It can be used to add a new denom 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?: string; title: string; description: string; - feetokens: FeeToken[]; + feetoken: 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. + * UpdateFeeTokenProposal is a gov Content type for adding a new whitelisted fee + * token. It must specify a denom along with gamm pool ID to use as a spot price + * calculator. It can be used to add a new denom 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[]; + feetoken?: 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. + * UpdateFeeTokenProposal is a gov Content type for adding a new whitelisted fee + * token. It must specify a denom along with gamm pool ID to use as a spot price + * calculator. It can be used to add a new denom 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?: string; title: string; description: string; - feetokens: FeeTokenSDKType[]; + feetoken: FeeTokenSDKType; } function createBaseUpdateFeeTokenProposal(): UpdateFeeTokenProposal { return { $typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", title: "", description: "", - feetokens: [] + feetoken: FeeToken.fromPartial({}) }; } export const UpdateFeeTokenProposal = { @@ -63,8 +63,8 @@ export const UpdateFeeTokenProposal = { if (message.description !== "") { writer.uint32(18).string(message.description); } - for (const v of message.feetokens) { - FeeToken.encode(v!, writer.uint32(26).fork()).ldelim(); + if (message.feetoken !== undefined) { + FeeToken.encode(message.feetoken, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -82,7 +82,7 @@ export const UpdateFeeTokenProposal = { message.description = reader.string(); break; case 3: - message.feetokens.push(FeeToken.decode(reader, reader.uint32())); + message.feetoken = FeeToken.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -95,25 +95,21 @@ export const UpdateFeeTokenProposal = { const message = createBaseUpdateFeeTokenProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; - message.feetokens = object.feetokens?.map(e => FeeToken.fromPartial(e)) || []; + message.feetoken = object.feetoken !== undefined && object.feetoken !== null ? FeeToken.fromPartial(object.feetoken) : undefined; return message; }, fromAmino(object: UpdateFeeTokenProposalAmino): UpdateFeeTokenProposal { return { title: object.title, description: object.description, - feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromAmino(e)) : [] + feetoken: object?.feetoken ? FeeToken.fromAmino(object.feetoken) : undefined }; }, toAmino(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAmino { const obj: any = {}; obj.title = message.title; obj.description = message.description; - if (message.feetokens) { - obj.feetokens = message.feetokens.map(e => e ? FeeToken.toAmino(e) : undefined); - } else { - obj.feetokens = []; - } + obj.feetoken = message.feetoken ? FeeToken.toAmino(message.feetoken) : undefined; return obj; }, fromAminoMsg(object: UpdateFeeTokenProposalAminoMsg): UpdateFeeTokenProposal { diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts index e48015585..3c18169fe 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts @@ -409,7 +409,7 @@ export const MsgSetValidatorSetPreferenceResponse = { function createBaseMsgDelegateToValidatorSet(): MsgDelegateToValidatorSet { return { delegator: "", - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgDelegateToValidatorSet = { @@ -541,7 +541,7 @@ export const MsgDelegateToValidatorSetResponse = { function createBaseMsgUndelegateFromValidatorSet(): MsgUndelegateFromValidatorSet { return { delegator: "", - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgUndelegateFromValidatorSet = { diff --git a/packages/osmojs/src/codegen/tendermint/abci/types.ts b/packages/osmojs/src/codegen/tendermint/abci/types.ts index 524e9336f..b45124856 100644 --- a/packages/osmojs/src/codegen/tendermint/abci/types.ts +++ b/packages/osmojs/src/codegen/tendermint/abci/types.ts @@ -1,7 +1,7 @@ import { Timestamp } from "../../google/protobuf/timestamp"; +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../types/params"; import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; -import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; @@ -161,40 +161,78 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna return "UNRECOGNIZED"; } } -export enum EvidenceType { +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +export const ResponseProcessProposal_ProposalStatusSDKType = ResponseProcessProposal_ProposalStatus; +export const ResponseProcessProposal_ProposalStatusAmino = ResponseProcessProposal_ProposalStatus; +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } +} +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } -export const EvidenceTypeSDKType = EvidenceType; -export const EvidenceTypeAmino = EvidenceType; -export function evidenceTypeFromJSON(object: any): EvidenceType { +export const MisbehaviorTypeSDKType = MisbehaviorType; +export const MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return MisbehaviorType.UNRECOGNIZED; } } -export function evidenceTypeToJSON(object: EvidenceType): string { +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { - case EvidenceType.UNKNOWN: + case MisbehaviorType.UNKNOWN: return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: + case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: + case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; - case EvidenceType.UNRECOGNIZED: + case MisbehaviorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } @@ -203,7 +241,6 @@ export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; - setOption?: RequestSetOption; initChain?: RequestInitChain; query?: RequestQuery; beginBlock?: RequestBeginBlock; @@ -215,6 +252,8 @@ export interface Request { offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; + prepareProposal?: RequestPrepareProposal; + processProposal?: RequestProcessProposal; } export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; @@ -224,7 +263,6 @@ export interface RequestAmino { echo?: RequestEchoAmino; flush?: RequestFlushAmino; info?: RequestInfoAmino; - set_option?: RequestSetOptionAmino; init_chain?: RequestInitChainAmino; query?: RequestQueryAmino; begin_block?: RequestBeginBlockAmino; @@ -236,6 +274,8 @@ export interface RequestAmino { offer_snapshot?: RequestOfferSnapshotAmino; load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; + prepare_proposal?: RequestPrepareProposalAmino; + process_proposal?: RequestProcessProposalAmino; } export interface RequestAminoMsg { type: "/tendermint.abci.Request"; @@ -245,7 +285,6 @@ export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; - set_option?: RequestSetOptionSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; begin_block?: RequestBeginBlockSDKType; @@ -257,6 +296,8 @@ export interface RequestSDKType { offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; + prepare_proposal?: RequestPrepareProposalSDKType; + process_proposal?: RequestProcessProposalSDKType; } export interface RequestEcho { message: string; @@ -290,6 +331,7 @@ export interface RequestInfo { version: string; blockVersion: bigint; p2pVersion: bigint; + abciVersion: string; } export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; @@ -299,6 +341,7 @@ export interface RequestInfoAmino { version: string; block_version: string; p2p_version: string; + abci_version: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; @@ -308,29 +351,7 @@ export interface RequestInfoSDKType { version: string; block_version: bigint; p2p_version: bigint; -} -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; -} -export interface RequestSetOptionProtoMsg { - typeUrl: "/tendermint.abci.RequestSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface RequestSetOptionAmino { - key: string; - value: string; -} -export interface RequestSetOptionAminoMsg { - type: "/tendermint.abci.RequestSetOption"; - value: RequestSetOptionAmino; -} -/** nondeterministic */ -export interface RequestSetOptionSDKType { - key: string; - value: string; + abci_version: string; } export interface RequestInitChain { time: Date; @@ -393,8 +414,8 @@ export interface RequestQuerySDKType { export interface RequestBeginBlock { hash: Uint8Array; header: Header; - lastCommitInfo: LastCommitInfo; - byzantineValidators: Evidence[]; + lastCommitInfo: CommitInfo; + byzantineValidators: Misbehavior[]; } export interface RequestBeginBlockProtoMsg { typeUrl: "/tendermint.abci.RequestBeginBlock"; @@ -403,8 +424,8 @@ export interface RequestBeginBlockProtoMsg { export interface RequestBeginBlockAmino { hash: Uint8Array; header?: HeaderAmino; - last_commit_info?: LastCommitInfoAmino; - byzantine_validators: EvidenceAmino[]; + last_commit_info?: CommitInfoAmino; + byzantine_validators: MisbehaviorAmino[]; } export interface RequestBeginBlockAminoMsg { type: "/tendermint.abci.RequestBeginBlock"; @@ -413,8 +434,8 @@ export interface RequestBeginBlockAminoMsg { export interface RequestBeginBlockSDKType { hash: Uint8Array; header: HeaderSDKType; - last_commit_info: LastCommitInfoSDKType; - byzantine_validators: EvidenceSDKType[]; + last_commit_info: CommitInfoSDKType; + byzantine_validators: MisbehaviorSDKType[]; } export interface RequestCheckTx { tx: Uint8Array; @@ -574,12 +595,103 @@ export interface RequestApplySnapshotChunkSDKType { chunk: Uint8Array; sender: string; } +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: bigint; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo; + misbehavior: Misbehavior[]; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} +export interface RequestPrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestPrepareProposal"; + value: Uint8Array; +} +export interface RequestPrepareProposalAmino { + /** the modified transactions cannot exceed this size. */ + max_tx_bytes: string; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + local_last_commit?: ExtendedCommitInfoAmino; + misbehavior: MisbehaviorAmino[]; + height: string; + time?: Date; + next_validators_hash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposer_address: Uint8Array; +} +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: Uint8Array[]; + proposed_last_commit?: CommitInfoAmino; + misbehavior: MisbehaviorAmino[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: string; + time?: Date; + next_validators_hash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposer_address: Uint8Array; +} +export interface RequestProcessProposalAminoMsg { + type: "/tendermint.abci.RequestProcessProposal"; + value: RequestProcessProposalAmino; +} +export interface RequestProcessProposalSDKType { + txs: Uint8Array[]; + proposed_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + hash: Uint8Array; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; - setOption?: ResponseSetOption; initChain?: ResponseInitChain; query?: ResponseQuery; beginBlock?: ResponseBeginBlock; @@ -591,6 +703,8 @@ export interface Response { offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; + prepareProposal?: ResponsePrepareProposal; + processProposal?: ResponseProcessProposal; } export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; @@ -601,7 +715,6 @@ export interface ResponseAmino { echo?: ResponseEchoAmino; flush?: ResponseFlushAmino; info?: ResponseInfoAmino; - set_option?: ResponseSetOptionAmino; init_chain?: ResponseInitChainAmino; query?: ResponseQueryAmino; begin_block?: ResponseBeginBlockAmino; @@ -613,6 +726,8 @@ export interface ResponseAmino { offer_snapshot?: ResponseOfferSnapshotAmino; load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; + prepare_proposal?: ResponsePrepareProposalAmino; + process_proposal?: ResponseProcessProposalAmino; } export interface ResponseAminoMsg { type: "/tendermint.abci.Response"; @@ -623,7 +738,6 @@ export interface ResponseSDKType { echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; - set_option?: ResponseSetOptionSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; begin_block?: ResponseBeginBlockSDKType; @@ -635,6 +749,8 @@ export interface ResponseSDKType { offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; + prepare_proposal?: ResponsePrepareProposalSDKType; + process_proposal?: ResponseProcessProposalSDKType; } /** nondeterministic */ export interface ResponseException { @@ -713,34 +829,6 @@ export interface ResponseInfoSDKType { last_block_height: bigint; last_block_app_hash: Uint8Array; } -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionProtoMsg { - typeUrl: "/tendermint.abci.ResponseSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface ResponseSetOptionAmino { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionAminoMsg { - type: "/tendermint.abci.ResponseSetOption"; - value: ResponseSetOptionAmino; -} -/** nondeterministic */ -export interface ResponseSetOptionSDKType { - code: number; - log: string; - info: string; -} export interface ResponseInitChain { consensusParams: ConsensusParams; validators: ValidatorUpdate[]; @@ -837,6 +925,13 @@ export interface ResponseCheckTx { gasUsed: bigint; events: Event[]; codespace: string; + sender: string; + priority: bigint; + /** + * mempool_error is set by Tendermint. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempoolError: string; } export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; @@ -853,6 +948,13 @@ export interface ResponseCheckTxAmino { gas_used: string; events: EventAmino[]; codespace: string; + sender: string; + priority: string; + /** + * mempool_error is set by Tendermint. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempool_error: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; @@ -867,6 +969,9 @@ export interface ResponseCheckTxSDKType { gas_used: bigint; events: EventSDKType[]; codespace: string; + sender: string; + priority: bigint; + mempool_error: string; } export interface ResponseDeliverTx { code: number; @@ -1033,91 +1138,90 @@ export interface ResponseApplySnapshotChunkSDKType { refetch_chunks: number[]; reject_senders: string[]; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; -} -export interface ConsensusParamsProtoMsg { - typeUrl: "/tendermint.abci.ConsensusParams"; +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; +export interface ResponsePrepareProposalAmino { + txs: Uint8Array[]; } -export interface ConsensusParamsAminoMsg { - type: "/tendermint.abci.ConsensusParams"; - value: ConsensusParamsAmino; +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; -} -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - maxBytes: bigint; - /** Note: must be greater or equal to -1 */ - maxGas: bigint; -} -export interface BlockParamsProtoMsg { - typeUrl: "/tendermint.abci.BlockParams"; +export interface ResponsePrepareProposalSDKType { + txs: Uint8Array[]; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** Note: must be greater than 0 */ - max_bytes: string; - /** Note: must be greater or equal to -1 */ - max_gas: string; +export interface ResponseProcessProposalAmino { + status: ResponseProcessProposal_ProposalStatus; } -export interface BlockParamsAminoMsg { - type: "/tendermint.abci.BlockParams"; - value: BlockParamsAmino; +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsSDKType { - max_bytes: bigint; - max_gas: bigint; +export interface ResponseProcessProposalSDKType { + status: ResponseProcessProposal_ProposalStatus; } -export interface LastCommitInfo { +export interface CommitInfo { round: number; votes: VoteInfo[]; } -export interface LastCommitInfoProtoMsg { - typeUrl: "/tendermint.abci.LastCommitInfo"; +export interface CommitInfoProtoMsg { + typeUrl: "/tendermint.abci.CommitInfo"; value: Uint8Array; } -export interface LastCommitInfoAmino { +export interface CommitInfoAmino { round: number; votes: VoteInfoAmino[]; } -export interface LastCommitInfoAminoMsg { - type: "/tendermint.abci.LastCommitInfo"; - value: LastCommitInfoAmino; +export interface CommitInfoAminoMsg { + type: "/tendermint.abci.CommitInfo"; + value: CommitInfoAmino; } -export interface LastCommitInfoSDKType { +export interface CommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; } +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} +export interface ExtendedCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedCommitInfo"; + value: Uint8Array; +} +export interface ExtendedCommitInfoAmino { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfoAmino[]; +} +export interface ExtendedCommitInfoAminoMsg { + type: "/tendermint.abci.ExtendedCommitInfo"; + value: ExtendedCommitInfoAmino; +} +export interface ExtendedCommitInfoSDKType { + round: number; + votes: ExtendedVoteInfoSDKType[]; +} /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -1155,8 +1259,8 @@ export interface EventSDKType { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -1166,8 +1270,8 @@ export interface EventAttributeProtoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeAmino { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -1177,8 +1281,8 @@ export interface EventAttributeAminoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; index: boolean; } /** @@ -1301,8 +1405,33 @@ export interface VoteInfoSDKType { validator: ValidatorSDKType; signed_last_block: boolean; } -export interface Evidence { - type: EvidenceType; +export interface ExtendedVoteInfo { + validator: Validator; + signedLastBlock: boolean; + /** Reserved for future use */ + voteExtension: Uint8Array; +} +export interface ExtendedVoteInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedVoteInfo"; + value: Uint8Array; +} +export interface ExtendedVoteInfoAmino { + validator?: ValidatorAmino; + signed_last_block: boolean; + /** Reserved for future use */ + vote_extension: Uint8Array; +} +export interface ExtendedVoteInfoAminoMsg { + type: "/tendermint.abci.ExtendedVoteInfo"; + value: ExtendedVoteInfoAmino; +} +export interface ExtendedVoteInfoSDKType { + validator: ValidatorSDKType; + signed_last_block: boolean; + vote_extension: Uint8Array; +} +export interface Misbehavior { + type: MisbehaviorType; /** The offending validator */ validator: Validator; /** The height when the offense occurred */ @@ -1316,12 +1445,12 @@ export interface Evidence { */ totalVotingPower: bigint; } -export interface EvidenceProtoMsg { - typeUrl: "/tendermint.abci.Evidence"; +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; } -export interface EvidenceAmino { - type: EvidenceType; +export interface MisbehaviorAmino { + type: MisbehaviorType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ @@ -1335,12 +1464,12 @@ export interface EvidenceAmino { */ total_voting_power: string; } -export interface EvidenceAminoMsg { - type: "/tendermint.abci.Evidence"; - value: EvidenceAmino; +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; } -export interface EvidenceSDKType { - type: EvidenceType; +export interface MisbehaviorSDKType { + type: MisbehaviorType; validator: ValidatorSDKType; height: bigint; time: Date; @@ -1390,7 +1519,6 @@ function createBaseRequest(): Request { echo: undefined, flush: undefined, info: undefined, - setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, @@ -1401,7 +1529,9 @@ function createBaseRequest(): Request { listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined }; } export const Request = { @@ -1416,9 +1546,6 @@ export const Request = { if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } - if (message.setOption !== undefined) { - RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); - } if (message.initChain !== undefined) { RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } @@ -1452,6 +1579,12 @@ export const Request = { if (message.applySnapshotChunk !== undefined) { RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Request { @@ -1470,9 +1603,6 @@ export const Request = { case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; - case 4: - message.setOption = RequestSetOption.decode(reader, reader.uint32()); - break; case 5: message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; @@ -1506,6 +1636,12 @@ export const Request = { case 15: message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1518,7 +1654,6 @@ export const Request = { message.echo = object.echo !== undefined && object.echo !== null ? RequestEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? RequestFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? RequestInfo.fromPartial(object.info) : undefined; - message.setOption = object.setOption !== undefined && object.setOption !== null ? RequestSetOption.fromPartial(object.setOption) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? RequestInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? RequestQuery.fromPartial(object.query) : undefined; message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? RequestBeginBlock.fromPartial(object.beginBlock) : undefined; @@ -1530,6 +1665,8 @@ export const Request = { message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? RequestProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: RequestAmino): Request { @@ -1537,7 +1674,6 @@ export const Request = { echo: object?.echo ? RequestEcho.fromAmino(object.echo) : undefined, flush: object?.flush ? RequestFlush.fromAmino(object.flush) : undefined, info: object?.info ? RequestInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? RequestSetOption.fromAmino(object.set_option) : undefined, initChain: object?.init_chain ? RequestInitChain.fromAmino(object.init_chain) : undefined, query: object?.query ? RequestQuery.fromAmino(object.query) : undefined, beginBlock: object?.begin_block ? RequestBeginBlock.fromAmino(object.begin_block) : undefined, @@ -1548,7 +1684,9 @@ export const Request = { listSnapshots: object?.list_snapshots ? RequestListSnapshots.fromAmino(object.list_snapshots) : undefined, offerSnapshot: object?.offer_snapshot ? RequestOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, loadSnapshotChunk: object?.load_snapshot_chunk ? RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined + applySnapshotChunk: object?.apply_snapshot_chunk ? RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined, + prepareProposal: object?.prepare_proposal ? RequestPrepareProposal.fromAmino(object.prepare_proposal) : undefined, + processProposal: object?.process_proposal ? RequestProcessProposal.fromAmino(object.process_proposal) : undefined }; }, toAmino(message: Request): RequestAmino { @@ -1556,7 +1694,6 @@ export const Request = { obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; @@ -1568,6 +1705,8 @@ export const Request = { obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? RequestPrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? RequestProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: RequestAminoMsg): Request { @@ -1700,7 +1839,8 @@ function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: BigInt(0), - p2pVersion: BigInt(0) + p2pVersion: BigInt(0), + abciVersion: "" }; } export const RequestInfo = { @@ -1715,6 +1855,9 @@ export const RequestInfo = { if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { @@ -1733,6 +1876,9 @@ export const RequestInfo = { case 3: message.p2pVersion = reader.uint64(); break; + case 4: + message.abciVersion = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1745,13 +1891,15 @@ export const RequestInfo = { message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); + message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { return { version: object.version, blockVersion: BigInt(object.block_version), - p2pVersion: BigInt(object.p2p_version) + p2pVersion: BigInt(object.p2p_version), + abciVersion: object.abci_version }; }, toAmino(message: RequestInfo): RequestInfoAmino { @@ -1759,6 +1907,7 @@ export const RequestInfo = { obj.version = message.version; obj.block_version = message.blockVersion ? message.blockVersion.toString() : undefined; obj.p2p_version = message.p2pVersion ? message.p2pVersion.toString() : undefined; + obj.abci_version = message.abciVersion; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { @@ -1777,80 +1926,9 @@ export const RequestInfo = { }; } }; -function createBaseRequestSetOption(): RequestSetOption { - return { - key: "", - value: "" - }; -} -export const RequestSetOption = { - typeUrl: "/tendermint.abci.RequestSetOption", - encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestSetOption { - const message = createBaseRequestSetOption(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, - fromAmino(object: RequestSetOptionAmino): RequestSetOption { - return { - key: object.key, - value: object.value - }; - }, - toAmino(message: RequestSetOption): RequestSetOptionAmino { - const obj: any = {}; - obj.key = message.key; - obj.value = message.value; - return obj; - }, - fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { - return RequestSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { - return RequestSetOption.decode(message.value); - }, - toProto(message: RequestSetOption): Uint8Array { - return RequestSetOption.encode(message).finish(); - }, - toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestSetOption", - value: RequestSetOption.encode(message).finish() - }; - } -}; function createBaseRequestInitChain(): RequestInitChain { return { - time: undefined, + time: new Date(), chainId: "", consensusParams: ConsensusParams.fromPartial({}), validators: [], @@ -2058,7 +2136,7 @@ function createBaseRequestBeginBlock(): RequestBeginBlock { return { hash: new Uint8Array(), header: Header.fromPartial({}), - lastCommitInfo: LastCommitInfo.fromPartial({}), + lastCommitInfo: CommitInfo.fromPartial({}), byzantineValidators: [] }; } @@ -2072,10 +2150,10 @@ export const RequestBeginBlock = { Header.encode(message.header, writer.uint32(18).fork()).ldelim(); } if (message.lastCommitInfo !== undefined) { - LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); } for (const v of message.byzantineValidators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -2093,10 +2171,10 @@ export const RequestBeginBlock = { message.header = Header.decode(reader, reader.uint32()); break; case 3: - message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()); break; case 4: - message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2109,25 +2187,25 @@ export const RequestBeginBlock = { const message = createBaseRequestBeginBlock(); message.hash = object.hash ?? new Uint8Array(); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; - message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? LastCommitInfo.fromPartial(object.lastCommitInfo) : undefined; - message.byzantineValidators = object.byzantineValidators?.map(e => Evidence.fromPartial(e)) || []; + message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? CommitInfo.fromPartial(object.lastCommitInfo) : undefined; + message.byzantineValidators = object.byzantineValidators?.map(e => Misbehavior.fromPartial(e)) || []; return message; }, fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { return { hash: object.hash, header: object?.header ? Header.fromAmino(object.header) : undefined, - lastCommitInfo: object?.last_commit_info ? LastCommitInfo.fromAmino(object.last_commit_info) : undefined, - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Evidence.fromAmino(e)) : [] + lastCommitInfo: object?.last_commit_info ? CommitInfo.fromAmino(object.last_commit_info) : undefined, + byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Misbehavior.fromAmino(e)) : [] }; }, toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { const obj: any = {}; obj.hash = message.hash; obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; + obj.last_commit_info = message.lastCommitInfo ? CommitInfo.toAmino(message.lastCommitInfo) : undefined; if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { obj.byzantine_validators = []; } @@ -2673,76 +2751,358 @@ export const RequestApplySnapshotChunk = { }; } }; -function createBaseResponse(): Response { +function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { - exception: undefined, - echo: undefined, - flush: undefined, - info: undefined, - setOption: undefined, - initChain: undefined, - query: undefined, - beginBlock: undefined, - checkTx: undefined, - deliverTx: undefined, - endBlock: undefined, - commit: undefined, - listSnapshots: undefined, - offerSnapshot: undefined, - loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const Response = { - typeUrl: "/tendermint.abci.Response", - encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.exception !== undefined) { - ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); - } - 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(); +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); } - if (message.info !== undefined) { - ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); - } - if (message.setOption !== undefined) { - ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); - } - if (message.initChain !== undefined) { - ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); - } - 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(); + for (const v of message.txs) { + writer.uint32(18).bytes(v!); } - if (message.endBlock !== undefined) { - ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); } - if (message.commit !== undefined) { - ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.listSnapshots !== undefined) { - ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); } - if (message.offerSnapshot !== undefined) { - ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); } - if (message.loadSnapshotChunk !== undefined) { - ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); } - if (message.applySnapshotChunk !== undefined) { - ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = reader.int64(); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? BigInt(object.maxTxBytes.toString()) : BigInt(0); + message.txs = object.txs?.map(e => e) || []; + message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestPrepareProposalAmino): RequestPrepareProposal { + return { + maxTxBytes: BigInt(object.max_tx_bytes), + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [], + localLastCommit: object?.local_last_commit ? ExtendedCommitInfo.fromAmino(object.local_last_commit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromAmino(e)) : [], + height: BigInt(object.height), + time: object.time, + nextValidatorsHash: object.next_validators_hash, + proposerAddress: object.proposer_address + }; + }, + toAmino(message: RequestPrepareProposal): RequestPrepareProposalAmino { + const obj: any = {}; + obj.max_tx_bytes = message.maxTxBytes ? message.maxTxBytes.toString() : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => e); + } else { + obj.txs = []; + } + obj.local_last_commit = message.localLastCommit ? ExtendedCommitInfo.toAmino(message.localLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time; + obj.next_validators_hash = message.nextValidatorsHash; + obj.proposer_address = message.proposerAddress; + return obj; + }, + fromAminoMsg(object: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); + }, + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() + }; + } +}; +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => e) || []; + message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestProcessProposalAmino): RequestProcessProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [], + proposedLastCommit: object?.proposed_last_commit ? CommitInfo.fromAmino(object.proposed_last_commit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromAmino(e)) : [], + hash: object.hash, + height: BigInt(object.height), + time: object.time, + nextValidatorsHash: object.next_validators_hash, + proposerAddress: object.proposer_address + }; + }, + toAmino(message: RequestProcessProposal): RequestProcessProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e); + } else { + obj.txs = []; + } + obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.hash = message.hash; + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time; + obj.next_validators_hash = message.nextValidatorsHash; + obj.proposer_address = message.proposerAddress; + return obj; + }, + fromAminoMsg(object: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); + }, + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() + }; + } +}; +function createBaseResponse(): Response { + return { + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + 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", + 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; }, @@ -2765,9 +3125,6 @@ export const Response = { case 4: message.info = ResponseInfo.decode(reader, reader.uint32()); break; - case 5: - message.setOption = ResponseSetOption.decode(reader, reader.uint32()); - break; case 6: message.initChain = ResponseInitChain.decode(reader, reader.uint32()); break; @@ -2801,6 +3158,12 @@ export const Response = { case 16: message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2814,7 +3177,6 @@ export const Response = { message.echo = object.echo !== undefined && object.echo !== null ? ResponseEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? ResponseFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? ResponseInfo.fromPartial(object.info) : undefined; - message.setOption = object.setOption !== undefined && object.setOption !== null ? ResponseSetOption.fromPartial(object.setOption) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? ResponseInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? ResponseQuery.fromPartial(object.query) : undefined; message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? ResponseBeginBlock.fromPartial(object.beginBlock) : undefined; @@ -2826,6 +3188,8 @@ export const Response = { message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? ResponsePrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? ResponseProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: ResponseAmino): Response { @@ -2834,7 +3198,6 @@ export const Response = { echo: object?.echo ? ResponseEcho.fromAmino(object.echo) : undefined, flush: object?.flush ? ResponseFlush.fromAmino(object.flush) : undefined, info: object?.info ? ResponseInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? ResponseSetOption.fromAmino(object.set_option) : undefined, initChain: object?.init_chain ? ResponseInitChain.fromAmino(object.init_chain) : undefined, query: object?.query ? ResponseQuery.fromAmino(object.query) : undefined, beginBlock: object?.begin_block ? ResponseBeginBlock.fromAmino(object.begin_block) : undefined, @@ -2845,7 +3208,9 @@ export const Response = { listSnapshots: object?.list_snapshots ? ResponseListSnapshots.fromAmino(object.list_snapshots) : undefined, offerSnapshot: object?.offer_snapshot ? ResponseOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, loadSnapshotChunk: object?.load_snapshot_chunk ? ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined + applySnapshotChunk: object?.apply_snapshot_chunk ? ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined, + prepareProposal: object?.prepare_proposal ? ResponsePrepareProposal.fromAmino(object.prepare_proposal) : undefined, + processProposal: object?.process_proposal ? ResponseProcessProposal.fromAmino(object.process_proposal) : undefined }; }, toAmino(message: Response): ResponseAmino { @@ -2854,7 +3219,6 @@ export const Response = { obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; @@ -2866,6 +3230,8 @@ export const Response = { obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? ResponsePrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? ResponseProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: ResponseAminoMsg): Response { @@ -3156,87 +3522,6 @@ export const ResponseInfo = { }; } }; -function createBaseResponseSetOption(): ResponseSetOption { - return { - code: 0, - log: "", - info: "" - }; -} -export const ResponseSetOption = { - typeUrl: "/tendermint.abci.ResponseSetOption", - encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ResponseSetOption { - const message = createBaseResponseSetOption(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - return message; - }, - fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { - return { - code: object.code, - log: object.log, - info: object.info - }; - }, - toAmino(message: ResponseSetOption): ResponseSetOptionAmino { - const obj: any = {}; - obj.code = message.code; - obj.log = message.log; - obj.info = message.info; - return obj; - }, - fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { - return ResponseSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { - return ResponseSetOption.decode(message.value); - }, - toProto(message: ResponseSetOption): Uint8Array { - return ResponseSetOption.encode(message).finish(); - }, - toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.ResponseSetOption", - value: ResponseSetOption.encode(message).finish() - }; - } -}; function createBaseResponseInitChain(): ResponseInitChain { return { consensusParams: ConsensusParams.fromPartial({}), @@ -3537,7 +3822,10 @@ function createBaseResponseCheckTx(): ResponseCheckTx { gasWanted: BigInt(0), gasUsed: BigInt(0), events: [], - codespace: "" + codespace: "", + sender: "", + priority: BigInt(0), + mempoolError: "" }; } export const ResponseCheckTx = { @@ -3567,6 +3855,15 @@ export const ResponseCheckTx = { if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.priority !== BigInt(0)) { + writer.uint32(80).int64(message.priority); + } + if (message.mempoolError !== "") { + writer.uint32(90).string(message.mempoolError); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { @@ -3600,6 +3897,15 @@ export const ResponseCheckTx = { case 8: message.codespace = reader.string(); break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.priority = reader.int64(); + break; + case 11: + message.mempoolError = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3617,6 +3923,9 @@ export const ResponseCheckTx = { message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; + message.sender = object.sender ?? ""; + message.priority = object.priority !== undefined && object.priority !== null ? BigInt(object.priority.toString()) : BigInt(0); + message.mempoolError = object.mempoolError ?? ""; return message; }, fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { @@ -3628,7 +3937,10 @@ export const ResponseCheckTx = { gasWanted: BigInt(object.gas_wanted), gasUsed: BigInt(object.gas_used), events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace + codespace: object.codespace, + sender: object.sender, + priority: BigInt(object.priority), + mempoolError: object.mempool_error }; }, toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { @@ -3645,6 +3957,9 @@ export const ResponseCheckTx = { obj.events = []; } obj.codespace = message.codespace; + obj.sender = message.sender; + obj.priority = message.priority ? message.priority.toString() : undefined; + obj.mempool_error = message.mempoolError; return obj; }, fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { @@ -4243,49 +4558,93 @@ export const ResponseApplySnapshotChunk = { }; } }; -function createBaseConsensusParams(): ConsensusParams { +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + txs: [] }; } -export const ConsensusParams = { - typeUrl: "/tendermint.abci.ConsensusParams", - encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + return message; + }, + fromPartial(object: Partial): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponsePrepareProposalAmino): ResponsePrepareProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [] + }; + }, + toAmino(message: ResponsePrepareProposal): ResponsePrepareProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e); + } else { + obj.txs = []; } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + return obj; + }, + fromAminoMsg(object: ResponsePrepareProposalAminoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: ResponsePrepareProposalProtoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.decode(message.value); + }, + toProto(message: ResponsePrepareProposal): Uint8Array { + return ResponsePrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: ResponsePrepareProposal): ResponsePrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + value: ResponsePrepareProposal.encode(message).finish() + }; + } +}; +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const message = createBaseResponseProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); + message.status = (reader.int32() as any); break; default: reader.skipType(tag & 7); @@ -4294,75 +4653,66 @@ export const ConsensusParams = { } return message; }, - fromPartial(object: Partial): ConsensusParams { - const message = createBaseConsensusParams(); - message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; - message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; - message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; - message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; + fromPartial(object: Partial): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; return message; }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { + fromAmino(object: ResponseProcessProposalAmino): ResponseProcessProposal { return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined + status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : -1 }; }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { + toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; - obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; - obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + obj.status = message.status; return obj; }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); + fromAminoMsg(object: ResponseProcessProposalAminoMsg): ResponseProcessProposal { + return ResponseProcessProposal.fromAmino(object.value); }, - fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { - return ConsensusParams.decode(message.value); + fromProtoMsg(message: ResponseProcessProposalProtoMsg): ResponseProcessProposal { + return ResponseProcessProposal.decode(message.value); }, - toProto(message: ConsensusParams): Uint8Array { - return ConsensusParams.encode(message).finish(); + toProto(message: ResponseProcessProposal): Uint8Array { + return ResponseProcessProposal.encode(message).finish(); }, - toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + toProtoMsg(message: ResponseProcessProposal): ResponseProcessProposalProtoMsg { return { - typeUrl: "/tendermint.abci.ConsensusParams", - value: ConsensusParams.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseProcessProposal", + value: ResponseProcessProposal.encode(message).finish() }; } }; -function createBaseBlockParams(): BlockParams { +function createBaseCommitInfo(): CommitInfo { return { - maxBytes: BigInt(0), - maxGas: BigInt(0) + round: 0, + votes: [] }; } -export const BlockParams = { - typeUrl: "/tendermint.abci.BlockParams", - encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.maxBytes !== BigInt(0)) { - writer.uint32(8).int64(message.maxBytes); +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); } - if (message.maxGas !== BigInt(0)) { - writer.uint32(16).int64(message.maxGas); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64(); + message.round = reader.int32(); break; case 2: - message.maxGas = reader.int64(); + message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4371,61 +4721,65 @@ export const BlockParams = { } return message; }, - fromPartial(object: Partial): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); - message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); + fromPartial(object: Partial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: BlockParamsAmino): BlockParams { + fromAmino(object: CommitInfoAmino): CommitInfo { return { - maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas) + round: object.round, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromAmino(e)) : [] }; }, - toAmino(message: BlockParams): BlockParamsAmino { + toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; - obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; + obj.round = message.round; + if (message.votes) { + obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + } else { + obj.votes = []; + } return obj; }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { - return BlockParams.decode(message.value); + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); }, - toProto(message: BlockParams): Uint8Array { - return BlockParams.encode(message).finish(); + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); }, - toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.BlockParams", - value: BlockParams.encode(message).finish() + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() }; } }; -function createBaseLastCommitInfo(): LastCommitInfo { +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { return { round: 0, votes: [] }; } -export const LastCommitInfo = { - typeUrl: "/tendermint.abci.LastCommitInfo", - encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LastCommitInfo { + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastCommitInfo(); + const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4433,7 +4787,7 @@ export const LastCommitInfo = { message.round = reader.int32(); break; case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4442,41 +4796,41 @@ export const LastCommitInfo = { } return message; }, - fromPartial(object: Partial): LastCommitInfo { - const message = createBaseLastCommitInfo(); + fromPartial(object: Partial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; - message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: LastCommitInfoAmino): LastCommitInfo { + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { return { round: object.round, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromAmino(e)) : [] + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromAmino(e)) : [] }; }, - toAmino(message: LastCommitInfo): LastCommitInfoAmino { + toAmino(message: ExtendedCommitInfo): ExtendedCommitInfoAmino { const obj: any = {}; obj.round = message.round; if (message.votes) { - obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toAmino(e) : undefined); } else { obj.votes = []; } return obj; }, - fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { - return LastCommitInfo.fromAmino(object.value); + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { - return LastCommitInfo.decode(message.value); + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); }, - toProto(message: LastCommitInfo): Uint8Array { - return LastCommitInfo.encode(message).finish(); + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); }, - toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.LastCommitInfo", - value: LastCommitInfo.encode(message).finish() + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() }; } }; @@ -4557,19 +4911,19 @@ export const Event = { }; function createBaseEventAttribute(): EventAttribute { return { - key: new Uint8Array(), - value: new Uint8Array(), + key: "", + value: "", index: false }; } export const EventAttribute = { typeUrl: "/tendermint.abci.EventAttribute", encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + if (message.key !== "") { + writer.uint32(10).string(message.key); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + if (message.value !== "") { + writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); @@ -4584,10 +4938,10 @@ export const EventAttribute = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.bytes(); + message.key = reader.string(); break; case 2: - message.value = reader.bytes(); + message.value = reader.string(); break; case 3: message.index = reader.bool(); @@ -4601,8 +4955,8 @@ export const EventAttribute = { }, fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; message.index = object.index ?? false; return message; }, @@ -4940,18 +5294,99 @@ export const VoteInfo = { }; } }; -function createBaseEvidence(): Evidence { +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + signedLastBlock: false, + voteExtension: new Uint8Array() + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtendedVoteInfoAmino): ExtendedVoteInfo { + return { + validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, + signedLastBlock: object.signed_last_block, + voteExtension: object.vote_extension + }; + }, + toAmino(message: ExtendedVoteInfo): ExtendedVoteInfoAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.signed_last_block = message.signedLastBlock; + obj.vote_extension = message.voteExtension; + return obj; + }, + fromAminoMsg(object: ExtendedVoteInfoAminoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedVoteInfoProtoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.decode(message.value); + }, + toProto(message: ExtendedVoteInfo): Uint8Array { + return ExtendedVoteInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedVoteInfo): ExtendedVoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + value: ExtendedVoteInfo.encode(message).finish() + }; + } +}; +function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), height: BigInt(0), - time: undefined, + time: new Date(), totalVotingPower: BigInt(0) }; } -export const Evidence = { - typeUrl: "/tendermint.abci.Evidence", - encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -4969,10 +5404,10 @@ export const Evidence = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4998,8 +5433,8 @@ export const Evidence = { } return message; }, - fromPartial(object: Partial): Evidence { - const message = createBaseEvidence(); + fromPartial(object: Partial): Misbehavior { + const message = createBaseMisbehavior(); message.type = object.type ?? 0; message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -5007,16 +5442,16 @@ export const Evidence = { message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, - fromAmino(object: EvidenceAmino): Evidence { + fromAmino(object: MisbehaviorAmino): Misbehavior { return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, + type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : -1, validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, height: BigInt(object.height), time: object.time, totalVotingPower: BigInt(object.total_voting_power) }; }, - toAmino(message: Evidence): EvidenceAmino { + toAmino(message: Misbehavior): MisbehaviorAmino { const obj: any = {}; obj.type = message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; @@ -5025,19 +5460,19 @@ export const Evidence = { obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); }, - fromProtoMsg(message: EvidenceProtoMsg): Evidence { - return Evidence.decode(message.value); + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); }, - toProto(message: Evidence): Uint8Array { - return Evidence.encode(message).finish(); + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); }, - toProtoMsg(message: Evidence): EvidenceProtoMsg { + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { return { - typeUrl: "/tendermint.abci.Evidence", - value: Evidence.encode(message).finish() + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() }; } }; diff --git a/packages/osmojs/src/codegen/tendermint/bundle.ts b/packages/osmojs/src/codegen/tendermint/bundle.ts index a1405caeb..8ee59c40d 100644 --- a/packages/osmojs/src/codegen/tendermint/bundle.ts +++ b/packages/osmojs/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _179 from "./abci/types"; -import * as _180 from "./crypto/keys"; -import * as _181 from "./crypto/proof"; -import * as _182 from "./libs/bits/types"; -import * as _183 from "./p2p/types"; -import * as _184 from "./types/block"; -import * as _185 from "./types/evidence"; -import * as _186 from "./types/params"; -import * as _187 from "./types/types"; -import * as _188 from "./types/validator"; -import * as _189 from "./version/types"; +import * as _42 from "./abci/types"; +import * as _43 from "./crypto/keys"; +import * as _44 from "./crypto/proof"; +import * as _45 from "./libs/bits/types"; +import * as _46 from "./p2p/types"; +import * as _47 from "./types/block"; +import * as _48 from "./types/evidence"; +import * as _49 from "./types/params"; +import * as _50 from "./types/types"; +import * as _51 from "./types/validator"; +import * as _52 from "./version/types"; export namespace tendermint { export const abci = { - ..._179 + ..._42 }; export const crypto = { - ..._180, - ..._181 + ..._43, + ..._44 }; export namespace libs { export const bits = { - ..._182 + ..._45 }; } export const p2p = { - ..._183 + ..._46 }; export const types = { - ..._184, - ..._185, - ..._186, - ..._187, - ..._188 + ..._47, + ..._48, + ..._49, + ..._50, + ..._51 }; export const version = { - ..._189 + ..._52 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/p2p/types.ts b/packages/osmojs/src/codegen/tendermint/p2p/types.ts index c0c2a8c28..c1d82e749 100644 --- a/packages/osmojs/src/codegen/tendermint/p2p/types.ts +++ b/packages/osmojs/src/codegen/tendermint/p2p/types.ts @@ -1,6 +1,27 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +export interface NetAddress { + id: string; + ip: string; + port: number; +} +export interface NetAddressProtoMsg { + typeUrl: "/tendermint.p2p.NetAddress"; + value: Uint8Array; +} +export interface NetAddressAmino { + id: string; + ip: string; + port: number; +} +export interface NetAddressAminoMsg { + type: "/tendermint.p2p.NetAddress"; + value: NetAddressAmino; +} +export interface NetAddressSDKType { + id: string; + ip: string; + port: number; +} export interface ProtocolVersion { p2p: bigint; block: bigint; @@ -24,113 +45,145 @@ export interface ProtocolVersionSDKType { block: bigint; app: bigint; } -export interface NodeInfo { +export interface DefaultNodeInfo { protocolVersion: ProtocolVersion; - nodeId: string; + defaultNodeId: string; listenAddr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOther; + other: DefaultNodeInfoOther; } -export interface NodeInfoProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfo"; +export interface DefaultNodeInfoProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfo"; value: Uint8Array; } -export interface NodeInfoAmino { +export interface DefaultNodeInfoAmino { protocol_version?: ProtocolVersionAmino; - node_id: string; + default_node_id: string; listen_addr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other?: NodeInfoOtherAmino; + other?: DefaultNodeInfoOtherAmino; } -export interface NodeInfoAminoMsg { - type: "/tendermint.p2p.NodeInfo"; - value: NodeInfoAmino; +export interface DefaultNodeInfoAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfo"; + value: DefaultNodeInfoAmino; } -export interface NodeInfoSDKType { +export interface DefaultNodeInfoSDKType { protocol_version: ProtocolVersionSDKType; - node_id: string; + default_node_id: string; listen_addr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOtherSDKType; + other: DefaultNodeInfoOtherSDKType; } -export interface NodeInfoOther { +export interface DefaultNodeInfoOther { txIndex: string; rpcAddress: string; } -export interface NodeInfoOtherProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfoOther"; +export interface DefaultNodeInfoOtherProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther"; value: Uint8Array; } -export interface NodeInfoOtherAmino { +export interface DefaultNodeInfoOtherAmino { tx_index: string; rpc_address: string; } -export interface NodeInfoOtherAminoMsg { - type: "/tendermint.p2p.NodeInfoOther"; - value: NodeInfoOtherAmino; +export interface DefaultNodeInfoOtherAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfoOther"; + value: DefaultNodeInfoOtherAmino; } -export interface NodeInfoOtherSDKType { +export interface DefaultNodeInfoOtherSDKType { tx_index: string; rpc_address: string; } -export interface PeerInfo { - id: string; - addressInfo: PeerAddressInfo[]; - lastConnected: Date; -} -export interface PeerInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerInfo"; - value: Uint8Array; -} -export interface PeerInfoAmino { - id: string; - address_info: PeerAddressInfoAmino[]; - last_connected?: Date; -} -export interface PeerInfoAminoMsg { - type: "/tendermint.p2p.PeerInfo"; - value: PeerInfoAmino; -} -export interface PeerInfoSDKType { - id: string; - address_info: PeerAddressInfoSDKType[]; - last_connected: Date; -} -export interface PeerAddressInfo { - address: string; - lastDialSuccess: Date; - lastDialFailure: Date; - dialFailures: number; -} -export interface PeerAddressInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerAddressInfo"; - value: Uint8Array; -} -export interface PeerAddressInfoAmino { - address: string; - last_dial_success?: Date; - last_dial_failure?: Date; - dial_failures: number; -} -export interface PeerAddressInfoAminoMsg { - type: "/tendermint.p2p.PeerAddressInfo"; - value: PeerAddressInfoAmino; -} -export interface PeerAddressInfoSDKType { - address: string; - last_dial_success: Date; - last_dial_failure: Date; - dial_failures: number; +function createBaseNetAddress(): NetAddress { + return { + id: "", + ip: "", + port: 0 + }; } +export const NetAddress = { + typeUrl: "/tendermint.p2p.NetAddress", + encode(message: NetAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.ip !== "") { + writer.uint32(18).string(message.ip); + } + if (message.port !== 0) { + writer.uint32(24).uint32(message.port); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNetAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NetAddress { + const message = createBaseNetAddress(); + message.id = object.id ?? ""; + message.ip = object.ip ?? ""; + message.port = object.port ?? 0; + return message; + }, + fromAmino(object: NetAddressAmino): NetAddress { + return { + id: object.id, + ip: object.ip, + port: object.port + }; + }, + toAmino(message: NetAddress): NetAddressAmino { + const obj: any = {}; + obj.id = message.id; + obj.ip = message.ip; + obj.port = message.port; + return obj; + }, + fromAminoMsg(object: NetAddressAminoMsg): NetAddress { + return NetAddress.fromAmino(object.value); + }, + fromProtoMsg(message: NetAddressProtoMsg): NetAddress { + return NetAddress.decode(message.value); + }, + toProto(message: NetAddress): Uint8Array { + return NetAddress.encode(message).finish(); + }, + toProtoMsg(message: NetAddress): NetAddressProtoMsg { + return { + typeUrl: "/tendermint.p2p.NetAddress", + value: NetAddress.encode(message).finish() + }; + } +}; function createBaseProtocolVersion(): ProtocolVersion { return { p2p: BigInt(0), @@ -212,26 +265,26 @@ export const ProtocolVersion = { }; } }; -function createBaseNodeInfo(): NodeInfo { +function createBaseDefaultNodeInfo(): DefaultNodeInfo { return { protocolVersion: ProtocolVersion.fromPartial({}), - nodeId: "", + defaultNodeId: "", listenAddr: "", network: "", version: "", channels: new Uint8Array(), moniker: "", - other: NodeInfoOther.fromPartial({}) + other: DefaultNodeInfoOther.fromPartial({}) }; } -export const NodeInfo = { - typeUrl: "/tendermint.p2p.NodeInfo", - encode(message: NodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfo = { + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + encode(message: DefaultNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocolVersion !== undefined) { ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } - if (message.nodeId !== "") { - writer.uint32(18).string(message.nodeId); + if (message.defaultNodeId !== "") { + writer.uint32(18).string(message.defaultNodeId); } if (message.listenAddr !== "") { writer.uint32(26).string(message.listenAddr); @@ -249,14 +302,14 @@ export const NodeInfo = { writer.uint32(58).string(message.moniker); } if (message.other !== undefined) { - NodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfo { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfo(); + const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,7 +317,7 @@ export const NodeInfo = { message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); break; case 2: - message.nodeId = reader.string(); + message.defaultNodeId = reader.string(); break; case 3: message.listenAddr = reader.string(); @@ -282,7 +335,7 @@ export const NodeInfo = { message.moniker = reader.string(); break; case 8: - message.other = NodeInfoOther.decode(reader, reader.uint32()); + message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -291,67 +344,67 @@ export const NodeInfo = { } return message; }, - fromPartial(object: Partial): NodeInfo { - const message = createBaseNodeInfo(); + fromPartial(object: Partial): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); message.protocolVersion = object.protocolVersion !== undefined && object.protocolVersion !== null ? ProtocolVersion.fromPartial(object.protocolVersion) : undefined; - message.nodeId = object.nodeId ?? ""; + message.defaultNodeId = object.defaultNodeId ?? ""; message.listenAddr = object.listenAddr ?? ""; message.network = object.network ?? ""; message.version = object.version ?? ""; message.channels = object.channels ?? new Uint8Array(); message.moniker = object.moniker ?? ""; - message.other = object.other !== undefined && object.other !== null ? NodeInfoOther.fromPartial(object.other) : undefined; + message.other = object.other !== undefined && object.other !== null ? DefaultNodeInfoOther.fromPartial(object.other) : undefined; return message; }, - fromAmino(object: NodeInfoAmino): NodeInfo { + fromAmino(object: DefaultNodeInfoAmino): DefaultNodeInfo { return { protocolVersion: object?.protocol_version ? ProtocolVersion.fromAmino(object.protocol_version) : undefined, - nodeId: object.node_id, + defaultNodeId: object.default_node_id, listenAddr: object.listen_addr, network: object.network, version: object.version, channels: object.channels, moniker: object.moniker, - other: object?.other ? NodeInfoOther.fromAmino(object.other) : undefined + other: object?.other ? DefaultNodeInfoOther.fromAmino(object.other) : undefined }; }, - toAmino(message: NodeInfo): NodeInfoAmino { + toAmino(message: DefaultNodeInfo): DefaultNodeInfoAmino { const obj: any = {}; obj.protocol_version = message.protocolVersion ? ProtocolVersion.toAmino(message.protocolVersion) : undefined; - obj.node_id = message.nodeId; + obj.default_node_id = message.defaultNodeId; obj.listen_addr = message.listenAddr; obj.network = message.network; obj.version = message.version; obj.channels = message.channels; obj.moniker = message.moniker; - obj.other = message.other ? NodeInfoOther.toAmino(message.other) : undefined; + obj.other = message.other ? DefaultNodeInfoOther.toAmino(message.other) : undefined; return obj; }, - fromAminoMsg(object: NodeInfoAminoMsg): NodeInfo { - return NodeInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoAminoMsg): DefaultNodeInfo { + return DefaultNodeInfo.fromAmino(object.value); }, - fromProtoMsg(message: NodeInfoProtoMsg): NodeInfo { - return NodeInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoProtoMsg): DefaultNodeInfo { + return DefaultNodeInfo.decode(message.value); }, - toProto(message: NodeInfo): Uint8Array { - return NodeInfo.encode(message).finish(); + toProto(message: DefaultNodeInfo): Uint8Array { + return DefaultNodeInfo.encode(message).finish(); }, - toProtoMsg(message: NodeInfo): NodeInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfo): DefaultNodeInfoProtoMsg { return { - typeUrl: "/tendermint.p2p.NodeInfo", - value: NodeInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + value: DefaultNodeInfo.encode(message).finish() }; } }; -function createBaseNodeInfoOther(): NodeInfoOther { +function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { return { txIndex: "", rpcAddress: "" }; } -export const NodeInfoOther = { - typeUrl: "/tendermint.p2p.NodeInfoOther", - encode(message: NodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfoOther = { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + encode(message: DefaultNodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txIndex !== "") { writer.uint32(10).string(message.txIndex); } @@ -360,10 +413,10 @@ export const NodeInfoOther = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfoOther { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfoOther { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfoOther(); + const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -380,213 +433,37 @@ export const NodeInfoOther = { } return message; }, - fromPartial(object: Partial): NodeInfoOther { - const message = createBaseNodeInfoOther(); + fromPartial(object: Partial): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); message.txIndex = object.txIndex ?? ""; message.rpcAddress = object.rpcAddress ?? ""; return message; }, - fromAmino(object: NodeInfoOtherAmino): NodeInfoOther { + fromAmino(object: DefaultNodeInfoOtherAmino): DefaultNodeInfoOther { return { txIndex: object.tx_index, rpcAddress: object.rpc_address }; }, - toAmino(message: NodeInfoOther): NodeInfoOtherAmino { + toAmino(message: DefaultNodeInfoOther): DefaultNodeInfoOtherAmino { const obj: any = {}; obj.tx_index = message.txIndex; obj.rpc_address = message.rpcAddress; return obj; }, - fromAminoMsg(object: NodeInfoOtherAminoMsg): NodeInfoOther { - return NodeInfoOther.fromAmino(object.value); - }, - fromProtoMsg(message: NodeInfoOtherProtoMsg): NodeInfoOther { - return NodeInfoOther.decode(message.value); - }, - toProto(message: NodeInfoOther): Uint8Array { - return NodeInfoOther.encode(message).finish(); - }, - toProtoMsg(message: NodeInfoOther): NodeInfoOtherProtoMsg { - return { - typeUrl: "/tendermint.p2p.NodeInfoOther", - value: NodeInfoOther.encode(message).finish() - }; - } -}; -function createBasePeerInfo(): PeerInfo { - return { - id: "", - addressInfo: [], - lastConnected: undefined - }; -} -export const PeerInfo = { - typeUrl: "/tendermint.p2p.PeerInfo", - encode(message: PeerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - for (const v of message.addressInfo) { - PeerAddressInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.lastConnected !== undefined) { - Timestamp.encode(toTimestamp(message.lastConnected), writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.addressInfo.push(PeerAddressInfo.decode(reader, reader.uint32())); - break; - case 3: - message.lastConnected = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PeerInfo { - const message = createBasePeerInfo(); - message.id = object.id ?? ""; - message.addressInfo = object.addressInfo?.map(e => PeerAddressInfo.fromPartial(e)) || []; - message.lastConnected = object.lastConnected ?? undefined; - return message; - }, - fromAmino(object: PeerInfoAmino): PeerInfo { - return { - id: object.id, - addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object.last_connected - }; - }, - toAmino(message: PeerInfo): PeerInfoAmino { - const obj: any = {}; - obj.id = message.id; - if (message.addressInfo) { - obj.address_info = message.addressInfo.map(e => e ? PeerAddressInfo.toAmino(e) : undefined); - } else { - obj.address_info = []; - } - obj.last_connected = message.lastConnected; - return obj; - }, - fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { - return PeerInfo.fromAmino(object.value); - }, - fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { - return PeerInfo.decode(message.value); - }, - toProto(message: PeerInfo): Uint8Array { - return PeerInfo.encode(message).finish(); - }, - toProtoMsg(message: PeerInfo): PeerInfoProtoMsg { - return { - typeUrl: "/tendermint.p2p.PeerInfo", - value: PeerInfo.encode(message).finish() - }; - } -}; -function createBasePeerAddressInfo(): PeerAddressInfo { - return { - address: "", - lastDialSuccess: undefined, - lastDialFailure: undefined, - dialFailures: 0 - }; -} -export const PeerAddressInfo = { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - encode(message: PeerAddressInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.lastDialSuccess !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialSuccess), writer.uint32(18).fork()).ldelim(); - } - if (message.lastDialFailure !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialFailure), writer.uint32(26).fork()).ldelim(); - } - if (message.dialFailures !== 0) { - writer.uint32(32).uint32(message.dialFailures); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerAddressInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerAddressInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.lastDialSuccess = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 3: - message.lastDialFailure = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 4: - message.dialFailures = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PeerAddressInfo { - const message = createBasePeerAddressInfo(); - message.address = object.address ?? ""; - message.lastDialSuccess = object.lastDialSuccess ?? undefined; - message.lastDialFailure = object.lastDialFailure ?? undefined; - message.dialFailures = object.dialFailures ?? 0; - return message; - }, - fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { - return { - address: object.address, - lastDialSuccess: object.last_dial_success, - lastDialFailure: object.last_dial_failure, - dialFailures: object.dial_failures - }; - }, - toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { - const obj: any = {}; - obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; - obj.dial_failures = message.dialFailures; - return obj; - }, - fromAminoMsg(object: PeerAddressInfoAminoMsg): PeerAddressInfo { - return PeerAddressInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoOtherAminoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.fromAmino(object.value); }, - fromProtoMsg(message: PeerAddressInfoProtoMsg): PeerAddressInfo { - return PeerAddressInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoOtherProtoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.decode(message.value); }, - toProto(message: PeerAddressInfo): Uint8Array { - return PeerAddressInfo.encode(message).finish(); + toProto(message: DefaultNodeInfoOther): Uint8Array { + return DefaultNodeInfoOther.encode(message).finish(); }, - toProtoMsg(message: PeerAddressInfo): PeerAddressInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfoOther): DefaultNodeInfoOtherProtoMsg { return { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - value: PeerAddressInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + value: DefaultNodeInfoOther.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/evidence.ts b/packages/osmojs/src/codegen/tendermint/types/evidence.ts index 852789dc1..9827d4587 100644 --- a/packages/osmojs/src/codegen/tendermint/types/evidence.ts +++ b/packages/osmojs/src/codegen/tendermint/types/evidence.ts @@ -181,7 +181,7 @@ function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { voteB: Vote.fromPartial({}), totalVotingPower: BigInt(0), validatorPower: BigInt(0), - timestamp: undefined + timestamp: new Date() }; } export const DuplicateVoteEvidence = { @@ -282,7 +282,7 @@ function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { commonHeight: BigInt(0), byzantineValidators: [], totalVotingPower: BigInt(0), - timestamp: undefined + timestamp: new Date() }; } export const LightClientAttackEvidence = { diff --git a/packages/osmojs/src/codegen/tendermint/types/params.ts b/packages/osmojs/src/codegen/tendermint/types/params.ts index c2db1391b..891de3372 100644 --- a/packages/osmojs/src/codegen/tendermint/types/params.ts +++ b/packages/osmojs/src/codegen/tendermint/types/params.ts @@ -50,13 +50,6 @@ export interface BlockParams { * Note: must be greater or equal to -1 */ maxGas: bigint; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - timeIotaMs: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; @@ -74,13 +67,6 @@ export interface BlockParamsAmino { * Note: must be greater or equal to -1 */ max_gas: string; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - time_iota_ms: string; } export interface BlockParamsAminoMsg { type: "/tendermint.types.BlockParams"; @@ -90,7 +76,6 @@ export interface BlockParamsAminoMsg { export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; - time_iota_ms: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -185,7 +170,7 @@ export interface ValidatorParamsSDKType { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - appVersion: bigint; + app: bigint; } export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; @@ -193,7 +178,7 @@ export interface VersionParamsProtoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsAmino { - app_version: string; + app: string; } export interface VersionParamsAminoMsg { type: "/tendermint.types.VersionParams"; @@ -201,7 +186,7 @@ export interface VersionParamsAminoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { - app_version: bigint; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -332,8 +317,7 @@ export const ConsensusParams = { function createBaseBlockParams(): BlockParams { return { maxBytes: BigInt(0), - maxGas: BigInt(0), - timeIotaMs: BigInt(0) + maxGas: BigInt(0) }; } export const BlockParams = { @@ -345,9 +329,6 @@ export const BlockParams = { if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } - if (message.timeIotaMs !== BigInt(0)) { - writer.uint32(24).int64(message.timeIotaMs); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { @@ -363,9 +344,6 @@ export const BlockParams = { case 2: message.maxGas = reader.int64(); break; - case 3: - message.timeIotaMs = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -377,21 +355,18 @@ export const BlockParams = { const message = createBaseBlockParams(); message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); - message.timeIotaMs = object.timeIotaMs !== undefined && object.timeIotaMs !== null ? BigInt(object.timeIotaMs.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { return { maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas), - timeIotaMs: BigInt(object.time_iota_ms) + maxGas: BigInt(object.max_gas) }; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; - obj.time_iota_ms = message.timeIotaMs ? message.timeIotaMs.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { @@ -413,7 +388,7 @@ export const BlockParams = { function createBaseEvidenceParams(): EvidenceParams { return { maxAgeNumBlocks: BigInt(0), - maxAgeDuration: undefined, + maxAgeDuration: Duration.fromPartial({}), maxBytes: BigInt(0) }; } @@ -558,14 +533,14 @@ export const ValidatorParams = { }; function createBaseVersionParams(): VersionParams { return { - appVersion: BigInt(0) + app: BigInt(0) }; } export const VersionParams = { typeUrl: "/tendermint.types.VersionParams", encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.appVersion !== BigInt(0)) { - writer.uint32(8).uint64(message.appVersion); + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); } return writer; }, @@ -577,7 +552,7 @@ export const VersionParams = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.appVersion = reader.uint64(); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -588,17 +563,17 @@ export const VersionParams = { }, fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: VersionParamsAmino): VersionParams { return { - appVersion: BigInt(object.app_version) + app: BigInt(object.app) }; }, toAmino(message: VersionParams): VersionParamsAmino { const obj: any = {}; - obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; + obj.app = message.app ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { diff --git a/packages/osmojs/src/codegen/tendermint/types/types.ts b/packages/osmojs/src/codegen/tendermint/types/types.ts index b2d0da7c8..ffef5da73 100644 --- a/packages/osmojs/src/codegen/tendermint/types/types.ts +++ b/packages/osmojs/src/codegen/tendermint/types/types.ts @@ -737,7 +737,7 @@ function createBaseHeader(): Header { version: Consensus.fromPartial({}), chainId: "", height: BigInt(0), - time: undefined, + time: new Date(), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), dataHash: new Uint8Array(), @@ -994,7 +994,7 @@ function createBaseVote(): Vote { height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: new Date(), validatorAddress: new Uint8Array(), validatorIndex: 0, signature: new Uint8Array() @@ -1218,7 +1218,7 @@ function createBaseCommitSig(): CommitSig { return { blockIdFlag: 0, validatorAddress: new Uint8Array(), - timestamp: undefined, + timestamp: new Date(), signature: new Uint8Array() }; } @@ -1312,7 +1312,7 @@ function createBaseProposal(): Proposal { round: 0, polRound: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: new Date(), signature: new Uint8Array() }; } diff --git a/packages/osmojs/src/codegen/utf8.ts b/packages/osmojs/src/codegen/utf8.ts index ca050352b..c22bba916 100644 --- a/packages/osmojs/src/codegen/utf8.ts +++ b/packages/osmojs/src/codegen/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ diff --git a/packages/osmojs/src/codegen/varint.ts b/packages/osmojs/src/codegen/varint.ts index c8ba965c6..90e455554 100644 --- a/packages/osmojs/src/codegen/varint.ts +++ b/packages/osmojs/src/codegen/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -454,18 +454,18 @@ export function int64Length(lo: number, hi: number) { ? 1 : 2 : part0 < 2097152 - ? 3 - : 4 + ? 3 + : 4 : part1 < 16384 - ? part1 < 128 - ? 5 - : 6 - : part1 < 2097152 - ? 7 - : 8 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 : part2 < 128 - ? 9 - : 10; + ? 9 + : 10; } export function writeFixed32( diff --git a/packages/osmojs/wasmd b/packages/osmojs/wasmd index bc0e81791..4c906d5a5 160000 --- a/packages/osmojs/wasmd +++ b/packages/osmojs/wasmd @@ -1 +1 @@ -Subproject commit bc0e8179129a82dba4b9205c63e002c71cbb4edd +Subproject commit 4c906d5a53a255c551d6ed981a548cffe47ae9f0 diff --git a/yarn.lock b/yarn.lock index 04bde01bb..80e85a4ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4385,6 +4385,11 @@ decamelize@^1.1.0: resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +decimal.js-light@^2.5.1: + version "2.5.1" + resolved "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" + integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== + dedent@0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"