From ef5f6dba8d49897d006a16edef164b058f3f0976 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Thu, 12 Sep 2024 15:46:21 +0100 Subject: [PATCH 1/7] fix: date display for active orders from node (#3840) --- .../server/src/queries/complex/orderbooks/active-orders.ts | 2 +- packages/web/components/complex/orders-history/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/queries/complex/orderbooks/active-orders.ts b/packages/server/src/queries/complex/orderbooks/active-orders.ts index 6b1fa9d618..83a76435ac 100644 --- a/packages/server/src/queries/complex/orderbooks/active-orders.ts +++ b/packages/server/src/queries/complex/orderbooks/active-orders.ts @@ -193,7 +193,7 @@ async function getTickInfoAndTransformOrders( output, quoteAsset, baseAsset, - placed_at: dayjs(o.placed_at / 1000).unix(), + placed_at: dayjs(Math.floor(o.placed_at / 1000000)).unix(), }; }); } diff --git a/packages/web/components/complex/orders-history/index.tsx b/packages/web/components/complex/orders-history/index.tsx index f699df1871..422c4c09f3 100644 --- a/packages/web/components/complex/orders-history/index.tsx +++ b/packages/web/components/complex/orders-history/index.tsx @@ -456,8 +456,8 @@ const TableOrderRow = memo( case "partiallyFilled": return ; case "cancelled": - const dayDiff = dayjs(new Date()).diff(dayjs(placed_at), "d"); - const hourDiff = dayjs(new Date()).diff(dayjs(placed_at), "h"); + const dayDiff = dayjs(new Date()).diff(placedAt, "d"); + const hourDiff = dayjs(new Date()).diff(placedAt, "h"); return ( From fc714a28a83918db1d12d9ba50a8a7b978b98d4c Mon Sep 17 00:00:00 2001 From: Matt Upham <30577966+mattupham@users.noreply.github.com> Date: Wed, 18 Sep 2024 08:32:48 -0700 Subject: [PATCH 2/7] Mattupham/fe 1077 v26 fe tasks (#3843) * feat: adding ledger support to 1CT * fix: make hash optional for TransactionRow type * Add timeout * Update default timeout height offset * Update OSMOSIS_COMMIT_HASH * Revert "(1CT) Add Ledger Coming Soon Copy (#3554)" This reverts commit 94f041a27337bf755c4c54496a3a14a25536479c. * Remove ledger paragraph * Clean up paragraph spacing * Update protos * Temp commit - snapshot of working progress * Update 1ct session allowed functions * get feature flags ready for launch * Clean up for launch * remove log * Fix type issues related to telescope --------- Co-authored-by: ghost --- packages/proto-codecs/package.json | 2 +- .../scripts/generated/package-types.ts | 3 + packages/proto-codecs/scripts/get-proto.sh | 11 +- packages/proto-codecs/src/codegen/binary.ts | 4 +- .../src/codegen/cosmos/auth/v1beta1/auth.ts | 16 +- .../cosmos/base/query/v1beta1/pagination.ts | 6 +- .../proto-codecs/src/codegen/cosmos/bundle.ts | 72 +- .../codegen/cosmos/staking/v1beta1/genesis.ts | 2 +- .../codegen/cosmos/staking/v1beta1/staking.ts | 6 +- .../codegen/cosmos/upgrade/v1beta1/upgrade.ts | 4 +- .../src/codegen/cosmwasm/bundle.ts | 8 +- .../src/codegen/cosmwasm/wasm/v1/authz.ts | 4 +- .../src/codegen/cosmwasm/wasm/v1/genesis.ts | 4 +- .../src/codegen/cosmwasm/wasm/v1/ibc.ts | 99 ++- .../cosmwasm/wasm/v1/proposal_legacy.ts | 8 +- .../src/codegen/cosmwasm/wasm/v1/tx.ts | 18 +- .../src/codegen/cosmwasm/wasm/v1/types.ts | 8 +- .../src/codegen/gogoproto/bundle.ts | 4 +- .../proto-codecs/src/codegen/google/bundle.ts | 22 +- .../src/codegen/google/protobuf/descriptor.ts | 14 +- packages/proto-codecs/src/codegen/helpers.ts | 4 +- .../ibc/applications/transfer/v1/authz.ts | 25 + .../ibc/applications/transfer/v1/tx.amino.ts | 7 +- .../applications/transfer/v1/tx.registry.ts | 21 +- .../ibc/applications/transfer/v1/tx.ts | 234 +++++- .../proto-codecs/src/codegen/ibc/bundle.ts | 12 +- .../src/codegen/ibc/core/client/v1/client.ts | 632 ++++++++-------- .../src/codegen/ibc/core/client/v1/genesis.ts | 15 +- .../codegen/ibc/core/client/v1/tx.amino.ts | 18 + .../codegen/ibc/core/client/v1/tx.registry.ts | 60 ++ .../src/codegen/ibc/core/client/v1/tx.ts | 716 +++++++++++++++++- packages/proto-codecs/src/codegen/index.ts | 4 +- .../src/codegen/osmosis/bundle.ts | 144 ++-- .../osmosis/concentratedliquidity/params.ts | 35 +- .../concentrated/v1beta1/tx.amino.ts | 3 +- .../poolmodel/concentrated/v1beta1/tx.ts | 8 +- .../concentratedliquidity/v1beta1/genesis.ts | 14 +- .../concentratedliquidity/v1beta1/gov.ts | 32 +- .../v1beta1/incentive_record.ts | 4 +- .../concentratedliquidity/v1beta1/pool.ts | 8 +- .../concentratedliquidity/v1beta1/position.ts | 8 +- .../concentratedliquidity/v1beta1/tx.ts | 20 +- .../osmosis/cosmwasmpool/v1beta1/gov.ts | 2 +- .../cosmwasmpool/v1beta1/model/pool.ts | 4 +- .../osmosis/cosmwasmpool/v1beta1/model/tx.ts | 8 +- .../osmosis/cosmwasmpool/v1beta1/params.ts | 2 +- .../gamm/poolmodels/balancer/v1beta1/tx.ts | 2 +- .../stableswap/v1beta1/stableswap_pool.ts | 2 +- .../gamm/poolmodels/stableswap/v1beta1/tx.ts | 4 +- .../osmosis/gamm/v1beta1/balancerPool.ts | 2 +- .../codegen/osmosis/gamm/v1beta1/genesis.ts | 107 +-- .../src/codegen/osmosis/gamm/v1beta1/gov.ts | 6 +- .../codegen/osmosis/gamm/v1beta1/params.ts | 106 +++ .../codegen/osmosis/gamm/v1beta1/shared.ts | 6 +- .../src/codegen/osmosis/gamm/v1beta1/tx.ts | 12 +- .../src/codegen/osmosis/lockup/genesis.ts | 2 +- .../src/codegen/osmosis/lockup/lock.ts | 22 +- .../src/codegen/osmosis/lockup/tx.ts | 84 +- .../osmosis/poolmanager/v1beta1/genesis.ts | 6 +- .../poolmanager/v1beta1/module_route.ts | 2 +- .../osmosis/poolmanager/v1beta1/swap_route.ts | 4 +- .../poolmanager/v1beta1/taker_fee_share.ts | 506 +++++++++++++ .../osmosis/poolmanager/v1beta1/tx.amino.ts | 12 + .../poolmanager/v1beta1/tx.registry.ts | 55 ++ .../codegen/osmosis/poolmanager/v1beta1/tx.ts | 562 +++++++++++++- .../osmosis/smartaccount/v1beta1/genesis.ts | 2 +- .../osmosis/smartaccount/v1beta1/models.ts | 2 +- .../osmosis/smartaccount/v1beta1/params.ts | 2 +- .../osmosis/smartaccount/v1beta1/tx.ts | 38 +- .../codegen/osmosis/superfluid/superfluid.ts | 10 +- .../codegen/osmosis/superfluid/tx.amino.ts | 2 +- .../src/codegen/osmosis/superfluid/tx.ts | 52 +- .../osmosis/valsetpref/v1beta1/tx.amino.ts | 2 +- .../codegen/osmosis/valsetpref/v1beta1/tx.ts | 6 +- .../src/codegen/tendermint/bundle.ts | 26 +- .../src/codegen/tendermint/crypto/proof.ts | 4 +- .../src/codegen/tendermint/types/evidence.ts | 8 +- .../src/codegen/tendermint/types/params.ts | 20 +- .../src/codegen/tendermint/types/types.ts | 16 +- .../src/codegen/tendermint/types/validator.ts | 8 +- .../src/codegen/tendermint/version/types.ts | 8 +- packages/proto-codecs/src/codegen/utf8.ts | 4 +- packages/proto-codecs/src/codegen/varint.ts | 4 +- packages/stores/src/account/base.ts | 21 +- packages/stores/src/account/osmosis/index.ts | 12 +- packages/stores/src/account/utils.ts | 4 +- .../osmosis/authenticator.ts | 6 +- .../src/message-composers/osmosis/lockup.ts | 4 +- packages/types/src/one-click-trading-types.ts | 4 +- .../introducing-one-click-trading.tsx | 29 +- .../one-click-trading-settings.tsx | 14 +- .../one-click-trading-welcome-back.tsx | 3 - .../transactions/transaction-row.tsx | 2 +- ...e-create-one-click-trading-session.spec.ts | 4 +- .../use-create-one-click-trading-session.tsx | 8 +- packages/web/hooks/use-feature-flags.ts | 4 + packages/web/localizations/de.json | 3 +- packages/web/localizations/en.json | 3 +- packages/web/localizations/es.json | 3 +- packages/web/localizations/fa.json | 3 +- packages/web/localizations/fr.json | 3 +- packages/web/localizations/gu.json | 3 +- packages/web/localizations/hi.json | 3 +- packages/web/localizations/ja.json | 3 +- packages/web/localizations/ko.json | 3 +- packages/web/localizations/pl.json | 3 +- packages/web/localizations/pt-br.json | 3 +- packages/web/localizations/ro.json | 3 +- packages/web/localizations/ru.json | 3 +- packages/web/localizations/tr.json | 3 +- packages/web/localizations/zh-cn.json | 3 +- packages/web/localizations/zh-hk.json | 3 +- packages/web/localizations/zh-tw.json | 3 +- yarn.lock | 118 ++- 114 files changed, 3376 insertions(+), 979 deletions(-) create mode 100644 packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/params.ts create mode 100644 packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/taker_fee_share.ts diff --git a/packages/proto-codecs/package.json b/packages/proto-codecs/package.json index 041b8f419d..a8ff027206 100644 --- a/packages/proto-codecs/package.json +++ b/packages/proto-codecs/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@cosmology/proto-parser": "^1.5.0", - "@cosmology/telescope": "^1.5.1", + "@cosmology/telescope": "^1.8.4", "@types/node": "^20.14.1", "regenerator-runtime": "^0.13.11", "rimraf": "^5.0.0", diff --git a/packages/proto-codecs/scripts/generated/package-types.ts b/packages/proto-codecs/scripts/generated/package-types.ts index e222c79605..93f889c3b2 100644 --- a/packages/proto-codecs/scripts/generated/package-types.ts +++ b/packages/proto-codecs/scripts/generated/package-types.ts @@ -11,6 +11,7 @@ export type AvailablePackages = | "osmosis.gamm.poolmodels.balancer.v1beta1" | "ibc.applications.interchain_accounts.v1" | "osmosis.concentratedliquidity.v1beta1" + | "osmosis.cosmwasmpool.v1beta1.model.v3" | "osmosis.downtimedetector.v1beta1" | "ibc.lightclients.solomachine.v2" | "ibc.lightclients.solomachine.v3" @@ -32,6 +33,7 @@ export type AvailablePackages = | "osmosis.valsetpref.v1beta1" | "cosmos.base.query.v1beta1" | "cosmos.base.store.v1beta1" + | "ibc.lightclients.wasm.v1" | "osmosis.protorev.v1beta1" | "cosmos.base.abci.v1beta1" | "ibc.applications.fee.v1" @@ -66,6 +68,7 @@ export type AvailablePackages = | "tendermint.abci" | "osmosis.lockup" | "tendermint.p2p" + | "capability.v1" | "cosmos.msg.v1" | "cosmos_proto" | "google.api" diff --git a/packages/proto-codecs/scripts/get-proto.sh b/packages/proto-codecs/scripts/get-proto.sh index 3c26688792..9c47f576d7 100755 --- a/packages/proto-codecs/scripts/get-proto.sh +++ b/packages/proto-codecs/scripts/get-proto.sh @@ -6,7 +6,7 @@ GREEN='\033[0;32m' # Green color NC='\033[0m' # No Color PROTO_DIR="./chain-proto" -OSMOSIS_COMMIT_HASH="b07e6725f7d97b3321c8165fc1d95a9ab6fa963b" +OSMOSIS_COMMIT_HASH="dd6442421a5643d8702200d6a46a6178160a8c76" ICS23_COMMIT_HASH="f4deb054b697458e7f0aa353c2f45a365361e895" @@ -26,9 +26,13 @@ git -C .repos/osmosis checkout $OSMOSIS_COMMIT_HASH # SDK PROTOS -COSMOS_SDK_VERSION=$(awk -F '=>' '/github.com\/osmosis-labs\/cosmos-sdk/ {print $2}' .repos/osmosis/go.mod | awk '{print $NF}' | tr -d '\n') +# COSMOS_SDK_VERSION=$(awk '/github.com\/cosmos\/cosmos-sdk/ {print $2}' .repos/osmosis/go.mod | tr -d '=> ') +# COSMOS_SDK_VERSION=$(awk -F '=>' '/github.com\/osmosis-labs\/cosmos-sdk/ {print $2}' .repos/osmosis/go.mod | awk '{print $NF}' | tr -d '\n') +COSMOS_SDK_VERSION=v0.50.6-v26-osmo-2 + echo -e "${GREEN}COSMOS_SDK_VERSION: $COSMOS_SDK_VERSION${NC}" +# git clone --filter=blob:none --sparse https://github.com/cosmos/cosmos-sdk.git .repos/cosmos-sdk git clone --filter=blob:none --sparse https://github.com/osmosis-labs/cosmos-sdk.git .repos/cosmos-sdk # Checkout to Cosmos hash commit @@ -52,7 +56,8 @@ git -C .repos/ibc-go checkout $IBC_GO_VERSION # WASMD PROTOS # Extract the Wasmd version from the go.mod file -WASMD_VERSION=$(awk '/github.com\/osmosis-labs\/wasmd/ {print $4}' .repos/osmosis/go.mod | awk '{print $NF}' | tr -d '\n') +# WASMD_VERSION=$(awk '/github.com\/osmosis-labs\/wasmd/ {print $4}' .repos/osmosis/go.mod | awk '{print $NF}' | tr -d '\n') +WASMD_VERSION=de7db0dc672e7beb201e06e7eb12b2de356ac7c9 echo -e "${GREEN}WASMD_VERSION: $WASMD_VERSION${NC}" # TROUBLESHOOTING diff --git a/packages/proto-codecs/src/codegen/binary.ts b/packages/proto-codecs/src/codegen/binary.ts index 2e685b1c8c..0ef5863093 100644 --- a/packages/proto-codecs/src/codegen/binary.ts +++ b/packages/proto-codecs/src/codegen/binary.ts @@ -1,8 +1,8 @@ //@ts-nocheck /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.1 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.4 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ // Copyright (c) 2016, Daniel Wirtz All rights reserved. diff --git a/packages/proto-codecs/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/proto-codecs/src/codegen/cosmos/auth/v1beta1/auth.ts index e5c18f2617..f71c08e943 100644 --- a/packages/proto-codecs/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/proto-codecs/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -199,10 +199,12 @@ export const BaseAccount = { obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; obj.account_number = message.accountNumber !== BigInt(0) - ? message.accountNumber.toString() + ? (message.accountNumber?.toString)() : undefined; obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + message.sequence !== BigInt(0) + ? (message.sequence?.toString)() + : undefined; return obj; }, fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { @@ -460,23 +462,23 @@ export const Params = { const obj: any = {}; obj.max_memo_characters = message.maxMemoCharacters !== BigInt(0) - ? message.maxMemoCharacters.toString() + ? (message.maxMemoCharacters?.toString)() : undefined; obj.tx_sig_limit = message.txSigLimit !== BigInt(0) - ? message.txSigLimit.toString() + ? (message.txSigLimit?.toString)() : undefined; obj.tx_size_cost_per_byte = message.txSizeCostPerByte !== BigInt(0) - ? message.txSizeCostPerByte.toString() + ? (message.txSizeCostPerByte?.toString)() : undefined; obj.sig_verify_cost_ed25519 = message.sigVerifyCostEd25519 !== BigInt(0) - ? message.sigVerifyCostEd25519.toString() + ? (message.sigVerifyCostEd25519?.toString)() : undefined; obj.sig_verify_cost_secp256k1 = message.sigVerifyCostSecp256k1 !== BigInt(0) - ? message.sigVerifyCostSecp256k1.toString() + ? (message.sigVerifyCostSecp256k1?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/proto-codecs/src/codegen/cosmos/base/query/v1beta1/pagination.ts index 2922a521c4..62d1cfef8c 100644 --- a/packages/proto-codecs/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/proto-codecs/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -272,9 +272,9 @@ export const PageRequest = { const obj: any = {}; obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.offset = - message.offset !== BigInt(0) ? message.offset.toString() : undefined; + message.offset !== BigInt(0) ? (message.offset?.toString)() : undefined; obj.limit = - message.limit !== BigInt(0) ? message.limit.toString() : undefined; + message.limit !== BigInt(0) ? (message.limit?.toString)() : undefined; obj.count_total = message.countTotal === false ? undefined : message.countTotal; obj.reverse = message.reverse === false ? undefined : message.reverse; @@ -368,7 +368,7 @@ export const PageResponse = { ? base64FromBytes(message.nextKey) : undefined; obj.total = - message.total !== BigInt(0) ? message.total.toString() : undefined; + message.total !== BigInt(0) ? (message.total?.toString)() : undefined; return obj; }, fromAminoMsg(object: PageResponseAminoMsg): PageResponse { diff --git a/packages/proto-codecs/src/codegen/cosmos/bundle.ts b/packages/proto-codecs/src/codegen/cosmos/bundle.ts index 8be7583117..5417e7728d 100644 --- a/packages/proto-codecs/src/codegen/cosmos/bundle.ts +++ b/packages/proto-codecs/src/codegen/cosmos/bundle.ts @@ -1,67 +1,67 @@ //@ts-nocheck -import * as _55 from "./auth/v1beta1/auth"; -import * as _56 from "./auth/v1beta1/genesis"; -import * as _57 from "./bank/v1beta1/authz"; -import * as _58 from "./bank/v1beta1/bank"; -import * as _59 from "./bank/v1beta1/genesis"; -import * as _60 from "./bank/v1beta1/tx"; -import * as _111 from "./bank/v1beta1/tx.amino"; -import * as _114 from "./bank/v1beta1/tx.registry"; -import * as _61 from "./base/query/v1beta1/pagination"; -import * as _62 from "./base/v1beta1/coin"; -import * as _63 from "./staking/v1beta1/authz"; -import * as _64 from "./staking/v1beta1/genesis"; -import * as _65 from "./staking/v1beta1/staking"; -import * as _66 from "./staking/v1beta1/tx"; -import * as _112 from "./staking/v1beta1/tx.amino"; -import * as _115 from "./staking/v1beta1/tx.registry"; -import * as _67 from "./upgrade/v1beta1/tx"; -import * as _113 from "./upgrade/v1beta1/tx.amino"; -import * as _116 from "./upgrade/v1beta1/tx.registry"; -import * as _68 from "./upgrade/v1beta1/upgrade"; +import * as _57 from "./auth/v1beta1/auth"; +import * as _58 from "./auth/v1beta1/genesis"; +import * as _59 from "./bank/v1beta1/authz"; +import * as _60 from "./bank/v1beta1/bank"; +import * as _61 from "./bank/v1beta1/genesis"; +import * as _62 from "./bank/v1beta1/tx"; +import * as _113 from "./bank/v1beta1/tx.amino"; +import * as _116 from "./bank/v1beta1/tx.registry"; +import * as _63 from "./base/query/v1beta1/pagination"; +import * as _64 from "./base/v1beta1/coin"; +import * as _65 from "./staking/v1beta1/authz"; +import * as _66 from "./staking/v1beta1/genesis"; +import * as _67 from "./staking/v1beta1/staking"; +import * as _68 from "./staking/v1beta1/tx"; +import * as _114 from "./staking/v1beta1/tx.amino"; +import * as _117 from "./staking/v1beta1/tx.registry"; +import * as _69 from "./upgrade/v1beta1/tx"; +import * as _115 from "./upgrade/v1beta1/tx.amino"; +import * as _118 from "./upgrade/v1beta1/tx.registry"; +import * as _70 from "./upgrade/v1beta1/upgrade"; export namespace cosmos { export namespace auth { export const v1beta1 = { - ..._55, - ..._56, + ..._57, + ..._58, }; } export namespace bank { export const v1beta1 = { - ..._57, - ..._58, ..._59, ..._60, - ..._111, - ..._114, + ..._61, + ..._62, + ..._113, + ..._116, }; } export namespace base { export namespace query { export const v1beta1 = { - ..._61, + ..._63, }; } export const v1beta1 = { - ..._62, + ..._64, }; } export namespace staking { export const v1beta1 = { - ..._63, - ..._64, ..._65, ..._66, - ..._112, - ..._115, + ..._67, + ..._68, + ..._114, + ..._117, }; } export namespace upgrade { export const v1beta1 = { - ..._67, - ..._68, - ..._113, - ..._116, + ..._69, + ..._70, + ..._115, + ..._118, }; } } diff --git a/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/genesis.ts index d182bf8912..519744187d 100644 --- a/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -388,7 +388,7 @@ export const LastValidatorPower = { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; obj.power = - message.power !== BigInt(0) ? message.power.toString() : undefined; + message.power !== BigInt(0) ? (message.power?.toString)() : undefined; return obj; }, fromAminoMsg(object: LastValidatorPowerAminoMsg): LastValidatorPower { diff --git a/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/staking.ts index 4b9f5d8e09..087376b7ef 100644 --- a/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/proto-codecs/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -1501,7 +1501,7 @@ export const Validator = { : undefined; obj.unbonding_height = message.unbondingHeight !== BigInt(0) - ? message.unbondingHeight.toString() + ? (message.unbondingHeight?.toString)() : undefined; obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) @@ -2300,7 +2300,7 @@ export const UnbondingDelegationEntry = { const obj: any = {}; obj.creation_height = message.creationHeight !== BigInt(0) - ? message.creationHeight.toString() + ? (message.creationHeight?.toString)() : undefined; obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) @@ -2447,7 +2447,7 @@ export const RedelegationEntry = { const obj: any = {}; obj.creation_height = message.creationHeight !== BigInt(0) - ? message.creationHeight.toString() + ? (message.creationHeight?.toString)() : undefined; obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) diff --git a/packages/proto-codecs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/proto-codecs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index 82e80efad5..8cbdb6aea1 100644 --- a/packages/proto-codecs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/proto-codecs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -338,7 +338,7 @@ export const Plan = { ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; + message.height !== BigInt(0) ? (message.height?.toString)() : undefined; obj.info = message.info === "" ? undefined : message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) @@ -650,7 +650,7 @@ export const ModuleVersion = { const obj: any = {}; obj.name = message.name === "" ? undefined : message.name; obj.version = - message.version !== BigInt(0) ? message.version.toString() : undefined; + message.version !== BigInt(0) ? (message.version?.toString)() : undefined; return obj; }, fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { diff --git a/packages/proto-codecs/src/codegen/cosmwasm/bundle.ts b/packages/proto-codecs/src/codegen/cosmwasm/bundle.ts index d4ddcb6ca4..e8c28e1bd2 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/bundle.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/bundle.ts @@ -4,8 +4,8 @@ import * as _9 from "./wasm/v1/genesis"; import * as _10 from "./wasm/v1/ibc"; import * as _11 from "./wasm/v1/proposal_legacy"; import * as _12 from "./wasm/v1/tx"; -import * as _89 from "./wasm/v1/tx.amino"; -import * as _90 from "./wasm/v1/tx.registry"; +import * as _91 from "./wasm/v1/tx.amino"; +import * as _92 from "./wasm/v1/tx.registry"; import * as _13 from "./wasm/v1/types"; export namespace cosmwasm { export namespace wasm { @@ -16,8 +16,8 @@ export namespace cosmwasm { ..._11, ..._12, ..._13, - ..._89, - ..._90, + ..._91, + ..._92, }; } } diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/authz.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/authz.ts index 4b28539b6f..5085df0242 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/authz.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/authz.ts @@ -1007,7 +1007,7 @@ export const MaxCallsLimit = { const obj: any = {}; obj.remaining = message.remaining !== BigInt(0) - ? message.remaining.toString() + ? (message.remaining?.toString)() : undefined; return obj; }, @@ -1177,7 +1177,7 @@ export const CombinedLimit = { const obj: any = {}; obj.calls_remaining = message.callsRemaining !== BigInt(0) - ? message.callsRemaining.toString() + ? (message.callsRemaining?.toString)() : undefined; if (message.amounts) { obj.amounts = message.amounts.map((e) => diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/genesis.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/genesis.ts index 4b9d941c85..4e516dcccb 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/genesis.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/genesis.ts @@ -346,7 +346,7 @@ export const Code = { toAmino(message: Code): CodeAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : CodeInfo.toAmino(CodeInfo.fromPartial({})); @@ -581,7 +581,7 @@ export const Sequence = { const obj: any = {}; obj.id_key = message.idKey ? base64FromBytes(message.idKey) : undefined; obj.value = - message.value !== BigInt(0) ? message.value.toString() : undefined; + message.value !== BigInt(0) ? (message.value?.toString)() : undefined; return obj; }, fromAminoMsg(object: SequenceAminoMsg): Sequence { diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/ibc.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/ibc.ts index 0dcf56b51e..397cce0c73 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/ibc.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/ibc.ts @@ -78,6 +78,20 @@ export interface MsgIBCSendResponseAminoMsg { export interface MsgIBCSendResponseSDKType { sequence: bigint; } +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponse {} +export interface MsgIBCWriteAcknowledgementResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponseAmino {} +export interface MsgIBCWriteAcknowledgementResponseAminoMsg { + type: "wasm/MsgIBCWriteAcknowledgementResponse"; + value: MsgIBCWriteAcknowledgementResponseAmino; +} +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponseSDKType {} /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannel { channel: string; @@ -191,11 +205,11 @@ export const MsgIBCSend = { obj.channel = message.channel === "" ? undefined : message.channel; obj.timeout_height = message.timeoutHeight !== BigInt(0) - ? message.timeoutHeight.toString() + ? (message.timeoutHeight?.toString)() : undefined; obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) - ? message.timeoutTimestamp.toString() + ? (message.timeoutTimestamp?.toString)() : undefined; obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; @@ -277,7 +291,9 @@ export const MsgIBCSendResponse = { toAmino(message: MsgIBCSendResponse): MsgIBCSendResponseAmino { const obj: any = {}; obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + message.sequence !== BigInt(0) + ? (message.sequence?.toString)() + : undefined; return obj; }, fromAminoMsg(object: MsgIBCSendResponseAminoMsg): MsgIBCSendResponse { @@ -302,6 +318,83 @@ export const MsgIBCSendResponse = { }; }, }; +function createBaseMsgIBCWriteAcknowledgementResponse(): MsgIBCWriteAcknowledgementResponse { + return {}; +} +export const MsgIBCWriteAcknowledgementResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", + encode( + _: MsgIBCWriteAcknowledgementResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgIBCWriteAcknowledgementResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgIBCWriteAcknowledgementResponse { + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + return message; + }, + fromAmino( + _: MsgIBCWriteAcknowledgementResponseAmino + ): MsgIBCWriteAcknowledgementResponse { + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + return message; + }, + toAmino( + _: MsgIBCWriteAcknowledgementResponse + ): MsgIBCWriteAcknowledgementResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgIBCWriteAcknowledgementResponseAminoMsg + ): MsgIBCWriteAcknowledgementResponse { + return MsgIBCWriteAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgIBCWriteAcknowledgementResponse + ): MsgIBCWriteAcknowledgementResponseAminoMsg { + return { + type: "wasm/MsgIBCWriteAcknowledgementResponse", + value: MsgIBCWriteAcknowledgementResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgIBCWriteAcknowledgementResponseProtoMsg + ): MsgIBCWriteAcknowledgementResponse { + return MsgIBCWriteAcknowledgementResponse.decode(message.value); + }, + toProto(message: MsgIBCWriteAcknowledgementResponse): Uint8Array { + return MsgIBCWriteAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgIBCWriteAcknowledgementResponse + ): MsgIBCWriteAcknowledgementResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", + value: MsgIBCWriteAcknowledgementResponse.encode(message).finish(), + }; + }, +}; function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { return { channel: "", diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts index e65deb5570..9087f9f05f 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts @@ -1215,7 +1215,7 @@ export const InstantiateContractProposal = { obj.run_as = message.runAs === "" ? undefined : message.runAs; obj.admin = message.admin === "" ? undefined : message.admin; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.label = message.label === "" ? undefined : message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { @@ -1419,7 +1419,7 @@ export const InstantiateContract2Proposal = { obj.run_as = message.runAs === "" ? undefined : message.runAs; obj.admin = message.admin === "" ? undefined : message.admin; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.label = message.label === "" ? undefined : message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { @@ -1567,7 +1567,7 @@ export const MigrateContractProposal = { message.description === "" ? undefined : message.description; obj.contract = message.contract === "" ? undefined : message.contract; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; return obj; }, @@ -2385,7 +2385,7 @@ export const AccessConfigUpdate = { toAmino(message: AccessConfigUpdate): AccessConfigUpdateAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/tx.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/tx.ts index 840660f66f..de84b1c691 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/tx.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/tx.ts @@ -166,7 +166,7 @@ export interface MsgInstantiateContractResponseSDKType { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2 { /** Sender is the that actor that signed the messages */ @@ -195,7 +195,7 @@ export interface MsgInstantiateContract2ProtoMsg { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2Amino { /** Sender is the that actor that signed the messages */ @@ -224,7 +224,7 @@ export interface MsgInstantiateContract2AminoMsg { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2SDKType { sender: string; @@ -1412,7 +1412,7 @@ export const MsgStoreCodeResponse = { toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; @@ -1550,7 +1550,7 @@ export const MsgInstantiateContract = { obj.sender = message.sender === "" ? undefined : message.sender; obj.admin = message.admin === "" ? undefined : message.admin; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.label = message.label === "" ? undefined : message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { @@ -1820,7 +1820,7 @@ export const MsgInstantiateContract2 = { obj.sender = message.sender === "" ? undefined : message.sender; obj.admin = message.admin === "" ? undefined : message.admin; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.label = message.label === "" ? undefined : message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { @@ -2258,7 +2258,7 @@ export const MsgMigrateContract = { obj.sender = message.sender === "" ? undefined : message.sender; obj.contract = message.contract === "" ? undefined : message.contract; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; return obj; }, @@ -2783,7 +2783,7 @@ export const MsgUpdateInstantiateConfig = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; @@ -4497,7 +4497,7 @@ export const MsgStoreAndMigrateContractResponse = { ): MsgStoreAndMigrateContractResponseAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; diff --git a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/types.ts b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/types.ts index 0da0aeca44..9aefcee965 100644 --- a/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/proto-codecs/src/codegen/cosmwasm/wasm/v1/types.ts @@ -893,7 +893,7 @@ export const ContractInfo = { toAmino(message: ContractInfo): ContractInfoAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.creator = message.creator === "" ? undefined : message.creator; obj.admin = message.admin === "" ? undefined : message.admin; obj.label = message.label === "" ? undefined : message.label; @@ -1025,7 +1025,7 @@ export const ContractCodeHistoryEntry = { const obj: any = {}; obj.operation = message.operation === 0 ? undefined : message.operation; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; @@ -1132,10 +1132,10 @@ export const AbsoluteTxPosition = { const obj: any = {}; obj.block_height = message.blockHeight !== BigInt(0) - ? message.blockHeight.toString() + ? (message.blockHeight?.toString)() : undefined; obj.tx_index = - message.txIndex !== BigInt(0) ? message.txIndex.toString() : undefined; + message.txIndex !== BigInt(0) ? (message.txIndex?.toString)() : undefined; return obj; }, fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { diff --git a/packages/proto-codecs/src/codegen/gogoproto/bundle.ts b/packages/proto-codecs/src/codegen/gogoproto/bundle.ts index 599df0adf5..eb4c611b82 100644 --- a/packages/proto-codecs/src/codegen/gogoproto/bundle.ts +++ b/packages/proto-codecs/src/codegen/gogoproto/bundle.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import * as _69 from "./gogo"; +import * as _71 from "./gogo"; export const gogoproto = { - ..._69, + ..._71, }; diff --git a/packages/proto-codecs/src/codegen/google/bundle.ts b/packages/proto-codecs/src/codegen/google/bundle.ts index 8172d20f1e..d9c9de9bd3 100644 --- a/packages/proto-codecs/src/codegen/google/bundle.ts +++ b/packages/proto-codecs/src/codegen/google/bundle.ts @@ -1,21 +1,21 @@ //@ts-nocheck -import * as _70 from "./api/annotations"; -import * as _71 from "./api/http"; -import * as _72 from "./protobuf/any"; -import * as _73 from "./protobuf/descriptor"; -import * as _74 from "./protobuf/duration"; -import * as _75 from "./protobuf/empty"; -import * as _76 from "./protobuf/timestamp"; +import * as _72 from "./api/annotations"; +import * as _73 from "./api/http"; +import * as _74 from "./protobuf/any"; +import * as _75 from "./protobuf/descriptor"; +import * as _76 from "./protobuf/duration"; +import * as _77 from "./protobuf/empty"; +import * as _78 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._70, - ..._71, - }; - export const protobuf = { ..._72, ..._73, + }; + export const protobuf = { ..._74, ..._75, ..._76, + ..._77, + ..._78, }; } diff --git a/packages/proto-codecs/src/codegen/google/protobuf/descriptor.ts b/packages/proto-codecs/src/codegen/google/protobuf/descriptor.ts index b602ded066..cfd537dd96 100644 --- a/packages/proto-codecs/src/codegen/google/protobuf/descriptor.ts +++ b/packages/proto-codecs/src/codegen/google/protobuf/descriptor.ts @@ -30,6 +30,7 @@ export enum FieldDescriptorProto_Type { * treat group fields as unknown fields. */ TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ TYPE_MESSAGE = 11, /** TYPE_BYTES - New in version 2. */ TYPE_BYTES = 12, @@ -199,12 +200,9 @@ export function fieldDescriptorProto_LabelToJSON( } /** Generated classes can be optimized for speed or code size. */ export enum FileOptions_OptimizeMode { - /** - * SPEED - Generate complete code for parsing, serialization, - * etc. - */ + /** SPEED - Generate complete code for parsing, serialization, */ SPEED = 1, - /** CODE_SIZE - Use ReflectionOps to implement these methods. */ + /** CODE_SIZE - etc. */ CODE_SIZE = 2, /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ LITE_RUNTIME = 3, @@ -410,6 +408,7 @@ export interface FileDescriptorSetSDKType { export interface FileDescriptorProto { /** file name, relative to root of source tree */ name: string; + /** e.g. "foo", "foo.bar", etc. */ package: string; /** Names of files imported by this file. */ dependency: string[]; @@ -447,6 +446,7 @@ export interface FileDescriptorProtoProtoMsg { export interface FileDescriptorProtoAmino { /** file name, relative to root of source tree */ name?: string; + /** e.g. "foo", "foo.bar", etc. */ package?: string; /** Names of files imported by this file. */ dependency?: string[]; @@ -5311,11 +5311,11 @@ export const UninterpretedOption = { message.identifierValue === "" ? undefined : message.identifierValue; obj.positive_int_value = message.positiveIntValue !== BigInt(0) - ? message.positiveIntValue.toString() + ? (message.positiveIntValue?.toString)() : undefined; obj.negative_int_value = message.negativeIntValue !== BigInt(0) - ? message.negativeIntValue.toString() + ? (message.negativeIntValue?.toString)() : undefined; obj.double_value = message.doubleValue === 0 ? undefined : message.doubleValue; diff --git a/packages/proto-codecs/src/codegen/helpers.ts b/packages/proto-codecs/src/codegen/helpers.ts index fc938ded82..6b01cec985 100644 --- a/packages/proto-codecs/src/codegen/helpers.ts +++ b/packages/proto-codecs/src/codegen/helpers.ts @@ -1,8 +1,8 @@ //@ts-nocheck /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.1 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.4 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ declare var self: any | undefined; diff --git a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/authz.ts b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/authz.ts index 3edd218d8d..9c890c3f97 100644 --- a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/authz.ts +++ b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/authz.ts @@ -15,6 +15,11 @@ export interface Allocation { spendLimit: Coin[]; /** allow list of receivers, an empty allow list permits any receiver address */ allowList: string[]; + /** + * allow list of memo strings, an empty list prohibits all memo strings; + * a list only with "*" permits any memo string + */ + allowedPacketData: string[]; } export interface AllocationProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Allocation"; @@ -30,6 +35,11 @@ export interface AllocationAmino { spend_limit?: CoinAmino[]; /** allow list of receivers, an empty allow list permits any receiver address */ allow_list?: string[]; + /** + * allow list of memo strings, an empty list prohibits all memo strings; + * a list only with "*" permits any memo string + */ + allowed_packet_data?: string[]; } export interface AllocationAminoMsg { type: "cosmos-sdk/Allocation"; @@ -41,6 +51,7 @@ export interface AllocationSDKType { source_channel: string; spend_limit: CoinSDKType[]; allow_list: string[]; + allowed_packet_data: string[]; } /** * TransferAuthorization allows the grantee to spend up to spend_limit coins from @@ -81,6 +92,7 @@ function createBaseAllocation(): Allocation { sourceChannel: "", spendLimit: [], allowList: [], + allowedPacketData: [], }; } export const Allocation = { @@ -101,6 +113,9 @@ export const Allocation = { for (const v of message.allowList) { writer.uint32(34).string(v!); } + for (const v of message.allowedPacketData) { + writer.uint32(42).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Allocation { @@ -123,6 +138,9 @@ export const Allocation = { case 4: message.allowList.push(reader.string()); break; + case 5: + message.allowedPacketData.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -137,6 +155,7 @@ export const Allocation = { message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; message.allowList = object.allowList?.map((e) => e) || []; + message.allowedPacketData = object.allowedPacketData?.map((e) => e) || []; return message; }, fromAmino(object: AllocationAmino): Allocation { @@ -150,6 +169,7 @@ export const Allocation = { message.spendLimit = object.spend_limit?.map((e) => Coin.fromAmino(e)) || []; message.allowList = object.allow_list?.map((e) => e) || []; + message.allowedPacketData = object.allowed_packet_data?.map((e) => e) || []; return message; }, toAmino(message: Allocation): AllocationAmino { @@ -170,6 +190,11 @@ export const Allocation = { } else { obj.allow_list = message.allowList; } + if (message.allowedPacketData) { + obj.allowed_packet_data = message.allowedPacketData.map((e) => e); + } else { + obj.allowed_packet_data = message.allowedPacketData; + } return obj; }, fromAminoMsg(object: AllocationAminoMsg): Allocation { diff --git a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts index 1d4356516b..726600333c 100644 --- a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts @@ -1,9 +1,14 @@ //@ts-nocheck -import { MsgTransfer } from "./tx"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.transfer.v1.MsgTransfer": { aminoType: "cosmos-sdk/MsgTransfer", toAmino: MsgTransfer.toAmino, fromAmino: MsgTransfer.fromAmino, }, + "/ibc.applications.transfer.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino, + }, }; diff --git a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts index bd759865ae..fd76678c29 100644 --- a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts +++ b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts @@ -1,9 +1,10 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgTransfer } from "./tx"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; export const registry: ReadonlyArray<[string, GeneratedType]> = [ ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], + ["/ibc.applications.transfer.v1.MsgUpdateParams", MsgUpdateParams], ]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { @@ -18,6 +19,12 @@ export const MessageComposer = { value: MsgTransfer.encode(value).finish(), }; }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, }, withTypeUrl: { transfer(value: MsgTransfer) { @@ -26,6 +33,12 @@ export const MessageComposer = { value, }; }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value, + }; + }, }, fromPartial: { transfer(value: MsgTransfer) { @@ -34,5 +47,11 @@ export const MessageComposer = { value: MsgTransfer.fromPartial(value), }; }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, }, }; diff --git a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.ts b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.ts index 9d754c241b..6ea0154b15 100644 --- a/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/packages/proto-codecs/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -9,6 +9,9 @@ import { Height, HeightAmino, HeightSDKType, + Params, + ParamsAmino, + ParamsSDKType, } from "../../../core/client/v1/client"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between @@ -54,7 +57,7 @@ export interface MsgTransferAmino { /** the channel by which the packet will be sent */ source_channel?: string; /** the tokens to be transferred */ - token?: CoinAmino; + token: CoinAmino; /** the sender address */ sender?: string; /** the recipient address on the destination chain */ @@ -63,7 +66,7 @@ export interface MsgTransferAmino { * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height?: HeightAmino; + timeout_height: HeightAmino; /** * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. @@ -113,6 +116,64 @@ export interface MsgTransferResponseAminoMsg { export interface MsgTransferResponseSDKType { sequence: bigint; } +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", @@ -254,7 +315,9 @@ export const MsgTransfer = { message.sourcePort === "" ? undefined : message.sourcePort; obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; - obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.token = message.token + ? Coin.toAmino(message.token) + : Coin.toAmino(Coin.fromPartial({})); obj.sender = message.sender === "" ? undefined : message.sender; obj.receiver = message.receiver === "" ? undefined : message.receiver; obj.timeout_height = message.timeoutHeight @@ -262,7 +325,7 @@ export const MsgTransfer = { : {}; obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) - ? message.timeoutTimestamp.toString() + ? (message.timeoutTimestamp?.toString)() : undefined; obj.memo = message.memo === "" ? undefined : message.memo; return obj; @@ -344,7 +407,9 @@ export const MsgTransferResponse = { toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { const obj: any = {}; obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + message.sequence !== BigInt(0) + ? (message.sequence?.toString)() + : undefined; return obj; }, fromAminoMsg(object: MsgTransferResponseAminoMsg): MsgTransferResponse { @@ -369,3 +434,162 @@ export const MsgTransferResponse = { }; }, }; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}), + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + encode( + message: MsgUpdateParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message), + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish(), + }; + }, +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + encode( + _: MsgUpdateParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpdateParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUpdateParamsResponseAminoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUpdateParamsResponseProtoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish(), + }; + }, +}; diff --git a/packages/proto-codecs/src/codegen/ibc/bundle.ts b/packages/proto-codecs/src/codegen/ibc/bundle.ts index d7e8e284cb..bab2715533 100644 --- a/packages/proto-codecs/src/codegen/ibc/bundle.ts +++ b/packages/proto-codecs/src/codegen/ibc/bundle.ts @@ -3,14 +3,14 @@ import * as _0 from "./applications/transfer/v1/authz"; import * as _1 from "./applications/transfer/v1/genesis"; import * as _2 from "./applications/transfer/v1/transfer"; import * as _3 from "./applications/transfer/v1/tx"; -import * as _85 from "./applications/transfer/v1/tx.amino"; -import * as _87 from "./applications/transfer/v1/tx.registry"; +import * as _87 from "./applications/transfer/v1/tx.amino"; +import * as _89 from "./applications/transfer/v1/tx.registry"; import * as _4 from "./applications/transfer/v2/packet"; import * as _5 from "./core/client/v1/client"; import * as _6 from "./core/client/v1/genesis"; import * as _7 from "./core/client/v1/tx"; -import * as _86 from "./core/client/v1/tx.amino"; -import * as _88 from "./core/client/v1/tx.registry"; +import * as _88 from "./core/client/v1/tx.amino"; +import * as _90 from "./core/client/v1/tx.registry"; export namespace ibc { export namespace applications { export namespace transfer { @@ -19,8 +19,8 @@ export namespace ibc { ..._1, ..._2, ..._3, - ..._85, ..._87, + ..._89, }; export const v2 = { ..._4, @@ -33,8 +33,8 @@ export namespace ibc { ..._5, ..._6, ..._7, - ..._86, ..._88, + ..._90, }; } } diff --git a/packages/proto-codecs/src/codegen/ibc/core/client/v1/client.ts b/packages/proto-codecs/src/codegen/ibc/core/client/v1/client.ts index 4252926253..7232e2be02 100644 --- a/packages/proto-codecs/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/proto-codecs/src/codegen/ibc/core/client/v1/client.ts @@ -115,11 +115,104 @@ export interface ClientConsensusStatesSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposal { $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; /** the title of the update proposal */ @@ -139,11 +232,14 @@ export interface ClientUpdateProposalProtoMsg { value: Uint8Array; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalAmino { /** the title of the update proposal */ title?: string; @@ -162,11 +258,14 @@ export interface ClientUpdateProposalAminoMsg { value: ClientUpdateProposalAmino; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalSDKType { $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; title: string; @@ -177,7 +276,10 @@ export interface ClientUpdateProposalSDKType { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposal { $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; @@ -200,7 +302,10 @@ export interface UpgradeProposalProtoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalAmino { title?: string; description?: string; @@ -222,7 +327,10 @@ export interface UpgradeProposalAminoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalSDKType { $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; @@ -230,96 +338,6 @@ export interface UpgradeProposalSDKType { plan: PlanSDKType; upgraded_client_state?: AnySDKType; } -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revisionNumber: bigint; - /** the height within the given revision */ - revisionHeight: bigint; -} -export interface HeightProtoMsg { - typeUrl: "/ibc.core.client.v1.Height"; - value: Uint8Array; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightAmino { - /** the revision that the client is currently on */ - revision_number?: string; - /** the height within the given revision */ - revision_height?: string; -} -export interface HeightAminoMsg { - type: "cosmos-sdk/Height"; - value: HeightAmino; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightSDKType { - revision_number: bigint; - revision_height: bigint; -} -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowedClients: string[]; -} -export interface ParamsProtoMsg { - typeUrl: "/ibc.core.client.v1.Params"; - value: Uint8Array; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsAmino { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowed_clients?: string[]; -} -export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; - value: ParamsAmino; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsSDKType { - allowed_clients: string[]; -} function createBaseIdentifiedClientState(): IdentifiedClientState { return { clientId: "", @@ -622,57 +640,39 @@ export const ClientConsensusStates = { }; }, }; -function createBaseClientUpdateProposal(): ClientUpdateProposal { +function createBaseHeight(): Height { return { - $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - title: "", - description: "", - subjectClientId: "", - substituteClientId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), }; } -export const ClientUpdateProposal = { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", encode( - message: ClientUpdateProposal, + message: Height, writer: BinaryWriter = BinaryWriter.create() ): BinaryWriter { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subjectClientId !== "") { - writer.uint32(26).string(message.subjectClientId); + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); } - if (message.substituteClientId !== "") { - writer.uint32(34).string(message.substituteClientId); + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); } return writer; }, - decode( - input: BinaryReader | Uint8Array, - length?: number - ): ClientUpdateProposal { + decode(input: BinaryReader | Uint8Array, length?: number): Height { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClientUpdateProposal(); + const message = createBaseHeight(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.revisionNumber = reader.uint64(); break; case 2: - message.description = reader.string(); - break; - case 3: - message.subjectClientId = reader.string(); - break; - case 4: - message.substituteClientId = reader.string(); + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -681,22 +681,208 @@ export const ClientUpdateProposal = { } return message; }, - fromPartial(object: Partial): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.subjectClientId = object.subjectClientId ?? ""; - message.substituteClientId = object.substituteClientId ?? ""; + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = + object.revisionNumber !== undefined && object.revisionNumber !== null + ? BigInt(object.revisionNumber.toString()) + : BigInt(0); + message.revisionHeight = + object.revisionHeight !== undefined && object.revisionHeight !== null + ? BigInt(object.revisionHeight.toString()) + : BigInt(0); return message; }, - fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0"), + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = + message.revisionNumber !== BigInt(0) + ? (message.revisionNumber?.toString)() + : undefined; + obj.revision_height = + message.revisionHeight !== BigInt(0) + ? (message.revisionHeight?.toString)() + : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: "cosmos-sdk/Height", + value: Height.toAmino(message), + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish(), + }; + }, +}; +function createBaseParams(): Params { + return { + allowedClients: [], + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map((e) => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map((e) => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map((e) => e); + } else { + obj.allowed_clients = message.allowedClients; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message), + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish(), + }; + }, +}; +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { + $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + title: "", + description: "", + subjectClientId: "", + substituteClientId: "", + }; +} +export const ClientUpdateProposal = { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + encode( + message: ClientUpdateProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): ClientUpdateProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, + fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } if ( object.subject_client_id !== undefined && object.subject_client_id !== null @@ -872,171 +1058,3 @@ export const UpgradeProposal = { }; }, }; -function createBaseHeight(): Height { - return { - revisionNumber: BigInt(0), - revisionHeight: BigInt(0), - }; -} -export const Height = { - typeUrl: "/ibc.core.client.v1.Height", - encode( - message: Height, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - if (message.revisionNumber !== BigInt(0)) { - writer.uint32(8).uint64(message.revisionNumber); - } - if (message.revisionHeight !== BigInt(0)) { - writer.uint32(16).uint64(message.revisionHeight); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Height { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeight(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revisionNumber = reader.uint64(); - break; - case 2: - message.revisionHeight = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Height { - const message = createBaseHeight(); - message.revisionNumber = - object.revisionNumber !== undefined && object.revisionNumber !== null - ? BigInt(object.revisionNumber.toString()) - : BigInt(0); - message.revisionHeight = - object.revisionHeight !== undefined && object.revisionHeight !== null - ? BigInt(object.revisionHeight.toString()) - : BigInt(0); - return message; - }, - fromAmino(object: HeightAmino): Height { - return { - revisionNumber: BigInt(object.revision_number || "0"), - revisionHeight: BigInt(object.revision_height || "0"), - }; - }, - toAmino(message: Height): HeightAmino { - const obj: any = {}; - obj.revision_number = - message.revisionNumber !== BigInt(0) - ? message.revisionNumber.toString() - : undefined; - obj.revision_height = - message.revisionHeight !== BigInt(0) - ? message.revisionHeight.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: HeightAminoMsg): Height { - return Height.fromAmino(object.value); - }, - toAminoMsg(message: Height): HeightAminoMsg { - return { - type: "cosmos-sdk/Height", - value: Height.toAmino(message), - }; - }, - fromProtoMsg(message: HeightProtoMsg): Height { - return Height.decode(message.value); - }, - toProto(message: Height): Uint8Array { - return Height.encode(message).finish(); - }, - toProtoMsg(message: Height): HeightProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Height", - value: Height.encode(message).finish(), - }; - }, -}; -function createBaseParams(): Params { - return { - allowedClients: [], - }; -} -export const Params = { - typeUrl: "/ibc.core.client.v1.Params", - encode( - message: Params, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - for (const v of message.allowedClients) { - writer.uint32(10).string(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowedClients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.allowedClients = object.allowedClients?.map((e) => e) || []; - return message; - }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - message.allowedClients = object.allowed_clients?.map((e) => e) || []; - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.allowedClients) { - obj.allowed_clients = message.allowedClients.map((e) => e); - } else { - obj.allowed_clients = message.allowedClients; - } - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "cosmos-sdk/Params", - value: Params.toAmino(message), - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Params", - value: Params.encode(message).finish(), - }; - }, -}; diff --git a/packages/proto-codecs/src/codegen/ibc/core/client/v1/genesis.ts b/packages/proto-codecs/src/codegen/ibc/core/client/v1/genesis.ts index d4147b7c35..fafe8737e8 100644 --- a/packages/proto-codecs/src/codegen/ibc/core/client/v1/genesis.ts +++ b/packages/proto-codecs/src/codegen/ibc/core/client/v1/genesis.ts @@ -21,7 +21,11 @@ export interface GenesisState { /** metadata from each client */ clientsMetadata: IdentifiedGenesisMetadata[]; params: Params; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ nextClientSequence: bigint; @@ -39,7 +43,11 @@ export interface GenesisStateAmino { /** metadata from each client */ clients_metadata?: IdentifiedGenesisMetadataAmino[]; params?: ParamsAmino; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ create_localhost?: boolean; /** the sequence for the next generated client identifier */ next_client_sequence?: string; @@ -54,6 +62,7 @@ export interface GenesisStateSDKType { clients_consensus: ClientConsensusStatesSDKType[]; clients_metadata: IdentifiedGenesisMetadataSDKType[]; params: ParamsSDKType; + /** @deprecated */ create_localhost: boolean; next_client_sequence: bigint; } @@ -281,7 +290,7 @@ export const GenesisState = { message.createLocalhost === false ? undefined : message.createLocalhost; obj.next_client_sequence = message.nextClientSequence !== BigInt(0) - ? message.nextClientSequence.toString() + ? (message.nextClientSequence?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.amino.ts b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.amino.ts index 06a99a83ac..d19be67e0f 100644 --- a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.amino.ts @@ -1,8 +1,11 @@ //@ts-nocheck import { MsgCreateClient, + MsgIBCSoftwareUpgrade, + MsgRecoverClient, MsgSubmitMisbehaviour, MsgUpdateClient, + MsgUpdateParams, MsgUpgradeClient, } from "./tx"; export const AminoConverter = { @@ -26,4 +29,19 @@ export const AminoConverter = { toAmino: MsgSubmitMisbehaviour.toAmino, fromAmino: MsgSubmitMisbehaviour.fromAmino, }, + "/ibc.core.client.v1.MsgRecoverClient": { + aminoType: "cosmos-sdk/MsgRecoverClient", + toAmino: MsgRecoverClient.toAmino, + fromAmino: MsgRecoverClient.fromAmino, + }, + "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + toAmino: MsgIBCSoftwareUpgrade.toAmino, + fromAmino: MsgIBCSoftwareUpgrade.fromAmino, + }, + "/ibc.core.client.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino, + }, }; diff --git a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.registry.ts b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.registry.ts index 330d4386f5..37655b3fc5 100644 --- a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.registry.ts +++ b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.registry.ts @@ -3,8 +3,11 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; import { MsgCreateClient, + MsgIBCSoftwareUpgrade, + MsgRecoverClient, MsgSubmitMisbehaviour, MsgUpdateClient, + MsgUpdateParams, MsgUpgradeClient, } from "./tx"; export const registry: ReadonlyArray<[string, GeneratedType]> = [ @@ -12,6 +15,9 @@ export const registry: ReadonlyArray<[string, GeneratedType]> = [ ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], + ["/ibc.core.client.v1.MsgRecoverClient", MsgRecoverClient], + ["/ibc.core.client.v1.MsgIBCSoftwareUpgrade", MsgIBCSoftwareUpgrade], + ["/ibc.core.client.v1.MsgUpdateParams", MsgUpdateParams], ]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { @@ -44,6 +50,24 @@ export const MessageComposer = { value: MsgSubmitMisbehaviour.encode(value).finish(), }; }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(value).finish(), + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(value).finish(), + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, }, withTypeUrl: { createClient(value: MsgCreateClient) { @@ -70,6 +94,24 @@ export const MessageComposer = { value, }; }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value, + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value, + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value, + }; + }, }, fromPartial: { createClient(value: MsgCreateClient) { @@ -96,5 +138,23 @@ export const MessageComposer = { value: MsgSubmitMisbehaviour.fromPartial(value), }; }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.fromPartial(value), + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.fromPartial(value), + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, }, }; diff --git a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.ts b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.ts index e887073187..b6b4f069df 100644 --- a/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.ts +++ b/packages/proto-codecs/src/codegen/ibc/core/client/v1/tx.ts @@ -1,7 +1,13 @@ //@ts-nocheck import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { + Plan, + PlanAmino, + PlanSDKType, +} from "../../../../cosmos/upgrade/v1beta1/upgrade"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { base64FromBytes, bytesFromBase64 } from "../../../../helpers"; +import { Params, ParamsAmino, ParamsSDKType } from "./client"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ @@ -188,17 +194,15 @@ export interface MsgUpgradeClientResponseSDKType {} /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviour { /** client unique identifier */ - /** @deprecated */ clientId: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ misbehaviour?: Any; /** signer address */ - /** @deprecated */ signer: string; } export interface MsgSubmitMisbehaviourProtoMsg { @@ -208,17 +212,15 @@ export interface MsgSubmitMisbehaviourProtoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourAmino { /** client unique identifier */ - /** @deprecated */ client_id?: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ misbehaviour?: AnyAmino; /** signer address */ - /** @deprecated */ signer?: string; } export interface MsgSubmitMisbehaviourAminoMsg { @@ -228,14 +230,12 @@ export interface MsgSubmitMisbehaviourAminoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourSDKType { - /** @deprecated */ client_id: string; - /** @deprecated */ misbehaviour?: AnySDKType; - /** @deprecated */ signer: string; } /** @@ -261,6 +261,169 @@ export interface MsgSubmitMisbehaviourResponseAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponseSDKType {} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClient { + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substituteClientId: string; + /** signer address */ + signer: string; +} +export interface MsgRecoverClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; + value: Uint8Array; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientAmino { + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substitute_client_id?: string; + /** signer address */ + signer?: string; +} +export interface MsgRecoverClientAminoMsg { + type: "cosmos-sdk/MsgRecoverClient"; + value: MsgRecoverClientAmino; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientSDKType { + subject_client_id: string; + substitute_client_id: string; + signer: string; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponse {} +export interface MsgRecoverClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; + value: Uint8Array; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseAmino {} +export interface MsgRecoverClientResponseAminoMsg { + type: "cosmos-sdk/MsgRecoverClientResponse"; + value: MsgRecoverClientResponseAmino; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseSDKType {} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgrade { + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgradedClientState?: Any; + /** signer address */ + signer: string; +} +export interface MsgIBCSoftwareUpgradeProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeAmino { + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgraded_client_state?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgIBCSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade"; + value: MsgIBCSoftwareUpgradeAmino; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeSDKType { + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; + signer: string; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponse {} +export interface MsgIBCSoftwareUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseAmino {} +export interface MsgIBCSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse"; + value: MsgIBCSoftwareUpgradeResponseAmino; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateClient(): MsgCreateClient { return { clientState: undefined, @@ -1027,3 +1190,532 @@ export const MsgSubmitMisbehaviourResponse = { }; }, }; +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "", + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + encode( + message: MsgRecoverClient, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.subjectClientId !== "") { + writer.uint32(10).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(18).string(message.substituteClientId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClient { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectClientId = reader.string(); + break; + case 2: + message.substituteClientId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecoverClientAmino): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + if ( + object.subject_client_id !== undefined && + object.subject_client_id !== null + ) { + message.subjectClientId = object.subject_client_id; + } + if ( + object.substitute_client_id !== undefined && + object.substitute_client_id !== null + ) { + message.substituteClientId = object.substitute_client_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgRecoverClient): MsgRecoverClientAmino { + const obj: any = {}; + obj.subject_client_id = + message.subjectClientId === "" ? undefined : message.subjectClientId; + obj.substitute_client_id = + message.substituteClientId === "" + ? undefined + : message.substituteClientId; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientAminoMsg): MsgRecoverClient { + return MsgRecoverClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClient): MsgRecoverClientAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClient", + value: MsgRecoverClient.toAmino(message), + }; + }, + fromProtoMsg(message: MsgRecoverClientProtoMsg): MsgRecoverClient { + return MsgRecoverClient.decode(message.value); + }, + toProto(message: MsgRecoverClient): Uint8Array { + return MsgRecoverClient.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClient): MsgRecoverClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(message).finish(), + }; + }, +}; +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + encode( + _: MsgRecoverClientResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgRecoverClientResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + fromAmino(_: MsgRecoverClientResponseAmino): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + toAmino(_: MsgRecoverClientResponse): MsgRecoverClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgRecoverClientResponseAminoMsg + ): MsgRecoverClientResponse { + return MsgRecoverClientResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgRecoverClientResponse + ): MsgRecoverClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClientResponse", + value: MsgRecoverClientResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgRecoverClientResponseProtoMsg + ): MsgRecoverClientResponse { + return MsgRecoverClientResponse.decode(message.value); + }, + toProto(message: MsgRecoverClientResponse): Uint8Array { + return MsgRecoverClientResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgRecoverClientResponse + ): MsgRecoverClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + value: MsgRecoverClientResponse.encode(message).finish(), + }; + }, +}; +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "", + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + encode( + message: MsgIBCSoftwareUpgrade, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode( + message.upgradedClientState, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgIBCSoftwareUpgrade { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 2: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + message.plan = + object.plan !== undefined && object.plan !== null + ? Plan.fromPartial(object.plan) + : undefined; + message.upgradedClientState = + object.upgradedClientState !== undefined && + object.upgradedClientState !== null + ? Any.fromPartial(object.upgradedClientState) + : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgIBCSoftwareUpgradeAmino): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if ( + object.upgraded_client_state !== undefined && + object.upgraded_client_state !== null + ) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAmino { + const obj: any = {}; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState + ? Any.toAmino(message.upgradedClientState) + : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeAminoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.toAmino(message), + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeProtoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgrade): Uint8Array { + return MsgIBCSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(message).finish(), + }; + }, +}; +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + encode( + _: MsgIBCSoftwareUpgradeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgIBCSoftwareUpgradeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + fromAmino( + _: MsgIBCSoftwareUpgradeResponseAmino + ): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + toAmino( + _: MsgIBCSoftwareUpgradeResponse + ): MsgIBCSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgIBCSoftwareUpgradeResponseAminoMsg + ): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgIBCSoftwareUpgradeResponse + ): MsgIBCSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgIBCSoftwareUpgradeResponseProtoMsg + ): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgradeResponse): Uint8Array { + return MsgIBCSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgIBCSoftwareUpgradeResponse + ): MsgIBCSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.encode(message).finish(), + }; + }, +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}), + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + encode( + message: MsgUpdateParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message), + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish(), + }; + }, +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + encode( + _: MsgUpdateParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgUpdateParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgUpdateParamsResponseAminoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgUpdateParamsResponseProtoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish(), + }; + }, +}; diff --git a/packages/proto-codecs/src/codegen/index.ts b/packages/proto-codecs/src/codegen/index.ts index 37a51a432d..1dd8fc334b 100644 --- a/packages/proto-codecs/src/codegen/index.ts +++ b/packages/proto-codecs/src/codegen/index.ts @@ -1,8 +1,8 @@ //@ts-nocheck /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.1 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.4 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ export * from "./binary"; diff --git a/packages/proto-codecs/src/codegen/osmosis/bundle.ts b/packages/proto-codecs/src/codegen/osmosis/bundle.ts index a8da3eb478..0c0a4b2d99 100644 --- a/packages/proto-codecs/src/codegen/osmosis/bundle.ts +++ b/packages/proto-codecs/src/codegen/osmosis/bundle.ts @@ -1,10 +1,10 @@ //@ts-nocheck import * as _14 from "./accum/v1beta1/accum"; import * as _15 from "./concentratedliquidity/params"; -import * as _91 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _101 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _92 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _102 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _93 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _103 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _94 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _104 from "./concentratedliquidity/v1beta1/tx.registry"; import * as _16 from "./cosmwasmpool/v1beta1/genesis"; import * as _17 from "./cosmwasmpool/v1beta1/gov"; import * as _18 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; @@ -17,49 +17,51 @@ import * as _24 from "./cosmwasmpool/v1beta1/model/tx"; import * as _25 from "./cosmwasmpool/v1beta1/params"; import * as _26 from "./cosmwasmpool/v1beta1/tx"; import * as _27 from "./gamm/poolmodels/balancer/v1beta1/tx"; -import * as _93 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; -import * as _103 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as _95 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as _105 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; import * as _28 from "./gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; import * as _29 from "./gamm/poolmodels/stableswap/v1beta1/tx"; -import * as _94 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; -import * as _104 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; +import * as _96 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; +import * as _106 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; import * as _30 from "./gamm/v1beta1/balancerPool"; import * as _31 from "./gamm/v1beta1/genesis"; import * as _32 from "./gamm/v1beta1/gov"; -import * as _33 from "./gamm/v1beta1/shared"; -import * as _34 from "./gamm/v1beta1/tx"; -import * as _95 from "./gamm/v1beta1/tx.amino"; -import * as _105 from "./gamm/v1beta1/tx.registry"; -import * as _35 from "./lockup/genesis"; -import * as _36 from "./lockup/lock"; -import * as _37 from "./lockup/params"; -import * as _38 from "./lockup/tx"; -import * as _96 from "./lockup/tx.amino"; -import * as _106 from "./lockup/tx.registry"; -import * as _39 from "./poolmanager/v1beta1/genesis"; -import * as _40 from "./poolmanager/v1beta1/gov"; -import * as _41 from "./poolmanager/v1beta1/module_route"; -import * as _42 from "./poolmanager/v1beta1/swap_route"; -import * as _43 from "./poolmanager/v1beta1/tracked_volume"; -import * as _44 from "./poolmanager/v1beta1/tx"; -import * as _97 from "./poolmanager/v1beta1/tx.amino"; -import * as _107 from "./poolmanager/v1beta1/tx.registry"; -import * as _45 from "./smartaccount/v1beta1/genesis"; -import * as _46 from "./smartaccount/v1beta1/models"; -import * as _47 from "./smartaccount/v1beta1/params"; -import * as _48 from "./smartaccount/v1beta1/tx"; -import * as _98 from "./smartaccount/v1beta1/tx.amino"; -import * as _108 from "./smartaccount/v1beta1/tx.registry"; -import * as _49 from "./superfluid/genesis"; -import * as _50 from "./superfluid/params"; -import * as _51 from "./superfluid/superfluid"; -import * as _52 from "./superfluid/tx"; -import * as _99 from "./superfluid/tx.amino"; -import * as _109 from "./superfluid/tx.registry"; -import * as _53 from "./valsetpref/v1beta1/state"; -import * as _54 from "./valsetpref/v1beta1/tx"; -import * as _100 from "./valsetpref/v1beta1/tx.amino"; -import * as _110 from "./valsetpref/v1beta1/tx.registry"; +import * as _33 from "./gamm/v1beta1/params"; +import * as _34 from "./gamm/v1beta1/shared"; +import * as _35 from "./gamm/v1beta1/tx"; +import * as _97 from "./gamm/v1beta1/tx.amino"; +import * as _107 from "./gamm/v1beta1/tx.registry"; +import * as _36 from "./lockup/genesis"; +import * as _37 from "./lockup/lock"; +import * as _38 from "./lockup/params"; +import * as _39 from "./lockup/tx"; +import * as _98 from "./lockup/tx.amino"; +import * as _108 from "./lockup/tx.registry"; +import * as _40 from "./poolmanager/v1beta1/genesis"; +import * as _41 from "./poolmanager/v1beta1/gov"; +import * as _42 from "./poolmanager/v1beta1/module_route"; +import * as _43 from "./poolmanager/v1beta1/swap_route"; +import * as _44 from "./poolmanager/v1beta1/taker_fee_share"; +import * as _45 from "./poolmanager/v1beta1/tracked_volume"; +import * as _46 from "./poolmanager/v1beta1/tx"; +import * as _99 from "./poolmanager/v1beta1/tx.amino"; +import * as _109 from "./poolmanager/v1beta1/tx.registry"; +import * as _47 from "./smartaccount/v1beta1/genesis"; +import * as _48 from "./smartaccount/v1beta1/models"; +import * as _49 from "./smartaccount/v1beta1/params"; +import * as _50 from "./smartaccount/v1beta1/tx"; +import * as _100 from "./smartaccount/v1beta1/tx.amino"; +import * as _110 from "./smartaccount/v1beta1/tx.registry"; +import * as _51 from "./superfluid/genesis"; +import * as _52 from "./superfluid/params"; +import * as _53 from "./superfluid/superfluid"; +import * as _54 from "./superfluid/tx"; +import * as _101 from "./superfluid/tx.amino"; +import * as _111 from "./superfluid/tx.registry"; +import * as _55 from "./valsetpref/v1beta1/state"; +import * as _56 from "./valsetpref/v1beta1/tx"; +import * as _102 from "./valsetpref/v1beta1/tx.amino"; +import * as _112 from "./valsetpref/v1beta1/tx.registry"; export namespace osmosis { export namespace accum { export const v1beta1 = { @@ -71,14 +73,14 @@ export namespace osmosis { poolmodel: { concentrated: { v1beta1: { - ..._91, - ..._101, + ..._93, + ..._103, }, }, }, v1beta1: { - ..._92, - ..._102, + ..._94, + ..._104, }, }; export namespace cosmwasmpool { @@ -101,16 +103,16 @@ export namespace osmosis { export namespace balancer { export const v1beta1 = { ..._27, - ..._93, - ..._103, + ..._95, + ..._105, }; } export namespace stableswap { export const v1beta1 = { ..._28, ..._29, - ..._94, - ..._104, + ..._96, + ..._106, }; } } @@ -120,54 +122,56 @@ export namespace osmosis { ..._32, ..._33, ..._34, - ..._95, - ..._105, + ..._35, + ..._97, + ..._107, }; } export const lockup = { - ..._35, ..._36, ..._37, ..._38, - ..._96, - ..._106, + ..._39, + ..._98, + ..._108, }; export namespace poolmanager { export const v1beta1 = { - ..._39, ..._40, ..._41, ..._42, ..._43, ..._44, - ..._97, - ..._107, + ..._45, + ..._46, + ..._99, + ..._109, }; } export namespace smartaccount { export const v1beta1 = { - ..._45, - ..._46, ..._47, ..._48, - ..._98, - ..._108, + ..._49, + ..._50, + ..._100, + ..._110, }; } export const superfluid = { - ..._49, - ..._50, ..._51, ..._52, - ..._99, - ..._109, + ..._53, + ..._54, + ..._101, + ..._111, }; export namespace valsetpref { export const v1beta1 = { - ..._53, - ..._54, - ..._100, - ..._110, + ..._55, + ..._56, + ..._102, + ..._112, }; } } diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/params.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/params.ts index 6ba730756c..97f5030213 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/params.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/params.ts @@ -26,14 +26,16 @@ export interface Params { */ balancerSharesRewardDiscount: string; /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convenient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. + * DEPRECATED: authorized_quote_denoms is a list of quote denoms that can be + * used as token1 when creating a pool. We limit the quote assets to a small + * set for the purposes of having convenient price increments stemming from + * tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. */ + /** @deprecated */ authorizedQuoteDenoms: string[]; authorizedUptimes: Duration[]; /** @@ -76,14 +78,16 @@ export interface ParamsAmino { */ balancer_shares_reward_discount?: string; /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convenient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. + * DEPRECATED: authorized_quote_denoms is a list of quote denoms that can be + * used as token1 when creating a pool. We limit the quote assets to a small + * set for the purposes of having convenient price increments stemming from + * tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. */ + /** @deprecated */ authorized_quote_denoms?: string[]; authorized_uptimes?: DurationAmino[]; /** @@ -111,6 +115,7 @@ export interface ParamsSDKType { authorized_tick_spacing: bigint[]; authorized_spread_factors: string[]; balancer_shares_reward_discount: string; + /** @deprecated */ authorized_quote_denoms: string[]; authorized_uptimes: DurationSDKType[]; is_permissionless_pool_creation_enabled: boolean; @@ -319,7 +324,7 @@ export const Params = { } obj.hook_gas_limit = message.hookGasLimit !== BigInt(0) - ? message.hookGasLimit.toString() + ? (message.hookGasLimit?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts index b702f8b412..94f92ab69b 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts @@ -3,8 +3,7 @@ import { MsgCreateConcentratedPool } from "./tx"; export const AminoConverter = { "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool": { - aminoType: - "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool", + aminoType: "osmosis/create-concentrated-pool", toAmino: MsgCreateConcentratedPool.toAmino, fromAmino: MsgCreateConcentratedPool.fromAmino, }, diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts index d9fef38d69..94b82e7537 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts @@ -23,7 +23,7 @@ export interface MsgCreateConcentratedPoolAmino { spread_factor?: string; } export interface MsgCreateConcentratedPoolAminoMsg { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool"; + type: "osmosis/create-concentrated-pool"; value: MsgCreateConcentratedPoolAmino; } /** ===================== MsgCreateConcentratedPool */ @@ -165,7 +165,7 @@ export const MsgCreateConcentratedPool = { obj.denom1 = message.denom1 === "" ? undefined : message.denom1; obj.tick_spacing = message.tickSpacing !== BigInt(0) - ? message.tickSpacing.toString() + ? (message.tickSpacing?.toString)() : undefined; obj.spread_factor = message.spreadFactor === "" ? undefined : message.spreadFactor; @@ -180,7 +180,7 @@ export const MsgCreateConcentratedPool = { message: MsgCreateConcentratedPool ): MsgCreateConcentratedPoolAminoMsg { return { - type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool", + type: "osmosis/create-concentrated-pool", value: MsgCreateConcentratedPool.toAmino(message), }; }, @@ -264,7 +264,7 @@ export const MsgCreateConcentratedPoolResponse = { ): MsgCreateConcentratedPoolResponseAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts index 3cf7264d69..eb324b190f 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts @@ -309,10 +309,10 @@ export const FullTick = { toAmino(message: FullTick): FullTickAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.tick_index = message.tickIndex !== BigInt(0) - ? message.tickIndex.toString() + ? (message.tickIndex?.toString)() : undefined; obj.info = message.info ? TickInfo.toAmino(message.info) : undefined; return obj; @@ -610,7 +610,7 @@ export const PositionData = { ? Position.toAmino(message.position) : undefined; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.spread_reward_accum_record = message.spreadRewardAccumRecord ? Record.toAmino(message.spreadRewardAccumRecord) : undefined; @@ -817,19 +817,19 @@ export const GenesisState = { } obj.next_position_id = message.nextPositionId !== BigInt(0) - ? message.nextPositionId.toString() + ? (message.nextPositionId?.toString)() : undefined; obj.next_incentive_record_id = message.nextIncentiveRecordId !== BigInt(0) - ? message.nextIncentiveRecordId.toString() + ? (message.nextIncentiveRecordId?.toString)() : undefined; obj.incentives_accumulator_pool_id_migration_threshold = message.incentivesAccumulatorPoolIdMigrationThreshold !== BigInt(0) - ? message.incentivesAccumulatorPoolIdMigrationThreshold.toString() + ? (message.incentivesAccumulatorPoolIdMigrationThreshold?.toString)() : undefined; obj.spread_factor_pool_id_migration_threshold = message.spreadFactorPoolIdMigrationThreshold !== BigInt(0) - ? message.spreadFactorPoolIdMigrationThreshold.toString() + ? (message.spreadFactorPoolIdMigrationThreshold?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts index 2ad0823939..a204c34901 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts @@ -117,6 +117,9 @@ export interface PoolRecord { denom0: string; denom1: string; tickSpacing: bigint; + /** DEPRECATED */ + /** @deprecated */ + exponentAtPriceOne: string; spreadFactor: string; } export interface PoolRecordProtoMsg { @@ -127,6 +130,9 @@ export interface PoolRecordAmino { denom0?: string; denom1?: string; tick_spacing?: string; + /** DEPRECATED */ + /** @deprecated */ + exponent_at_price_one?: string; spread_factor?: string; } export interface PoolRecordAminoMsg { @@ -137,6 +143,8 @@ export interface PoolRecordSDKType { denom0: string; denom1: string; tick_spacing: bigint; + /** @deprecated */ + exponent_at_price_one: string; spread_factor: string; } function createBaseCreateConcentratedLiquidityPoolsProposal(): CreateConcentratedLiquidityPoolsProposal { @@ -465,10 +473,10 @@ export const PoolIdToTickSpacingRecord = { toAmino(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.new_tick_spacing = message.newTickSpacing !== BigInt(0) - ? message.newTickSpacing.toString() + ? (message.newTickSpacing?.toString)() : undefined; return obj; }, @@ -508,6 +516,7 @@ function createBasePoolRecord(): PoolRecord { denom0: "", denom1: "", tickSpacing: BigInt(0), + exponentAtPriceOne: "", spreadFactor: "", }; } @@ -526,6 +535,9 @@ export const PoolRecord = { if (message.tickSpacing !== BigInt(0)) { writer.uint32(24).uint64(message.tickSpacing); } + if (message.exponentAtPriceOne !== "") { + writer.uint32(34).string(message.exponentAtPriceOne); + } if (message.spreadFactor !== "") { writer .uint32(42) @@ -550,6 +562,9 @@ export const PoolRecord = { case 3: message.tickSpacing = reader.uint64(); break; + case 4: + message.exponentAtPriceOne = reader.string(); + break; case 5: message.spreadFactor = Decimal.fromAtomics( reader.string(), @@ -571,6 +586,7 @@ export const PoolRecord = { object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); + message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; message.spreadFactor = object.spreadFactor ?? ""; return message; }, @@ -585,6 +601,12 @@ export const PoolRecord = { if (object.tick_spacing !== undefined && object.tick_spacing !== null) { message.tickSpacing = BigInt(object.tick_spacing); } + if ( + object.exponent_at_price_one !== undefined && + object.exponent_at_price_one !== null + ) { + message.exponentAtPriceOne = object.exponent_at_price_one; + } if (object.spread_factor !== undefined && object.spread_factor !== null) { message.spreadFactor = object.spread_factor; } @@ -596,8 +618,12 @@ export const PoolRecord = { obj.denom1 = message.denom1 === "" ? undefined : message.denom1; obj.tick_spacing = message.tickSpacing !== BigInt(0) - ? message.tickSpacing.toString() + ? (message.tickSpacing?.toString)() : undefined; + obj.exponent_at_price_one = + message.exponentAtPriceOne === "" + ? undefined + : message.exponentAtPriceOne; obj.spread_factor = message.spreadFactor === "" ? undefined : message.spreadFactor; return obj; diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts index a21b54cb9c..8ec7906d0d 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts @@ -220,10 +220,10 @@ export const IncentiveRecord = { const obj: any = {}; obj.incentive_id = message.incentiveId !== BigInt(0) - ? message.incentiveId.toString() + ? (message.incentiveId?.toString)() : undefined; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.incentive_record_body = message.incentiveRecordBody ? IncentiveRecordBody.toAmino(message.incentiveRecordBody) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts index 0888b0ef12..f16ea53326 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts @@ -323,7 +323,7 @@ export const Pool = { message.spreadRewardsAddress === "" ? undefined : message.spreadRewardsAddress; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? (message.id?.toString)() : undefined; obj.current_tick_liquidity = message.currentTickLiquidity === "" ? undefined @@ -334,15 +334,15 @@ export const Pool = { message.currentSqrtPrice === "" ? undefined : message.currentSqrtPrice; obj.current_tick = message.currentTick !== BigInt(0) - ? message.currentTick.toString() + ? (message.currentTick?.toString)() : undefined; obj.tick_spacing = message.tickSpacing !== BigInt(0) - ? message.tickSpacing.toString() + ? (message.tickSpacing?.toString)() : undefined; obj.exponent_at_price_one = message.exponentAtPriceOne !== BigInt(0) - ? message.exponentAtPriceOne.toString() + ? (message.exponentAtPriceOne?.toString)() : undefined; obj.spread_factor = message.spreadFactor === "" ? undefined : message.spreadFactor; diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts index f4e4ee5c47..7a464dd9b0 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts @@ -278,18 +278,18 @@ export const Position = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.address = message.address === "" ? undefined : message.address; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.lower_tick = message.lowerTick !== BigInt(0) - ? message.lowerTick.toString() + ? (message.lowerTick?.toString)() : undefined; obj.upper_tick = message.upperTick !== BigInt(0) - ? message.upperTick.toString() + ? (message.upperTick?.toString)() : undefined; obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) diff --git a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts index 7ea1fced91..17c3323bfa 100644 --- a/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts @@ -523,15 +523,15 @@ export const MsgCreatePosition = { toAmino(message: MsgCreatePosition): MsgCreatePositionAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.sender = message.sender === "" ? undefined : message.sender; obj.lower_tick = message.lowerTick !== BigInt(0) - ? message.lowerTick.toString() + ? (message.lowerTick?.toString)() : undefined; obj.upper_tick = message.upperTick !== BigInt(0) - ? message.upperTick.toString() + ? (message.upperTick?.toString)() : undefined; if (message.tokensProvided) { obj.tokens_provided = message.tokensProvided.map((e) => @@ -695,7 +695,7 @@ export const MsgCreatePositionResponse = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.amount0 = message.amount0 === "" ? undefined : message.amount0; obj.amount1 = message.amount1 === "" ? undefined : message.amount1; @@ -703,11 +703,11 @@ export const MsgCreatePositionResponse = { message.liquidityCreated === "" ? undefined : message.liquidityCreated; obj.lower_tick = message.lowerTick !== BigInt(0) - ? message.lowerTick.toString() + ? (message.lowerTick?.toString)() : undefined; obj.upper_tick = message.upperTick !== BigInt(0) - ? message.upperTick.toString() + ? (message.upperTick?.toString)() : undefined; return obj; }, @@ -856,7 +856,7 @@ export const MsgAddToPosition = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.sender = message.sender === "" ? undefined : message.sender; obj.amount0 = message.amount0 === "" ? undefined : message.amount0; @@ -969,7 +969,7 @@ export const MsgAddToPositionResponse = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.amount0 = message.amount0 === "" ? undefined : message.amount0; obj.amount1 = message.amount1 === "" ? undefined : message.amount1; @@ -1092,7 +1092,7 @@ export const MsgWithdrawPosition = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.sender = message.sender === "" ? undefined : message.sender; obj.liquidity_amount = @@ -1835,7 +1835,7 @@ export const MsgFungifyChargedPositionsResponse = { const obj: any = {}; obj.new_position_id = message.newPositionId !== BigInt(0) - ? message.newPositionId.toString() + ? (message.newPositionId?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts index cc6d7a24ae..6e6fd7f1d5 100644 --- a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts +++ b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts @@ -443,7 +443,7 @@ export const MigratePoolContractsProposal = { } obj.new_code_id = message.newCodeId !== BigInt(0) - ? message.newCodeId.toString() + ? (message.newCodeId?.toString)() : undefined; obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) diff --git a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts index a91743d77b..c216b978bc 100644 --- a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts +++ b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts @@ -180,9 +180,9 @@ export const CosmWasmPool = { obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts index 6f3995f792..830143dbe9 100644 --- a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts @@ -18,7 +18,7 @@ export interface MsgCreateCosmWasmPoolAmino { sender?: string; } export interface MsgCreateCosmWasmPoolAminoMsg { - type: "osmosis/cosmwasmpool/create-cosm-wasm-pool"; + type: "osmosis/MsgCreateCosmWasmPool"; value: MsgCreateCosmWasmPoolAmino; } /** ===================== MsgCreateCosmwasmPool */ @@ -127,7 +127,7 @@ export const MsgCreateCosmWasmPool = { toAmino(message: MsgCreateCosmWasmPool): MsgCreateCosmWasmPoolAmino { const obj: any = {}; obj.code_id = - message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + message.codeId !== BigInt(0) ? (message.codeId?.toString)() : undefined; obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; @@ -139,7 +139,7 @@ export const MsgCreateCosmWasmPool = { }, toAminoMsg(message: MsgCreateCosmWasmPool): MsgCreateCosmWasmPoolAminoMsg { return { - type: "osmosis/cosmwasmpool/create-cosm-wasm-pool", + type: "osmosis/MsgCreateCosmWasmPool", value: MsgCreateCosmWasmPool.toAmino(message), }; }, @@ -217,7 +217,7 @@ export const MsgCreateCosmWasmPoolResponse = { ): MsgCreateCosmWasmPoolResponseAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( diff --git a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts index c372ba8680..ebe77d0dbf 100644 --- a/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts +++ b/packages/proto-codecs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts @@ -122,7 +122,7 @@ export const Params = { } obj.pool_migration_limit = message.poolMigrationLimit !== BigInt(0) - ? message.poolMigrationLimit.toString() + ? (message.poolMigrationLimit?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts index 31b0e4b1b5..21791319d3 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts @@ -249,7 +249,7 @@ export const MsgCreateBalancerPoolResponse = { ): MsgCreateBalancerPoolResponseAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts index c9d005f3df..ada1f25700 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts @@ -366,7 +366,7 @@ export const Pool = { toAmino(message: Pool): PoolAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? (message.id?.toString)() : undefined; obj.pool_params = message.poolParams ? PoolParams.toAmino(message.poolParams) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts index 4f6a0c1a5a..78e366c634 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts @@ -359,7 +359,7 @@ export const MsgCreateStableswapPoolResponse = { ): MsgCreateStableswapPoolResponseAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -487,7 +487,7 @@ export const MsgStableSwapAdjustScalingFactors = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; if (message.scalingFactors) { obj.scaling_factors = message.scalingFactors.map((e) => e.toString()); } else { diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts index 6494bb7378..a7e0ee1585 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts @@ -771,7 +771,7 @@ export const Pool = { toAmino(message: Pool): PoolAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? (message.id?.toString)() : undefined; obj.pool_params = message.poolParams ? PoolParams.toAmino(message.poolParams) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/genesis.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/genesis.ts index e66a37cbd9..13d9b5f0fd 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/genesis.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/genesis.ts @@ -1,10 +1,5 @@ //@ts-nocheck import { BinaryReader, BinaryWriter } from "../../../binary"; -import { - Coin, - CoinAmino, - CoinSDKType, -} from "../../../cosmos/base/v1beta1/coin"; import { Any, AnyAmino, @@ -25,31 +20,12 @@ import { PoolSDKType as Pool2SDKType } from "../poolmodels/stableswap/v1beta1/st import { Pool as Pool3 } from "./balancerPool"; import { PoolProtoMsg as Pool3ProtoMsg } from "./balancerPool"; import { PoolSDKType as Pool3SDKType } from "./balancerPool"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType, } from "./shared"; -/** Params holds parameters for the incentives module */ -export interface Params { - poolCreationFee: Coin[]; -} -export interface ParamsProtoMsg { - typeUrl: "/osmosis.gamm.v1beta1.Params"; - value: Uint8Array; -} -/** Params holds parameters for the incentives module */ -export interface ParamsAmino { - pool_creation_fee?: CoinAmino[]; -} -export interface ParamsAminoMsg { - type: "osmosis/gamm/params"; - value: ParamsAmino; -} -/** Params holds parameters for the incentives module */ -export interface ParamsSDKType { - pool_creation_fee: CoinSDKType[]; -} /** GenesisState defines the gamm module's genesis state. */ export interface GenesisState { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; @@ -96,85 +72,6 @@ export interface GenesisStateSDKType { params: ParamsSDKType; migration_records?: MigrationRecordsSDKType; } -function createBaseParams(): Params { - return { - poolCreationFee: [], - }; -} -export const Params = { - typeUrl: "/osmosis.gamm.v1beta1.Params", - encode( - message: Params, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - for (const v of message.poolCreationFee) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.poolCreationFee = - object.poolCreationFee?.map((e) => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - message.poolCreationFee = - object.pool_creation_fee?.map((e) => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.poolCreationFee) { - obj.pool_creation_fee = message.poolCreationFee.map((e) => - e ? Coin.toAmino(e) : undefined - ); - } else { - obj.pool_creation_fee = message.poolCreationFee; - } - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "osmosis/gamm/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.gamm.v1beta1.Params", - value: Params.encode(message).finish(), - }; - }, -}; function createBaseGenesisState(): GenesisState { return { pools: [], @@ -286,7 +183,7 @@ export const GenesisState = { } obj.next_pool_number = message.nextPoolNumber !== BigInt(0) - ? message.nextPoolNumber.toString() + ? (message.nextPoolNumber?.toString)() : undefined; obj.params = message.params ? Params.toAmino(message.params) : undefined; obj.migration_records = message.migrationRecords diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/gov.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/gov.ts index 5aa24136b0..b8fb666a74 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/gov.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/gov.ts @@ -604,7 +604,7 @@ export const PoolRecordWithCFMMLink = { obj.denom1 = message.denom1 === "" ? undefined : message.denom1; obj.tick_spacing = message.tickSpacing !== BigInt(0) - ? message.tickSpacing.toString() + ? (message.tickSpacing?.toString)() : undefined; obj.exponent_at_price_one = message.exponentAtPriceOne === "" @@ -614,7 +614,7 @@ export const PoolRecordWithCFMMLink = { message.spreadFactor === "" ? undefined : message.spreadFactor; obj.balancer_pool_id = message.balancerPoolId !== BigInt(0) - ? message.balancerPoolId.toString() + ? (message.balancerPoolId?.toString)() : undefined; return obj; }, @@ -889,7 +889,7 @@ export const SetScalingFactorControllerProposal = { obj.description = message.description === "" ? undefined : message.description; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.controller_address = message.controllerAddress === "" ? undefined : message.controllerAddress; return obj; diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/params.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/params.ts new file mode 100644 index 0000000000..4b604fb05d --- /dev/null +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/params.ts @@ -0,0 +1,106 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { + Coin, + CoinAmino, + CoinSDKType, +} from "../../../cosmos/base/v1beta1/coin"; +/** Params holds parameters for the incentives module */ +export interface Params { + poolCreationFee: Coin[]; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the incentives module */ +export interface ParamsAmino { + pool_creation_fee?: CoinAmino[]; +} +export interface ParamsAminoMsg { + type: "osmosis/gamm/params"; + value: ParamsAmino; +} +/** Params holds parameters for the incentives module */ +export interface ParamsSDKType { + pool_creation_fee: CoinSDKType[]; +} +function createBaseParams(): Params { + return { + poolCreationFee: [], + }; +} +export const Params = { + typeUrl: "/osmosis.gamm.v1beta1.Params", + encode( + message: Params, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.poolCreationFee) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.poolCreationFee = + object.poolCreationFee?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.poolCreationFee = + object.pool_creation_fee?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.poolCreationFee) { + obj.pool_creation_fee = message.poolCreationFee.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.pool_creation_fee = message.poolCreationFee; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/gamm/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.gamm.v1beta1.Params", + value: Params.encode(message).finish(), + }; + }, +}; diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/shared.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/shared.ts index 9821d5651c..16736ee77f 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/shared.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/shared.ts @@ -242,10 +242,12 @@ export const BalancerToConcentratedPoolLink = { const obj: any = {}; obj.balancer_pool_id = message.balancerPoolId !== BigInt(0) - ? message.balancerPoolId.toString() + ? (message.balancerPoolId?.toString)() : undefined; obj.cl_pool_id = - message.clPoolId !== BigInt(0) ? message.clPoolId.toString() : undefined; + message.clPoolId !== BigInt(0) + ? (message.clPoolId?.toString)() + : undefined; return obj; }, fromAminoMsg( diff --git a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/tx.ts index 3822a8de27..4fa878f243 100644 --- a/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/gamm/v1beta1/tx.ts @@ -494,7 +494,7 @@ export const MsgJoinPool = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.share_out_amount = message.shareOutAmount === "" ? undefined : message.shareOutAmount; if (message.tokenInMaxs) { @@ -713,7 +713,7 @@ export const MsgExitPool = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.share_in_amount = message.shareInAmount === "" ? undefined : message.shareInAmount; if (message.tokenOutMins) { @@ -1368,7 +1368,7 @@ export const MsgJoinSwapExternAmountIn = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_in = message.tokenIn ? Coin.toAmino(message.tokenIn) : undefined; obj.share_out_min_amount = message.shareOutMinAmount === "" ? undefined : message.shareOutMinAmount; @@ -1606,7 +1606,7 @@ export const MsgJoinSwapShareAmountOut = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_in_denom = message.tokenInDenom === "" ? undefined : message.tokenInDenom; obj.share_out_amount = @@ -1850,7 +1850,7 @@ export const MsgExitSwapShareAmountIn = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_out_denom = message.tokenOutDenom === "" ? undefined : message.tokenOutDenom; obj.share_in_amount = @@ -2084,7 +2084,7 @@ export const MsgExitSwapExternAmountOut = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_out = message.tokenOut ? Coin.toAmino(message.tokenOut) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/lockup/genesis.ts b/packages/proto-codecs/src/codegen/osmosis/lockup/genesis.ts index 05482c20e5..fb8fd8cd99 100644 --- a/packages/proto-codecs/src/codegen/osmosis/lockup/genesis.ts +++ b/packages/proto-codecs/src/codegen/osmosis/lockup/genesis.ts @@ -127,7 +127,7 @@ export const GenesisState = { const obj: any = {}; obj.last_lock_id = message.lastLockId !== BigInt(0) - ? message.lastLockId.toString() + ? (message.lastLockId?.toString)() : undefined; if (message.locks) { obj.locks = message.locks.map((e) => diff --git a/packages/proto-codecs/src/codegen/osmosis/lockup/lock.ts b/packages/proto-codecs/src/codegen/osmosis/lockup/lock.ts index 7addbdf7a8..925b5e4cbc 100644 --- a/packages/proto-codecs/src/codegen/osmosis/lockup/lock.ts +++ b/packages/proto-codecs/src/codegen/osmosis/lockup/lock.ts @@ -69,7 +69,7 @@ export interface PeriodLock { * The ID of the lock is decided upon lock creation, incrementing by 1 for * every lock. */ - ID: bigint; + iD: bigint; /** * Owner is the account address of the lock owner. * Only the owner can modify the state of the lock. @@ -300,7 +300,7 @@ export interface SyntheticLockSDKType { } function createBasePeriodLock(): PeriodLock { return { - ID: BigInt(0), + iD: BigInt(0), owner: "", duration: Duration.fromPartial({}), endTime: new Date(), @@ -314,8 +314,8 @@ export const PeriodLock = { message: PeriodLock, writer: BinaryWriter = BinaryWriter.create() ): BinaryWriter { - if (message.ID !== BigInt(0)) { - writer.uint32(8).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); } if (message.owner !== "") { writer.uint32(18).string(message.owner); @@ -346,7 +346,7 @@ export const PeriodLock = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; case 2: message.owner = reader.string(); @@ -374,9 +374,9 @@ export const PeriodLock = { }, fromPartial(object: Partial): PeriodLock { const message = createBasePeriodLock(); - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); message.owner = object.owner ?? ""; message.duration = @@ -391,7 +391,7 @@ export const PeriodLock = { fromAmino(object: PeriodLockAmino): PeriodLock { const message = createBasePeriodLock(); if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } if (object.owner !== undefined && object.owner !== null) { message.owner = object.owner; @@ -413,7 +413,7 @@ export const PeriodLock = { }, toAmino(message: PeriodLock): PeriodLockAmino { const obj: any = {}; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; obj.owner = message.owner === "" ? undefined : message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) @@ -676,7 +676,7 @@ export const SyntheticLock = { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId !== BigInt(0) - ? message.underlyingLockId.toString() + ? (message.underlyingLockId?.toString)() : undefined; obj.synth_denom = message.synthDenom === "" ? undefined : message.synthDenom; diff --git a/packages/proto-codecs/src/codegen/osmosis/lockup/tx.ts b/packages/proto-codecs/src/codegen/osmosis/lockup/tx.ts index 8c83a3fbf9..a9dbf54832 100644 --- a/packages/proto-codecs/src/codegen/osmosis/lockup/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/lockup/tx.ts @@ -31,7 +31,7 @@ export interface MsgLockTokensSDKType { coins: CoinSDKType[]; } export interface MsgLockTokensResponse { - ID: bigint; + iD: bigint; } export interface MsgLockTokensResponseProtoMsg { typeUrl: "/osmosis.lockup.MsgLockTokensResponse"; @@ -83,7 +83,7 @@ export interface MsgBeginUnlockingAllResponseSDKType { } export interface MsgBeginUnlocking { owner: string; - ID: bigint; + iD: bigint; /** Amount of unlocking coins. Unlock all if not set. */ coins: Coin[]; } @@ -132,7 +132,7 @@ export interface MsgBeginUnlockingResponseSDKType { */ export interface MsgExtendLockup { owner: string; - ID: bigint; + iD: bigint; /** * duration to be set. fails if lower than the current duration, or is * unlocking @@ -192,7 +192,7 @@ export interface MsgExtendLockupResponseSDKType { */ export interface MsgForceUnlock { owner: string; - ID: bigint; + iD: bigint; /** Amount of unlocking coins. Unlock all if not set. */ coins: Coin[]; } @@ -386,7 +386,7 @@ export const MsgLockTokens = { }; function createBaseMsgLockTokensResponse(): MsgLockTokensResponse { return { - ID: BigInt(0), + iD: BigInt(0), }; } export const MsgLockTokensResponse = { @@ -395,8 +395,8 @@ export const MsgLockTokensResponse = { message: MsgLockTokensResponse, writer: BinaryWriter = BinaryWriter.create() ): BinaryWriter { - if (message.ID !== BigInt(0)) { - writer.uint32(8).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); } return writer; }, @@ -412,7 +412,7 @@ export const MsgLockTokensResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -423,22 +423,22 @@ export const MsgLockTokensResponse = { }, fromPartial(object: Partial): MsgLockTokensResponse { const message = createBaseMsgLockTokensResponse(); - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); return message; }, fromAmino(object: MsgLockTokensResponseAmino): MsgLockTokensResponse { const message = createBaseMsgLockTokensResponse(); if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } return message; }, toAmino(message: MsgLockTokensResponse): MsgLockTokensResponseAmino { const obj: any = {}; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; return obj; }, fromAminoMsg(object: MsgLockTokensResponseAminoMsg): MsgLockTokensResponse { @@ -637,7 +637,7 @@ export const MsgBeginUnlockingAllResponse = { function createBaseMsgBeginUnlocking(): MsgBeginUnlocking { return { owner: "", - ID: BigInt(0), + iD: BigInt(0), coins: [], }; } @@ -650,8 +650,8 @@ export const MsgBeginUnlocking = { if (message.owner !== "") { writer.uint32(10).string(message.owner); } - if (message.ID !== BigInt(0)) { - writer.uint32(16).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(16).uint64(message.iD); } for (const v of message.coins) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); @@ -670,7 +670,7 @@ export const MsgBeginUnlocking = { message.owner = reader.string(); break; case 2: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; case 3: message.coins.push(Coin.decode(reader, reader.uint32())); @@ -685,9 +685,9 @@ export const MsgBeginUnlocking = { fromPartial(object: Partial): MsgBeginUnlocking { const message = createBaseMsgBeginUnlocking(); message.owner = object.owner ?? ""; - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -698,7 +698,7 @@ export const MsgBeginUnlocking = { message.owner = object.owner; } if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; return message; @@ -706,7 +706,7 @@ export const MsgBeginUnlocking = { toAmino(message: MsgBeginUnlocking): MsgBeginUnlockingAmino { const obj: any = {}; obj.owner = message.owner === "" ? undefined : message.owner; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; if (message.coins) { obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); } else { @@ -809,7 +809,7 @@ export const MsgBeginUnlockingResponse = { obj.success = message.success === false ? undefined : message.success; obj.unlockingLockID = message.unlockingLockID !== BigInt(0) - ? message.unlockingLockID.toString() + ? (message.unlockingLockID?.toString)() : undefined; return obj; }, @@ -846,7 +846,7 @@ export const MsgBeginUnlockingResponse = { function createBaseMsgExtendLockup(): MsgExtendLockup { return { owner: "", - ID: BigInt(0), + iD: BigInt(0), duration: Duration.fromPartial({}), }; } @@ -859,8 +859,8 @@ export const MsgExtendLockup = { if (message.owner !== "") { writer.uint32(10).string(message.owner); } - if (message.ID !== BigInt(0)) { - writer.uint32(16).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(16).uint64(message.iD); } if (message.duration !== undefined) { Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); @@ -879,7 +879,7 @@ export const MsgExtendLockup = { message.owner = reader.string(); break; case 2: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; case 3: message.duration = Duration.decode(reader, reader.uint32()); @@ -894,9 +894,9 @@ export const MsgExtendLockup = { fromPartial(object: Partial): MsgExtendLockup { const message = createBaseMsgExtendLockup(); message.owner = object.owner ?? ""; - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); message.duration = object.duration !== undefined && object.duration !== null @@ -910,7 +910,7 @@ export const MsgExtendLockup = { message.owner = object.owner; } if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } if (object.duration !== undefined && object.duration !== null) { message.duration = Duration.fromAmino(object.duration); @@ -920,7 +920,7 @@ export const MsgExtendLockup = { toAmino(message: MsgExtendLockup): MsgExtendLockupAmino { const obj: any = {}; obj.owner = message.owner === "" ? undefined : message.owner; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; @@ -1037,7 +1037,7 @@ export const MsgExtendLockupResponse = { function createBaseMsgForceUnlock(): MsgForceUnlock { return { owner: "", - ID: BigInt(0), + iD: BigInt(0), coins: [], }; } @@ -1050,8 +1050,8 @@ export const MsgForceUnlock = { if (message.owner !== "") { writer.uint32(10).string(message.owner); } - if (message.ID !== BigInt(0)) { - writer.uint32(16).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(16).uint64(message.iD); } for (const v of message.coins) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); @@ -1070,7 +1070,7 @@ export const MsgForceUnlock = { message.owner = reader.string(); break; case 2: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; case 3: message.coins.push(Coin.decode(reader, reader.uint32())); @@ -1085,9 +1085,9 @@ export const MsgForceUnlock = { fromPartial(object: Partial): MsgForceUnlock { const message = createBaseMsgForceUnlock(); message.owner = object.owner ?? ""; - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -1098,7 +1098,7 @@ export const MsgForceUnlock = { message.owner = object.owner; } if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } message.coins = object.coins?.map((e) => Coin.fromAmino(e)) || []; return message; @@ -1106,7 +1106,7 @@ export const MsgForceUnlock = { toAmino(message: MsgForceUnlock): MsgForceUnlockAmino { const obj: any = {}; obj.owner = message.owner === "" ? undefined : message.owner; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; if (message.coins) { obj.coins = message.coins.map((e) => (e ? Coin.toAmino(e) : undefined)); } else { @@ -1301,7 +1301,7 @@ export const MsgSetRewardReceiverAddress = { const obj: any = {}; obj.owner = message.owner === "" ? undefined : message.owner; obj.lockID = - message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + message.lockID !== BigInt(0) ? (message.lockID?.toString)() : undefined; obj.reward_receiver = message.rewardReceiver === "" ? undefined : message.rewardReceiver; return obj; diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts index 063ff237fe..fa1024a817 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts @@ -574,7 +574,7 @@ export const GenesisState = { const obj: any = {}; obj.next_pool_id = message.nextPoolId !== BigInt(0) - ? message.nextPoolId.toString() + ? (message.nextPoolId?.toString)() : undefined; obj.params = message.params ? Params.toAmino(message.params) : undefined; if (message.poolRoutes) { @@ -1037,7 +1037,7 @@ export const TakerFeesTracker = { } obj.height_accounting_starts_from = message.heightAccountingStartsFrom !== BigInt(0) - ? message.heightAccountingStartsFrom.toString() + ? (message.heightAccountingStartsFrom?.toString)() : undefined; return obj; }, @@ -1126,7 +1126,7 @@ export const PoolVolume = { toAmino(message: PoolVolume): PoolVolumeAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; if (message.poolVolume) { obj.pool_volume = message.poolVolume.map((e) => e ? Coin.toAmino(e) : undefined diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts index 9d78e05afb..455002ef20 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts @@ -162,7 +162,7 @@ export const ModuleRoute = { const obj: any = {}; obj.pool_type = message.poolType === 0 ? undefined : message.poolType; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg(object: ModuleRouteAminoMsg): ModuleRoute { diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts index 1d311b9d72..a54a385204 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts @@ -146,7 +146,7 @@ export const SwapAmountInRoute = { toAmino(message: SwapAmountInRoute): SwapAmountInRouteAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_out_denom = message.tokenOutDenom === "" ? undefined : message.tokenOutDenom; return obj; @@ -239,7 +239,7 @@ export const SwapAmountOutRoute = { toAmino(message: SwapAmountOutRoute): SwapAmountOutRouteAmino { const obj: any = {}; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; obj.token_in_denom = message.tokenInDenom === "" ? undefined : message.tokenInDenom; return obj; diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/taker_fee_share.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/taker_fee_share.ts new file mode 100644 index 0000000000..cbeca99e86 --- /dev/null +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/taker_fee_share.ts @@ -0,0 +1,506 @@ +//@ts-nocheck +import { Decimal } from "@cosmjs/math"; + +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { + Coin, + CoinAmino, + CoinSDKType, +} from "../../../cosmos/base/v1beta1/coin"; +/** + * TakerFeeShareAgreement represents the agreement between the Osmosis protocol + * and a specific denom to share a certain percent of taker fees generated in + * any route that contains said denom. For example, if the agreement specifies a + * 10% skim_percent, this means 10% of the taker fees generated in a swap route + * containing the specified denom will be sent to the address specified + * in the skim_address field at the end of each epoch. These skim_percents are + * additive, so if three taker fee agreements have skim percents of 10%, 20%, + * and 30%, the total skim percent for the route will be 60%. + */ +export interface TakerFeeShareAgreement { + /** denom is the denom that has the taker fee share agreement. */ + denom: string; + /** + * skim_percent is the percentage of taker fees that will be skimmed for the + * denom, in the event that the denom is included in the swap route. + */ + skimPercent: string; + /** + * skim_address is the address belonging to the respective denom + * that the skimmed taker fees will be sent to at the end of each epoch. + */ + skimAddress: string; +} +export interface TakerFeeShareAgreementProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeShareAgreement"; + value: Uint8Array; +} +/** + * TakerFeeShareAgreement represents the agreement between the Osmosis protocol + * and a specific denom to share a certain percent of taker fees generated in + * any route that contains said denom. For example, if the agreement specifies a + * 10% skim_percent, this means 10% of the taker fees generated in a swap route + * containing the specified denom will be sent to the address specified + * in the skim_address field at the end of each epoch. These skim_percents are + * additive, so if three taker fee agreements have skim percents of 10%, 20%, + * and 30%, the total skim percent for the route will be 60%. + */ +export interface TakerFeeShareAgreementAmino { + /** denom is the denom that has the taker fee share agreement. */ + denom?: string; + /** + * skim_percent is the percentage of taker fees that will be skimmed for the + * denom, in the event that the denom is included in the swap route. + */ + skim_percent?: string; + /** + * skim_address is the address belonging to the respective denom + * that the skimmed taker fees will be sent to at the end of each epoch. + */ + skim_address?: string; +} +export interface TakerFeeShareAgreementAminoMsg { + type: "osmosis/poolmanager/taker-fee-share-agreement"; + value: TakerFeeShareAgreementAmino; +} +/** + * TakerFeeShareAgreement represents the agreement between the Osmosis protocol + * and a specific denom to share a certain percent of taker fees generated in + * any route that contains said denom. For example, if the agreement specifies a + * 10% skim_percent, this means 10% of the taker fees generated in a swap route + * containing the specified denom will be sent to the address specified + * in the skim_address field at the end of each epoch. These skim_percents are + * additive, so if three taker fee agreements have skim percents of 10%, 20%, + * and 30%, the total skim percent for the route will be 60%. + */ +export interface TakerFeeShareAgreementSDKType { + denom: string; + skim_percent: string; + skim_address: string; +} +/** + * TakerFeeSkimAccumulator accumulates the total skimmed taker fees for each + * denom that has a taker fee share agreement. + */ +export interface TakerFeeSkimAccumulator { + /** denom is the denom that has the taker fee share agreement. */ + denom: string; + /** skimmed_taker_fees is the total skimmed taker fees for the denom. */ + skimmedTakerFees: Coin[]; +} +export interface TakerFeeSkimAccumulatorProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeSkimAccumulator"; + value: Uint8Array; +} +/** + * TakerFeeSkimAccumulator accumulates the total skimmed taker fees for each + * denom that has a taker fee share agreement. + */ +export interface TakerFeeSkimAccumulatorAmino { + /** denom is the denom that has the taker fee share agreement. */ + denom?: string; + /** skimmed_taker_fees is the total skimmed taker fees for the denom. */ + skimmed_taker_fees?: CoinAmino[]; +} +export interface TakerFeeSkimAccumulatorAminoMsg { + type: "osmosis/poolmanager/taker-fee-skim-accumulator"; + value: TakerFeeSkimAccumulatorAmino; +} +/** + * TakerFeeSkimAccumulator accumulates the total skimmed taker fees for each + * denom that has a taker fee share agreement. + */ +export interface TakerFeeSkimAccumulatorSDKType { + denom: string; + skimmed_taker_fees: CoinSDKType[]; +} +/** + * AlloyContractTakerFeeShareState contains the contract address of the alloyed + * asset pool, along with the adjusted taker fee share agreements for any asset + * within the alloyed asset pool that has a taker fee share agreement. If for + * instance there are two denoms, and denomA makes up 50 percent and denomB + * makes up 50 percent, and denom A has a taker fee share agreement with a skim + * percent of 10%, then the adjusted taker fee share agreement for denomA will + * be 5%. + */ +export interface AlloyContractTakerFeeShareState { + /** contract_address is the address of the alloyed asset pool contract. */ + contractAddress: string; + /** + * taker_fee_share_agreements is the adjusted taker fee share agreements for + * any asset within the alloyed asset pool that has a taker fee share + * agreement. + */ + takerFeeShareAgreements: TakerFeeShareAgreement[]; +} +export interface AlloyContractTakerFeeShareStateProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.AlloyContractTakerFeeShareState"; + value: Uint8Array; +} +/** + * AlloyContractTakerFeeShareState contains the contract address of the alloyed + * asset pool, along with the adjusted taker fee share agreements for any asset + * within the alloyed asset pool that has a taker fee share agreement. If for + * instance there are two denoms, and denomA makes up 50 percent and denomB + * makes up 50 percent, and denom A has a taker fee share agreement with a skim + * percent of 10%, then the adjusted taker fee share agreement for denomA will + * be 5%. + */ +export interface AlloyContractTakerFeeShareStateAmino { + /** contract_address is the address of the alloyed asset pool contract. */ + contract_address?: string; + /** + * taker_fee_share_agreements is the adjusted taker fee share agreements for + * any asset within the alloyed asset pool that has a taker fee share + * agreement. + */ + taker_fee_share_agreements?: TakerFeeShareAgreementAmino[]; +} +export interface AlloyContractTakerFeeShareStateAminoMsg { + type: "osmosis/poolmanager/alloy-contract-taker-fee-share-state"; + value: AlloyContractTakerFeeShareStateAmino; +} +/** + * AlloyContractTakerFeeShareState contains the contract address of the alloyed + * asset pool, along with the adjusted taker fee share agreements for any asset + * within the alloyed asset pool that has a taker fee share agreement. If for + * instance there are two denoms, and denomA makes up 50 percent and denomB + * makes up 50 percent, and denom A has a taker fee share agreement with a skim + * percent of 10%, then the adjusted taker fee share agreement for denomA will + * be 5%. + */ +export interface AlloyContractTakerFeeShareStateSDKType { + contract_address: string; + taker_fee_share_agreements: TakerFeeShareAgreementSDKType[]; +} +function createBaseTakerFeeShareAgreement(): TakerFeeShareAgreement { + return { + denom: "", + skimPercent: "", + skimAddress: "", + }; +} +export const TakerFeeShareAgreement = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeShareAgreement", + encode( + message: TakerFeeShareAgreement, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.skimPercent !== "") { + writer + .uint32(18) + .string(Decimal.fromUserInput(message.skimPercent, 18).atomics); + } + if (message.skimAddress !== "") { + writer.uint32(26).string(message.skimAddress); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TakerFeeShareAgreement { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeShareAgreement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.skimPercent = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 3: + message.skimAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeeShareAgreement { + const message = createBaseTakerFeeShareAgreement(); + message.denom = object.denom ?? ""; + message.skimPercent = object.skimPercent ?? ""; + message.skimAddress = object.skimAddress ?? ""; + return message; + }, + fromAmino(object: TakerFeeShareAgreementAmino): TakerFeeShareAgreement { + const message = createBaseTakerFeeShareAgreement(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.skim_percent !== undefined && object.skim_percent !== null) { + message.skimPercent = object.skim_percent; + } + if (object.skim_address !== undefined && object.skim_address !== null) { + message.skimAddress = object.skim_address; + } + return message; + }, + toAmino(message: TakerFeeShareAgreement): TakerFeeShareAgreementAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.skim_percent = + message.skimPercent === "" ? undefined : message.skimPercent; + obj.skim_address = + message.skimAddress === "" ? undefined : message.skimAddress; + return obj; + }, + fromAminoMsg(object: TakerFeeShareAgreementAminoMsg): TakerFeeShareAgreement { + return TakerFeeShareAgreement.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeShareAgreement): TakerFeeShareAgreementAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-share-agreement", + value: TakerFeeShareAgreement.toAmino(message), + }; + }, + fromProtoMsg( + message: TakerFeeShareAgreementProtoMsg + ): TakerFeeShareAgreement { + return TakerFeeShareAgreement.decode(message.value); + }, + toProto(message: TakerFeeShareAgreement): Uint8Array { + return TakerFeeShareAgreement.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeShareAgreement): TakerFeeShareAgreementProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeShareAgreement", + value: TakerFeeShareAgreement.encode(message).finish(), + }; + }, +}; +function createBaseTakerFeeSkimAccumulator(): TakerFeeSkimAccumulator { + return { + denom: "", + skimmedTakerFees: [], + }; +} +export const TakerFeeSkimAccumulator = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeSkimAccumulator", + encode( + message: TakerFeeSkimAccumulator, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + for (const v of message.skimmedTakerFees) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): TakerFeeSkimAccumulator { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeSkimAccumulator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.skimmedTakerFees.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): TakerFeeSkimAccumulator { + const message = createBaseTakerFeeSkimAccumulator(); + message.denom = object.denom ?? ""; + message.skimmedTakerFees = + object.skimmedTakerFees?.map((e) => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TakerFeeSkimAccumulatorAmino): TakerFeeSkimAccumulator { + const message = createBaseTakerFeeSkimAccumulator(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + message.skimmedTakerFees = + object.skimmed_taker_fees?.map((e) => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: TakerFeeSkimAccumulator): TakerFeeSkimAccumulatorAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + if (message.skimmedTakerFees) { + obj.skimmed_taker_fees = message.skimmedTakerFees.map((e) => + e ? Coin.toAmino(e) : undefined + ); + } else { + obj.skimmed_taker_fees = message.skimmedTakerFees; + } + return obj; + }, + fromAminoMsg( + object: TakerFeeSkimAccumulatorAminoMsg + ): TakerFeeSkimAccumulator { + return TakerFeeSkimAccumulator.fromAmino(object.value); + }, + toAminoMsg( + message: TakerFeeSkimAccumulator + ): TakerFeeSkimAccumulatorAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-skim-accumulator", + value: TakerFeeSkimAccumulator.toAmino(message), + }; + }, + fromProtoMsg( + message: TakerFeeSkimAccumulatorProtoMsg + ): TakerFeeSkimAccumulator { + return TakerFeeSkimAccumulator.decode(message.value); + }, + toProto(message: TakerFeeSkimAccumulator): Uint8Array { + return TakerFeeSkimAccumulator.encode(message).finish(); + }, + toProtoMsg( + message: TakerFeeSkimAccumulator + ): TakerFeeSkimAccumulatorProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeSkimAccumulator", + value: TakerFeeSkimAccumulator.encode(message).finish(), + }; + }, +}; +function createBaseAlloyContractTakerFeeShareState(): AlloyContractTakerFeeShareState { + return { + contractAddress: "", + takerFeeShareAgreements: [], + }; +} +export const AlloyContractTakerFeeShareState = { + typeUrl: "/osmosis.poolmanager.v1beta1.AlloyContractTakerFeeShareState", + encode( + message: AlloyContractTakerFeeShareState, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + for (const v of message.takerFeeShareAgreements) { + TakerFeeShareAgreement.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): AlloyContractTakerFeeShareState { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAlloyContractTakerFeeShareState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.takerFeeShareAgreements.push( + TakerFeeShareAgreement.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): AlloyContractTakerFeeShareState { + const message = createBaseAlloyContractTakerFeeShareState(); + message.contractAddress = object.contractAddress ?? ""; + message.takerFeeShareAgreements = + object.takerFeeShareAgreements?.map((e) => + TakerFeeShareAgreement.fromPartial(e) + ) || []; + return message; + }, + fromAmino( + object: AlloyContractTakerFeeShareStateAmino + ): AlloyContractTakerFeeShareState { + const message = createBaseAlloyContractTakerFeeShareState(); + if ( + object.contract_address !== undefined && + object.contract_address !== null + ) { + message.contractAddress = object.contract_address; + } + message.takerFeeShareAgreements = + object.taker_fee_share_agreements?.map((e) => + TakerFeeShareAgreement.fromAmino(e) + ) || []; + return message; + }, + toAmino( + message: AlloyContractTakerFeeShareState + ): AlloyContractTakerFeeShareStateAmino { + const obj: any = {}; + obj.contract_address = + message.contractAddress === "" ? undefined : message.contractAddress; + if (message.takerFeeShareAgreements) { + obj.taker_fee_share_agreements = message.takerFeeShareAgreements.map( + (e) => (e ? TakerFeeShareAgreement.toAmino(e) : undefined) + ); + } else { + obj.taker_fee_share_agreements = message.takerFeeShareAgreements; + } + return obj; + }, + fromAminoMsg( + object: AlloyContractTakerFeeShareStateAminoMsg + ): AlloyContractTakerFeeShareState { + return AlloyContractTakerFeeShareState.fromAmino(object.value); + }, + toAminoMsg( + message: AlloyContractTakerFeeShareState + ): AlloyContractTakerFeeShareStateAminoMsg { + return { + type: "osmosis/poolmanager/alloy-contract-taker-fee-share-state", + value: AlloyContractTakerFeeShareState.toAmino(message), + }; + }, + fromProtoMsg( + message: AlloyContractTakerFeeShareStateProtoMsg + ): AlloyContractTakerFeeShareState { + return AlloyContractTakerFeeShareState.decode(message.value); + }, + toProto(message: AlloyContractTakerFeeShareState): Uint8Array { + return AlloyContractTakerFeeShareState.encode(message).finish(); + }, + toProtoMsg( + message: AlloyContractTakerFeeShareState + ): AlloyContractTakerFeeShareStateProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.AlloyContractTakerFeeShareState", + value: AlloyContractTakerFeeShareState.encode(message).finish(), + }; + }, +}; diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts index 5e72de857f..d129e3139d 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -1,6 +1,8 @@ //@ts-nocheck import { MsgSetDenomPairTakerFee, + MsgSetRegisteredAlloyedPool, + MsgSetTakerFeeShareAgreementForDenom, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSwapExactAmountIn, @@ -32,4 +34,14 @@ export const AminoConverter = { toAmino: MsgSetDenomPairTakerFee.toAmino, fromAmino: MsgSetDenomPairTakerFee.fromAmino, }, + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom": { + aminoType: "osmosis/poolmanager/set-taker-fee-share-agreement-for-denom", + toAmino: MsgSetTakerFeeShareAgreementForDenom.toAmino, + fromAmino: MsgSetTakerFeeShareAgreementForDenom.fromAmino, + }, + "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool": { + aminoType: "osmosis/poolmanager/set-registered-alloyed-pool", + toAmino: MsgSetRegisteredAlloyedPool.toAmino, + fromAmino: MsgSetRegisteredAlloyedPool.fromAmino, + }, }; diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts index e1f2caacd1..dece4492e3 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -3,6 +3,8 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; import { MsgSetDenomPairTakerFee, + MsgSetRegisteredAlloyedPool, + MsgSetTakerFeeShareAgreementForDenom, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSwapExactAmountIn, @@ -23,6 +25,14 @@ export const registry: ReadonlyArray<[string, GeneratedType]> = [ "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", MsgSetDenomPairTakerFee, ], + [ + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + MsgSetTakerFeeShareAgreementForDenom, + ], + [ + "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + MsgSetRegisteredAlloyedPool, + ], ]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { @@ -61,6 +71,21 @@ export const MessageComposer = { value: MsgSetDenomPairTakerFee.encode(value).finish(), }; }, + setTakerFeeShareAgreementForDenom( + value: MsgSetTakerFeeShareAgreementForDenom + ) { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + value: MsgSetTakerFeeShareAgreementForDenom.encode(value).finish(), + }; + }, + setRegisteredAlloyedPool(value: MsgSetRegisteredAlloyedPool) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + value: MsgSetRegisteredAlloyedPool.encode(value).finish(), + }; + }, }, withTypeUrl: { swapExactAmountIn(value: MsgSwapExactAmountIn) { @@ -93,6 +118,21 @@ export const MessageComposer = { value, }; }, + setTakerFeeShareAgreementForDenom( + value: MsgSetTakerFeeShareAgreementForDenom + ) { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + value, + }; + }, + setRegisteredAlloyedPool(value: MsgSetRegisteredAlloyedPool) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + value, + }; + }, }, fromPartial: { swapExactAmountIn(value: MsgSwapExactAmountIn) { @@ -125,5 +165,20 @@ export const MessageComposer = { value: MsgSetDenomPairTakerFee.fromPartial(value), }; }, + setTakerFeeShareAgreementForDenom( + value: MsgSetTakerFeeShareAgreementForDenom + ) { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + value: MsgSetTakerFeeShareAgreementForDenom.fromPartial(value), + }; + }, + setRegisteredAlloyedPool(value: MsgSetRegisteredAlloyedPool) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + value: MsgSetRegisteredAlloyedPool.fromPartial(value), + }; + }, }, }; diff --git a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts index 63082fd062..a6418c0c23 100644 --- a/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts @@ -245,14 +245,133 @@ export interface MsgSetDenomPairTakerFeeResponseAminoMsg { export interface MsgSetDenomPairTakerFeeResponseSDKType { success: boolean; } +/** ===================== MsgSetTakerFeeShareAgreementForDenom */ +export interface MsgSetTakerFeeShareAgreementForDenom { + sender: string; + /** + * denom is the denom that the taker fee share agreement is being set for. + * Ex. If this is set to "nBTC", then any trade route that includes "nBTC" + * will have the skim_percent skimmed from the taker fees and sent to the + * skim_address. + */ + denom: string; + /** + * skim_percent is the percentage of taker fees that will be skimmed for the + * bridge provider, in the event that the bridge provider's denom is included + * in the swap route. + */ + skimPercent: string; + /** + * skim_address is the address belonging to the respective bridge provider + * that the skimmed taker fees will be sent to at the end of each epoch. + */ + skimAddress: string; +} +export interface MsgSetTakerFeeShareAgreementForDenomProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom"; + value: Uint8Array; +} +/** ===================== MsgSetTakerFeeShareAgreementForDenom */ +export interface MsgSetTakerFeeShareAgreementForDenomAmino { + sender?: string; + /** + * denom is the denom that the taker fee share agreement is being set for. + * Ex. If this is set to "nBTC", then any trade route that includes "nBTC" + * will have the skim_percent skimmed from the taker fees and sent to the + * skim_address. + */ + denom?: string; + /** + * skim_percent is the percentage of taker fees that will be skimmed for the + * bridge provider, in the event that the bridge provider's denom is included + * in the swap route. + */ + skim_percent?: string; + /** + * skim_address is the address belonging to the respective bridge provider + * that the skimmed taker fees will be sent to at the end of each epoch. + */ + skim_address?: string; +} +export interface MsgSetTakerFeeShareAgreementForDenomAminoMsg { + type: "osmosis/poolmanager/set-taker-fee-share-agreement-for-denom"; + value: MsgSetTakerFeeShareAgreementForDenomAmino; +} +/** ===================== MsgSetTakerFeeShareAgreementForDenom */ +export interface MsgSetTakerFeeShareAgreementForDenomSDKType { + sender: string; + denom: string; + skim_percent: string; + skim_address: string; +} +export interface MsgSetTakerFeeShareAgreementForDenomResponse {} +export interface MsgSetTakerFeeShareAgreementForDenomResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenomResponse"; + value: Uint8Array; +} +export interface MsgSetTakerFeeShareAgreementForDenomResponseAmino {} +export interface MsgSetTakerFeeShareAgreementForDenomResponseAminoMsg { + type: "osmosis/poolmanager/set-taker-fee-share-agreement-for-denom-response"; + value: MsgSetTakerFeeShareAgreementForDenomResponseAmino; +} +export interface MsgSetTakerFeeShareAgreementForDenomResponseSDKType {} +/** ===================== MsgSetRegisteredAlloyedPool */ +export interface MsgSetRegisteredAlloyedPool { + sender: string; + /** + * pool_id is the id of the pool that is being registered as an alloyed pool. + * Only alloyed pools that intend to be used in taker fee revenue sharing + * should be registered. + */ + poolId: bigint; +} +export interface MsgSetRegisteredAlloyedPoolProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool"; + value: Uint8Array; +} +/** ===================== MsgSetRegisteredAlloyedPool */ +export interface MsgSetRegisteredAlloyedPoolAmino { + sender?: string; + /** + * pool_id is the id of the pool that is being registered as an alloyed pool. + * Only alloyed pools that intend to be used in taker fee revenue sharing + * should be registered. + */ + pool_id?: string; +} +export interface MsgSetRegisteredAlloyedPoolAminoMsg { + type: "osmosis/poolmanager/set-registered-alloyed-pool"; + value: MsgSetRegisteredAlloyedPoolAmino; +} +/** ===================== MsgSetRegisteredAlloyedPool */ +export interface MsgSetRegisteredAlloyedPoolSDKType { + sender: string; + pool_id: bigint; +} +export interface MsgSetRegisteredAlloyedPoolResponse {} +export interface MsgSetRegisteredAlloyedPoolResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPoolResponse"; + value: Uint8Array; +} +export interface MsgSetRegisteredAlloyedPoolResponseAmino {} +export interface MsgSetRegisteredAlloyedPoolResponseAminoMsg { + type: "osmosis/poolmanager/set-registered-alloyed-pool-response"; + value: MsgSetRegisteredAlloyedPoolResponseAmino; +} +export interface MsgSetRegisteredAlloyedPoolResponseSDKType {} export interface DenomPairTakerFee { /** - * denom0 and denom1 get automatically lexigographically sorted - * when being stored, so the order of input here does not matter. + * DEPRECATED: Now that we are using uni-directional trading pairs, we are + * using tokenInDenom and tokenOutDenom instead of denom0 and denom1 to + * prevent confusion. */ + /** @deprecated */ denom0: string; + /** @deprecated */ denom1: string; takerFee: string; + tokenInDenom: string; + tokenOutDenom: string; } export interface DenomPairTakerFeeProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee"; @@ -260,21 +379,30 @@ export interface DenomPairTakerFeeProtoMsg { } export interface DenomPairTakerFeeAmino { /** - * denom0 and denom1 get automatically lexigographically sorted - * when being stored, so the order of input here does not matter. + * DEPRECATED: Now that we are using uni-directional trading pairs, we are + * using tokenInDenom and tokenOutDenom instead of denom0 and denom1 to + * prevent confusion. */ + /** @deprecated */ denom0?: string; + /** @deprecated */ denom1?: string; taker_fee?: string; + tokenInDenom?: string; + tokenOutDenom?: string; } export interface DenomPairTakerFeeAminoMsg { type: "osmosis/poolmanager/denom-pair-taker-fee"; value: DenomPairTakerFeeAmino; } export interface DenomPairTakerFeeSDKType { + /** @deprecated */ denom0: string; + /** @deprecated */ denom1: string; taker_fee: string; + tokenInDenom: string; + tokenOutDenom: string; } function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { @@ -1391,11 +1519,413 @@ export const MsgSetDenomPairTakerFeeResponse = { }; }, }; +function createBaseMsgSetTakerFeeShareAgreementForDenom(): MsgSetTakerFeeShareAgreementForDenom { + return { + sender: "", + denom: "", + skimPercent: "", + skimAddress: "", + }; +} +export const MsgSetTakerFeeShareAgreementForDenom = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + encode( + message: MsgSetTakerFeeShareAgreementForDenom, + 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.skimPercent !== "") { + writer + .uint32(26) + .string(Decimal.fromUserInput(message.skimPercent, 18).atomics); + } + if (message.skimAddress !== "") { + writer.uint32(34).string(message.skimAddress); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetTakerFeeShareAgreementForDenom { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetTakerFeeShareAgreementForDenom(); + 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.skimPercent = Decimal.fromAtomics( + reader.string(), + 18 + ).toString(); + break; + case 4: + message.skimAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetTakerFeeShareAgreementForDenom { + const message = createBaseMsgSetTakerFeeShareAgreementForDenom(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.skimPercent = object.skimPercent ?? ""; + message.skimAddress = object.skimAddress ?? ""; + return message; + }, + fromAmino( + object: MsgSetTakerFeeShareAgreementForDenomAmino + ): MsgSetTakerFeeShareAgreementForDenom { + const message = createBaseMsgSetTakerFeeShareAgreementForDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.skim_percent !== undefined && object.skim_percent !== null) { + message.skimPercent = object.skim_percent; + } + if (object.skim_address !== undefined && object.skim_address !== null) { + message.skimAddress = object.skim_address; + } + return message; + }, + toAmino( + message: MsgSetTakerFeeShareAgreementForDenom + ): MsgSetTakerFeeShareAgreementForDenomAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.skim_percent = + message.skimPercent === "" ? undefined : message.skimPercent; + obj.skim_address = + message.skimAddress === "" ? undefined : message.skimAddress; + return obj; + }, + fromAminoMsg( + object: MsgSetTakerFeeShareAgreementForDenomAminoMsg + ): MsgSetTakerFeeShareAgreementForDenom { + return MsgSetTakerFeeShareAgreementForDenom.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetTakerFeeShareAgreementForDenom + ): MsgSetTakerFeeShareAgreementForDenomAminoMsg { + return { + type: "osmosis/poolmanager/set-taker-fee-share-agreement-for-denom", + value: MsgSetTakerFeeShareAgreementForDenom.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetTakerFeeShareAgreementForDenomProtoMsg + ): MsgSetTakerFeeShareAgreementForDenom { + return MsgSetTakerFeeShareAgreementForDenom.decode(message.value); + }, + toProto(message: MsgSetTakerFeeShareAgreementForDenom): Uint8Array { + return MsgSetTakerFeeShareAgreementForDenom.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetTakerFeeShareAgreementForDenom + ): MsgSetTakerFeeShareAgreementForDenomProtoMsg { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenom", + value: MsgSetTakerFeeShareAgreementForDenom.encode(message).finish(), + }; + }, +}; +function createBaseMsgSetTakerFeeShareAgreementForDenomResponse(): MsgSetTakerFeeShareAgreementForDenomResponse { + return {}; +} +export const MsgSetTakerFeeShareAgreementForDenomResponse = { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenomResponse", + encode( + _: MsgSetTakerFeeShareAgreementForDenomResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetTakerFeeShareAgreementForDenomResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetTakerFeeShareAgreementForDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetTakerFeeShareAgreementForDenomResponse { + const message = createBaseMsgSetTakerFeeShareAgreementForDenomResponse(); + return message; + }, + fromAmino( + _: MsgSetTakerFeeShareAgreementForDenomResponseAmino + ): MsgSetTakerFeeShareAgreementForDenomResponse { + const message = createBaseMsgSetTakerFeeShareAgreementForDenomResponse(); + return message; + }, + toAmino( + _: MsgSetTakerFeeShareAgreementForDenomResponse + ): MsgSetTakerFeeShareAgreementForDenomResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetTakerFeeShareAgreementForDenomResponseAminoMsg + ): MsgSetTakerFeeShareAgreementForDenomResponse { + return MsgSetTakerFeeShareAgreementForDenomResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetTakerFeeShareAgreementForDenomResponse + ): MsgSetTakerFeeShareAgreementForDenomResponseAminoMsg { + return { + type: "osmosis/poolmanager/set-taker-fee-share-agreement-for-denom-response", + value: MsgSetTakerFeeShareAgreementForDenomResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetTakerFeeShareAgreementForDenomResponseProtoMsg + ): MsgSetTakerFeeShareAgreementForDenomResponse { + return MsgSetTakerFeeShareAgreementForDenomResponse.decode(message.value); + }, + toProto(message: MsgSetTakerFeeShareAgreementForDenomResponse): Uint8Array { + return MsgSetTakerFeeShareAgreementForDenomResponse.encode( + message + ).finish(); + }, + toProtoMsg( + message: MsgSetTakerFeeShareAgreementForDenomResponse + ): MsgSetTakerFeeShareAgreementForDenomResponseProtoMsg { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetTakerFeeShareAgreementForDenomResponse", + value: + MsgSetTakerFeeShareAgreementForDenomResponse.encode(message).finish(), + }; + }, +}; +function createBaseMsgSetRegisteredAlloyedPool(): MsgSetRegisteredAlloyedPool { + return { + sender: "", + poolId: BigInt(0), + }; +} +export const MsgSetRegisteredAlloyedPool = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + encode( + message: MsgSetRegisteredAlloyedPool, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(16).uint64(message.poolId); + } + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRegisteredAlloyedPool { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetRegisteredAlloyedPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + object: Partial + ): MsgSetRegisteredAlloyedPool { + const message = createBaseMsgSetRegisteredAlloyedPool(); + message.sender = object.sender ?? ""; + message.poolId = + object.poolId !== undefined && object.poolId !== null + ? BigInt(object.poolId.toString()) + : BigInt(0); + return message; + }, + fromAmino( + object: MsgSetRegisteredAlloyedPoolAmino + ): MsgSetRegisteredAlloyedPool { + const message = createBaseMsgSetRegisteredAlloyedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino( + message: MsgSetRegisteredAlloyedPool + ): MsgSetRegisteredAlloyedPoolAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.pool_id = + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; + return obj; + }, + fromAminoMsg( + object: MsgSetRegisteredAlloyedPoolAminoMsg + ): MsgSetRegisteredAlloyedPool { + return MsgSetRegisteredAlloyedPool.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetRegisteredAlloyedPool + ): MsgSetRegisteredAlloyedPoolAminoMsg { + return { + type: "osmosis/poolmanager/set-registered-alloyed-pool", + value: MsgSetRegisteredAlloyedPool.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetRegisteredAlloyedPoolProtoMsg + ): MsgSetRegisteredAlloyedPool { + return MsgSetRegisteredAlloyedPool.decode(message.value); + }, + toProto(message: MsgSetRegisteredAlloyedPool): Uint8Array { + return MsgSetRegisteredAlloyedPool.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetRegisteredAlloyedPool + ): MsgSetRegisteredAlloyedPoolProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPool", + value: MsgSetRegisteredAlloyedPool.encode(message).finish(), + }; + }, +}; +function createBaseMsgSetRegisteredAlloyedPoolResponse(): MsgSetRegisteredAlloyedPoolResponse { + return {}; +} +export const MsgSetRegisteredAlloyedPoolResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPoolResponse", + encode( + _: MsgSetRegisteredAlloyedPoolResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer; + }, + decode( + input: BinaryReader | Uint8Array, + length?: number + ): MsgSetRegisteredAlloyedPoolResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetRegisteredAlloyedPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial( + _: Partial + ): MsgSetRegisteredAlloyedPoolResponse { + const message = createBaseMsgSetRegisteredAlloyedPoolResponse(); + return message; + }, + fromAmino( + _: MsgSetRegisteredAlloyedPoolResponseAmino + ): MsgSetRegisteredAlloyedPoolResponse { + const message = createBaseMsgSetRegisteredAlloyedPoolResponse(); + return message; + }, + toAmino( + _: MsgSetRegisteredAlloyedPoolResponse + ): MsgSetRegisteredAlloyedPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg( + object: MsgSetRegisteredAlloyedPoolResponseAminoMsg + ): MsgSetRegisteredAlloyedPoolResponse { + return MsgSetRegisteredAlloyedPoolResponse.fromAmino(object.value); + }, + toAminoMsg( + message: MsgSetRegisteredAlloyedPoolResponse + ): MsgSetRegisteredAlloyedPoolResponseAminoMsg { + return { + type: "osmosis/poolmanager/set-registered-alloyed-pool-response", + value: MsgSetRegisteredAlloyedPoolResponse.toAmino(message), + }; + }, + fromProtoMsg( + message: MsgSetRegisteredAlloyedPoolResponseProtoMsg + ): MsgSetRegisteredAlloyedPoolResponse { + return MsgSetRegisteredAlloyedPoolResponse.decode(message.value); + }, + toProto(message: MsgSetRegisteredAlloyedPoolResponse): Uint8Array { + return MsgSetRegisteredAlloyedPoolResponse.encode(message).finish(); + }, + toProtoMsg( + message: MsgSetRegisteredAlloyedPoolResponse + ): MsgSetRegisteredAlloyedPoolResponseProtoMsg { + return { + typeUrl: + "/osmosis.poolmanager.v1beta1.MsgSetRegisteredAlloyedPoolResponse", + value: MsgSetRegisteredAlloyedPoolResponse.encode(message).finish(), + }; + }, +}; function createBaseDenomPairTakerFee(): DenomPairTakerFee { return { denom0: "", denom1: "", takerFee: "", + tokenInDenom: "", + tokenOutDenom: "", }; } export const DenomPairTakerFee = { @@ -1415,6 +1945,12 @@ export const DenomPairTakerFee = { .uint32(26) .string(Decimal.fromUserInput(message.takerFee, 18).atomics); } + if (message.tokenInDenom !== "") { + writer.uint32(34).string(message.tokenInDenom); + } + if (message.tokenOutDenom !== "") { + writer.uint32(42).string(message.tokenOutDenom); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFee { @@ -1437,6 +1973,12 @@ export const DenomPairTakerFee = { 18 ).toString(); break; + case 4: + message.tokenInDenom = reader.string(); + break; + case 5: + message.tokenOutDenom = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1449,6 +1991,8 @@ export const DenomPairTakerFee = { message.denom0 = object.denom0 ?? ""; message.denom1 = object.denom1 ?? ""; message.takerFee = object.takerFee ?? ""; + message.tokenInDenom = object.tokenInDenom ?? ""; + message.tokenOutDenom = object.tokenOutDenom ?? ""; return message; }, fromAmino(object: DenomPairTakerFeeAmino): DenomPairTakerFee { @@ -1462,6 +2006,12 @@ export const DenomPairTakerFee = { if (object.taker_fee !== undefined && object.taker_fee !== null) { message.takerFee = object.taker_fee; } + if (object.tokenInDenom !== undefined && object.tokenInDenom !== null) { + message.tokenInDenom = object.tokenInDenom; + } + if (object.tokenOutDenom !== undefined && object.tokenOutDenom !== null) { + message.tokenOutDenom = object.tokenOutDenom; + } return message; }, toAmino(message: DenomPairTakerFee): DenomPairTakerFeeAmino { @@ -1469,6 +2019,10 @@ export const DenomPairTakerFee = { obj.denom0 = message.denom0 === "" ? undefined : message.denom0; obj.denom1 = message.denom1 === "" ? undefined : message.denom1; obj.taker_fee = message.takerFee === "" ? undefined : message.takerFee; + obj.tokenInDenom = + message.tokenInDenom === "" ? undefined : message.tokenInDenom; + obj.tokenOutDenom = + message.tokenOutDenom === "" ? undefined : message.tokenOutDenom; return obj; }, fromAminoMsg(object: DenomPairTakerFeeAminoMsg): DenomPairTakerFee { diff --git a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/genesis.ts b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/genesis.ts index 4f1a0cee2a..1001fbdaa4 100644 --- a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/genesis.ts +++ b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/genesis.ts @@ -271,7 +271,7 @@ export const GenesisState = { obj.params = message.params ? Params.toAmino(message.params) : undefined; obj.next_authenticator_id = message.nextAuthenticatorId !== BigInt(0) - ? message.nextAuthenticatorId.toString() + ? (message.nextAuthenticatorId?.toString)() : undefined; if (message.authenticatorData) { obj.authenticator_data = message.authenticatorData.map((e) => diff --git a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/models.ts b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/models.ts index c339dbfc0a..448b685038 100644 --- a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/models.ts +++ b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/models.ts @@ -139,7 +139,7 @@ export const AccountAuthenticator = { }, toAmino(message: AccountAuthenticator): AccountAuthenticatorAmino { const obj: any = {}; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? (message.id?.toString)() : undefined; obj.type = message.type === "" ? undefined : message.type; obj.config = message.config ? base64FromBytes(message.config) : undefined; return obj; diff --git a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/params.ts b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/params.ts index c6d7ee7fff..bb9d0e77ee 100644 --- a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/params.ts +++ b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/params.ts @@ -138,7 +138,7 @@ export const Params = { const obj: any = {}; obj.maximum_unauthenticated_gas = message.maximumUnauthenticatedGas !== BigInt(0) - ? message.maximumUnauthenticatedGas.toString() + ? (message.maximumUnauthenticatedGas?.toString)() : undefined; obj.is_smart_account_active = message.isSmartAccountActive === false diff --git a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/tx.ts index 2441802c17..66d35e7e99 100644 --- a/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/smartaccount/v1beta1/tx.ts @@ -4,7 +4,7 @@ import { base64FromBytes, bytesFromBase64 } from "../../../helpers"; /** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ export interface MsgAddAuthenticator { sender: string; - type: string; + authenticatorType: string; data: Uint8Array; } export interface MsgAddAuthenticatorProtoMsg { @@ -14,7 +14,7 @@ export interface MsgAddAuthenticatorProtoMsg { /** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ export interface MsgAddAuthenticatorAmino { sender?: string; - type?: string; + authenticator_type?: string; data?: string; } export interface MsgAddAuthenticatorAminoMsg { @@ -24,12 +24,11 @@ export interface MsgAddAuthenticatorAminoMsg { /** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ export interface MsgAddAuthenticatorSDKType { sender: string; - type: string; + authenticator_type: string; data: Uint8Array; } /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ export interface MsgAddAuthenticatorResponse { - /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ success: boolean; } export interface MsgAddAuthenticatorResponseProtoMsg { @@ -38,7 +37,6 @@ export interface MsgAddAuthenticatorResponseProtoMsg { } /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ export interface MsgAddAuthenticatorResponseAmino { - /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ success?: boolean; } export interface MsgAddAuthenticatorResponseAminoMsg { @@ -86,10 +84,6 @@ export interface MsgRemoveAuthenticatorSDKType { * type. */ export interface MsgRemoveAuthenticatorResponse { - /** - * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response - * type. - */ success: boolean; } export interface MsgRemoveAuthenticatorResponseProtoMsg { @@ -101,10 +95,6 @@ export interface MsgRemoveAuthenticatorResponseProtoMsg { * type. */ export interface MsgRemoveAuthenticatorResponseAmino { - /** - * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response - * type. - */ success?: boolean; } export interface MsgRemoveAuthenticatorResponseAminoMsg { @@ -189,7 +179,7 @@ export interface TxExtensionSDKType { function createBaseMsgAddAuthenticator(): MsgAddAuthenticator { return { sender: "", - type: "", + authenticatorType: "", data: new Uint8Array(), }; } @@ -202,8 +192,8 @@ export const MsgAddAuthenticator = { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.type !== "") { - writer.uint32(18).string(message.type); + if (message.authenticatorType !== "") { + writer.uint32(18).string(message.authenticatorType); } if (message.data.length !== 0) { writer.uint32(26).bytes(message.data); @@ -225,7 +215,7 @@ export const MsgAddAuthenticator = { message.sender = reader.string(); break; case 2: - message.type = reader.string(); + message.authenticatorType = reader.string(); break; case 3: message.data = reader.bytes(); @@ -240,7 +230,7 @@ export const MsgAddAuthenticator = { fromPartial(object: Partial): MsgAddAuthenticator { const message = createBaseMsgAddAuthenticator(); message.sender = object.sender ?? ""; - message.type = object.type ?? ""; + message.authenticatorType = object.authenticatorType ?? ""; message.data = object.data ?? new Uint8Array(); return message; }, @@ -249,8 +239,11 @@ export const MsgAddAuthenticator = { if (object.sender !== undefined && object.sender !== null) { message.sender = object.sender; } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; + if ( + object.authenticator_type !== undefined && + object.authenticator_type !== null + ) { + message.authenticatorType = object.authenticator_type; } if (object.data !== undefined && object.data !== null) { message.data = bytesFromBase64(object.data); @@ -260,7 +253,8 @@ export const MsgAddAuthenticator = { toAmino(message: MsgAddAuthenticator): MsgAddAuthenticatorAmino { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; - obj.type = message.type === "" ? undefined : message.type; + obj.authenticator_type = + message.authenticatorType === "" ? undefined : message.authenticatorType; obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, @@ -442,7 +436,7 @@ export const MsgRemoveAuthenticator = { toAmino(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorAmino { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.id = message.id !== BigInt(0) ? (message.id?.toString)() : undefined; return obj; }, fromAminoMsg(object: MsgRemoveAuthenticatorAminoMsg): MsgRemoveAuthenticator { diff --git a/packages/proto-codecs/src/codegen/osmosis/superfluid/superfluid.ts b/packages/proto-codecs/src/codegen/osmosis/superfluid/superfluid.ts index 2e687443c2..65218e8b1c 100644 --- a/packages/proto-codecs/src/codegen/osmosis/superfluid/superfluid.ts +++ b/packages/proto-codecs/src/codegen/osmosis/superfluid/superfluid.ts @@ -467,7 +467,7 @@ export const SuperfluidIntermediaryAccount = { obj.denom = message.denom === "" ? undefined : message.denom; obj.val_addr = message.valAddr === "" ? undefined : message.valAddr; obj.gauge_id = - message.gaugeId !== BigInt(0) ? message.gaugeId.toString() : undefined; + message.gaugeId !== BigInt(0) ? (message.gaugeId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -589,7 +589,7 @@ export const OsmoEquivalentMultiplierRecord = { const obj: any = {}; obj.epoch_number = message.epochNumber !== BigInt(0) - ? message.epochNumber.toString() + ? (message.epochNumber?.toString)() : undefined; obj.denom = message.denom === "" ? undefined : message.denom; obj.multiplier = message.multiplier === "" ? undefined : message.multiplier; @@ -856,7 +856,7 @@ export const LockIdIntermediaryAccountConnection = { ): LockIdIntermediaryAccountConnectionAmino { const obj: any = {}; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.intermediary_account = message.intermediaryAccount === "" ? undefined @@ -1131,10 +1131,10 @@ export const ConcentratedPoolUserPositionRecord = { message.validatorAddress === "" ? undefined : message.validatorAddress; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.synthetic_lock = message.syntheticLock ? SyntheticLock.toAmino(message.syntheticLock) : undefined; diff --git a/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.amino.ts b/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.amino.ts index fd7dfdfe5e..35f12c6115 100644 --- a/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.amino.ts @@ -28,7 +28,7 @@ export const AminoConverter = { fromAmino: MsgSuperfluidUnbondLock.fromAmino, }, "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock": { - aminoType: "osmosis/superfluid-undelegate-and-unbond-lock", + aminoType: "osmosis/superfluid-undelegate-unbond-lock", toAmino: MsgSuperfluidUndelegateAndUnbondLock.toAmino, fromAmino: MsgSuperfluidUndelegateAndUnbondLock.fromAmino, }, diff --git a/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.ts b/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.ts index 2c73259234..6e45d97178 100644 --- a/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/superfluid/tx.ts @@ -118,7 +118,7 @@ export interface MsgSuperfluidUndelegateAndUnbondLockAmino { coin?: CoinAmino; } export interface MsgSuperfluidUndelegateAndUnbondLockAminoMsg { - type: "osmosis/superfluid-undelegate-and-unbond-lock"; + type: "osmosis/superfluid-undelegate-unbond-lock"; value: MsgSuperfluidUndelegateAndUnbondLockAmino; } export interface MsgSuperfluidUndelegateAndUnbondLockSDKType { @@ -192,7 +192,7 @@ export interface MsgLockAndSuperfluidDelegateSDKType { val_addr: string; } export interface MsgLockAndSuperfluidDelegateResponse { - ID: bigint; + iD: bigint; } export interface MsgLockAndSuperfluidDelegateResponseProtoMsg { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse"; @@ -624,7 +624,7 @@ export const MsgSuperfluidDelegate = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.val_addr = message.valAddr === "" ? undefined : message.valAddr; return obj; }, @@ -796,7 +796,7 @@ export const MsgSuperfluidUndelegate = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -975,7 +975,7 @@ export const MsgSuperfluidUnbondLock = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -1172,7 +1172,7 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; return obj; }, @@ -1185,7 +1185,7 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { message: MsgSuperfluidUndelegateAndUnbondLock ): MsgSuperfluidUndelegateAndUnbondLockAminoMsg { return { - type: "osmosis/superfluid-undelegate-and-unbond-lock", + type: "osmosis/superfluid-undelegate-unbond-lock", value: MsgSuperfluidUndelegateAndUnbondLock.toAmino(message), }; }, @@ -1267,7 +1267,7 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { ): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { const obj: any = {}; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -1422,7 +1422,7 @@ export const MsgLockAndSuperfluidDelegate = { }; function createBaseMsgLockAndSuperfluidDelegateResponse(): MsgLockAndSuperfluidDelegateResponse { return { - ID: BigInt(0), + iD: BigInt(0), }; } export const MsgLockAndSuperfluidDelegateResponse = { @@ -1431,8 +1431,8 @@ export const MsgLockAndSuperfluidDelegateResponse = { message: MsgLockAndSuperfluidDelegateResponse, writer: BinaryWriter = BinaryWriter.create() ): BinaryWriter { - if (message.ID !== BigInt(0)) { - writer.uint32(8).uint64(message.ID); + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); } return writer; }, @@ -1448,7 +1448,7 @@ export const MsgLockAndSuperfluidDelegateResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ID = reader.uint64(); + message.iD = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1461,9 +1461,9 @@ export const MsgLockAndSuperfluidDelegateResponse = { object: Partial ): MsgLockAndSuperfluidDelegateResponse { const message = createBaseMsgLockAndSuperfluidDelegateResponse(); - message.ID = - object.ID !== undefined && object.ID !== null - ? BigInt(object.ID.toString()) + message.iD = + object.iD !== undefined && object.iD !== null + ? BigInt(object.iD.toString()) : BigInt(0); return message; }, @@ -1472,7 +1472,7 @@ export const MsgLockAndSuperfluidDelegateResponse = { ): MsgLockAndSuperfluidDelegateResponse { const message = createBaseMsgLockAndSuperfluidDelegateResponse(); if (object.ID !== undefined && object.ID !== null) { - message.ID = BigInt(object.ID); + message.iD = BigInt(object.ID); } return message; }, @@ -1480,7 +1480,7 @@ export const MsgLockAndSuperfluidDelegateResponse = { message: MsgLockAndSuperfluidDelegateResponse ): MsgLockAndSuperfluidDelegateResponseAmino { const obj: any = {}; - obj.ID = message.ID !== BigInt(0) ? message.ID.toString() : undefined; + obj.ID = message.iD !== BigInt(0) ? (message.iD?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -1613,7 +1613,7 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { } obj.val_addr = message.valAddr === "" ? undefined : message.valAddr; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -1737,10 +1737,10 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { ): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { const obj: any = {}; obj.lockID = - message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + message.lockID !== BigInt(0) ? (message.lockID?.toString)() : undefined; obj.positionID = message.positionID !== BigInt(0) - ? message.positionID.toString() + ? (message.positionID?.toString)() : undefined; return obj; }, @@ -1858,7 +1858,7 @@ export const MsgUnPoolWhitelistedPool = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.pool_id = - message.poolId !== BigInt(0) ? message.poolId.toString() : undefined; + message.poolId !== BigInt(0) ? (message.poolId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -2098,7 +2098,7 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.shares_to_migrate = message.sharesToMigrate ? Coin.toAmino(message.sharesToMigrate) : undefined; @@ -2420,7 +2420,7 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.sender = message.sender === "" ? undefined : message.sender; obj.token_desired0 = message.tokenDesired0 @@ -2591,14 +2591,14 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { const obj: any = {}; obj.position_id = message.positionId !== BigInt(0) - ? message.positionId.toString() + ? (message.positionId?.toString)() : undefined; obj.amount0 = message.amount0 === "" ? undefined : message.amount0; obj.amount1 = message.amount1 === "" ? undefined : message.amount1; obj.new_liquidity = message.newLiquidity === "" ? undefined : message.newLiquidity; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -2756,7 +2756,7 @@ export const MsgUnbondConvertAndStake = { toAmino(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAmino { const obj: any = {}; obj.lock_id = - message.lockId !== BigInt(0) ? message.lockId.toString() : undefined; + message.lockId !== BigInt(0) ? (message.lockId?.toString)() : undefined; obj.sender = message.sender === "" ? undefined : message.sender; obj.val_addr = message.valAddr === "" ? undefined : message.valAddr; obj.min_amt_to_stake = diff --git a/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts b/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts index d3e23fbc90..fa5d895899 100644 --- a/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts +++ b/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts @@ -40,7 +40,7 @@ export const AminoConverter = { fromAmino: MsgWithdrawDelegationRewards.fromAmino, }, "/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens": { - aminoType: "osmosis/valsetpref/delegate-bonded-tokens", + aminoType: "osmosis/MsgDelegateBondedTokens", toAmino: MsgDelegateBondedTokens.toAmino, fromAmino: MsgDelegateBondedTokens.fromAmino, }, diff --git a/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts b/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts index f15375c329..7da9502dd0 100644 --- a/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts +++ b/packages/proto-codecs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts @@ -307,7 +307,7 @@ export interface MsgDelegateBondedTokensAmino { lockID?: string; } export interface MsgDelegateBondedTokensAminoMsg { - type: "osmosis/valsetpref/delegate-bonded-tokens"; + type: "osmosis/MsgDelegateBondedTokens"; value: MsgDelegateBondedTokensAmino; } /** @@ -1496,7 +1496,7 @@ export const MsgDelegateBondedTokens = { const obj: any = {}; obj.delegator = message.delegator === "" ? undefined : message.delegator; obj.lockID = - message.lockID !== BigInt(0) ? message.lockID.toString() : undefined; + message.lockID !== BigInt(0) ? (message.lockID?.toString)() : undefined; return obj; }, fromAminoMsg( @@ -1508,7 +1508,7 @@ export const MsgDelegateBondedTokens = { message: MsgDelegateBondedTokens ): MsgDelegateBondedTokensAminoMsg { return { - type: "osmosis/valsetpref/delegate-bonded-tokens", + type: "osmosis/MsgDelegateBondedTokens", value: MsgDelegateBondedTokens.toAmino(message), }; }, diff --git a/packages/proto-codecs/src/codegen/tendermint/bundle.ts b/packages/proto-codecs/src/codegen/tendermint/bundle.ts index abe6da1e95..8f39da08ae 100644 --- a/packages/proto-codecs/src/codegen/tendermint/bundle.ts +++ b/packages/proto-codecs/src/codegen/tendermint/bundle.ts @@ -1,25 +1,25 @@ //@ts-nocheck -import * as _77 from "./crypto/keys"; -import * as _78 from "./crypto/proof"; -import * as _79 from "./types/block"; -import * as _80 from "./types/evidence"; -import * as _81 from "./types/params"; -import * as _82 from "./types/types"; -import * as _83 from "./types/validator"; -import * as _84 from "./version/types"; +import * as _79 from "./crypto/keys"; +import * as _80 from "./crypto/proof"; +import * as _81 from "./types/block"; +import * as _82 from "./types/evidence"; +import * as _83 from "./types/params"; +import * as _84 from "./types/types"; +import * as _85 from "./types/validator"; +import * as _86 from "./version/types"; export namespace tendermint { export const crypto = { - ..._77, - ..._78, - }; - export const types = { ..._79, ..._80, + }; + export const types = { ..._81, ..._82, ..._83, + ..._84, + ..._85, }; export const version = { - ..._84, + ..._86, }; } diff --git a/packages/proto-codecs/src/codegen/tendermint/crypto/proof.ts b/packages/proto-codecs/src/codegen/tendermint/crypto/proof.ts index aea0c97a06..f825bbd1c6 100644 --- a/packages/proto-codecs/src/codegen/tendermint/crypto/proof.ts +++ b/packages/proto-codecs/src/codegen/tendermint/crypto/proof.ts @@ -218,9 +218,9 @@ export const Proof = { toAmino(message: Proof): ProofAmino { const obj: any = {}; obj.total = - message.total !== BigInt(0) ? message.total.toString() : undefined; + message.total !== BigInt(0) ? (message.total?.toString)() : undefined; obj.index = - message.index !== BigInt(0) ? message.index.toString() : undefined; + message.index !== BigInt(0) ? (message.index?.toString)() : undefined; obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; diff --git a/packages/proto-codecs/src/codegen/tendermint/types/evidence.ts b/packages/proto-codecs/src/codegen/tendermint/types/evidence.ts index 4ac0db72e1..1e11f749a4 100644 --- a/packages/proto-codecs/src/codegen/tendermint/types/evidence.ts +++ b/packages/proto-codecs/src/codegen/tendermint/types/evidence.ts @@ -349,11 +349,11 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() + ? (message.totalVotingPower?.toString)() : undefined; obj.validator_power = message.validatorPower !== BigInt(0) - ? message.validatorPower.toString() + ? (message.validatorPower?.toString)() : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) @@ -503,7 +503,7 @@ export const LightClientAttackEvidence = { : undefined; obj.common_height = message.commonHeight !== BigInt(0) - ? message.commonHeight.toString() + ? (message.commonHeight?.toString)() : undefined; if (message.byzantineValidators) { obj.byzantine_validators = message.byzantineValidators.map((e) => @@ -514,7 +514,7 @@ export const LightClientAttackEvidence = { } obj.total_voting_power = message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() + ? (message.totalVotingPower?.toString)() : undefined; obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) diff --git a/packages/proto-codecs/src/codegen/tendermint/types/params.ts b/packages/proto-codecs/src/codegen/tendermint/types/params.ts index b2f3e1f02c..eb2353b7cf 100644 --- a/packages/proto-codecs/src/codegen/tendermint/types/params.ts +++ b/packages/proto-codecs/src/codegen/tendermint/types/params.ts @@ -450,12 +450,14 @@ export const BlockParams = { toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = - message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + message.maxBytes !== BigInt(0) + ? (message.maxBytes?.toString)() + : undefined; obj.max_gas = - message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; + message.maxGas !== BigInt(0) ? (message.maxGas?.toString)() : undefined; obj.time_iota_ms = message.timeIotaMs !== BigInt(0) - ? message.timeIotaMs.toString() + ? (message.timeIotaMs?.toString)() : undefined; return obj; }, @@ -565,13 +567,15 @@ export const EvidenceParams = { const obj: any = {}; obj.max_age_num_blocks = message.maxAgeNumBlocks !== BigInt(0) - ? message.maxAgeNumBlocks.toString() + ? (message.maxAgeNumBlocks?.toString)() : undefined; obj.max_age_duration = message.maxAgeDuration ? Duration.toAmino(message.maxAgeDuration) : undefined; obj.max_bytes = - message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; + message.maxBytes !== BigInt(0) + ? (message.maxBytes?.toString)() + : undefined; return obj; }, fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { @@ -712,7 +716,7 @@ export const VersionParams = { const obj: any = {}; obj.app_version = message.appVersion !== BigInt(0) - ? message.appVersion.toString() + ? (message.appVersion?.toString)() : undefined; return obj; }, @@ -802,11 +806,11 @@ export const HashedParams = { const obj: any = {}; obj.block_max_bytes = message.blockMaxBytes !== BigInt(0) - ? message.blockMaxBytes.toString() + ? (message.blockMaxBytes?.toString)() : undefined; obj.block_max_gas = message.blockMaxGas !== BigInt(0) - ? message.blockMaxGas.toString() + ? (message.blockMaxGas?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/tendermint/types/types.ts b/packages/proto-codecs/src/codegen/tendermint/types/types.ts index fc81e6b299..b8cbbd3b68 100644 --- a/packages/proto-codecs/src/codegen/tendermint/types/types.ts +++ b/packages/proto-codecs/src/codegen/tendermint/types/types.ts @@ -186,6 +186,7 @@ export interface Header { lastBlockId: BlockID; /** hashes of block data */ lastCommitHash: Uint8Array; + /** transactions */ dataHash: Uint8Array; /** hashes from the app output from the prev block */ validatorsHash: Uint8Array; @@ -195,6 +196,7 @@ export interface Header { consensusHash: Uint8Array; /** state after txs from the previous block */ appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ lastResultsHash: Uint8Array; /** consensus info */ evidenceHash: Uint8Array; @@ -216,6 +218,7 @@ export interface HeaderAmino { last_block_id?: BlockIDAmino; /** hashes of block data */ last_commit_hash?: string; + /** transactions */ data_hash?: string; /** hashes from the app output from the prev block */ validators_hash?: string; @@ -225,6 +228,7 @@ export interface HeaderAmino { consensus_hash?: string; /** state after txs from the previous block */ app_hash?: string; + /** root hash of all results from the txs from the previous block */ last_results_hash?: string; /** consensus info */ evidence_hash?: string; @@ -1007,7 +1011,7 @@ export const Header = { : undefined; obj.chain_id = message.chainId === "" ? undefined : message.chainId; obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; + message.height !== BigInt(0) ? (message.height?.toString)() : undefined; obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; @@ -1272,7 +1276,7 @@ export const Vote = { const obj: any = {}; obj.type = message.type === 0 ? undefined : message.type; obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; + message.height !== BigInt(0) ? (message.height?.toString)() : undefined; obj.round = message.round === 0 ? undefined : message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) @@ -1394,7 +1398,7 @@ export const Commit = { toAmino(message: Commit): CommitAmino { const obj: any = {}; obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; + message.height !== BigInt(0) ? (message.height?.toString)() : undefined; obj.round = message.round === 0 ? undefined : message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) @@ -1669,7 +1673,7 @@ export const Proposal = { const obj: any = {}; obj.type = message.type === 0 ? undefined : message.type; obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; + message.height !== BigInt(0) ? (message.height?.toString)() : undefined; obj.round = message.round === 0 ? undefined : message.round; obj.pol_round = message.polRound === 0 ? undefined : message.polRound; obj.block_id = message.blockId @@ -1977,11 +1981,11 @@ export const BlockMeta = { : undefined; obj.block_size = message.blockSize !== BigInt(0) - ? message.blockSize.toString() + ? (message.blockSize?.toString)() : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; obj.num_txs = - message.numTxs !== BigInt(0) ? message.numTxs.toString() : undefined; + message.numTxs !== BigInt(0) ? (message.numTxs?.toString)() : undefined; return obj; }, fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { diff --git a/packages/proto-codecs/src/codegen/tendermint/types/validator.ts b/packages/proto-codecs/src/codegen/tendermint/types/validator.ts index 7a579e97a9..b400e73d62 100644 --- a/packages/proto-codecs/src/codegen/tendermint/types/validator.ts +++ b/packages/proto-codecs/src/codegen/tendermint/types/validator.ts @@ -162,7 +162,7 @@ export const ValidatorSet = { : undefined; obj.total_voting_power = message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() + ? (message.totalVotingPower?.toString)() : undefined; return obj; }, @@ -283,11 +283,11 @@ export const Validator = { : undefined; obj.voting_power = message.votingPower !== BigInt(0) - ? message.votingPower.toString() + ? (message.votingPower?.toString)() : undefined; obj.proposer_priority = message.proposerPriority !== BigInt(0) - ? message.proposerPriority.toString() + ? (message.proposerPriority?.toString)() : undefined; return obj; }, @@ -377,7 +377,7 @@ export const SimpleValidator = { : undefined; obj.voting_power = message.votingPower !== BigInt(0) - ? message.votingPower.toString() + ? (message.votingPower?.toString)() : undefined; return obj; }, diff --git a/packages/proto-codecs/src/codegen/tendermint/version/types.ts b/packages/proto-codecs/src/codegen/tendermint/version/types.ts index d884f909d3..761b057430 100644 --- a/packages/proto-codecs/src/codegen/tendermint/version/types.ts +++ b/packages/proto-codecs/src/codegen/tendermint/version/types.ts @@ -133,7 +133,9 @@ export const App = { toAmino(message: App): AppAmino { const obj: any = {}; obj.protocol = - message.protocol !== BigInt(0) ? message.protocol.toString() : undefined; + message.protocol !== BigInt(0) + ? (message.protocol?.toString)() + : undefined; obj.software = message.software === "" ? undefined : message.software; return obj; }, @@ -219,8 +221,8 @@ export const Consensus = { toAmino(message: Consensus): ConsensusAmino { const obj: any = {}; obj.block = - message.block !== BigInt(0) ? message.block.toString() : undefined; - obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; + message.block !== BigInt(0) ? (message.block?.toString)() : undefined; + obj.app = message.app !== BigInt(0) ? (message.app?.toString)() : undefined; return obj; }, fromAminoMsg(object: ConsensusAminoMsg): Consensus { diff --git a/packages/proto-codecs/src/codegen/utf8.ts b/packages/proto-codecs/src/codegen/utf8.ts index e21ff3b15f..b08fab1161 100644 --- a/packages/proto-codecs/src/codegen/utf8.ts +++ b/packages/proto-codecs/src/codegen/utf8.ts @@ -1,8 +1,8 @@ //@ts-nocheck /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.1 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.4 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ // Copyright (c) 2016, Daniel Wirtz All rights reserved. diff --git a/packages/proto-codecs/src/codegen/varint.ts b/packages/proto-codecs/src/codegen/varint.ts index b5a96e1fde..2cf5f1f013 100644 --- a/packages/proto-codecs/src/codegen/varint.ts +++ b/packages/proto-codecs/src/codegen/varint.ts @@ -1,8 +1,8 @@ //@ts-nocheck /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.5.1 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.4 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ // Copyright 2008 Google Inc. All rights reserved. diff --git a/packages/stores/src/account/base.ts b/packages/stores/src/account/base.ts index ccf5c786fd..30287d5281 100644 --- a/packages/stores/src/account/base.ts +++ b/packages/stores/src/account/base.ts @@ -26,10 +26,10 @@ import { Functionify, QueriesStore, } from "@osmosis-labs/keplr-stores"; +import type { osmosisAminoConverters } from "@osmosis-labs/proto-codecs"; import { queryRPCStatus } from "@osmosis-labs/server"; import { encodeAnyBase64, - getOsmosisCodec, QuoteStdFee, SimulateNotAvailableError, TxTracer, @@ -822,21 +822,28 @@ export class AccountStore[] = []> { } } - const osmosis = await getOsmosisCodec(); - /** * If the message is an authenticator message, force the direct signing. * This is because the authenticator message should be signed with proto for now. */ - const isAuthenticatorMsg = messages.some( + + type TypeUrl = keyof typeof osmosisAminoConverters; + const getTypeUrl = (typeUrl: TypeUrl) => { + return typeUrl; + }; + + // TODO - update proto codec + const doesTxNeedDirectSigning = messages.some( (message) => message.typeUrl === - osmosis.smartaccount.v1beta1.MsgAddAuthenticator.typeUrl || + getTypeUrl( + "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition" + ) || message.typeUrl === - osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator.typeUrl + getTypeUrl("/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference") ); - const forceSignDirect = isAuthenticatorMsg; + const forceSignDirect = doesTxNeedDirectSigning; return ("signAmino" in offlineSigner || "signAmino" in wallet.client) && !forceSignDirect diff --git a/packages/stores/src/account/osmosis/index.ts b/packages/stores/src/account/osmosis/index.ts index ced0991b7c..6a3fedfa13 100644 --- a/packages/stores/src/account/osmosis/index.ts +++ b/packages/stores/src/account/osmosis/index.ts @@ -1698,7 +1698,7 @@ export class OsmosisAccountImpl { lockIds.map(async (lockId) => { return makeBeginUnlockingMsg({ owner: this.address, - ID: BigInt(lockId), + iD: BigInt(lockId), coins: [], }); }) @@ -1754,7 +1754,7 @@ export class OsmosisAccountImpl { msgs.push( await makeBeginUnlockingMsg({ owner: this.address, - ID: BigInt(lock.lockId), + iD: BigInt(lock.lockId), coins: [], }) ); @@ -2204,7 +2204,7 @@ export class OsmosisAccountImpl { onBroadcasted, signOptions, }: { - addAuthenticators: { type: string; data: Uint8Array }[]; + addAuthenticators: { authenticatorType: string; data: Uint8Array }[]; removeAuthenticators: bigint[]; memo?: string; onFulfill?: (tx: DeliverTxResponse) => void; @@ -2213,7 +2213,7 @@ export class OsmosisAccountImpl { }) { const addAuthenticatorMsgs = addAuthenticators.map((authenticator) => makeAddAuthenticatorMsg({ - type: authenticator.type, + authenticatorType: authenticator.authenticatorType, data: authenticator.data, sender: this.address, }) @@ -2262,14 +2262,14 @@ export class OsmosisAccountImpl { } async sendAddAuthenticatorsMsg( - authenticators: { type: string; data: any }[], + authenticators: { authenticatorType: string; data: any }[], memo: string = "", onFulfill?: (tx: DeliverTxResponse) => void ) { const addAuthenticatorMsgs = await Promise.all( authenticators.map((authenticator) => makeAddAuthenticatorMsg({ - type: authenticator.type, + authenticatorType: authenticator.authenticatorType, data: authenticator.data, sender: this.address, }) diff --git a/packages/stores/src/account/utils.ts b/packages/stores/src/account/utils.ts index d3823d0187..3dc714cbab 100644 --- a/packages/stores/src/account/utils.ts +++ b/packages/stores/src/account/utils.ts @@ -141,9 +141,9 @@ export const UseOneClickTradingLocalStorageKey = "use-one-click-enabled"; export const HasUsedOneClickTradingLocalStorageKey = "has-used-one-click"; // The number of heights from current before transaction times out. -// 30 heights * 5 second block time = 150 seconds before transaction +// 75 heights * 2 second block time = 150 seconds before transaction // timeout and mempool eviction. -const defaultTimeoutHeightOffset = 30; +const defaultTimeoutHeightOffset = 75; export const NEXT_TX_TIMEOUT_HEIGHT_OFFSET: bigint = BigInt( process.env.TIMEOUT_HEIGHT_OFFSET diff --git a/packages/tx/src/message-composers/osmosis/authenticator.ts b/packages/tx/src/message-composers/osmosis/authenticator.ts index e620fa6156..e11691b68c 100644 --- a/packages/tx/src/message-composers/osmosis/authenticator.ts +++ b/packages/tx/src/message-composers/osmosis/authenticator.ts @@ -1,11 +1,11 @@ import { getOsmosisCodec } from "../../codec"; export async function makeAddAuthenticatorMsg({ - type, + authenticatorType, data, sender, }: { - type: string; + authenticatorType: string; data: Uint8Array; sender: string; }) { @@ -14,7 +14,7 @@ export async function makeAddAuthenticatorMsg({ { data, sender, - type, + authenticatorType, } ); } diff --git a/packages/tx/src/message-composers/osmosis/lockup.ts b/packages/tx/src/message-composers/osmosis/lockup.ts index 731e66cca7..42545a91f0 100644 --- a/packages/tx/src/message-composers/osmosis/lockup.ts +++ b/packages/tx/src/message-composers/osmosis/lockup.ts @@ -20,13 +20,13 @@ export async function makeLockTokensMsg({ export async function makeBeginUnlockingMsg({ owner, - ID, + iD, coins, }: MsgBeginUnlocking) { const osmosis = await getOsmosisCodec(); return osmosis.lockup.MessageComposer.withTypeUrl.beginUnlocking({ owner, - ID, + iD, coins, }); } diff --git a/packages/types/src/one-click-trading-types.ts b/packages/types/src/one-click-trading-types.ts index 88ef0040a4..2485410aa7 100644 --- a/packages/types/src/one-click-trading-types.ts +++ b/packages/types/src/one-click-trading-types.ts @@ -4,7 +4,9 @@ export type AvailableOneClickTradingMessages = | "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn" | "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn" | "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut" - | "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut"; + | "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut" + | "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition" + | "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference"; export type OneClickTradingResetPeriods = "day" | "week" | "month" | "year"; export interface OneClickTradingTimeLimit { diff --git a/packages/web/components/one-click-trading/introducing-one-click-trading.tsx b/packages/web/components/one-click-trading/introducing-one-click-trading.tsx index 7762c89ac9..f75f031264 100644 --- a/packages/web/components/one-click-trading/introducing-one-click-trading.tsx +++ b/packages/web/components/one-click-trading/introducing-one-click-trading.tsx @@ -58,23 +58,18 @@ export const IntroducingOneClick = ({ > {t("oneClickTrading.introduction.startTradingButton")} -
-

- {t("oneClickTrading.introduction.defaultParameters")} –{" "} - -

-

- {t("oneClickTrading.introduction.ledgerComingSoon")} -

-
+

+ {t("oneClickTrading.introduction.defaultParameters")} –{" "} + +

); }; diff --git a/packages/web/components/one-click-trading/one-click-trading-settings.tsx b/packages/web/components/one-click-trading/one-click-trading-settings.tsx index 668b2f3eea..84940d2219 100644 --- a/packages/web/components/one-click-trading/one-click-trading-settings.tsx +++ b/packages/web/components/one-click-trading/one-click-trading-settings.tsx @@ -405,9 +405,9 @@ export const OneClickTradingSettings = ({ )} -
- {isOneClickTradingEnabled && - (isLoadingEstimateRemoveTx || !!estimateRemoveTxData) && ( + {isOneClickTradingEnabled && + (isLoadingEstimateRemoveTx || !!estimateRemoveTxData) && ( +
- )} - -

- {t("oneClickTrading.introduction.ledgerComingSoon")} -

-
+
+ )} diff --git a/packages/web/components/one-click-trading/one-click-trading-welcome-back.tsx b/packages/web/components/one-click-trading/one-click-trading-welcome-back.tsx index 4876dfa081..d0c2362847 100644 --- a/packages/web/components/one-click-trading/one-click-trading-welcome-back.tsx +++ b/packages/web/components/one-click-trading/one-click-trading-welcome-back.tsx @@ -101,9 +101,6 @@ export const OneClickTradingWelcomeBack = ({

{t("oneClickTrading.welcomeBack.description")}

-

- {t("oneClickTrading.introduction.ledgerComingSoon")} -

); diff --git a/packages/web/components/transactions/transaction-row.tsx b/packages/web/components/transactions/transaction-row.tsx index d6ee4c8678..aabb2bc502 100644 --- a/packages/web/components/transactions/transaction-row.tsx +++ b/packages/web/components/transactions/transaction-row.tsx @@ -37,7 +37,7 @@ export interface TransactionRow { value?: PricePretty; }; onClick?: () => void; - hash: string; + hash?: string; } export const TransactionRow: FunctionComponent = ({ diff --git a/packages/web/hooks/mutations/one-click-trading/__tests__/use-create-one-click-trading-session.spec.ts b/packages/web/hooks/mutations/one-click-trading/__tests__/use-create-one-click-trading-session.spec.ts index e9bf3333b6..ed9f1b6b4d 100644 --- a/packages/web/hooks/mutations/one-click-trading/__tests__/use-create-one-click-trading-session.spec.ts +++ b/packages/web/hooks/mutations/one-click-trading/__tests__/use-create-one-click-trading-session.spec.ts @@ -35,7 +35,7 @@ describe("isAuthenticatorOneClickTradingSession", () => { authenticator: { id: "1", config: Buffer.from(rawAuthenticator.data).toString("base64"), - type: rawAuthenticator.type, + type: rawAuthenticator.authenticatorType, }, }); expect(isAuthenticatorOneClickTradingSession({ authenticator })).toBe(true); @@ -71,7 +71,7 @@ describe("getOneClickTradingSessionAuthenticator", () => { sessionPeriod, }); - expect(result.type).toEqual("AllOf"); + expect(result.authenticatorType).toEqual("AllOf"); const data = JSON.parse(Buffer.from(result.data).toString()); expect(data).toHaveLength(3); expect(data[0].type).toEqual("SignatureVerification"); diff --git a/packages/web/hooks/mutations/one-click-trading/use-create-one-click-trading-session.tsx b/packages/web/hooks/mutations/one-click-trading/use-create-one-click-trading-session.tsx index fc81c5d2a4..e8d1719c56 100644 --- a/packages/web/hooks/mutations/one-click-trading/use-create-one-click-trading-session.tsx +++ b/packages/web/hooks/mutations/one-click-trading/use-create-one-click-trading-session.tsx @@ -70,7 +70,7 @@ export function getOneClickTradingSessionAuthenticator({ allowedAmount: string; sessionPeriod: OneClickTradingTimeLimit; }): { - type: AuthenticatorType; + authenticatorType: AuthenticatorType; data: Uint8Array; } { const signatureVerification = { @@ -112,8 +112,10 @@ export function getOneClickTradingSessionAuthenticator({ messageFilterAnyOf, ]; + // We return the message structure we want to broadcase here, + // not the structure of the authenticator returned from the chain. return { - type: "AllOf", + authenticatorType: "AllOf", data: new Uint8Array( Buffer.from(JSON.stringify(compositeAuthData)).toJSON().data ), @@ -247,6 +249,8 @@ export const useCreateOneClickTradingSession = ({ "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", + "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", + "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", ]; let sessionPeriod: OneClickTradingTimeLimit; diff --git a/packages/web/hooks/use-feature-flags.ts b/packages/web/hooks/use-feature-flags.ts index bbbca4f2de..93321039e8 100644 --- a/packages/web/hooks/use-feature-flags.ts +++ b/packages/web/hooks/use-feature-flags.ts @@ -113,6 +113,10 @@ export function useFeatureFlags() { launchdarklyFlags.limitOrders && (LIMIT_ORDER_COUNTRY_CODES.length === 0 || LIMIT_ORDER_COUNTRY_CODES.includes(levanaGeoblock?.countryCode ?? "")), + // To test chain upgrades easily on Edgenet, uncomment the flags below + // limitOrders: true, + // oneClickTrading: true, + // staking: true, } as Record< AvailableFlags | "_isInitialized" | "_isClientIDPresent", boolean diff --git a/packages/web/localizations/de.json b/packages/web/localizations/de.json index 7dcb0a5828..aa35255dcb 100644 --- a/packages/web/localizations/de.json +++ b/packages/web/localizations/de.json @@ -442,8 +442,7 @@ "learnMore": "Erfahren Sie mehr", "startTradingButton": "Starten Sie den 1-Klick-Handel", "defaultParameters": "Die Standardeinstellungen sind auf 1 Stunde mit einem Verlustschutzlimit von 5.000 USD festgelegt.", - "changeButton": "Einstellungen bearbeiten", - "ledgerComingSoon": "Unterstützung für Ledger-Hardware-Wallets in Kürze verfügbar." + "changeButton": "Einstellungen bearbeiten" }, "floatingBanner": { "newPill": "Neu", diff --git a/packages/web/localizations/en.json b/packages/web/localizations/en.json index 1d36b948d3..da145e1d51 100644 --- a/packages/web/localizations/en.json +++ b/packages/web/localizations/en.json @@ -442,8 +442,7 @@ "learnMore": "Learn more", "startTradingButton": "Start 1-Click Trading", "defaultParameters": "Default settings are set to 1 hour with a $5,000 USD Loss Protection limit.", - "changeButton": "Edit settings", - "ledgerComingSoon": "Ledger hardware wallet support coming soon." + "changeButton": "Edit settings" }, "floatingBanner": { "newPill": "New", diff --git a/packages/web/localizations/es.json b/packages/web/localizations/es.json index 90028014ea..30ee2bc4bd 100644 --- a/packages/web/localizations/es.json +++ b/packages/web/localizations/es.json @@ -442,8 +442,7 @@ "learnMore": "Aprende más", "startTradingButton": "Comience a operar con 1 clic", "defaultParameters": "La configuración predeterminada está establecida en 1 hora con un límite de protección contra pérdidas de $5,000 USD.", - "changeButton": "Editar ajustes", - "ledgerComingSoon": "Próximamente se admitirá la billetera de hardware de Ledger." + "changeButton": "Editar ajustes" }, "floatingBanner": { "newPill": "Nuevo", diff --git a/packages/web/localizations/fa.json b/packages/web/localizations/fa.json index c8d43d5328..605ea2316b 100644 --- a/packages/web/localizations/fa.json +++ b/packages/web/localizations/fa.json @@ -442,8 +442,7 @@ "learnMore": "بیشتر بدانید", "startTradingButton": "شروع تجارت با 1 کلیک", "defaultParameters": "تنظیمات پیش‌فرض روی 1 ساعت با محدودیت محافظت از ضرر 5000 دلار آمریکا تنظیم شده است.", - "changeButton": "ویرایش تنظیمات", - "ledgerComingSoon": "پشتیبانی کیف پول سخت افزاری لجر به زودی." + "changeButton": "ویرایش تنظیمات" }, "floatingBanner": { "newPill": "جدید", diff --git a/packages/web/localizations/fr.json b/packages/web/localizations/fr.json index 53f58ec2ee..373f07d62c 100644 --- a/packages/web/localizations/fr.json +++ b/packages/web/localizations/fr.json @@ -442,8 +442,7 @@ "learnMore": "Apprendre encore plus", "startTradingButton": "Commencez le trading en 1 clic", "defaultParameters": "Les paramètres par défaut sont définis sur 1 heure avec une limite de protection contre les pertes de 5 000 USD.", - "changeButton": "Modifier les paramètres", - "ledgerComingSoon": "La prise en charge du portefeuille matériel Ledger sera bientôt disponible." + "changeButton": "Modifier les paramètres" }, "floatingBanner": { "newPill": "Nouveau", diff --git a/packages/web/localizations/gu.json b/packages/web/localizations/gu.json index 460702f9e4..2d4e0cd0b8 100644 --- a/packages/web/localizations/gu.json +++ b/packages/web/localizations/gu.json @@ -442,8 +442,7 @@ "learnMore": "વધુ શીખો", "startTradingButton": "1-ક્લિક ટ્રેડિંગ શરૂ કરો", "defaultParameters": "ડિફોલ્ટ સેટિંગ્સ $5,000 USD નુકશાન સંરક્ષણ મર્યાદા સાથે 1 કલાક પર સેટ છે.", - "changeButton": "સેટિંગ્સ સંપાદિત કરો", - "ledgerComingSoon": "લેજર હાર્ડવેર વૉલેટ સપોર્ટ ટૂંક સમયમાં આવી રહ્યું છે." + "changeButton": "સેટિંગ્સ સંપાદિત કરો" }, "floatingBanner": { "newPill": "નવી", diff --git a/packages/web/localizations/hi.json b/packages/web/localizations/hi.json index 9539f01a02..917ad65f13 100644 --- a/packages/web/localizations/hi.json +++ b/packages/web/localizations/hi.json @@ -442,8 +442,7 @@ "learnMore": "और अधिक जानें", "startTradingButton": "1-क्लिक ट्रेडिंग प्रारंभ करें", "defaultParameters": "डिफ़ॉल्ट सेटिंग $5,000 USD हानि संरक्षण सीमा के साथ 1 घंटे पर सेट की गई है।", - "changeButton": "विन्यास बदलें", - "ledgerComingSoon": "लेजर हार्डवेयर वॉलेट समर्थन जल्द ही आ रहा है।" + "changeButton": "विन्यास बदलें" }, "floatingBanner": { "newPill": "नया", diff --git a/packages/web/localizations/ja.json b/packages/web/localizations/ja.json index 8732d7eed4..2cf40ebc21 100644 --- a/packages/web/localizations/ja.json +++ b/packages/web/localizations/ja.json @@ -442,8 +442,7 @@ "learnMore": "もっと詳しく知る", "startTradingButton": "1-Click取引を開始する", "defaultParameters": "デフォルト設定は 1 時間に設定されており、損失保護の限度額は 5,000 米ドルです。", - "changeButton": "編集の設定", - "ledgerComingSoon": "Ledger ハードウェア ウォレットのサポートがまもなく開始されます。" + "changeButton": "編集の設定" }, "floatingBanner": { "newPill": "新しい", diff --git a/packages/web/localizations/ko.json b/packages/web/localizations/ko.json index aa7e77a0cb..38b5785dd2 100644 --- a/packages/web/localizations/ko.json +++ b/packages/web/localizations/ko.json @@ -442,8 +442,7 @@ "learnMore": "더 알아보기", "startTradingButton": "1-클릭 거래 시작", "defaultParameters": "기본 설정은 1시간으로 설정되어 있으며 손실 보호 한도는 USD 5,000입니다.", - "changeButton": "설정 수정", - "ledgerComingSoon": "Ledger 하드웨어 지갑이 곧 지원될 예정입니다." + "changeButton": "설정 수정" }, "floatingBanner": { "newPill": "새로운", diff --git a/packages/web/localizations/pl.json b/packages/web/localizations/pl.json index f4728d10fc..2da0cfe4f1 100644 --- a/packages/web/localizations/pl.json +++ b/packages/web/localizations/pl.json @@ -442,8 +442,7 @@ "learnMore": "Ucz się więcej", "startTradingButton": "Rozpocznij handel jednym kliknięciem", "defaultParameters": "Ustawienia domyślne są ustawione na 1 godzinę z limitem ochrony przed stratą w wysokości 5000 USD.", - "changeButton": "Edytuj ustawienia", - "ledgerComingSoon": "Obsługa portfela sprzętowego Ledger już wkrótce." + "changeButton": "Edytuj ustawienia" }, "floatingBanner": { "newPill": "Nowy", diff --git a/packages/web/localizations/pt-br.json b/packages/web/localizations/pt-br.json index 150883f909..e312cde97e 100644 --- a/packages/web/localizations/pt-br.json +++ b/packages/web/localizations/pt-br.json @@ -442,8 +442,7 @@ "learnMore": "Saber mais", "startTradingButton": "Comece a negociação com 1 clique", "defaultParameters": "As configurações padrão são definidas para 1 hora com um limite de proteção contra perdas de US$ 5.000.", - "changeButton": "Editar Configurações", - "ledgerComingSoon": "Suporte para carteira de hardware Ledger em breve." + "changeButton": "Editar Configurações" }, "floatingBanner": { "newPill": "Novo", diff --git a/packages/web/localizations/ro.json b/packages/web/localizations/ro.json index de825da860..51748fd19b 100644 --- a/packages/web/localizations/ro.json +++ b/packages/web/localizations/ro.json @@ -442,8 +442,7 @@ "learnMore": "Află mai multe", "startTradingButton": "Începeți tranzacționarea cu 1 clic", "defaultParameters": "Setările implicite sunt setate la 1 oră cu o limită de protecție împotriva pierderilor de 5.000 USD.", - "changeButton": "Editeaza setarile", - "ledgerComingSoon": "Asistență pentru portofelul hardware Ledger va veni în curând." + "changeButton": "Editeaza setarile" }, "floatingBanner": { "newPill": "Nou", diff --git a/packages/web/localizations/ru.json b/packages/web/localizations/ru.json index e0472d1d3c..876168962c 100644 --- a/packages/web/localizations/ru.json +++ b/packages/web/localizations/ru.json @@ -442,8 +442,7 @@ "learnMore": "Узнать больше", "startTradingButton": "Начать торговлю в 1 клик", "defaultParameters": "Настройки по умолчанию установлены на 1 час с лимитом защиты от потерь в размере 5000 долларов США.", - "changeButton": "Изменить настройки", - "ledgerComingSoon": "Скоро появится поддержка аппаратного кошелька Ledger." + "changeButton": "Изменить настройки" }, "floatingBanner": { "newPill": "Новый", diff --git a/packages/web/localizations/tr.json b/packages/web/localizations/tr.json index 21d28da809..86c06b5b6b 100644 --- a/packages/web/localizations/tr.json +++ b/packages/web/localizations/tr.json @@ -442,8 +442,7 @@ "learnMore": "Daha fazla bilgi edin", "startTradingButton": "Tek Tıklamayla Ticareti Başlatın", "defaultParameters": "Varsayılan ayarlar 5.000 USD Kayıp Koruma limitiyle 1 saate ayarlanmıştır.", - "changeButton": "Ayarları düzenle", - "ledgerComingSoon": "Ledger donanım cüzdanı desteği çok yakında." + "changeButton": "Ayarları düzenle" }, "floatingBanner": { "newPill": "Yeni", diff --git a/packages/web/localizations/zh-cn.json b/packages/web/localizations/zh-cn.json index 7492a59f56..1d6b5bbd10 100644 --- a/packages/web/localizations/zh-cn.json +++ b/packages/web/localizations/zh-cn.json @@ -442,8 +442,7 @@ "learnMore": "了解更多", "startTradingButton": "开始一键交易", "defaultParameters": "默认设置为 1 小时,损失保护限额为 5,000 美元。", - "changeButton": "编辑设置", - "ledgerComingSoon": "Ledger 硬件钱包支持即将推出。" + "changeButton": "编辑设置" }, "floatingBanner": { "newPill": "新的", diff --git a/packages/web/localizations/zh-hk.json b/packages/web/localizations/zh-hk.json index 0220626ab2..cf33c2a51d 100644 --- a/packages/web/localizations/zh-hk.json +++ b/packages/web/localizations/zh-hk.json @@ -442,8 +442,7 @@ "learnMore": "了解更多", "startTradingButton": "開始一鍵交易", "defaultParameters": "預設為 1 小時,損失保護限額為 5,000 美元。", - "changeButton": "編輯設定", - "ledgerComingSoon": "Ledger 硬體錢包支援即將推出。" + "changeButton": "編輯設定" }, "floatingBanner": { "newPill": "新的", diff --git a/packages/web/localizations/zh-tw.json b/packages/web/localizations/zh-tw.json index 7c2d58a5f7..cfa348fc45 100644 --- a/packages/web/localizations/zh-tw.json +++ b/packages/web/localizations/zh-tw.json @@ -442,8 +442,7 @@ "learnMore": "了解更多", "startTradingButton": "開始一鍵交易", "defaultParameters": "預設為 1 小時,損失保護限額為 5,000 美元。", - "changeButton": "編輯設定", - "ledgerComingSoon": "Ledger 硬體錢包支援即將推出。" + "changeButton": "編輯設定" }, "floatingBanner": { "newPill": "新的", diff --git a/yarn.lock b/yarn.lock index 8e4400af17..82124b175c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2792,15 +2792,14 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== -"@cosmology/ast@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.5.1.tgz#e941690fdc91daca3ddbf17c3ed8e3f4ecacbf61" - integrity sha512-+zqdY4K+zDSNz7DCA2Z+5AqtGMgVmngsOjayNu7mLi/Lfm9r+JGoITrOGQRltRjg/G9yN/UH2VAHnIr5TH94Jg== +"@cosmology/ast@^1.8.2": + version "1.8.2" + resolved "https://registry.npmjs.org/@cosmology/ast/-/ast-1.8.2.tgz#4e5fddb06860d308d670b2b360e77c1e5c2d384d" + integrity sha512-tBjgoXIccJmFvLgrRL22KGLTm7VbbicuaYzS1rdmyDgC2qj4Xg+f/Sco+7y2eTbHMNZDGd0BUyo0HxVn96OYsQ== dependencies: - "@babel/parser" "^7.23.6" "@babel/types" "7.23.6" - "@cosmology/types" "^1.5.0" - "@cosmology/utils" "^1.5.0" + "@cosmology/types" "^1.8.2" + "@cosmology/utils" "^1.8.2" case "1.6.3" dotty "0.1.2" @@ -2817,6 +2816,20 @@ minimatch "5.1.0" mkdirp "3.0.0" +"@cosmology/proto-parser@^1.8.2": + version "1.8.2" + resolved "https://registry.npmjs.org/@cosmology/proto-parser/-/proto-parser-1.8.2.tgz#d95dfa7be983a50d4d7cdd3edda11747e05f3df2" + integrity sha512-XMdG4T0gbb3oE2zKNFw+0k+lojP+qyGWcL/5s8eHwYJa+dhCdutHW6D6yuCXl98CmHA2iPtYSbY37dXk+P4K6A== + dependencies: + "@cosmology/protobufjs" "7.3.2" + "@cosmology/types" "^1.8.2" + "@cosmology/utils" "^1.8.2" + dotty "0.1.2" + fast-json-patch "3.1.1" + glob "8.0.3" + minimatch "5.1.0" + mkdirp "3.0.0" + "@cosmology/protobufjs@6.11.6": version "6.11.6" resolved "https://registry.npmjs.org/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz" @@ -2836,20 +2849,39 @@ "@types/node" ">=13.7.0" long "^4.0.0" -"@cosmology/telescope@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.5.1.tgz#3e395d452fd97c1eee6fabf0deb2a9ba58bcaecf" - integrity sha512-nGB7AYv5kZeQ311HlYv3znBiKfnBu5E3OHgm2pjbFbl8iDbrL18hlHg0VSr5jRjTHAGRGQ1FnjEoP0XoccPUaA== +"@cosmology/protobufjs@7.3.2": + version "7.3.2" + resolved "https://registry.npmjs.org/@cosmology/protobufjs/-/protobufjs-7.3.2.tgz#6c2acdaec9e4b7aab4647bb236da1258e7526a87" + integrity sha512-zHf/yqGQ7QSjIYvv7kvGKY9yXNjqj55kWdRyntrXwnte/tY8uMTuCFD/EWC48LGhGu3P7nbzTlhyCGMc3xm9bw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^5.0.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + +"@cosmology/telescope@^1.8.4": + version "1.8.4" + resolved "https://registry.npmjs.org/@cosmology/telescope/-/telescope-1.8.4.tgz#a960040f4b8869e7df789c636123161ffc8b5b12" + integrity sha512-Ao6g1KxX4D7sD7lXf5hX2+DdsZQTRjcFRyx6qqeIWv0wz8EjGgNsX0DzZ2IAufD3hOABseLfVYMBXtfYruBQqw== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6" "@babel/traverse" "7.23.6" "@babel/types" "7.23.6" - "@cosmology/ast" "^1.5.1" - "@cosmology/proto-parser" "^1.5.0" - "@cosmology/types" "^1.5.0" - "@cosmology/utils" "^1.5.0" - "@cosmwasm/ts-codegen" "0.34.0" + "@cosmology/ast" "^1.8.2" + "@cosmology/proto-parser" "^1.8.2" + "@cosmology/types" "^1.8.2" + "@cosmology/utils" "^1.8.2" + "@cosmwasm/ts-codegen" "0.35.7" "@types/parse-package-name" "0.1.0" case "1.6.3" dargs "7.0.0" @@ -2864,6 +2896,7 @@ mkdirp "3.0.0" parse-package-name "1.0.0" rimraf "5.0.0" + yaml "^2.3.4" "@cosmology/types@^1.5.0": version "1.5.0" @@ -2872,6 +2905,14 @@ dependencies: case "1.6.3" +"@cosmology/types@^1.8.2": + version "1.8.2" + resolved "https://registry.npmjs.org/@cosmology/types/-/types-1.8.2.tgz#635e7775634c6c3f1dd4dc84027f974509bc28b3" + integrity sha512-cE8oov4ytxLwS5Q9F4I0LANh7HJwftQYhye0Yq60hFXruYHEJ3qkcHRGjtRSM9/Z1F7XG9S6xSXCT8nrH7+/IQ== + dependencies: + case "1.6.3" + fast-json-patch "3.1.1" + "@cosmology/utils@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.5.0.tgz#dafa16e3757b73898b5310fee41e82ae830c1d9b" @@ -2880,6 +2921,14 @@ "@cosmology/types" "^1.5.0" dotty "0.1.2" +"@cosmology/utils@^1.8.2": + version "1.8.2" + resolved "https://registry.npmjs.org/@cosmology/utils/-/utils-1.8.2.tgz#114c2a1a7cbebc8b55703caab405a78da52f1fdf" + integrity sha512-KAy8Y/hJmF8OjJp55M3+AE2VDF+1qHsE0rPqCtj1ujoX/qYl5ZnZF3Hv7oEO1d8Hhh/625KrUOfUK9LlPviUFw== + dependencies: + "@cosmology/types" "^1.8.2" + dotty "0.1.2" + "@cosmos-kit/cdcwallet-extension@^2.13.2": version "2.13.2" resolved "https://registry.yarnpkg.com/@cosmos-kit/cdcwallet-extension/-/cdcwallet-extension-2.13.2.tgz#303026b4f434a70444bbf8810485b0e80030dd62" @@ -3091,10 +3140,10 @@ resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.15.tgz#cdc6d8fce42217704c1c0d5814f0ee7ce27e8dab" integrity sha512-HlXYJjFrNpjiV/GUKhri1UL8/bhlOIFFLpRF78YDSqq16x0+plIqx5CAvEusFcKTDpVfpeD5sfUHiKvP7euNFg== -"@cosmwasm/ts-codegen@0.34.0": - version "0.34.0" - resolved "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz#659bb69fc5f74cbd623567f3090e69072f08b23c" - integrity sha512-Mt/aYj0be9GnA51Arysqr9L8KQNWUJJHoJvtru7hkHmukPSewZDilwHCOJAaehk5gjsP7LFey2o2KEdfzkANhA== +"@cosmwasm/ts-codegen@0.35.7": + version "0.35.7" + resolved "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.35.7.tgz#b88c03b732824113fc765d560504516faca6f23b" + integrity sha512-qbOAYJPe5O5AjoWytZcsVvM0SBA39sMpiqnVIIgjJiqp4G4D5GjR2/UV3ePpygnIxxKZWMnOpPPUvLMjflblCw== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -3122,7 +3171,7 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.25.0" + wasm-ast-types "^0.26.4" "@dao-dao/cosmiframe@^0.1.0": version "0.1.0" @@ -7219,6 +7268,13 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/long@^5.0.0": + version "5.0.0" + resolved "https://registry.npmjs.org/@types/long/-/long-5.0.0.tgz#daaa7b7f74c919c946ff74889d5ca2afe363b2cd" + integrity sha512-eQs9RsucA/LNjnMoJvWG/nXa7Pot/RbBzilF/QRIU/xRl+0ApxrSUFsV5lmf01SvSlqMzJ7Zwxe440wmz2SJGA== + dependencies: + long "*" + "@types/mdast@^3.0.0": version "3.0.14" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.14.tgz#0735473a5b35be032b9f2685b7413cbab1b8a639" @@ -12445,6 +12501,11 @@ fast-glob@^3.3.1: merge2 "^1.3.0" micromatch "^4.0.4" +fast-json-patch@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947" + integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ== + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" @@ -15889,7 +15950,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -"long@^3 || ^4 || ^5", long@^5.0.0, long@^5.2.0, long@^5.2.1, long@^5.2.3: +long@*, "long@^3 || ^4 || ^5", long@^5.0.0, long@^5.2.0, long@^5.2.1, long@^5.2.3: version "5.2.3" resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== @@ -21656,10 +21717,10 @@ warning@^4.0.3: dependencies: loose-envify "^1.0.0" -wasm-ast-types@^0.25.0: - version "0.25.0" - resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz#9f4056803c99fae6899c1f226e46cf730d9fe2db" - integrity sha512-ZTjXuBqRf3ntxXmskO1TyTTr8UbmAZGr72JGGctizzpdokMtuLsk5q8jHaFUv/qgQni1KuBxZnHIyaj1lnZegQ== +wasm-ast-types@^0.26.4: + version "0.26.4" + resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.26.4.tgz#cade0616c7158a0d05df8d6b8cac5cc098385fd1" + integrity sha512-bMxkQzc/+e7s5W+EBfurl/Y7KnTm0YPeg/cXjyio3PHULKWQULMREgyuJXJWaIa+8sKI1+OI61YeFSJBilm9YQ== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10" @@ -22079,6 +22140,11 @@ yaml@^1.10.2: resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.3.4: + version "2.5.1" + resolved "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130" + integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== + yargs-parser@21.1.1, yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" From 1d030405a0ba06a3e7f757275a767e284abf6ec0 Mon Sep 17 00:00:00 2001 From: yakuramori <62520712+yury-dubinin@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:54:22 +0200 Subject: [PATCH 3/7] Less alerts from claim workflow (#3845) --- .../workflows/monitoring-claim-orders .yml | 70 +------------------ packages/web/e2e/tests/select.spec.ts | 7 +- 2 files changed, 7 insertions(+), 70 deletions(-) diff --git a/.github/workflows/monitoring-claim-orders .yml b/.github/workflows/monitoring-claim-orders .yml index ac1b71b6ea..9eacbb8e8c 100644 --- a/.github/workflows/monitoring-claim-orders .yml +++ b/.github/workflows/monitoring-claim-orders .yml @@ -3,7 +3,7 @@ name: Technical job to claim orders created by monitoring on: workflow_dispatch: schedule: - - cron: "*/45 * * * *" + - cron: "19 * * * *" jobs: fe-claim1-tests: @@ -40,40 +40,6 @@ jobs: with: name: claim1-test-results path: packages/web/playwright-report - - name: Send Slack alert if test fails - id: slack - if: failure() - uses: slackapi/slack-github-action@v1.26.0 - with: - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "🚨 Claim Tests Failure Alert 🚨" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Production App URL:* https://app.osmosis.zone" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Click here to view the run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Actions Run>" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SERVER_E2E_TESTS_SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK fe-claim2-tests: timeout-minutes: 10 @@ -109,40 +75,6 @@ jobs: with: name: claim2-test-results path: packages/web/playwright-report - - name: Send Slack alert if test fails - id: slack - if: failure() - uses: slackapi/slack-github-action@v1.26.0 - with: - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "🚨 Claim Tests Failure Alert 🚨" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Production App URL:* https://app.osmosis.zone" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Click here to view the run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Actions Run>" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SERVER_E2E_TESTS_SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK delete-deployments: runs-on: ubuntu-latest diff --git a/packages/web/e2e/tests/select.spec.ts b/packages/web/e2e/tests/select.spec.ts index 0293fb3f0c..550fb1d86a 100644 --- a/packages/web/e2e/tests/select.spec.ts +++ b/packages/web/e2e/tests/select.spec.ts @@ -1,5 +1,10 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { BrowserContext, chromium, Page, test } from "@playwright/test"; +import { + type BrowserContext, + chromium, + type Page, + test, +} from "@playwright/test"; import { addCoverageReport, attachCoverageReport } from "monocart-reporter"; import { TradePage } from "~/e2e/pages/trade-page"; From 8956a002f91ff2008633743b7098d4ceeecc45f8 Mon Sep 17 00:00:00 2001 From: Matt Upham <30577966+mattupham@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:07:09 -0700 Subject: [PATCH 4/7] Publish Stage (#3831) (#3846) * Mattupham/fe 1067 portfolio v3 update 0 change values to be green and up (#3823) * add threshold updates * Clean up logs * [Limit Orders]: SQS Active Order Query (#3828) * fix: increased cache time and refetch interval for active orders * fix: even longer cache * fix: WIP batch query implementation * fix: longer delay between batches * fix: batch size/timing * fix: vercel max duration * fix: wired in sqs query for active orders * fix: build * fix: filled orders styling * fix: remove claimable orders test data * fix: further reduced queries * feat: moved orders query to passthrough * fix: moved active orders to local router * fix: altered orders cache to be more responsive * chore: post typing fixes for active orders sqs query * fix: reverted unnecessary changes * feat: removed pool restriction on orderbooks * Clean up formatter (#3829) * Clean up formatter * Remove log * update no price data * add pr notification yaml (#3830) Co-authored-by: Michael Millington <> * fix lint issue (#3832) * Handle PricePretty and Lint issue * add search from query param for earn (#3836) * Update search from query param * Do not log subsequent chart interaction events / Handle last event tracking (#3834) * Handle last event tracking * Clean up * Clean up types * Update event properties * Add types for event options * Fix lint * Update MATIC -> POL (#3835) * Update MATIC -> POL * Update tests * feat: feature flag for sqs active orders (#3837) * [Limit Orders]: Fix date display for order history (#3833) * fix: date display for order history * fix: undid feature flag changes * fix: typing issue * [Limit Orders]: Price to Tick Crash Handler (#3838) * fix: price to tick error handling * feat: added swap source to swap amplitude events --------- * Update IBC overrides to use POL (#3839) --------- Co-authored-by: Jon Ator Co-authored-by: yakuramori <62520712+yury-dubinin@users.noreply.github.com> Co-authored-by: Connor Barr Co-authored-by: Max Millington --- packages/server/src/queries/complex/orderbooks/active-orders.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/queries/complex/orderbooks/active-orders.ts b/packages/server/src/queries/complex/orderbooks/active-orders.ts index 83a76435ac..6b1fa9d618 100644 --- a/packages/server/src/queries/complex/orderbooks/active-orders.ts +++ b/packages/server/src/queries/complex/orderbooks/active-orders.ts @@ -193,7 +193,7 @@ async function getTickInfoAndTransformOrders( output, quoteAsset, baseAsset, - placed_at: dayjs(Math.floor(o.placed_at / 1000000)).unix(), + placed_at: dayjs(o.placed_at / 1000).unix(), }; }); } From c0894d05415d7996a6c322ab1810fa5bb72b0f0d Mon Sep 17 00:00:00 2001 From: Jon Ator Date: Wed, 18 Sep 2024 16:37:21 -0400 Subject: [PATCH 5/7] check for nil response data in numia tokens endpoint (#3847) * check for nil response data * check volume & price * remove old token query * fix index * update type --- .../src/queries/complex/assets/market.ts | 4 +- .../complex/assets/price/providers/sidecar.ts | 14 +++- .../src/queries/data-services/token-data.ts | 4 +- packages/stores/src/queries-external/index.ts | 1 - packages/stores/src/queries-external/store.ts | 7 -- .../src/queries-external/token-data/index.ts | 74 ------------------- .../src/queries-external/token-data/types.ts | 14 ---- 7 files changed, 14 insertions(+), 104 deletions(-) delete mode 100644 packages/stores/src/queries-external/token-data/index.ts delete mode 100644 packages/stores/src/queries-external/token-data/types.ts diff --git a/packages/server/src/queries/complex/assets/market.ts b/packages/server/src/queries/complex/assets/market.ts index 57d162e80c..27c7a6cf5a 100644 --- a/packages/server/src/queries/complex/assets/market.ts +++ b/packages/server/src/queries/complex/assets/market.ts @@ -231,14 +231,14 @@ function makeMarketActivityFromTokenData(tokenData: TokenData) { : undefined, denom: tokenData.denom, symbol: tokenData.symbol, - liquidity: new PricePretty(DEFAULT_VS_CURRENCY, tokenData.liquidity), + liquidity: new PricePretty(DEFAULT_VS_CURRENCY, tokenData.liquidity ?? 0), liquidity24hChange: tokenData.liquidity_24h_change !== null ? new RatePretty( new Dec(tokenData.liquidity_24h_change).quo(new Dec(100)) ) : undefined, - volume24h: new PricePretty(DEFAULT_VS_CURRENCY, tokenData.volume_24h), + volume24h: new PricePretty(DEFAULT_VS_CURRENCY, tokenData.volume_24h ?? 0), volume24hChange: tokenData.volume_24h_change !== null ? new RatePretty(new Dec(tokenData.volume_24h_change).quo(new Dec(100))) diff --git a/packages/server/src/queries/complex/assets/price/providers/sidecar.ts b/packages/server/src/queries/complex/assets/price/providers/sidecar.ts index 90c72c30b8..3d192ff395 100644 --- a/packages/server/src/queries/complex/assets/price/providers/sidecar.ts +++ b/packages/server/src/queries/complex/assets/price/providers/sidecar.ts @@ -1,5 +1,6 @@ import { Dec } from "@keplr-wallet/unit"; import { Asset } from "@osmosis-labs/types"; +import { isNil } from "@osmosis-labs/utils"; import cachified, { CacheEntry } from "cachified"; import { LRUCache } from "lru-cache"; @@ -30,8 +31,8 @@ function getBatchLoader() { ttl: 1000 * 60 * 10, // 10 minutes getFreshValue: () => new EdgeDataLoader( - (coinMinimalDenoms: readonly string[]) => { - return queryPrices(coinMinimalDenoms as string[]).then((priceMap) => + (coinMinimalDenoms: readonly string[]) => + queryPrices(coinMinimalDenoms as string[]).then((priceMap) => coinMinimalDenoms.map((baseCoinMinimalDenom) => { try { const price = @@ -40,6 +41,12 @@ function getBatchLoader() { // trim to 18 decimals to silence Dec warnings const p = price.replace(/(\.\d{18})\d*/, "$1"); + if (isNil(p)) { + return new Error( + `No SQS price result for ${baseCoinMinimalDenom} and USDC` + ); + } + if (new Dec(p).isZero()) return new Error( `No SQS price result for ${baseCoinMinimalDenom} and USDC` @@ -51,8 +58,7 @@ function getBatchLoader() { ); } }) - ); - }, + ), { // SQS imposes a limit on URI length from its Nginx configuration, so we impose a limit to avoid hitting that limit. maxBatchSize: 100, diff --git a/packages/server/src/queries/data-services/token-data.ts b/packages/server/src/queries/data-services/token-data.ts index b392ca36b5..3d24f816a0 100644 --- a/packages/server/src/queries/data-services/token-data.ts +++ b/packages/server/src/queries/data-services/token-data.ts @@ -7,9 +7,9 @@ export interface TokenData { denom: string; symbol: string; main: boolean; - liquidity: number; + liquidity: number | null; liquidity_24h_change: number | null; - volume_24h: number; + volume_24h: number | null; volume_24h_change: number | null; name: string; price_1h_change: number | null; diff --git a/packages/stores/src/queries-external/index.ts b/packages/stores/src/queries-external/index.ts index 9bd0f6ed26..8171d7551a 100644 --- a/packages/stores/src/queries-external/index.ts +++ b/packages/stores/src/queries-external/index.ts @@ -7,7 +7,6 @@ export * from "./pool-fees"; export * from "./pool-rewards"; export * from "./pools"; export * from "./store"; -export * from "./token-data"; export * from "./token-historical-chart"; export const IMPERATOR_TIMESERIES_DEFAULT_BASEURL = diff --git a/packages/stores/src/queries-external/store.ts b/packages/stores/src/queries-external/store.ts index 0b98c1b2d9..d6e022e0e6 100644 --- a/packages/stores/src/queries-external/store.ts +++ b/packages/stores/src/queries-external/store.ts @@ -24,7 +24,6 @@ import { ObservableQueryPoolAprs } from "./numia"; import { ObservableQueryPoolFeesMetrics } from "./pool-fees"; import { ObservableQueryAccountsPoolRewards } from "./pool-rewards"; import { ObservableQueryPositionsPerformanceMetrics } from "./position-performance"; -import { ObservableQueryTokensData } from "./token-data"; import { ObservableQueryTokensHistoricalChart } from "./token-historical-chart"; import { ObservableQueryMarketCap } from "./token-market-cap"; @@ -35,7 +34,6 @@ export class QueriesExternalStore { public readonly queryChainStatus: DeepReadonly; public readonly queryMarketCaps: DeepReadonly; public readonly queryTokenHistoricalChart: DeepReadonly; - public readonly queryTokenData: DeepReadonly; public readonly queryActiveGauges: DeepReadonly; public readonly queryICNSNames: DeepReadonly; public readonly queryPositionsPerformaceMetrics: DeepReadonly; @@ -90,11 +88,6 @@ export class QueriesExternalStore { kvStore, indexerDataBaseUrl ); - this.queryTokenData = new ObservableQueryTokensData( - kvStore, - priceStore, - timeseriesDataBaseUrl - ); this.queryActiveGauges = new ObservableQueryActiveGauges( kvStore, webApiBaseUrl, diff --git a/packages/stores/src/queries-external/token-data/index.ts b/packages/stores/src/queries-external/token-data/index.ts deleted file mode 100644 index 2babb0b4f7..0000000000 --- a/packages/stores/src/queries-external/token-data/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { KVStore } from "@keplr-wallet/common"; -import { Dec, PricePretty, RatePretty } from "@keplr-wallet/unit"; -import { HasMapStore } from "@osmosis-labs/keplr-stores"; -import { computed, makeObservable } from "mobx"; - -import { IPriceStore } from "../../price"; -import { IMPERATOR_TIMESERIES_DEFAULT_BASEURL } from ".."; -import { ObservableQueryExternalBase } from "../base"; -import { TokenData } from "./types"; - -/** Queries Imperator token history data chart. */ -export class ObservableQueryTokenData extends ObservableQueryExternalBase< - TokenData[] -> { - constructor( - kvStore: KVStore, - protected readonly priceStore: IPriceStore, - baseURL: string, - protected readonly denom: string - ) { - super(kvStore, baseURL, `/tokens/v2/${denom}`); - - makeObservable(this); - } - - protected canFetch(): boolean { - return Boolean(this.denom); - } - - @computed - get get24hrChange(): RatePretty | undefined { - if (!this.response) return undefined; - - try { - return new RatePretty( - new Dec(this.response.data[0].price_24h_change / 100) - ); - } catch { - return undefined; - } - } - - @computed - get price() { - const fiat = this.priceStore.getFiatCurrency( - this.priceStore.defaultVsCurrency - ); - - if (!this?.response?.data[0]?.price || !fiat) return undefined; - - return new PricePretty(fiat, new Dec(this.response.data[0].price)); - } -} - -export class ObservableQueryTokensData extends HasMapStore { - constructor( - kvStore: KVStore, - priceStore: IPriceStore, - timeseriesDataBaseUrl = IMPERATOR_TIMESERIES_DEFAULT_BASEURL - ) { - super((symbol: string) => { - return new ObservableQueryTokenData( - kvStore, - priceStore, - timeseriesDataBaseUrl, - symbol - ); - }); - } - - get(symbol: string) { - return super.get(symbol) as ObservableQueryTokenData; - } -} diff --git a/packages/stores/src/queries-external/token-data/types.ts b/packages/stores/src/queries-external/token-data/types.ts deleted file mode 100644 index 8127925057..0000000000 --- a/packages/stores/src/queries-external/token-data/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface TokenData { - price: number; - denom: string; - symbol: string; - main: boolean; - liquidity: number; - liquidity_24h_change: number; - volume_24h: number; - volume_24h_change: number; - name: string; - price_24h_change: number; - exponent: number; - display: string; -} From d1c59fdc21c21c1106bb74dbe182c0e0f7ca0a82 Mon Sep 17 00:00:00 2001 From: Jon Ator Date: Thu, 19 Sep 2024 10:42:49 -0400 Subject: [PATCH 6/7] Use Skip API key with tx status endpoints (#3849) * add skip tx tracking edge functions * fix test * nit --- .../__tests__/skip-transfer-status.spec.ts | 23 ++++- packages/bridge/src/skip/client.ts | 3 +- packages/bridge/src/skip/index.ts | 1 + packages/bridge/src/skip/transfer-status.ts | 83 +++++++++++-------- packages/web/pages/api/skip-track-tx.ts | 32 +++++++ packages/web/pages/api/skip-tx-status.ts | 32 +++++++ packages/web/stores/root.ts | 28 ++++++- 7 files changed, 162 insertions(+), 40 deletions(-) create mode 100644 packages/web/pages/api/skip-track-tx.ts create mode 100644 packages/web/pages/api/skip-tx-status.ts diff --git a/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts b/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts index 64177cb7d7..551acca3c7 100644 --- a/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts +++ b/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts @@ -4,7 +4,11 @@ import { rest } from "msw"; import { MockChains } from "../../__tests__/mock-chains"; import { server } from "../../__tests__/msw"; import { BridgeEnvironment, TransferStatusReceiver } from "../../interface"; -import { SkipTransferStatusProvider } from "../transfer-status"; +import { SkipApiClient } from "../client"; +import { + SkipStatusProvider, + SkipTransferStatusProvider, +} from "../transfer-status"; jest.mock("@osmosis-labs/utils", () => ({ ...jest.requireActual("@osmosis-labs/utils"), @@ -19,6 +23,14 @@ jest.mock("@osmosis-labs/utils", () => ({ }), })); +const SkipStatusProvider: SkipStatusProvider = { + transactionStatus: ({ chainID, txHash, env }) => { + const client = new SkipApiClient(env); + return client.transactionStatus({ chainID, txHash }); + }, + trackTransaction: () => Promise.resolve(), +}; + // silence console errors jest.spyOn(console, "error").mockImplementation(() => {}); @@ -31,7 +43,8 @@ describe("SkipTransferStatusProvider", () => { beforeEach(() => { provider = new SkipTransferStatusProvider( "mainnet" as BridgeEnvironment, - MockChains + MockChains, + SkipStatusProvider ); provider.statusReceiverDelegate = mockReceiver; }); @@ -108,7 +121,8 @@ describe("SkipTransferStatusProvider", () => { it("should generate correct explorer URL for testnet", () => { const testnetProvider = new SkipTransferStatusProvider( "testnet" as BridgeEnvironment, - MockChains + MockChains, + SkipStatusProvider ); const url = testnetProvider.makeExplorerUrl( JSON.stringify({ @@ -123,7 +137,8 @@ describe("SkipTransferStatusProvider", () => { it("should generate correct explorer URL for a cosmos chain", () => { const cosmosProvider = new SkipTransferStatusProvider( "mainnet" as BridgeEnvironment, - MockChains + MockChains, + SkipStatusProvider ); const url = cosmosProvider.makeExplorerUrl( JSON.stringify({ diff --git a/packages/bridge/src/skip/client.ts b/packages/bridge/src/skip/client.ts index 51507064ff..bcf4f2a673 100644 --- a/packages/bridge/src/skip/client.ts +++ b/packages/bridge/src/skip/client.ts @@ -14,6 +14,7 @@ import { export class SkipApiClient { constructor( readonly env: BridgeEnvironment, + protected readonly apiKey = process.env.SKIP_API_KEY, readonly baseUrl = "https://api.skip.money" ) {} @@ -122,7 +123,7 @@ export class SkipApiClient { return apiClient(args[0], args[1]); } - const key = process.env.SKIP_API_KEY; + const key = this.apiKey; if (!key) throw new Error("SKIP_API_KEY is not set"); return apiClient(args[0], { diff --git a/packages/bridge/src/skip/index.ts b/packages/bridge/src/skip/index.ts index 4bce785b66..679f6e05a5 100644 --- a/packages/bridge/src/skip/index.ts +++ b/packages/bridge/src/skip/index.ts @@ -936,4 +936,5 @@ export class SkipBridgeProvider implements BridgeProvider { } } +export * from "./client"; export * from "./transfer-status"; diff --git a/packages/bridge/src/skip/transfer-status.ts b/packages/bridge/src/skip/transfer-status.ts index d937f56135..650cce723b 100644 --- a/packages/bridge/src/skip/transfer-status.ts +++ b/packages/bridge/src/skip/transfer-status.ts @@ -9,8 +9,23 @@ import type { TransferStatusProvider, TransferStatusReceiver, } from "../interface"; -import { SkipApiClient } from "./client"; import { SkipBridgeProvider } from "./index"; +import { SkipTxStatusResponse } from "./types"; + +type Transaction = { + chainID: string; + txHash: string; + env: BridgeEnvironment; +}; + +export interface SkipStatusProvider { + transactionStatus: ({ + chainID, + txHash, + env, + }: Transaction) => Promise; + trackTransaction: ({ chainID, txHash, env }: Transaction) => Promise; +} /** Tracks (polls skip endpoint) and reports status updates on Skip bridge transfers. */ export class SkipTransferStatusProvider implements TransferStatusProvider { @@ -19,12 +34,13 @@ export class SkipTransferStatusProvider implements TransferStatusProvider { statusReceiverDelegate?: TransferStatusReceiver | undefined; - readonly skipClient: SkipApiClient; readonly axelarScanBaseUrl: string; - constructor(env: BridgeEnvironment, protected readonly chainList: Chain[]) { - this.skipClient = new SkipApiClient(env); - + constructor( + protected readonly env: BridgeEnvironment, + protected readonly chainList: Chain[], + protected readonly skipStatusProvider: SkipStatusProvider + ) { this.axelarScanBaseUrl = env === "mainnet" ? "https://axelarscan.io" @@ -40,39 +56,38 @@ export class SkipTransferStatusProvider implements TransferStatusProvider { await poll({ fn: async () => { - try { - const txStatus = await this.skipClient.transactionStatus({ - chainID: fromChainId.toString(), - txHash: sendTxHash, + const tx = { + chainID: fromChainId.toString(), + txHash: sendTxHash, + env: this.env, + }; + + const txStatus = await this.skipStatusProvider + .transactionStatus(tx) + .catch(async (error) => { + if (error instanceof Error && error.message.includes("not found")) { + // if we get an error that it's not found, prompt skip to track it first + // then try again + await this.skipStatusProvider.trackTransaction(tx); + return this.skipStatusProvider.transactionStatus(tx); + } + + throw error; }); - let status: TransferStatus = "pending"; - if (txStatus.state === "STATE_COMPLETED_SUCCESS") { - status = "success"; - } - - if (txStatus.state === "STATE_COMPLETED_ERROR") { - status = "failed"; - } - - return { - id: sendTxHash, - status, - }; - } catch (error: any) { - if ("message" in error) { - if (error.message.includes("not found")) { - await this.skipClient.trackTransaction({ - chainID: fromChainId.toString(), - txHash: sendTxHash, - }); - - return undefined; - } - } + let status: TransferStatus = "pending"; + if (txStatus.state === "STATE_COMPLETED_SUCCESS") { + status = "success"; + } - throw error; + if (txStatus.state === "STATE_COMPLETED_ERROR") { + status = "failed"; } + + return { + id: sendTxHash, + status, + }; }, validate: (incomingStatus) => { if (!incomingStatus) { diff --git a/packages/web/pages/api/skip-track-tx.ts b/packages/web/pages/api/skip-track-tx.ts new file mode 100644 index 0000000000..c5a551635b --- /dev/null +++ b/packages/web/pages/api/skip-track-tx.ts @@ -0,0 +1,32 @@ +import { BridgeEnvironment, SkipApiClient } from "@osmosis-labs/bridge"; +import { NextApiRequest, NextApiResponse } from "next"; + +/** This edge function is necessary to invoke the SkipApiClient on the server + * as a secret API key is required for the client. + */ +export default async function skipTrackTx( + req: NextApiRequest, + res: NextApiResponse +) { + const { chainID, txHash, env } = req.query as { + chainID: string; + txHash: string; + env: BridgeEnvironment; + }; + + if (!chainID || !txHash || !env) { + return res.status(400).json({ error: "Missing required query parameters" }); + } + + const skipClient = new SkipApiClient(env); + + try { + const status = await skipClient.trackTransaction({ chainID, txHash }); + return res.status(200).json(status); + } catch (error) { + if (error instanceof Error) { + return res.status(500).json({ error: error.message }); + } + return res.status(500).json({ error: "An unknown error occurred" }); + } +} diff --git a/packages/web/pages/api/skip-tx-status.ts b/packages/web/pages/api/skip-tx-status.ts new file mode 100644 index 0000000000..7f53bb563e --- /dev/null +++ b/packages/web/pages/api/skip-tx-status.ts @@ -0,0 +1,32 @@ +import { BridgeEnvironment, SkipApiClient } from "@osmosis-labs/bridge"; +import { NextApiRequest, NextApiResponse } from "next"; + +/** This edge function is necessary to invoke the SkipApiClient on the server + * as a secret API key is required for the client. + */ +export default async function skipTxStatus( + req: NextApiRequest, + res: NextApiResponse +) { + const { chainID, txHash, env } = req.query as { + chainID: string; + txHash: string; + env: BridgeEnvironment; + }; + + if (!chainID || !txHash || !env) { + return res.status(400).json({ error: "Missing required query parameters" }); + } + + const skipClient = new SkipApiClient(env); + + try { + const status = await skipClient.transactionStatus({ chainID, txHash }); + return res.status(200).json(status); + } catch (error) { + if (error instanceof Error) { + return res.status(500).json({ error: error.message }); + } + return res.status(500).json({ error: "An unknown error occurred" }); + } +} diff --git a/packages/web/stores/root.ts b/packages/web/stores/root.ts index cd58c88026..a002d7de34 100644 --- a/packages/web/stores/root.ts +++ b/packages/web/stores/root.ts @@ -249,7 +249,33 @@ export class RootStore { ), new SkipTransferStatusProvider( IS_TESTNET ? "testnet" : "mainnet", - ChainList + ChainList, + { + transactionStatus: async ({ chainID, txHash, env }) => { + const response = await fetch( + `/api/skip-tx-status?chainID=${chainID}&txHash=${txHash}&env=${env}` + ); + const responseJson = await response.json(); + if (!response.ok) { + throw new Error( + "Failed to fetch transaction status: " + responseJson.error + ); + } + return responseJson; + }, + trackTransaction: async ({ chainID, txHash, env }) => { + const response = await fetch( + `/api/skip-track-tx?chainID=${chainID}&txHash=${txHash}&env=${env}` + ); + const responseJson = await response.json(); + if (!response.ok) { + throw new Error( + "Failed to track transaction: " + responseJson.error + ); + } + return responseJson; + }, + } ), new IbcTransferStatusProvider(ChainList, AssetLists), ]; From 62531de05ed72e3466757de01184d4f3f5428c05 Mon Sep 17 00:00:00 2001 From: Jon Ator Date: Thu, 19 Sep 2024 11:40:34 -0400 Subject: [PATCH 7/7] Amplitude: prevent outlier value usd logs (#3825) * prevent outlier value usd logs * usd const * forgot one * format --- .../bridge/amount-and-review-screen.tsx | 18 ++++++++++--- packages/web/components/swap-tool/alt.tsx | 16 +++++++++--- packages/web/components/swap-tool/index.tsx | 16 +++++++++--- packages/web/config/analytics-events.ts | 6 ++--- .../web/hooks/limit-orders/use-place-limit.ts | 25 +++++++++++++++---- 5 files changed, 61 insertions(+), 20 deletions(-) diff --git a/packages/web/components/bridge/amount-and-review-screen.tsx b/packages/web/components/bridge/amount-and-review-screen.tsx index 733fb02a08..909d335854 100644 --- a/packages/web/components/bridge/amount-and-review-screen.tsx +++ b/packages/web/components/bridge/amount-and-review-screen.tsx @@ -6,7 +6,7 @@ import { useMemo, useState } from "react"; import { getAddress } from "viem"; import { Screen, useScreenManager } from "~/components/screen-manager"; -import { EventName } from "~/config"; +import { EventName, OUTLIER_USD_VALUE_THRESHOLD } from "~/config"; import { useAmplitudeAnalytics } from "~/hooks"; import { BridgeScreen } from "~/hooks/bridge"; import { useEvmWalletAccount } from "~/hooks/evm-wallet"; @@ -342,6 +342,18 @@ export const AmountAndReviewScreen = observer( ? fromChain.chainName : toChain.chainName; + let valueUsd = Number( + q.input.fiatValue.toDec().toString() + ); + // Protect our data from outliers + // Perhaps from upstream issues with price data providers + if ( + isNaN(valueUsd) || + valueUsd > OUTLIER_USD_VALUE_THRESHOLD + ) { + valueUsd = 0; + } + logEvent([ EventName.DepositWithdraw.started, { @@ -352,9 +364,7 @@ export const AmountAndReviewScreen = observer( isRecommendedVariant, network: networkName, transferDirection: direction, - valueUsd: Number( - q.input.fiatValue.toDec().toString() - ), + valueUsd, walletName, }, ]); diff --git a/packages/web/components/swap-tool/alt.tsx b/packages/web/components/swap-tool/alt.tsx index f3107e3e45..ec88970f45 100644 --- a/packages/web/components/swap-tool/alt.tsx +++ b/packages/web/components/swap-tool/alt.tsx @@ -29,7 +29,7 @@ import { tError } from "~/components/localization"; import { TradeDetails } from "~/components/swap-tool/trade-details"; import { GenericDisclaimer } from "~/components/tooltip/generic-disclaimer"; import { Button } from "~/components/ui/button"; -import { EventName, EventPage } from "~/config"; +import { EventName, EventPage, OUTLIER_USD_VALUE_THRESHOLD } from "~/config"; import { useAmplitudeAnalytics, useDisclosure, @@ -214,6 +214,16 @@ export const AltSwapTool: FunctionComponent = observer( const sendSwapTx = () => { if (!swapState.inAmountInput.amount) return; + let valueUsd = Number( + swapState.inAmountInput.fiatValue?.toDec().toString() ?? "0" + ); + + // Protect our data from outliers + // Perhaps from upstream issues with price data providers + if (isNaN(valueUsd) || valueUsd > OUTLIER_USD_VALUE_THRESHOLD) { + valueUsd = 0; + } + const baseEvent = { fromToken: swapState.fromAsset?.coinDenom, tokenAmount: Number(swapState.inAmountInput.amount.toDec().toString()), @@ -223,9 +233,7 @@ export const AltSwapTool: FunctionComponent = observer( ({ pools }) => pools.length !== 1 ), isMultiRoute: (swapState.quote?.split.length ?? 0) > 1, - valueUsd: Number( - swapState.inAmountInput.fiatValue?.toDec().toString() ?? "0" - ), + valueUsd, feeValueUsd: Number(swapState.totalFee?.toString() ?? "0"), page, quoteTimeMilliseconds: swapState.quote?.timeMs, diff --git a/packages/web/components/swap-tool/index.tsx b/packages/web/components/swap-tool/index.tsx index f1c009d0a2..e72e5897ab 100644 --- a/packages/web/components/swap-tool/index.tsx +++ b/packages/web/components/swap-tool/index.tsx @@ -28,7 +28,7 @@ import { Popover } from "~/components/popover"; import { SplitRoute } from "~/components/swap-tool/split-route"; import { InfoTooltip, Tooltip } from "~/components/tooltip"; import { Button } from "~/components/ui/button"; -import { EventName, EventPage } from "~/config"; +import { EventName, EventPage, OUTLIER_USD_VALUE_THRESHOLD } from "~/config"; import { useAmplitudeAnalytics, useDisclosure, @@ -186,6 +186,16 @@ export const SwapTool: FunctionComponent = observer( if (!swapState.inAmountInput.amount) return; + let valueUsd = Number( + swapState.inAmountInput.fiatValue?.toDec().toString() ?? "0" + ); + + // Protect our data from outliers + // Perhaps from upstream issues with price data providers + if (isNaN(valueUsd) || valueUsd > OUTLIER_USD_VALUE_THRESHOLD) { + valueUsd = 0; + } + const baseEvent = { fromToken: swapState.fromAsset?.coinDenom, tokenAmount: Number(swapState.inAmountInput.amount.toDec().toString()), @@ -195,9 +205,7 @@ export const SwapTool: FunctionComponent = observer( ({ pools }) => pools.length !== 1 ), isMultiRoute: (swapState.quote?.split.length ?? 0) > 1, - valueUsd: Number( - swapState.inAmountInput.fiatValue?.toDec().toString() ?? "0" - ), + valueUsd, feeValueUsd: Number(swapState.totalFee?.toString() ?? "0"), page, quoteTimeMilliseconds: swapState.quote?.timeMs, diff --git a/packages/web/config/analytics-events.ts b/packages/web/config/analytics-events.ts index ba6b1f92a1..28b5505fa4 100644 --- a/packages/web/config/analytics-events.ts +++ b/packages/web/config/analytics-events.ts @@ -1,11 +1,11 @@ /** # User Events Constants * Logged to Amplitude at https://analytics.amplitude.com/osmosis-zone/ */ - import { AllocationOptions } from "~/components/complex/portfolio/types"; -// Should be in sync with: https://docs.google.com/spreadsheets/d/18w8VwJmmRdb_E-XkE1UjkqhLxCyhqVVhWlzDgTtbRWo/edit?usp=sharing -// For maintainability - all event logs should be in high level component +/** Max value of USD event to check against to prevent + * outliers from corrupting dashboards. */ +export const OUTLIER_USD_VALUE_THRESHOLD = 1_500_000; export type AmountDefault = "half" | "max" | "input"; diff --git a/packages/web/hooks/limit-orders/use-place-limit.ts b/packages/web/hooks/limit-orders/use-place-limit.ts index 8d58e58991..7ddfcf1efd 100644 --- a/packages/web/hooks/limit-orders/use-place-limit.ts +++ b/packages/web/hooks/limit-orders/use-place-limit.ts @@ -6,7 +6,7 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { useAsync } from "react-use"; import { tError } from "~/components/localization"; -import { EventName, EventPage } from "~/config"; +import { EventName, EventPage, OUTLIER_USD_VALUE_THRESHOLD } from "~/config"; import { isValidNumericalRawInput, useAmountInput, @@ -283,6 +283,16 @@ export const usePlaceLimit = ({ } if (isMarket) { + let valueUsd = Number( + marketState.inAmountInput.fiatValue?.toDec().toString() ?? "0" + ); + + // Protect our data from outliers + // Perhaps from upstream issues with price data providers + if (isNaN(valueUsd) || valueUsd > OUTLIER_USD_VALUE_THRESHOLD) { + valueUsd = 0; + } + const baseEvent = { fromToken: marketState.fromAsset?.coinDenom, tokenAmount: Number( @@ -294,9 +304,7 @@ export const usePlaceLimit = ({ ({ pools }) => pools.length !== 1 ), isMultiRoute: (marketState.quote?.split.length ?? 0) > 1, - valueUsd: Number( - marketState.inAmountInput.fiatValue?.toDec().toString() ?? "0" - ), + valueUsd, feeValueUsd: Number(marketState.totalFee?.toString() ?? "0"), page, quoteTimeMilliseconds: marketState.quote?.timeMs, @@ -328,12 +336,19 @@ export const usePlaceLimit = ({ const paymentDenom = paymentTokenValue?.toCoin().denom ?? ""; + let valueUsd = Number(paymentFiatValue?.toDec().toString() ?? "0"); + // Protect our data from outliers + // Perhaps from upstream issues with price data providers + if (isNaN(valueUsd) || valueUsd > OUTLIER_USD_VALUE_THRESHOLD) { + valueUsd = 0; + } + const baseEvent = { type: orderDirection === "bid" ? "buy" : "sell", fromToken: paymentDenom, toToken: orderDirection === "bid" ? baseAsset?.coinDenom : quoteAsset?.coinDenom, - valueUsd: Number(paymentFiatValue?.toDec().toString() ?? "0"), + valueUsd, tokenAmount: Number(quantity), page, isOnHomePage: page === "Swap Page",