From b6de2ed26bd5672d3d6b3909e9f91cfbb87fc77b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 4 Apr 2024 14:57:36 -0700 Subject: [PATCH] BREAKING CHANGE: no RPC or registry, currently incompatible with vat env --- packages/cosmic-proto/scripts/codegen.cjs | 4 +- .../cosmic-proto/src/codegen/agoric/bundle.ts | 24 - .../cosmic-proto/src/codegen/agoric/client.ts | 59 - .../src/codegen/agoric/lien/genesis.ts | 59 +- .../src/codegen/agoric/lien/lien.ts | 46 +- .../src/codegen/agoric/rpc.query.ts | 89 - .../cosmic-proto/src/codegen/agoric/rpc.tx.ts | 60 - .../src/codegen/agoric/swingset/genesis.ts | 79 +- .../src/codegen/agoric/swingset/msgs.amino.ts | 35 - .../codegen/agoric/swingset/msgs.registry.ts | 183 -- .../codegen/agoric/swingset/msgs.rpc.msg.ts | 98 - .../src/codegen/agoric/swingset/msgs.ts | 300 --- .../agoric/swingset/query.rpc.Query.ts | 66 - .../src/codegen/agoric/swingset/query.ts | 142 +- .../src/codegen/agoric/swingset/swingset.ts | 386 +--- .../src/codegen/agoric/vbank/genesis.ts | 39 +- .../codegen/agoric/vbank/query.rpc.Query.ts | 51 - .../src/codegen/agoric/vbank/query.ts | 91 +- .../src/codegen/agoric/vbank/vbank.ts | 142 +- .../src/codegen/agoric/vibc/msgs.amino.ts | 9 - .../src/codegen/agoric/vibc/msgs.registry.ts | 53 - .../src/codegen/agoric/vibc/msgs.rpc.msg.ts | 23 - .../src/codegen/agoric/vibc/msgs.ts | 53 +- .../codegen/agoric/vlocalchain/vlocalchain.ts | 128 +- .../src/codegen/agoric/vstorage/genesis.ts | 60 - .../agoric/vstorage/query.rpc.Query.ts | 69 - .../src/codegen/agoric/vstorage/query.ts | 200 -- .../src/codegen/agoric/vstorage/vstorage.ts | 51 - .../src/codegen/cosmos/auth/v1beta1/auth.ts | 173 +- .../codegen/cosmos/auth/v1beta1/genesis.ts | 44 +- .../cosmos/auth/v1beta1/query.rpc.Query.ts | 182 -- .../src/codegen/cosmos/auth/v1beta1/query.ts | 562 +---- .../src/codegen/cosmos/authz/v1beta1/authz.ts | 258 +-- .../src/codegen/cosmos/authz/v1beta1/event.ts | 86 - .../codegen/cosmos/authz/v1beta1/genesis.ts | 40 +- .../cosmos/authz/v1beta1/query.rpc.Query.ts | 98 - .../src/codegen/cosmos/authz/v1beta1/query.ts | 277 --- .../codegen/cosmos/authz/v1beta1/tx.amino.ts | 19 - .../cosmos/authz/v1beta1/tx.registry.ts | 115 - .../cosmos/authz/v1beta1/tx.rpc.msg.ts | 64 - .../src/codegen/cosmos/authz/v1beta1/tx.ts | 298 +-- .../src/codegen/cosmos/bank/v1beta1/authz.ts | 40 +- .../src/codegen/cosmos/bank/v1beta1/bank.ts | 346 +-- .../codegen/cosmos/bank/v1beta1/genesis.ts | 114 +- .../cosmos/bank/v1beta1/query.rpc.Query.ts | 241 -- .../src/codegen/cosmos/bank/v1beta1/query.ts | 780 +------ .../codegen/cosmos/bank/v1beta1/tx.amino.ts | 14 - .../cosmos/bank/v1beta1/tx.registry.ts | 84 - .../codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts | 40 - .../src/codegen/cosmos/bank/v1beta1/tx.ts | 139 +- .../codegen/cosmos/base/abci/v1beta1/abci.ts | 573 +---- .../cosmos/base/query/v1beta1/pagination.ts | 139 -- .../base/reflection/v2alpha1/reflection.ts | 1057 +-------- .../src/codegen/cosmos/base/v1beta1/coin.ts | 136 -- .../cosmic-proto/src/codegen/cosmos/bundle.ts | 92 - .../cosmic-proto/src/codegen/cosmos/client.ts | 79 - .../src/codegen/cosmos/crypto/ed25519/keys.ts | 67 - .../src/codegen/cosmos/crypto/hd/v1/hd.ts | 58 - .../cosmos/crypto/keyring/v1/record.ts | 185 +- .../codegen/cosmos/crypto/multisig/keys.ts | 44 +- .../crypto/multisig/v1beta1/multisig.ts | 78 - .../codegen/cosmos/crypto/secp256k1/keys.ts | 64 - .../codegen/cosmos/crypto/secp256r1/keys.ts | 63 - .../distribution/v1beta1/distribution.ts | 601 ----- .../cosmos/distribution/v1beta1/genesis.ts | 547 +---- .../distribution/v1beta1/query.rpc.Query.ts | 245 -- .../cosmos/distribution/v1beta1/query.ts | 821 +------ .../cosmos/distribution/v1beta1/tx.amino.ts | 29 - .../distribution/v1beta1/tx.registry.ts | 157 -- .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 107 - .../codegen/cosmos/distribution/v1beta1/tx.ts | 321 +-- .../cosmos/feegrant/v1beta1/feegrant.ts | 311 +-- .../cosmos/feegrant/v1beta1/genesis.ts | 35 +- .../feegrant/v1beta1/query.rpc.Query.ts | 91 - .../codegen/cosmos/feegrant/v1beta1/query.ts | 250 +- .../cosmos/feegrant/v1beta1/tx.amino.ts | 14 - .../cosmos/feegrant/v1beta1/tx.registry.ts | 84 - .../cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 60 - .../src/codegen/cosmos/feegrant/v1beta1/tx.ts | 217 +- .../src/codegen/cosmos/gov/v1/genesis.ts | 94 - .../src/codegen/cosmos/gov/v1/gov.ts | 443 +--- .../codegen/cosmos/gov/v1/query.rpc.Query.ts | 151 -- .../src/codegen/cosmos/gov/v1/query.ts | 627 ----- .../src/codegen/cosmos/gov/v1/tx.amino.ts | 35 - .../src/codegen/cosmos/gov/v1/tx.registry.ts | 183 -- .../src/codegen/cosmos/gov/v1/tx.rpc.msg.ts | 91 - .../src/codegen/cosmos/gov/v1/tx.ts | 549 +---- .../src/codegen/cosmos/gov/v1beta1/genesis.ts | 94 - .../src/codegen/cosmos/gov/v1beta1/gov.ts | 647 +----- .../cosmos/gov/v1beta1/query.rpc.Query.ts | 171 -- .../src/codegen/cosmos/gov/v1beta1/query.ts | 627 ----- .../codegen/cosmos/gov/v1beta1/tx.amino.ts | 29 - .../codegen/cosmos/gov/v1beta1/tx.registry.ts | 151 -- .../codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts | 76 - .../src/codegen/cosmos/gov/v1beta1/tx.ts | 461 +--- .../src/codegen/cosmos/group/v1/events.ts | 297 --- .../src/codegen/cosmos/group/v1/genesis.ts | 116 - .../cosmos/group/v1/query.rpc.Query.ts | 330 --- .../src/codegen/cosmos/group/v1/query.ts | 1119 +-------- .../src/codegen/cosmos/group/v1/tx.amino.ts | 89 - .../codegen/cosmos/group/v1/tx.registry.ts | 477 ---- .../src/codegen/cosmos/group/v1/tx.rpc.msg.ts | 263 --- .../src/codegen/cosmos/group/v1/tx.ts | 1258 +--------- .../src/codegen/cosmos/group/v1/types.ts | 760 +----- .../codegen/cosmos/mint/v1beta1/genesis.ts | 45 +- .../src/codegen/cosmos/mint/v1beta1/mint.ts | 115 - .../cosmos/mint/v1beta1/query.rpc.Query.ts | 88 - .../src/codegen/cosmos/mint/v1beta1/query.ts | 191 +- .../codegen/cosmos/params/v1beta1/params.ts | 90 - .../cosmos/params/v1beta1/query.rpc.Query.ts | 66 - .../codegen/cosmos/params/v1beta1/query.ts | 169 +- .../src/codegen/cosmos/rpc.query.ts | 78 - .../cosmic-proto/src/codegen/cosmos/rpc.tx.ts | 50 - .../codegen/cosmos/staking/v1beta1/authz.ts | 114 +- .../codegen/cosmos/staking/v1beta1/genesis.ts | 152 -- .../cosmos/staking/v1beta1/query.rpc.Query.ts | 365 --- .../codegen/cosmos/staking/v1beta1/query.ts | 1261 +--------- .../codegen/cosmos/staking/v1beta1/staking.ts | 1120 +-------- .../cosmos/staking/v1beta1/tx.amino.ts | 35 - .../cosmos/staking/v1beta1/tx.registry.ts | 183 -- .../cosmos/staking/v1beta1/tx.rpc.msg.ts | 111 - .../src/codegen/cosmos/staking/v1beta1/tx.ts | 481 +--- .../cosmos/tx/signing/v1beta1/signing.ts | 235 +- .../cosmos/tx/v1beta1/service.rpc.Service.ts | 124 - .../src/codegen/cosmos/tx/v1beta1/service.ts | 463 +--- .../src/codegen/cosmos/tx/v1beta1/tx.ts | 789 +------ .../cosmos/upgrade/v1beta1/query.rpc.Query.ts | 155 -- .../codegen/cosmos/upgrade/v1beta1/query.ts | 397 ---- .../cosmos/upgrade/v1beta1/tx.amino.ts | 14 - .../cosmos/upgrade/v1beta1/tx.registry.ts | 84 - .../cosmos/upgrade/v1beta1/tx.rpc.msg.ts | 59 - .../src/codegen/cosmos/upgrade/v1beta1/tx.ts | 138 +- .../codegen/cosmos/upgrade/v1beta1/upgrade.ts | 228 +- .../cosmos/vesting/v1beta1/tx.amino.ts | 23 - .../cosmos/vesting/v1beta1/tx.registry.ts | 125 - .../cosmos/vesting/v1beta1/tx.rpc.msg.ts | 85 - .../src/codegen/cosmos/vesting/v1beta1/tx.ts | 277 +-- .../codegen/cosmos/vesting/v1beta1/vesting.ts | 305 +-- .../src/codegen/cosmos_proto/cosmos.ts | 104 - .../src/codegen/google/api/http.ts | 474 ---- .../src/codegen/google/protobuf/any.ts | 134 -- .../src/codegen/google/protobuf/descriptor.ts | 2051 +---------------- .../src/codegen/google/protobuf/duration.ts | 81 - .../src/codegen/google/protobuf/empty.ts | 27 - .../src/codegen/google/protobuf/timestamp.ts | 102 +- .../codegen/ibc/core/channel/v1/channel.ts | 421 +--- .../src/codegen/ibc/core/client/v1/client.ts | 347 +-- packages/cosmic-proto/src/codegen/index.ts | 2 - .../src/codegen/tendermint/abci/types.ts | 1805 +-------------- .../src/codegen/tendermint/crypto/keys.ts | 32 - .../src/codegen/tendermint/crypto/proof.ts | 166 -- .../src/codegen/tendermint/libs/bits/types.ts | 29 - .../src/codegen/tendermint/p2p/types.ts | 223 -- .../src/codegen/tendermint/types/block.ts | 50 +- .../src/codegen/tendermint/types/evidence.ts | 201 +- .../src/codegen/tendermint/types/params.ts | 263 +-- .../src/codegen/tendermint/types/types.ts | 643 +----- .../src/codegen/tendermint/types/validator.ts | 129 +- .../src/codegen/tendermint/version/types.ts | 66 - packages/cosmic-proto/src/index.ts | 28 - .../test/snapshots/test-exports.js.md | 12 - .../test/snapshots/test-exports.js.snap | Bin 1300 -> 1128 bytes packages/cosmic-proto/test/test-helpers.js | 39 +- packages/cosmic-proto/test/test-readme.js | 4 +- 164 files changed, 146 insertions(+), 37778 deletions(-) delete mode 100644 packages/cosmic-proto/src/codegen/agoric/client.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/rpc.query.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/rpc.tx.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/swingset/msgs.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/swingset/msgs.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/swingset/msgs.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/swingset/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/vbank/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/vibc/msgs.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/vibc/msgs.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/vibc/msgs.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/agoric/vstorage/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/client.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/group/v1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/rpc.query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/rpc.tx.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts delete mode 100644 packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts diff --git a/packages/cosmic-proto/scripts/codegen.cjs b/packages/cosmic-proto/scripts/codegen.cjs index 4db01ea36e5..6c76b447fbe 100644 --- a/packages/cosmic-proto/scripts/codegen.cjs +++ b/packages/cosmic-proto/scripts/codegen.cjs @@ -86,13 +86,13 @@ telescope({ }, aminoEncoding: { // Necessary for getSigningAgoricClient - enabled: true, + enabled: false, }, lcdClients: { enabled: false, }, rpcClients: { - enabled: true, + enabled: false, }, }, }) diff --git a/packages/cosmic-proto/src/codegen/agoric/bundle.ts b/packages/cosmic-proto/src/codegen/agoric/bundle.ts index 5cf83abef5e..bbee300a776 100644 --- a/packages/cosmic-proto/src/codegen/agoric/bundle.ts +++ b/packages/cosmic-proto/src/codegen/agoric/bundle.ts @@ -14,17 +14,6 @@ import * as _11 from './vlocalchain/vlocalchain.js'; import * as _12 from './vstorage/genesis.js'; import * as _13 from './vstorage/query.js'; import * as _14 from './vstorage/vstorage.js'; -import * as _98 from './swingset/msgs.amino.js'; -import * as _99 from './vibc/msgs.amino.js'; -import * as _100 from './swingset/msgs.registry.js'; -import * as _101 from './vibc/msgs.registry.js'; -import * as _102 from './swingset/query.rpc.Query.js'; -import * as _103 from './vbank/query.rpc.Query.js'; -import * as _104 from './vstorage/query.rpc.Query.js'; -import * as _105 from './swingset/msgs.rpc.msg.js'; -import * as _106 from './vibc/msgs.rpc.msg.js'; -import * as _150 from './rpc.query.js'; -import * as _151 from './rpc.tx.js'; export namespace agoric { export const lien = { ..._0, @@ -35,23 +24,15 @@ export namespace agoric { ..._3, ..._4, ..._5, - ..._98, - ..._100, - ..._102, - ..._105, }; export const vbank = { ..._6, ..._7, ..._8, ..._9, - ..._103, }; export const vibc = { ..._10, - ..._99, - ..._101, - ..._106, }; export const vlocalchain = { ..._11, @@ -60,10 +41,5 @@ export namespace agoric { ..._12, ..._13, ..._14, - ..._104, - }; - export const ClientFactory = { - ..._150, - ..._151, }; } diff --git a/packages/cosmic-proto/src/codegen/agoric/client.ts b/packages/cosmic-proto/src/codegen/agoric/client.ts deleted file mode 100644 index a639a96ad60..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/client.ts +++ /dev/null @@ -1,59 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing'; -import { - defaultRegistryTypes, - AminoTypes, - SigningStargateClient, -} from '@cosmjs/stargate'; -import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; -import * as agoricSwingsetMsgsRegistry from './swingset/msgs.registry.js'; -import * as agoricVibcMsgsRegistry from './vibc/msgs.registry.js'; -import * as agoricSwingsetMsgsAmino from './swingset/msgs.amino.js'; -import * as agoricVibcMsgsAmino from './vibc/msgs.amino.js'; -export const agoricAminoConverters = { - ...agoricSwingsetMsgsAmino.AminoConverter, - ...agoricVibcMsgsAmino.AminoConverter, -}; -export const agoricProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ - ...agoricSwingsetMsgsRegistry.registry, - ...agoricVibcMsgsRegistry.registry, -]; -export const getSigningAgoricClientOptions = ({ - defaultTypes = defaultRegistryTypes, -}: { - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; -} = {}): { - registry: Registry; - aminoTypes: AminoTypes; -} => { - const registry = new Registry([...defaultTypes, ...agoricProtoRegistry]); - const aminoTypes = new AminoTypes({ - ...agoricAminoConverters, - }); - return { - registry, - aminoTypes, - }; -}; -export const getSigningAgoricClient = async ({ - rpcEndpoint, - signer, - defaultTypes = defaultRegistryTypes, -}: { - rpcEndpoint: string | HttpEndpoint; - signer: OfflineSigner; - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; -}) => { - const { registry, aminoTypes } = getSigningAgoricClientOptions({ - defaultTypes, - }); - const client = await SigningStargateClient.connectWithSigner( - rpcEndpoint, - signer, - { - registry: registry as any, - aminoTypes, - }, - ); - return client; -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/lien/genesis.ts b/packages/cosmic-proto/src/codegen/agoric/lien/genesis.ts index 31092031745..2e01236be0e 100644 --- a/packages/cosmic-proto/src/codegen/agoric/lien/genesis.ts +++ b/packages/cosmic-proto/src/codegen/agoric/lien/genesis.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Lien, LienAmino, LienSDKType } from './lien.js'; +import { Lien, LienSDKType } from './lien.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** The initial or exported state. */ @@ -11,14 +11,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** The initial or exported state. */ -export interface GenesisStateAmino { - liens?: AccountLienAmino[]; -} -export interface GenesisStateAminoMsg { - type: '/agoric.lien.GenesisState'; - value: GenesisStateAmino; -} -/** The initial or exported state. */ export interface GenesisStateSDKType { liens: AccountLienSDKType[]; } @@ -34,17 +26,6 @@ export interface AccountLienProtoMsg { value: Uint8Array; } /** The lien on a particular account */ -export interface AccountLienAmino { - /** Account address, bech32-encoded. */ - address?: string; - /** The liened amount. Should be nonzero. */ - lien?: LienAmino; -} -export interface AccountLienAminoMsg { - type: '/agoric.lien.AccountLien'; - value: AccountLienAmino; -} -/** The lien on a particular account */ export interface AccountLienSDKType { address: string; lien?: LienSDKType; @@ -106,25 +87,6 @@ export const GenesisState = { message.liens = object.liens?.map(e => AccountLien.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - message.liens = object.liens?.map(e => AccountLien.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - if (message.liens) { - obj.liens = message.liens.map(e => - e ? AccountLien.toAmino(e) : undefined, - ); - } else { - obj.liens = message.liens; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, @@ -201,25 +163,6 @@ export const AccountLien = { : undefined; return message; }, - fromAmino(object: AccountLienAmino): AccountLien { - const message = createBaseAccountLien(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.lien !== undefined && object.lien !== null) { - message.lien = Lien.fromAmino(object.lien); - } - return message; - }, - toAmino(message: AccountLien): AccountLienAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.lien = message.lien ? Lien.toAmino(message.lien) : undefined; - return obj; - }, - fromAminoMsg(object: AccountLienAminoMsg): AccountLien { - return AccountLien.fromAmino(object.value); - }, fromProtoMsg(message: AccountLienProtoMsg): AccountLien { return AccountLien.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/lien/lien.ts b/packages/cosmic-proto/src/codegen/agoric/lien/lien.ts index b2cf2e4c989..ba25d451416 100644 --- a/packages/cosmic-proto/src/codegen/agoric/lien/lien.ts +++ b/packages/cosmic-proto/src/codegen/agoric/lien/lien.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - Coin, - CoinAmino, - CoinSDKType, -} from '../../cosmos/base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../cosmos/base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; /** Lien contains the lien state of a particular account. */ export interface Lien { @@ -21,21 +17,6 @@ export interface LienProtoMsg { value: Uint8Array; } /** Lien contains the lien state of a particular account. */ -export interface LienAmino { - /** coins holds the amount liened */ - coins?: CoinAmino[]; - /** - * delegated tracks the net amount delegated for non-vesting accounts, - * or zero coins for vesting accounts. - * (Vesting accounts have their own fields to track delegation.) - */ - delegated?: CoinAmino[]; -} -export interface LienAminoMsg { - type: '/agoric.lien.Lien'; - value: LienAmino; -} -/** Lien contains the lien state of a particular account. */ export interface LienSDKType { coins: CoinSDKType[]; delegated: CoinSDKType[]; @@ -113,31 +94,6 @@ export const Lien = { message.delegated = object.delegated?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: LienAmino): Lien { - const message = createBaseLien(); - message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; - message.delegated = object.delegated?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Lien): LienAmino { - const obj: any = {}; - if (message.coins) { - obj.coins = message.coins.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.coins = message.coins; - } - if (message.delegated) { - obj.delegated = message.delegated.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.delegated = message.delegated; - } - return obj; - }, - fromAminoMsg(object: LienAminoMsg): Lien { - return Lien.fromAmino(object.value); - }, fromProtoMsg(message: LienProtoMsg): Lien { return Lien.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/rpc.query.ts b/packages/cosmic-proto/src/codegen/agoric/rpc.query.ts deleted file mode 100644 index 74605c7f166..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/rpc.query.ts +++ /dev/null @@ -1,89 +0,0 @@ -//@ts-nocheck -import { Tendermint34Client, HttpEndpoint } from '@cosmjs/tendermint-rpc'; -import { QueryClient } from '@cosmjs/stargate'; -export const createRPCQueryClient = async ({ - rpcEndpoint, -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - agoric: { - swingset: ( - await import('./swingset/query.rpc.Query.js') - ).createRpcQueryExtension(client), - vbank: ( - await import('./vbank/query.rpc.Query.js') - ).createRpcQueryExtension(client), - vstorage: ( - await import('./vstorage/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - cosmos: { - auth: { - v1beta1: ( - await import('../cosmos/auth/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - authz: { - v1beta1: ( - await import('../cosmos/authz/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - bank: { - v1beta1: ( - await import('../cosmos/bank/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - distribution: { - v1beta1: ( - await import('../cosmos/distribution/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - feegrant: { - v1beta1: ( - await import('../cosmos/feegrant/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - gov: { - v1: ( - await import('../cosmos/gov/v1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - v1beta1: ( - await import('../cosmos/gov/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - group: { - v1: ( - await import('../cosmos/group/v1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - mint: { - v1beta1: ( - await import('../cosmos/mint/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - params: { - v1beta1: ( - await import('../cosmos/params/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - staking: { - v1beta1: ( - await import('../cosmos/staking/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - tx: { - v1beta1: ( - await import('../cosmos/tx/v1beta1/service.rpc.Service.js') - ).createRpcQueryExtension(client), - }, - upgrade: { - v1beta1: ( - await import('../cosmos/upgrade/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/rpc.tx.ts b/packages/cosmic-proto/src/codegen/agoric/rpc.tx.ts deleted file mode 100644 index 0e72631dd82..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/rpc.tx.ts +++ /dev/null @@ -1,60 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../helpers.js'; -export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ - agoric: { - swingset: new (await import('./swingset/msgs.rpc.msg.js')).MsgClientImpl( - rpc, - ), - vibc: new (await import('./vibc/msgs.rpc.msg.js')).MsgClientImpl(rpc), - }, - cosmos: { - authz: { - v1beta1: new ( - await import('../cosmos/authz/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - bank: { - v1beta1: new ( - await import('../cosmos/bank/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - distribution: { - v1beta1: new ( - await import('../cosmos/distribution/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - feegrant: { - v1beta1: new ( - await import('../cosmos/feegrant/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - gov: { - v1: new (await import('../cosmos/gov/v1/tx.rpc.msg.js')).MsgClientImpl( - rpc, - ), - v1beta1: new ( - await import('../cosmos/gov/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - group: { - v1: new (await import('../cosmos/group/v1/tx.rpc.msg.js')).MsgClientImpl( - rpc, - ), - }, - staking: { - v1beta1: new ( - await import('../cosmos/staking/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - upgrade: { - v1beta1: new ( - await import('../cosmos/upgrade/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - vesting: { - v1beta1: new ( - await import('../cosmos/vesting/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - }, -}); diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/genesis.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/genesis.ts index 2db3d188570..b1607171c9c 100644 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/genesis.ts +++ b/packages/cosmic-proto/src/codegen/agoric/swingset/genesis.ts @@ -1,12 +1,5 @@ //@ts-nocheck -import { - Params, - ParamsAmino, - ParamsSDKType, - State, - StateAmino, - StateSDKType, -} from './swingset.js'; +import { Params, ParamsSDKType, State, StateSDKType } from './swingset.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** The initial or exported state. */ @@ -20,16 +13,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** The initial or exported state. */ -export interface GenesisStateAmino { - params?: ParamsAmino; - state?: StateAmino; - swing_store_export_data: SwingStoreExportDataEntryAmino[]; -} -export interface GenesisStateAminoMsg { - type: '/agoric.swingset.GenesisState'; - value: GenesisStateAmino; -} -/** The initial or exported state. */ export interface GenesisStateSDKType { params: ParamsSDKType; state: StateSDKType; @@ -45,15 +28,6 @@ export interface SwingStoreExportDataEntryProtoMsg { value: Uint8Array; } /** A SwingStore "export data" entry. */ -export interface SwingStoreExportDataEntryAmino { - key?: string; - value?: string; -} -export interface SwingStoreExportDataEntryAminoMsg { - type: '/agoric.swingset.SwingStoreExportDataEntry'; - value: SwingStoreExportDataEntryAmino; -} -/** A SwingStore "export data" entry. */ export interface SwingStoreExportDataEntrySDKType { key: string; value: string; @@ -150,36 +124,6 @@ export const GenesisState = { ) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - if (object.state !== undefined && object.state !== null) { - message.state = State.fromAmino(object.state); - } - message.swingStoreExportData = - object.swing_store_export_data?.map(e => - SwingStoreExportDataEntry.fromAmino(e), - ) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.state = message.state ? State.toAmino(message.state) : undefined; - if (message.swingStoreExportData) { - obj.swing_store_export_data = message.swingStoreExportData.map(e => - e ? SwingStoreExportDataEntry.toAmino(e) : undefined, - ); - } else { - obj.swing_store_export_data = message.swingStoreExportData; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, @@ -257,27 +201,6 @@ export const SwingStoreExportDataEntry = { message.value = object.value ?? ''; return message; }, - fromAmino(object: SwingStoreExportDataEntryAmino): SwingStoreExportDataEntry { - const message = createBaseSwingStoreExportDataEntry(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: SwingStoreExportDataEntry): SwingStoreExportDataEntryAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.value = message.value === '' ? undefined : message.value; - return obj; - }, - fromAminoMsg( - object: SwingStoreExportDataEntryAminoMsg, - ): SwingStoreExportDataEntry { - return SwingStoreExportDataEntry.fromAmino(object.value); - }, fromProtoMsg( message: SwingStoreExportDataEntryProtoMsg, ): SwingStoreExportDataEntry { diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.amino.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.amino.ts deleted file mode 100644 index 3d1f6d57d01..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.amino.ts +++ /dev/null @@ -1,35 +0,0 @@ -//@ts-nocheck -import { - MsgInstallBundle, - MsgDeliverInbound, - MsgWalletAction, - MsgWalletSpendAction, - MsgProvision, -} from './msgs.js'; -export const AminoConverter = { - '/agoric.swingset.MsgInstallBundle': { - aminoType: '/agoric.swingset.MsgInstallBundle', - toAmino: MsgInstallBundle.toAmino, - fromAmino: MsgInstallBundle.fromAmino, - }, - '/agoric.swingset.MsgDeliverInbound': { - aminoType: '/agoric.swingset.MsgDeliverInbound', - toAmino: MsgDeliverInbound.toAmino, - fromAmino: MsgDeliverInbound.fromAmino, - }, - '/agoric.swingset.MsgWalletAction': { - aminoType: '/agoric.swingset.MsgWalletAction', - toAmino: MsgWalletAction.toAmino, - fromAmino: MsgWalletAction.fromAmino, - }, - '/agoric.swingset.MsgWalletSpendAction': { - aminoType: '/agoric.swingset.MsgWalletSpendAction', - toAmino: MsgWalletSpendAction.toAmino, - fromAmino: MsgWalletSpendAction.fromAmino, - }, - '/agoric.swingset.MsgProvision': { - aminoType: '/agoric.swingset.MsgProvision', - toAmino: MsgProvision.toAmino, - fromAmino: MsgProvision.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.registry.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.registry.ts deleted file mode 100644 index 919ba12f8a2..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.registry.ts +++ /dev/null @@ -1,183 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgInstallBundle, - MsgDeliverInbound, - MsgWalletAction, - MsgWalletSpendAction, - MsgProvision, -} from './msgs.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/agoric.swingset.MsgInstallBundle', MsgInstallBundle], - ['/agoric.swingset.MsgDeliverInbound', MsgDeliverInbound], - ['/agoric.swingset.MsgWalletAction', MsgWalletAction], - ['/agoric.swingset.MsgWalletSpendAction', MsgWalletSpendAction], - ['/agoric.swingset.MsgProvision', MsgProvision], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - installBundle(value: MsgInstallBundle) { - return { - typeUrl: '/agoric.swingset.MsgInstallBundle', - value: MsgInstallBundle.encode(value).finish(), - }; - }, - deliverInbound(value: MsgDeliverInbound) { - return { - typeUrl: '/agoric.swingset.MsgDeliverInbound', - value: MsgDeliverInbound.encode(value).finish(), - }; - }, - walletAction(value: MsgWalletAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletAction', - value: MsgWalletAction.encode(value).finish(), - }; - }, - walletSpendAction(value: MsgWalletSpendAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletSpendAction', - value: MsgWalletSpendAction.encode(value).finish(), - }; - }, - provision(value: MsgProvision) { - return { - typeUrl: '/agoric.swingset.MsgProvision', - value: MsgProvision.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - installBundle(value: MsgInstallBundle) { - return { - typeUrl: '/agoric.swingset.MsgInstallBundle', - value, - }; - }, - deliverInbound(value: MsgDeliverInbound) { - return { - typeUrl: '/agoric.swingset.MsgDeliverInbound', - value, - }; - }, - walletAction(value: MsgWalletAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletAction', - value, - }; - }, - walletSpendAction(value: MsgWalletSpendAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletSpendAction', - value, - }; - }, - provision(value: MsgProvision) { - return { - typeUrl: '/agoric.swingset.MsgProvision', - value, - }; - }, - }, - toJSON: { - installBundle(value: MsgInstallBundle) { - return { - typeUrl: '/agoric.swingset.MsgInstallBundle', - value: MsgInstallBundle.toJSON(value), - }; - }, - deliverInbound(value: MsgDeliverInbound) { - return { - typeUrl: '/agoric.swingset.MsgDeliverInbound', - value: MsgDeliverInbound.toJSON(value), - }; - }, - walletAction(value: MsgWalletAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletAction', - value: MsgWalletAction.toJSON(value), - }; - }, - walletSpendAction(value: MsgWalletSpendAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletSpendAction', - value: MsgWalletSpendAction.toJSON(value), - }; - }, - provision(value: MsgProvision) { - return { - typeUrl: '/agoric.swingset.MsgProvision', - value: MsgProvision.toJSON(value), - }; - }, - }, - fromJSON: { - installBundle(value: any) { - return { - typeUrl: '/agoric.swingset.MsgInstallBundle', - value: MsgInstallBundle.fromJSON(value), - }; - }, - deliverInbound(value: any) { - return { - typeUrl: '/agoric.swingset.MsgDeliverInbound', - value: MsgDeliverInbound.fromJSON(value), - }; - }, - walletAction(value: any) { - return { - typeUrl: '/agoric.swingset.MsgWalletAction', - value: MsgWalletAction.fromJSON(value), - }; - }, - walletSpendAction(value: any) { - return { - typeUrl: '/agoric.swingset.MsgWalletSpendAction', - value: MsgWalletSpendAction.fromJSON(value), - }; - }, - provision(value: any) { - return { - typeUrl: '/agoric.swingset.MsgProvision', - value: MsgProvision.fromJSON(value), - }; - }, - }, - fromPartial: { - installBundle(value: MsgInstallBundle) { - return { - typeUrl: '/agoric.swingset.MsgInstallBundle', - value: MsgInstallBundle.fromPartial(value), - }; - }, - deliverInbound(value: MsgDeliverInbound) { - return { - typeUrl: '/agoric.swingset.MsgDeliverInbound', - value: MsgDeliverInbound.fromPartial(value), - }; - }, - walletAction(value: MsgWalletAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletAction', - value: MsgWalletAction.fromPartial(value), - }; - }, - walletSpendAction(value: MsgWalletSpendAction) { - return { - typeUrl: '/agoric.swingset.MsgWalletSpendAction', - value: MsgWalletSpendAction.fromPartial(value), - }; - }, - provision(value: MsgProvision) { - return { - typeUrl: '/agoric.swingset.MsgProvision', - value: MsgProvision.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.rpc.msg.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.rpc.msg.ts deleted file mode 100644 index c94ce2c582d..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.rpc.msg.ts +++ /dev/null @@ -1,98 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../helpers.js'; -import { BinaryReader } from '../../binary.js'; -import { - MsgInstallBundle, - MsgInstallBundleResponse, - MsgDeliverInbound, - MsgDeliverInboundResponse, - MsgWalletAction, - MsgWalletActionResponse, - MsgWalletSpendAction, - MsgWalletSpendActionResponse, - MsgProvision, - MsgProvisionResponse, -} from './msgs.js'; -/** Transactions. */ -export interface Msg { - /** Install a JavaScript sources bundle on the chain's SwingSet controller. */ - installBundle(request: MsgInstallBundle): Promise; - /** Send inbound messages. */ - deliverInbound( - request: MsgDeliverInbound, - ): Promise; - /** Perform a low-privilege wallet action. */ - walletAction(request: MsgWalletAction): Promise; - /** Perform a wallet action that spends assets. */ - walletSpendAction( - request: MsgWalletSpendAction, - ): Promise; - /** Provision a new endpoint. */ - provision(request: MsgProvision): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.installBundle = this.installBundle.bind(this); - this.deliverInbound = this.deliverInbound.bind(this); - this.walletAction = this.walletAction.bind(this); - this.walletSpendAction = this.walletSpendAction.bind(this); - this.provision = this.provision.bind(this); - } - installBundle(request: MsgInstallBundle): Promise { - const data = MsgInstallBundle.encode(request).finish(); - const promise = this.rpc.request( - 'agoric.swingset.Msg', - 'InstallBundle', - data, - ); - return promise.then(data => - MsgInstallBundleResponse.decode(new BinaryReader(data)), - ); - } - deliverInbound( - request: MsgDeliverInbound, - ): Promise { - const data = MsgDeliverInbound.encode(request).finish(); - const promise = this.rpc.request( - 'agoric.swingset.Msg', - 'DeliverInbound', - data, - ); - return promise.then(data => - MsgDeliverInboundResponse.decode(new BinaryReader(data)), - ); - } - walletAction(request: MsgWalletAction): Promise { - const data = MsgWalletAction.encode(request).finish(); - const promise = this.rpc.request( - 'agoric.swingset.Msg', - 'WalletAction', - data, - ); - return promise.then(data => - MsgWalletActionResponse.decode(new BinaryReader(data)), - ); - } - walletSpendAction( - request: MsgWalletSpendAction, - ): Promise { - const data = MsgWalletSpendAction.encode(request).finish(); - const promise = this.rpc.request( - 'agoric.swingset.Msg', - 'WalletSpendAction', - data, - ); - return promise.then(data => - MsgWalletSpendActionResponse.decode(new BinaryReader(data)), - ); - } - provision(request: MsgProvision): Promise { - const data = MsgProvision.encode(request).finish(); - const promise = this.rpc.request('agoric.swingset.Msg', 'Provision', data); - return promise.then(data => - MsgProvisionResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.ts index 8291efb0a46..0345742434c 100644 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.ts +++ b/packages/cosmic-proto/src/codegen/agoric/swingset/msgs.ts @@ -13,17 +13,6 @@ export interface MsgDeliverInboundProtoMsg { value: Uint8Array; } /** MsgDeliverInbound defines an SDK message for delivering an eventual send */ -export interface MsgDeliverInboundAmino { - messages: string[]; - nums: string[]; - ack: string; - submitter: string; -} -export interface MsgDeliverInboundAminoMsg { - type: '/agoric.swingset.MsgDeliverInbound'; - value: MsgDeliverInboundAmino; -} -/** MsgDeliverInbound defines an SDK message for delivering an eventual send */ export interface MsgDeliverInboundSDKType { messages: string[]; nums: bigint[]; @@ -37,12 +26,6 @@ export interface MsgDeliverInboundResponseProtoMsg { value: Uint8Array; } /** MsgDeliverInboundResponse is an empty reply. */ -export interface MsgDeliverInboundResponseAmino {} -export interface MsgDeliverInboundResponseAminoMsg { - type: '/agoric.swingset.MsgDeliverInboundResponse'; - value: MsgDeliverInboundResponseAmino; -} -/** MsgDeliverInboundResponse is an empty reply. */ export interface MsgDeliverInboundResponseSDKType {} /** * MsgWalletAction defines an SDK message for the on-chain wallet to perform an @@ -58,20 +41,6 @@ export interface MsgWalletActionProtoMsg { typeUrl: '/agoric.swingset.MsgWalletAction'; value: Uint8Array; } -/** - * MsgWalletAction defines an SDK message for the on-chain wallet to perform an - * action that *does not* spend any assets (other than gas fees/stamps). This - * message type is typically protected by feegrant budgets. - */ -export interface MsgWalletActionAmino { - owner: string; - /** The action to perform, as JSON-stringified marshalled data. */ - action?: string; -} -export interface MsgWalletActionAminoMsg { - type: '/agoric.swingset.MsgWalletAction'; - value: MsgWalletActionAmino; -} /** * MsgWalletAction defines an SDK message for the on-chain wallet to perform an * action that *does not* spend any assets (other than gas fees/stamps). This @@ -88,12 +57,6 @@ export interface MsgWalletActionResponseProtoMsg { value: Uint8Array; } /** MsgWalletActionResponse is an empty reply. */ -export interface MsgWalletActionResponseAmino {} -export interface MsgWalletActionResponseAminoMsg { - type: '/agoric.swingset.MsgWalletActionResponse'; - value: MsgWalletActionResponseAmino; -} -/** MsgWalletActionResponse is an empty reply. */ export interface MsgWalletActionResponseSDKType {} /** * MsgWalletSpendAction defines an SDK message for the on-chain wallet to @@ -109,20 +72,6 @@ export interface MsgWalletSpendActionProtoMsg { typeUrl: '/agoric.swingset.MsgWalletSpendAction'; value: Uint8Array; } -/** - * MsgWalletSpendAction defines an SDK message for the on-chain wallet to - * perform an action that *does spend the owner's assets.* This message type is - * typically protected by explicit confirmation by the user. - */ -export interface MsgWalletSpendActionAmino { - owner: string; - /** The action to perform, as JSON-stringified marshalled data. */ - spend_action?: string; -} -export interface MsgWalletSpendActionAminoMsg { - type: '/agoric.swingset.MsgWalletSpendAction'; - value: MsgWalletSpendActionAmino; -} /** * MsgWalletSpendAction defines an SDK message for the on-chain wallet to * perform an action that *does spend the owner's assets.* This message type is @@ -139,12 +88,6 @@ export interface MsgWalletSpendActionResponseProtoMsg { value: Uint8Array; } /** MsgWalletSpendActionResponse is an empty reply. */ -export interface MsgWalletSpendActionResponseAmino {} -export interface MsgWalletSpendActionResponseAminoMsg { - type: '/agoric.swingset.MsgWalletSpendActionResponse'; - value: MsgWalletSpendActionResponseAmino; -} -/** MsgWalletSpendActionResponse is an empty reply. */ export interface MsgWalletSpendActionResponseSDKType {} /** MsgProvision defines an SDK message for provisioning a client to the chain */ export interface MsgProvision { @@ -158,17 +101,6 @@ export interface MsgProvisionProtoMsg { value: Uint8Array; } /** MsgProvision defines an SDK message for provisioning a client to the chain */ -export interface MsgProvisionAmino { - nickname: string; - address: string; - power_flags: string[]; - submitter: string; -} -export interface MsgProvisionAminoMsg { - type: '/agoric.swingset.MsgProvision'; - value: MsgProvisionAmino; -} -/** MsgProvision defines an SDK message for provisioning a client to the chain */ export interface MsgProvisionSDKType { nickname: string; address: Uint8Array; @@ -182,12 +114,6 @@ export interface MsgProvisionResponseProtoMsg { value: Uint8Array; } /** MsgProvisionResponse is an empty reply. */ -export interface MsgProvisionResponseAmino {} -export interface MsgProvisionResponseAminoMsg { - type: '/agoric.swingset.MsgProvisionResponse'; - value: MsgProvisionResponseAmino; -} -/** MsgProvisionResponse is an empty reply. */ export interface MsgProvisionResponseSDKType {} /** MsgInstallBundle carries a signed bundle to SwingSet. */ export interface MsgInstallBundle { @@ -206,22 +132,6 @@ export interface MsgInstallBundleProtoMsg { value: Uint8Array; } /** MsgInstallBundle carries a signed bundle to SwingSet. */ -export interface MsgInstallBundleAmino { - bundle: string; - submitter: string; - /** - * Either bundle or compressed_bundle will be set. - * Default compression algorithm is gzip. - */ - compressed_bundle: string; - /** Size in bytes of uncompression of compressed_bundle. */ - uncompressed_size: string; -} -export interface MsgInstallBundleAminoMsg { - type: '/agoric.swingset.MsgInstallBundle'; - value: MsgInstallBundleAmino; -} -/** MsgInstallBundle carries a signed bundle to SwingSet. */ export interface MsgInstallBundleSDKType { bundle: string; submitter: Uint8Array; @@ -237,15 +147,6 @@ export interface MsgInstallBundleResponseProtoMsg { typeUrl: '/agoric.swingset.MsgInstallBundleResponse'; value: Uint8Array; } -/** - * MsgInstallBundleResponse is an empty acknowledgement that an install bundle - * message has been queued for the SwingSet kernel's consideration. - */ -export interface MsgInstallBundleResponseAmino {} -export interface MsgInstallBundleResponseAminoMsg { - type: '/agoric.swingset.MsgInstallBundleResponse'; - value: MsgInstallBundleResponseAmino; -} /** * MsgInstallBundleResponse is an empty acknowledgement that an install bundle * message has been queued for the SwingSet kernel's consideration. @@ -360,37 +261,6 @@ export const MsgDeliverInbound = { message.submitter = object.submitter ?? new Uint8Array(); return message; }, - fromAmino(object: MsgDeliverInboundAmino): MsgDeliverInbound { - const message = createBaseMsgDeliverInbound(); - message.messages = object.messages?.map(e => e) || []; - message.nums = object.nums?.map(e => BigInt(e)) || []; - if (object.ack !== undefined && object.ack !== null) { - message.ack = BigInt(object.ack); - } - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = bytesFromBase64(object.submitter); - } - return message; - }, - toAmino(message: MsgDeliverInbound): MsgDeliverInboundAmino { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => e); - } else { - obj.messages = message.messages; - } - if (message.nums) { - obj.nums = message.nums.map(e => e.toString()); - } else { - obj.nums = message.nums; - } - obj.ack = message.ack ? message.ack.toString() : '0'; - obj.submitter = message.submitter ? base64FromBytes(message.submitter) : ''; - return obj; - }, - fromAminoMsg(object: MsgDeliverInboundAminoMsg): MsgDeliverInbound { - return MsgDeliverInbound.fromAmino(object.value); - }, fromProtoMsg(message: MsgDeliverInboundProtoMsg): MsgDeliverInbound { return MsgDeliverInbound.decode(message.value); }, @@ -446,19 +316,6 @@ export const MsgDeliverInboundResponse = { const message = createBaseMsgDeliverInboundResponse(); return message; }, - fromAmino(_: MsgDeliverInboundResponseAmino): MsgDeliverInboundResponse { - const message = createBaseMsgDeliverInboundResponse(); - return message; - }, - toAmino(_: MsgDeliverInboundResponse): MsgDeliverInboundResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgDeliverInboundResponseAminoMsg, - ): MsgDeliverInboundResponse { - return MsgDeliverInboundResponse.fromAmino(object.value); - }, fromProtoMsg( message: MsgDeliverInboundResponseProtoMsg, ): MsgDeliverInboundResponse { @@ -540,25 +397,6 @@ export const MsgWalletAction = { message.action = object.action ?? ''; return message; }, - fromAmino(object: MsgWalletActionAmino): MsgWalletAction { - const message = createBaseMsgWalletAction(); - if (object.owner !== undefined && object.owner !== null) { - message.owner = bytesFromBase64(object.owner); - } - if (object.action !== undefined && object.action !== null) { - message.action = object.action; - } - return message; - }, - toAmino(message: MsgWalletAction): MsgWalletActionAmino { - const obj: any = {}; - obj.owner = message.owner ? base64FromBytes(message.owner) : ''; - obj.action = message.action === '' ? undefined : message.action; - return obj; - }, - fromAminoMsg(object: MsgWalletActionAminoMsg): MsgWalletAction { - return MsgWalletAction.fromAmino(object.value); - }, fromProtoMsg(message: MsgWalletActionProtoMsg): MsgWalletAction { return MsgWalletAction.decode(message.value); }, @@ -612,19 +450,6 @@ export const MsgWalletActionResponse = { const message = createBaseMsgWalletActionResponse(); return message; }, - fromAmino(_: MsgWalletActionResponseAmino): MsgWalletActionResponse { - const message = createBaseMsgWalletActionResponse(); - return message; - }, - toAmino(_: MsgWalletActionResponse): MsgWalletActionResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgWalletActionResponseAminoMsg, - ): MsgWalletActionResponse { - return MsgWalletActionResponse.fromAmino(object.value); - }, fromProtoMsg( message: MsgWalletActionResponseProtoMsg, ): MsgWalletActionResponse { @@ -710,26 +535,6 @@ export const MsgWalletSpendAction = { message.spendAction = object.spendAction ?? ''; return message; }, - fromAmino(object: MsgWalletSpendActionAmino): MsgWalletSpendAction { - const message = createBaseMsgWalletSpendAction(); - if (object.owner !== undefined && object.owner !== null) { - message.owner = bytesFromBase64(object.owner); - } - if (object.spend_action !== undefined && object.spend_action !== null) { - message.spendAction = object.spend_action; - } - return message; - }, - toAmino(message: MsgWalletSpendAction): MsgWalletSpendActionAmino { - const obj: any = {}; - obj.owner = message.owner ? base64FromBytes(message.owner) : ''; - obj.spend_action = - message.spendAction === '' ? undefined : message.spendAction; - return obj; - }, - fromAminoMsg(object: MsgWalletSpendActionAminoMsg): MsgWalletSpendAction { - return MsgWalletSpendAction.fromAmino(object.value); - }, fromProtoMsg(message: MsgWalletSpendActionProtoMsg): MsgWalletSpendAction { return MsgWalletSpendAction.decode(message.value); }, @@ -785,21 +590,6 @@ export const MsgWalletSpendActionResponse = { const message = createBaseMsgWalletSpendActionResponse(); return message; }, - fromAmino( - _: MsgWalletSpendActionResponseAmino, - ): MsgWalletSpendActionResponse { - const message = createBaseMsgWalletSpendActionResponse(); - return message; - }, - toAmino(_: MsgWalletSpendActionResponse): MsgWalletSpendActionResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgWalletSpendActionResponseAminoMsg, - ): MsgWalletSpendActionResponse { - return MsgWalletSpendActionResponse.fromAmino(object.value); - }, fromProtoMsg( message: MsgWalletSpendActionResponseProtoMsg, ): MsgWalletSpendActionResponse { @@ -912,35 +702,6 @@ export const MsgProvision = { message.submitter = object.submitter ?? new Uint8Array(); return message; }, - fromAmino(object: MsgProvisionAmino): MsgProvision { - const message = createBaseMsgProvision(); - if (object.nickname !== undefined && object.nickname !== null) { - message.nickname = object.nickname; - } - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - message.powerFlags = object.power_flags?.map(e => e) || []; - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = bytesFromBase64(object.submitter); - } - return message; - }, - toAmino(message: MsgProvision): MsgProvisionAmino { - const obj: any = {}; - obj.nickname = message.nickname ?? ''; - obj.address = message.address ? base64FromBytes(message.address) : ''; - if (message.powerFlags) { - obj.power_flags = message.powerFlags.map(e => e); - } else { - obj.power_flags = message.powerFlags; - } - obj.submitter = message.submitter ? base64FromBytes(message.submitter) : ''; - return obj; - }, - fromAminoMsg(object: MsgProvisionAminoMsg): MsgProvision { - return MsgProvision.fromAmino(object.value); - }, fromProtoMsg(message: MsgProvisionProtoMsg): MsgProvision { return MsgProvision.decode(message.value); }, @@ -994,17 +755,6 @@ export const MsgProvisionResponse = { const message = createBaseMsgProvisionResponse(); return message; }, - fromAmino(_: MsgProvisionResponseAmino): MsgProvisionResponse { - const message = createBaseMsgProvisionResponse(); - return message; - }, - toAmino(_: MsgProvisionResponse): MsgProvisionResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgProvisionResponseAminoMsg): MsgProvisionResponse { - return MsgProvisionResponse.fromAmino(object.value); - }, fromProtoMsg(message: MsgProvisionResponseProtoMsg): MsgProvisionResponse { return MsgProvisionResponse.decode(message.value); }, @@ -1117,43 +867,6 @@ export const MsgInstallBundle = { : BigInt(0); return message; }, - fromAmino(object: MsgInstallBundleAmino): MsgInstallBundle { - const message = createBaseMsgInstallBundle(); - if (object.bundle !== undefined && object.bundle !== null) { - message.bundle = object.bundle; - } - if (object.submitter !== undefined && object.submitter !== null) { - message.submitter = bytesFromBase64(object.submitter); - } - if ( - object.compressed_bundle !== undefined && - object.compressed_bundle !== null - ) { - message.compressedBundle = bytesFromBase64(object.compressed_bundle); - } - if ( - object.uncompressed_size !== undefined && - object.uncompressed_size !== null - ) { - message.uncompressedSize = BigInt(object.uncompressed_size); - } - return message; - }, - toAmino(message: MsgInstallBundle): MsgInstallBundleAmino { - const obj: any = {}; - obj.bundle = message.bundle ?? ''; - obj.submitter = message.submitter ? base64FromBytes(message.submitter) : ''; - obj.compressed_bundle = message.compressedBundle - ? base64FromBytes(message.compressedBundle) - : ''; - obj.uncompressed_size = message.uncompressedSize - ? message.uncompressedSize.toString() - : '0'; - return obj; - }, - fromAminoMsg(object: MsgInstallBundleAminoMsg): MsgInstallBundle { - return MsgInstallBundle.fromAmino(object.value); - }, fromProtoMsg(message: MsgInstallBundleProtoMsg): MsgInstallBundle { return MsgInstallBundle.decode(message.value); }, @@ -1207,19 +920,6 @@ export const MsgInstallBundleResponse = { const message = createBaseMsgInstallBundleResponse(); return message; }, - fromAmino(_: MsgInstallBundleResponseAmino): MsgInstallBundleResponse { - const message = createBaseMsgInstallBundleResponse(); - return message; - }, - toAmino(_: MsgInstallBundleResponse): MsgInstallBundleResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgInstallBundleResponseAminoMsg, - ): MsgInstallBundleResponse { - return MsgInstallBundleResponse.fromAmino(object.value); - }, fromProtoMsg( message: MsgInstallBundleResponseProtoMsg, ): MsgInstallBundleResponse { diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/query.rpc.Query.ts deleted file mode 100644 index 85bc0cbd1fe..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/query.rpc.Query.ts +++ /dev/null @@ -1,66 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../helpers.js'; -import { BinaryReader } from '../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryParamsRequest, - QueryParamsResponse, - QueryEgressRequest, - QueryEgressResponse, - QueryMailboxRequest, - QueryMailboxResponse, -} from './query.js'; -/** Query provides defines the gRPC querier service */ -export interface Query { - /** Params queries params of the swingset module. */ - params(request?: QueryParamsRequest): Promise; - /** Egress queries a provisioned egress. */ - egress(request: QueryEgressRequest): Promise; - /** Return the contents of a peer's outbound mailbox. */ - mailbox(request: QueryMailboxRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.params = this.params.bind(this); - this.egress = this.egress.bind(this); - this.mailbox = this.mailbox.bind(this); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.swingset.Query', 'Params', data); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - egress(request: QueryEgressRequest): Promise { - const data = QueryEgressRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.swingset.Query', 'Egress', data); - return promise.then(data => - QueryEgressResponse.decode(new BinaryReader(data)), - ); - } - mailbox(request: QueryMailboxRequest): Promise { - const data = QueryMailboxRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.swingset.Query', 'Mailbox', data); - return promise.then(data => - QueryMailboxResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - egress(request: QueryEgressRequest): Promise { - return queryService.egress(request); - }, - mailbox(request: QueryMailboxRequest): Promise { - return queryService.mailbox(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/query.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/query.ts index d6825767f37..ea9ef1acbd5 100644 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/query.ts +++ b/packages/cosmic-proto/src/codegen/agoric/swingset/query.ts @@ -1,12 +1,5 @@ //@ts-nocheck -import { - Params, - ParamsAmino, - ParamsSDKType, - Egress, - EgressAmino, - EgressSDKType, -} from './swingset.js'; +import { Params, ParamsSDKType, Egress, EgressSDKType } from './swingset.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../helpers.js'; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ @@ -16,12 +9,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: '/agoric.swingset.QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -33,15 +20,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params defines the parameters of the module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: '/agoric.swingset.QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -54,14 +32,6 @@ export interface QueryEgressRequestProtoMsg { value: Uint8Array; } /** QueryEgressRequest is the request type for the Query/Egress RPC method */ -export interface QueryEgressRequestAmino { - peer: string; -} -export interface QueryEgressRequestAminoMsg { - type: '/agoric.swingset.QueryEgressRequest'; - value: QueryEgressRequestAmino; -} -/** QueryEgressRequest is the request type for the Query/Egress RPC method */ export interface QueryEgressRequestSDKType { peer: Uint8Array; } @@ -74,14 +44,6 @@ export interface QueryEgressResponseProtoMsg { value: Uint8Array; } /** QueryEgressResponse is the egress response. */ -export interface QueryEgressResponseAmino { - egress?: EgressAmino; -} -export interface QueryEgressResponseAminoMsg { - type: '/agoric.swingset.QueryEgressResponse'; - value: QueryEgressResponseAmino; -} -/** QueryEgressResponse is the egress response. */ export interface QueryEgressResponseSDKType { egress?: EgressSDKType; } @@ -94,14 +56,6 @@ export interface QueryMailboxRequestProtoMsg { value: Uint8Array; } /** QueryMailboxRequest is the mailbox query. */ -export interface QueryMailboxRequestAmino { - peer: string; -} -export interface QueryMailboxRequestAminoMsg { - type: '/agoric.swingset.QueryMailboxRequest'; - value: QueryMailboxRequestAmino; -} -/** QueryMailboxRequest is the mailbox query. */ export interface QueryMailboxRequestSDKType { peer: Uint8Array; } @@ -114,14 +68,6 @@ export interface QueryMailboxResponseProtoMsg { value: Uint8Array; } /** QueryMailboxResponse is the mailbox response. */ -export interface QueryMailboxResponseAmino { - value: string; -} -export interface QueryMailboxResponseAminoMsg { - type: '/agoric.swingset.QueryMailboxResponse'; - value: QueryMailboxResponseAmino; -} -/** QueryMailboxResponse is the mailbox response. */ export interface QueryMailboxResponseSDKType { value: string; } @@ -165,17 +111,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -245,21 +180,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -330,21 +250,6 @@ export const QueryEgressRequest = { message.peer = object.peer ?? new Uint8Array(); return message; }, - fromAmino(object: QueryEgressRequestAmino): QueryEgressRequest { - const message = createBaseQueryEgressRequest(); - if (object.peer !== undefined && object.peer !== null) { - message.peer = bytesFromBase64(object.peer); - } - return message; - }, - toAmino(message: QueryEgressRequest): QueryEgressRequestAmino { - const obj: any = {}; - obj.peer = message.peer ? base64FromBytes(message.peer) : ''; - return obj; - }, - fromAminoMsg(object: QueryEgressRequestAminoMsg): QueryEgressRequest { - return QueryEgressRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryEgressRequestProtoMsg): QueryEgressRequest { return QueryEgressRequest.decode(message.value); }, @@ -414,21 +319,6 @@ export const QueryEgressResponse = { : undefined; return message; }, - fromAmino(object: QueryEgressResponseAmino): QueryEgressResponse { - const message = createBaseQueryEgressResponse(); - if (object.egress !== undefined && object.egress !== null) { - message.egress = Egress.fromAmino(object.egress); - } - return message; - }, - toAmino(message: QueryEgressResponse): QueryEgressResponseAmino { - const obj: any = {}; - obj.egress = message.egress ? Egress.toAmino(message.egress) : undefined; - return obj; - }, - fromAminoMsg(object: QueryEgressResponseAminoMsg): QueryEgressResponse { - return QueryEgressResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryEgressResponseProtoMsg): QueryEgressResponse { return QueryEgressResponse.decode(message.value); }, @@ -499,21 +389,6 @@ export const QueryMailboxRequest = { message.peer = object.peer ?? new Uint8Array(); return message; }, - fromAmino(object: QueryMailboxRequestAmino): QueryMailboxRequest { - const message = createBaseQueryMailboxRequest(); - if (object.peer !== undefined && object.peer !== null) { - message.peer = bytesFromBase64(object.peer); - } - return message; - }, - toAmino(message: QueryMailboxRequest): QueryMailboxRequestAmino { - const obj: any = {}; - obj.peer = message.peer ? base64FromBytes(message.peer) : ''; - return obj; - }, - fromAminoMsg(object: QueryMailboxRequestAminoMsg): QueryMailboxRequest { - return QueryMailboxRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryMailboxRequestProtoMsg): QueryMailboxRequest { return QueryMailboxRequest.decode(message.value); }, @@ -579,21 +454,6 @@ export const QueryMailboxResponse = { message.value = object.value ?? ''; return message; }, - fromAmino(object: QueryMailboxResponseAmino): QueryMailboxResponse { - const message = createBaseQueryMailboxResponse(); - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: QueryMailboxResponse): QueryMailboxResponseAmino { - const obj: any = {}; - obj.value = message.value ?? ''; - return obj; - }, - fromAminoMsg(object: QueryMailboxResponseAminoMsg): QueryMailboxResponse { - return QueryMailboxResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryMailboxResponseProtoMsg): QueryMailboxResponse { return QueryMailboxResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/swingset/swingset.ts b/packages/cosmic-proto/src/codegen/agoric/swingset/swingset.ts index 6006a07b75f..0bcb023c83f 100644 --- a/packages/cosmic-proto/src/codegen/agoric/swingset/swingset.ts +++ b/packages/cosmic-proto/src/codegen/agoric/swingset/swingset.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - Coin, - CoinAmino, - CoinSDKType, -} from '../../cosmos/base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../cosmos/base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../helpers.js'; /** @@ -24,24 +20,6 @@ export interface CoreEvalProposalProtoMsg { typeUrl: '/agoric.swingset.CoreEvalProposal'; value: Uint8Array; } -/** - * CoreEvalProposal is a gov Content type for evaluating code in the SwingSet - * core. - * See `bridgeCoreEval` in agoric-sdk packages/vats/src/core/chain-behaviors.js. - */ -export interface CoreEvalProposalAmino { - title?: string; - description?: string; - /** - * Although evals are sequential, they may run concurrently, since they each - * can return a Promise. - */ - evals?: CoreEvalAmino[]; -} -export interface CoreEvalProposalAminoMsg { - type: '/agoric.swingset.CoreEvalProposal'; - value: CoreEvalProposalAmino; -} /** * CoreEvalProposal is a gov Content type for evaluating code in the SwingSet * core. @@ -72,26 +50,6 @@ export interface CoreEvalProtoMsg { typeUrl: '/agoric.swingset.CoreEval'; value: Uint8Array; } -/** - * CoreEval defines an individual SwingSet core evaluation, for use in - * CoreEvalProposal. - */ -export interface CoreEvalAmino { - /** - * Grant these JSON-stringified core bootstrap permits to the jsCode, as the - * `powers` endowment. - */ - json_permits?: string; - /** - * Evaluate this JavaScript code in a Compartment endowed with `powers` as - * well as some powerless helpers. - */ - js_code?: string; -} -export interface CoreEvalAminoMsg { - type: '/agoric.swingset.CoreEval'; - value: CoreEvalAmino; -} /** * CoreEval defines an individual SwingSet core evaluation, for use in * CoreEvalProposal. @@ -150,55 +108,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params are the swingset configuration/governance parameters. */ -export interface ParamsAmino { - /** - * Map from unit name to a value in SwingSet "beans". - * Must not be negative. - * - * These values are used by SwingSet to normalize named per-resource charges - * (maybe rent) in a single Nat usage unit, the "bean". - * - * There is no required order to this list of entries, but all the chain - * nodes must all serialize and deserialize the existing order without - * permuting it. - */ - beans_per_unit?: StringBeansAmino[]; - /** - * The price in Coins per the unit named "fee". This value is used by - * cosmic-swingset JS code to decide how many tokens to charge. - * - * cost = beans_used * fee_unit_price / beans_per_unit["fee"] - */ - fee_unit_price?: CoinAmino[]; - /** - * The SwingSet bootstrap vat configuration file. Not usefully modifiable - * via governance as it is only referenced by the chain's initial - * construction. - */ - bootstrap_vat_config?: string; - /** - * If the provision submitter doesn't hold a provisionpass, their requested - * power flags are looked up in this fee menu (first match wins) and the sum - * is charged. If any power flag is not found in this menu, the request is - * rejected. - */ - power_flag_fees?: PowerFlagFeeAmino[]; - /** - * Maximum sizes for queues. - * These values are used by SwingSet to compute how many messages should be - * accepted in a block. - * - * There is no required order to this list of entries, but all the chain - * nodes must all serialize and deserialize the existing order without - * permuting it. - */ - queue_max?: QueueSizeAmino[]; -} -export interface ParamsAminoMsg { - type: '/agoric.swingset.Params'; - value: ParamsAmino; -} -/** Params are the swingset configuration/governance parameters. */ export interface ParamsSDKType { beans_per_unit: StringBeansSDKType[]; fee_unit_price: CoinSDKType[]; @@ -219,18 +128,6 @@ export interface StateProtoMsg { value: Uint8Array; } /** The current state of the module. */ -export interface StateAmino { - /** - * The allowed number of items to add to queues, as determined by SwingSet. - * Transactions which attempt to enqueue more should be rejected. - */ - queue_allowed?: QueueSizeAmino[]; -} -export interface StateAminoMsg { - type: '/agoric.swingset.State'; - value: StateAmino; -} -/** The current state of the module. */ export interface StateSDKType { queue_allowed: QueueSizeSDKType[]; } @@ -246,17 +143,6 @@ export interface StringBeansProtoMsg { value: Uint8Array; } /** Map element of a string key to a Nat bean count. */ -export interface StringBeansAmino { - /** What the beans are for. */ - key?: string; - /** The actual bean value. */ - beans?: string; -} -export interface StringBeansAminoMsg { - type: '/agoric.swingset.StringBeans'; - value: StringBeansAmino; -} -/** Map element of a string key to a Nat bean count. */ export interface StringBeansSDKType { key: string; beans: string; @@ -271,15 +157,6 @@ export interface PowerFlagFeeProtoMsg { value: Uint8Array; } /** Map a provisioning power flag to its corresponding fee. */ -export interface PowerFlagFeeAmino { - power_flag?: string; - fee?: CoinAmino[]; -} -export interface PowerFlagFeeAminoMsg { - type: '/agoric.swingset.PowerFlagFee'; - value: PowerFlagFeeAmino; -} -/** Map a provisioning power flag to its corresponding fee. */ export interface PowerFlagFeeSDKType { power_flag: string; fee: CoinSDKType[]; @@ -296,17 +173,6 @@ export interface QueueSizeProtoMsg { value: Uint8Array; } /** Map element of a string key to a size. */ -export interface QueueSizeAmino { - /** What the size is for. */ - key?: string; - /** The actual size value. */ - size?: number; -} -export interface QueueSizeAminoMsg { - type: '/agoric.swingset.QueueSize'; - value: QueueSizeAmino; -} -/** Map element of a string key to a size. */ export interface QueueSizeSDKType { key: string; size: number; @@ -323,17 +189,6 @@ export interface EgressProtoMsg { value: Uint8Array; } /** Egress is the format for a swingset egress. */ -export interface EgressAmino { - nickname: string; - peer: string; - /** TODO: Remove these power flags as they are deprecated and have no effect. */ - power_flags: string[]; -} -export interface EgressAminoMsg { - type: '/agoric.swingset.Egress'; - value: EgressAmino; -} -/** Egress is the format for a swingset egress. */ export interface EgressSDKType { nickname: string; peer: Uint8Array; @@ -353,20 +208,6 @@ export interface SwingStoreArtifactProtoMsg { typeUrl: '/agoric.swingset.SwingStoreArtifact'; value: Uint8Array; } -/** - * SwingStoreArtifact encodes an artifact of a swing-store export. - * Artifacts may be stored or transmitted in any order. Most handlers do - * maintain the artifact order from their original source as an effect of how - * they handle the artifacts. - */ -export interface SwingStoreArtifactAmino { - name: string; - data: string; -} -export interface SwingStoreArtifactAminoMsg { - type: '/agoric.swingset.SwingStoreArtifact'; - value: SwingStoreArtifactAmino; -} /** * SwingStoreArtifact encodes an artifact of a swing-store export. * Artifacts may be stored or transmitted in any order. Most handlers do @@ -453,32 +294,6 @@ export const CoreEvalProposal = { message.evals = object.evals?.map(e => CoreEval.fromPartial(e)) || []; return message; }, - fromAmino(object: CoreEvalProposalAmino): CoreEvalProposal { - const message = createBaseCoreEvalProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - message.evals = object.evals?.map(e => CoreEval.fromAmino(e)) || []; - return message; - }, - toAmino(message: CoreEvalProposal): CoreEvalProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - if (message.evals) { - obj.evals = message.evals.map(e => (e ? CoreEval.toAmino(e) : undefined)); - } else { - obj.evals = message.evals; - } - return obj; - }, - fromAminoMsg(object: CoreEvalProposalAminoMsg): CoreEvalProposal { - return CoreEvalProposal.fromAmino(object.value); - }, fromProtoMsg(message: CoreEvalProposalProtoMsg): CoreEvalProposal { return CoreEvalProposal.decode(message.value); }, @@ -552,26 +367,6 @@ export const CoreEval = { message.jsCode = object.jsCode ?? ''; return message; }, - fromAmino(object: CoreEvalAmino): CoreEval { - const message = createBaseCoreEval(); - if (object.json_permits !== undefined && object.json_permits !== null) { - message.jsonPermits = object.json_permits; - } - if (object.js_code !== undefined && object.js_code !== null) { - message.jsCode = object.js_code; - } - return message; - }, - toAmino(message: CoreEval): CoreEvalAmino { - const obj: any = {}; - obj.json_permits = - message.jsonPermits === '' ? undefined : message.jsonPermits; - obj.js_code = message.jsCode === '' ? undefined : message.jsCode; - return obj; - }, - fromAminoMsg(object: CoreEvalAminoMsg): CoreEval { - return CoreEval.fromAmino(object.value); - }, fromProtoMsg(message: CoreEvalProtoMsg): CoreEval { return CoreEval.decode(message.value); }, @@ -717,62 +512,6 @@ export const Params = { object.queueMax?.map(e => QueueSize.fromPartial(e)) || []; return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - message.beansPerUnit = - object.beans_per_unit?.map(e => StringBeans.fromAmino(e)) || []; - message.feeUnitPrice = - object.fee_unit_price?.map(e => Coin.fromAmino(e)) || []; - if ( - object.bootstrap_vat_config !== undefined && - object.bootstrap_vat_config !== null - ) { - message.bootstrapVatConfig = object.bootstrap_vat_config; - } - message.powerFlagFees = - object.power_flag_fees?.map(e => PowerFlagFee.fromAmino(e)) || []; - message.queueMax = object.queue_max?.map(e => QueueSize.fromAmino(e)) || []; - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.beansPerUnit) { - obj.beans_per_unit = message.beansPerUnit.map(e => - e ? StringBeans.toAmino(e) : undefined, - ); - } else { - obj.beans_per_unit = message.beansPerUnit; - } - if (message.feeUnitPrice) { - obj.fee_unit_price = message.feeUnitPrice.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.fee_unit_price = message.feeUnitPrice; - } - obj.bootstrap_vat_config = - message.bootstrapVatConfig === '' - ? undefined - : message.bootstrapVatConfig; - if (message.powerFlagFees) { - obj.power_flag_fees = message.powerFlagFees.map(e => - e ? PowerFlagFee.toAmino(e) : undefined, - ); - } else { - obj.power_flag_fees = message.powerFlagFees; - } - if (message.queueMax) { - obj.queue_max = message.queueMax.map(e => - e ? QueueSize.toAmino(e) : undefined, - ); - } else { - obj.queue_max = message.queueMax; - } - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, @@ -844,26 +583,6 @@ export const State = { object.queueAllowed?.map(e => QueueSize.fromPartial(e)) || []; return message; }, - fromAmino(object: StateAmino): State { - const message = createBaseState(); - message.queueAllowed = - object.queue_allowed?.map(e => QueueSize.fromAmino(e)) || []; - return message; - }, - toAmino(message: State): StateAmino { - const obj: any = {}; - if (message.queueAllowed) { - obj.queue_allowed = message.queueAllowed.map(e => - e ? QueueSize.toAmino(e) : undefined, - ); - } else { - obj.queue_allowed = message.queueAllowed; - } - return obj; - }, - fromAminoMsg(object: StateAminoMsg): State { - return State.fromAmino(object.value); - }, fromProtoMsg(message: StateProtoMsg): State { return State.decode(message.value); }, @@ -936,25 +655,6 @@ export const StringBeans = { message.beans = object.beans ?? ''; return message; }, - fromAmino(object: StringBeansAmino): StringBeans { - const message = createBaseStringBeans(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.beans !== undefined && object.beans !== null) { - message.beans = object.beans; - } - return message; - }, - toAmino(message: StringBeans): StringBeansAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.beans = message.beans === '' ? undefined : message.beans; - return obj; - }, - fromAminoMsg(object: StringBeansAminoMsg): StringBeans { - return StringBeans.fromAmino(object.value); - }, fromProtoMsg(message: StringBeansProtoMsg): StringBeans { return StringBeans.decode(message.value); }, @@ -1033,27 +733,6 @@ export const PowerFlagFee = { message.fee = object.fee?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: PowerFlagFeeAmino): PowerFlagFee { - const message = createBasePowerFlagFee(); - if (object.power_flag !== undefined && object.power_flag !== null) { - message.powerFlag = object.power_flag; - } - message.fee = object.fee?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: PowerFlagFee): PowerFlagFeeAmino { - const obj: any = {}; - obj.power_flag = message.powerFlag === '' ? undefined : message.powerFlag; - if (message.fee) { - obj.fee = message.fee.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.fee = message.fee; - } - return obj; - }, - fromAminoMsg(object: PowerFlagFeeAminoMsg): PowerFlagFee { - return PowerFlagFee.fromAmino(object.value); - }, fromProtoMsg(message: PowerFlagFeeProtoMsg): PowerFlagFee { return PowerFlagFee.decode(message.value); }, @@ -1126,25 +805,6 @@ export const QueueSize = { message.size = object.size ?? 0; return message; }, - fromAmino(object: QueueSizeAmino): QueueSize { - const message = createBaseQueueSize(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.size !== undefined && object.size !== null) { - message.size = object.size; - } - return message; - }, - toAmino(message: QueueSize): QueueSizeAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.size = message.size === 0 ? undefined : message.size; - return obj; - }, - fromAminoMsg(object: QueueSizeAminoMsg): QueueSize { - return QueueSize.fromAmino(object.value); - }, fromProtoMsg(message: QueueSizeProtoMsg): QueueSize { return QueueSize.decode(message.value); }, @@ -1238,31 +898,6 @@ export const Egress = { message.powerFlags = object.powerFlags?.map(e => e) || []; return message; }, - fromAmino(object: EgressAmino): Egress { - const message = createBaseEgress(); - if (object.nickname !== undefined && object.nickname !== null) { - message.nickname = object.nickname; - } - if (object.peer !== undefined && object.peer !== null) { - message.peer = bytesFromBase64(object.peer); - } - message.powerFlags = object.power_flags?.map(e => e) || []; - return message; - }, - toAmino(message: Egress): EgressAmino { - const obj: any = {}; - obj.nickname = message.nickname ?? ''; - obj.peer = message.peer ? base64FromBytes(message.peer) : ''; - if (message.powerFlags) { - obj.power_flags = message.powerFlags.map(e => e); - } else { - obj.power_flags = message.powerFlags; - } - return obj; - }, - fromAminoMsg(object: EgressAminoMsg): Egress { - return Egress.fromAmino(object.value); - }, fromProtoMsg(message: EgressProtoMsg): Egress { return Egress.decode(message.value); }, @@ -1343,25 +978,6 @@ export const SwingStoreArtifact = { message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: SwingStoreArtifactAmino): SwingStoreArtifact { - const message = createBaseSwingStoreArtifact(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - toAmino(message: SwingStoreArtifact): SwingStoreArtifactAmino { - const obj: any = {}; - obj.name = message.name ?? ''; - obj.data = message.data ? base64FromBytes(message.data) : ''; - return obj; - }, - fromAminoMsg(object: SwingStoreArtifactAminoMsg): SwingStoreArtifact { - return SwingStoreArtifact.fromAmino(object.value); - }, fromProtoMsg(message: SwingStoreArtifactProtoMsg): SwingStoreArtifact { return SwingStoreArtifact.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vbank/genesis.ts b/packages/cosmic-proto/src/codegen/agoric/vbank/genesis.ts index 2c066bb722e..70a86e0716e 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vbank/genesis.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vbank/genesis.ts @@ -1,12 +1,5 @@ //@ts-nocheck -import { - Params, - ParamsAmino, - ParamsSDKType, - State, - StateAmino, - StateSDKType, -} from './vbank.js'; +import { Params, ParamsSDKType, State, StateSDKType } from './vbank.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** The initial and exported module state. */ @@ -21,17 +14,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** The initial and exported module state. */ -export interface GenesisStateAmino { - /** parms defines all the parameters of the module. */ - params?: ParamsAmino; - /** state is the current operation state. */ - state?: StateAmino; -} -export interface GenesisStateAminoMsg { - type: '/agoric.vbank.GenesisState'; - value: GenesisStateAmino; -} -/** The initial and exported module state. */ export interface GenesisStateSDKType { params: ParamsSDKType; state: StateSDKType; @@ -103,25 +85,6 @@ export const GenesisState = { : undefined; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - if (object.state !== undefined && object.state !== null) { - message.state = State.fromAmino(object.state); - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.state = message.state ? State.toAmino(message.state) : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vbank/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/agoric/vbank/query.rpc.Query.ts deleted file mode 100644 index 730360b9661..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/vbank/query.rpc.Query.ts +++ /dev/null @@ -1,51 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../helpers.js'; -import { BinaryReader } from '../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryParamsRequest, - QueryParamsResponse, - QueryStateRequest, - QueryStateResponse, -} from './query.js'; -/** Query defines the gRPC querier service for vbank module. */ -export interface Query { - /** Params queries params of the vbank module. */ - params(request?: QueryParamsRequest): Promise; - /** State queries current state of the vbank module. */ - state(request?: QueryStateRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.params = this.params.bind(this); - this.state = this.state.bind(this); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.vbank.Query', 'Params', data); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - state(request: QueryStateRequest = {}): Promise { - const data = QueryStateRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.vbank.Query', 'State', data); - return promise.then(data => - QueryStateResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - state(request?: QueryStateRequest): Promise { - return queryService.state(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/vbank/query.ts b/packages/cosmic-proto/src/codegen/agoric/vbank/query.ts index cb84b32bb14..6d596960176 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vbank/query.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vbank/query.ts @@ -1,12 +1,5 @@ //@ts-nocheck -import { - Params, - ParamsAmino, - ParamsSDKType, - State, - StateAmino, - StateSDKType, -} from './vbank.js'; +import { Params, ParamsSDKType, State, StateSDKType } from './vbank.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ @@ -16,12 +9,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: '/agoric.vbank.QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -33,15 +20,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params defines the parameters of the module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: '/agoric.vbank.QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -52,12 +30,6 @@ export interface QueryStateRequestProtoMsg { value: Uint8Array; } /** QueryStateRequest is the request type for the Query/State RPC method. */ -export interface QueryStateRequestAmino {} -export interface QueryStateRequestAminoMsg { - type: '/agoric.vbank.QueryStateRequest'; - value: QueryStateRequestAmino; -} -/** QueryStateRequest is the request type for the Query/State RPC method. */ export interface QueryStateRequestSDKType {} /** QueryStateResponse is the response type for the Query/State RPC method. */ export interface QueryStateResponse { @@ -69,15 +41,6 @@ export interface QueryStateResponseProtoMsg { value: Uint8Array; } /** QueryStateResponse is the response type for the Query/State RPC method. */ -export interface QueryStateResponseAmino { - /** state defines the parameters of the module. */ - state?: StateAmino; -} -export interface QueryStateResponseAminoMsg { - type: '/agoric.vbank.QueryStateResponse'; - value: QueryStateResponseAmino; -} -/** QueryStateResponse is the response type for the Query/State RPC method. */ export interface QueryStateResponseSDKType { state: StateSDKType; } @@ -121,17 +84,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -201,21 +153,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -266,17 +203,6 @@ export const QueryStateRequest = { const message = createBaseQueryStateRequest(); return message; }, - fromAmino(_: QueryStateRequestAmino): QueryStateRequest { - const message = createBaseQueryStateRequest(); - return message; - }, - toAmino(_: QueryStateRequest): QueryStateRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryStateRequestAminoMsg): QueryStateRequest { - return QueryStateRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryStateRequestProtoMsg): QueryStateRequest { return QueryStateRequest.decode(message.value); }, @@ -346,21 +272,6 @@ export const QueryStateResponse = { : undefined; return message; }, - fromAmino(object: QueryStateResponseAmino): QueryStateResponse { - const message = createBaseQueryStateResponse(); - if (object.state !== undefined && object.state !== null) { - message.state = State.fromAmino(object.state); - } - return message; - }, - toAmino(message: QueryStateResponse): QueryStateResponseAmino { - const obj: any = {}; - obj.state = message.state ? State.toAmino(message.state) : undefined; - return obj; - }, - fromAminoMsg(object: QueryStateResponseAminoMsg): QueryStateResponse { - return QueryStateResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryStateResponseProtoMsg): QueryStateResponse { return QueryStateResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts b/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts index 1d571c9d0ea..47f4f231be6 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - Coin, - CoinAmino, - CoinSDKType, -} from '../../cosmos/base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../cosmos/base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { Decimal } from '@cosmjs/math'; import { isSet } from '../../helpers.js'; @@ -33,31 +29,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** The module governance/configuration parameters. */ -export interface ParamsAmino { - /** - * reward_epoch_duration_blocks is the length of a reward epoch, in blocks. - * A value of zero has the same meaning as a value of one: - * the full reward buffer should be distributed immediately. - */ - reward_epoch_duration_blocks?: string; - /** - * per_epoch_reward_fraction is a fraction of the reward pool to distrubute - * once every reward epoch. If less than zero, use approximately continuous - * per-block distribution. - */ - per_epoch_reward_fraction?: string; - /** - * reward_smoothing_blocks is the number of blocks over which to distribute - * an epoch's rewards. If zero, use the same value as - * reward_epoch_duration_blocks. - */ - reward_smoothing_blocks?: string; -} -export interface ParamsAminoMsg { - type: '/agoric.vbank.Params'; - value: ParamsAmino; -} -/** The module governance/configuration parameters. */ export interface ParamsSDKType { reward_epoch_duration_blocks: bigint; per_epoch_reward_fraction: string; @@ -85,27 +56,6 @@ export interface StateProtoMsg { value: Uint8Array; } /** The current state of the module. */ -export interface StateAmino { - /** - * rewardPool is the current balance of rewards in the module account. - * NOTE: Tracking manually since there is no bank call for getting a - * module account balance by name. - */ - reward_pool?: CoinAmino[]; - /** - * reward_block_amount is the amount of reward, if available, to send to the - * fee collector module on every block. - */ - reward_block_amount?: CoinAmino[]; - /** last_sequence is a sequence number for communicating with the VM. */ - last_sequence?: string; - last_reward_distribution_block?: string; -} -export interface StateAminoMsg { - type: '/agoric.vbank.State'; - value: StateAmino; -} -/** The current state of the module. */ export interface StateSDKType { reward_pool: CoinSDKType[]; reward_block_amount: CoinSDKType[]; @@ -209,49 +159,6 @@ export const Params = { : BigInt(0); return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - if ( - object.reward_epoch_duration_blocks !== undefined && - object.reward_epoch_duration_blocks !== null - ) { - message.rewardEpochDurationBlocks = BigInt( - object.reward_epoch_duration_blocks, - ); - } - if ( - object.per_epoch_reward_fraction !== undefined && - object.per_epoch_reward_fraction !== null - ) { - message.perEpochRewardFraction = object.per_epoch_reward_fraction; - } - if ( - object.reward_smoothing_blocks !== undefined && - object.reward_smoothing_blocks !== null - ) { - message.rewardSmoothingBlocks = BigInt(object.reward_smoothing_blocks); - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.reward_epoch_duration_blocks = - message.rewardEpochDurationBlocks !== BigInt(0) - ? message.rewardEpochDurationBlocks.toString() - : undefined; - obj.per_epoch_reward_fraction = - message.perEpochRewardFraction === '' - ? undefined - : message.perEpochRewardFraction; - obj.reward_smoothing_blocks = - message.rewardSmoothingBlocks !== BigInt(0) - ? message.rewardSmoothingBlocks.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, @@ -376,53 +283,6 @@ export const State = { : BigInt(0); return message; }, - fromAmino(object: StateAmino): State { - const message = createBaseState(); - message.rewardPool = object.reward_pool?.map(e => Coin.fromAmino(e)) || []; - message.rewardBlockAmount = - object.reward_block_amount?.map(e => Coin.fromAmino(e)) || []; - if (object.last_sequence !== undefined && object.last_sequence !== null) { - message.lastSequence = BigInt(object.last_sequence); - } - if ( - object.last_reward_distribution_block !== undefined && - object.last_reward_distribution_block !== null - ) { - message.lastRewardDistributionBlock = BigInt( - object.last_reward_distribution_block, - ); - } - return message; - }, - toAmino(message: State): StateAmino { - const obj: any = {}; - if (message.rewardPool) { - obj.reward_pool = message.rewardPool.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.reward_pool = message.rewardPool; - } - if (message.rewardBlockAmount) { - obj.reward_block_amount = message.rewardBlockAmount.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.reward_block_amount = message.rewardBlockAmount; - } - obj.last_sequence = - message.lastSequence !== BigInt(0) - ? message.lastSequence.toString() - : undefined; - obj.last_reward_distribution_block = - message.lastRewardDistributionBlock !== BigInt(0) - ? message.lastRewardDistributionBlock.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: StateAminoMsg): State { - return State.fromAmino(object.value); - }, fromProtoMsg(message: StateProtoMsg): State { return State.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.amino.ts b/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.amino.ts deleted file mode 100644 index 75219fc4e4d..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.amino.ts +++ /dev/null @@ -1,9 +0,0 @@ -//@ts-nocheck -import { MsgSendPacket } from './msgs.js'; -export const AminoConverter = { - '/agoric.vibc.MsgSendPacket': { - aminoType: '/agoric.vibc.MsgSendPacket', - toAmino: MsgSendPacket.toAmino, - fromAmino: MsgSendPacket.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.registry.ts b/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.registry.ts deleted file mode 100644 index 95dfa18472f..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.registry.ts +++ /dev/null @@ -1,53 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { MsgSendPacket } from './msgs.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/agoric.vibc.MsgSendPacket', MsgSendPacket], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - sendPacket(value: MsgSendPacket) { - return { - typeUrl: '/agoric.vibc.MsgSendPacket', - value: MsgSendPacket.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - sendPacket(value: MsgSendPacket) { - return { - typeUrl: '/agoric.vibc.MsgSendPacket', - value, - }; - }, - }, - toJSON: { - sendPacket(value: MsgSendPacket) { - return { - typeUrl: '/agoric.vibc.MsgSendPacket', - value: MsgSendPacket.toJSON(value), - }; - }, - }, - fromJSON: { - sendPacket(value: any) { - return { - typeUrl: '/agoric.vibc.MsgSendPacket', - value: MsgSendPacket.fromJSON(value), - }; - }, - }, - fromPartial: { - sendPacket(value: MsgSendPacket) { - return { - typeUrl: '/agoric.vibc.MsgSendPacket', - value: MsgSendPacket.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.rpc.msg.ts b/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.rpc.msg.ts deleted file mode 100644 index 4f82327410f..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.rpc.msg.ts +++ /dev/null @@ -1,23 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../helpers.js'; -import { BinaryReader } from '../../binary.js'; -import { MsgSendPacket, MsgSendPacketResponse } from './msgs.js'; -/** The module transactions. */ -export interface Msg { - /** Force sending an arbitrary packet on a channel. */ - sendPacket(request: MsgSendPacket): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.sendPacket = this.sendPacket.bind(this); - } - sendPacket(request: MsgSendPacket): Promise { - const data = MsgSendPacket.encode(request).finish(); - const promise = this.rpc.request('agoric.vibc.Msg', 'SendPacket', data); - return promise.then(data => - MsgSendPacketResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.ts b/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.ts index 170a22cddf3..399d65ad934 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vibc/msgs.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - Packet, - PacketAmino, - PacketSDKType, -} from '../../ibc/core/channel/v1/channel.js'; +import { Packet, PacketSDKType } from '../../ibc/core/channel/v1/channel.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../helpers.js'; /** MsgSendPacket is an SDK message for sending an outgoing IBC packet */ @@ -16,15 +12,6 @@ export interface MsgSendPacketProtoMsg { value: Uint8Array; } /** MsgSendPacket is an SDK message for sending an outgoing IBC packet */ -export interface MsgSendPacketAmino { - packet: PacketAmino; - sender: string; -} -export interface MsgSendPacketAminoMsg { - type: '/agoric.vibc.MsgSendPacket'; - value: MsgSendPacketAmino; -} -/** MsgSendPacket is an SDK message for sending an outgoing IBC packet */ export interface MsgSendPacketSDKType { packet: PacketSDKType; sender: Uint8Array; @@ -36,12 +23,6 @@ export interface MsgSendPacketResponseProtoMsg { value: Uint8Array; } /** Empty response for SendPacket. */ -export interface MsgSendPacketResponseAmino {} -export interface MsgSendPacketResponseAminoMsg { - type: '/agoric.vibc.MsgSendPacketResponse'; - value: MsgSendPacketResponseAmino; -} -/** Empty response for SendPacket. */ export interface MsgSendPacketResponseSDKType {} function createBaseMsgSendPacket(): MsgSendPacket { return { @@ -111,27 +92,6 @@ export const MsgSendPacket = { message.sender = object.sender ?? new Uint8Array(); return message; }, - fromAmino(object: MsgSendPacketAmino): MsgSendPacket { - const message = createBaseMsgSendPacket(); - if (object.packet !== undefined && object.packet !== null) { - message.packet = Packet.fromAmino(object.packet); - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = bytesFromBase64(object.sender); - } - return message; - }, - toAmino(message: MsgSendPacket): MsgSendPacketAmino { - const obj: any = {}; - obj.packet = message.packet - ? Packet.toAmino(message.packet) - : Packet.toAmino(Packet.fromPartial({})); - obj.sender = message.sender ? base64FromBytes(message.sender) : ''; - return obj; - }, - fromAminoMsg(object: MsgSendPacketAminoMsg): MsgSendPacket { - return MsgSendPacket.fromAmino(object.value); - }, fromProtoMsg(message: MsgSendPacketProtoMsg): MsgSendPacket { return MsgSendPacket.decode(message.value); }, @@ -185,17 +145,6 @@ export const MsgSendPacketResponse = { const message = createBaseMsgSendPacketResponse(); return message; }, - fromAmino(_: MsgSendPacketResponseAmino): MsgSendPacketResponse { - const message = createBaseMsgSendPacketResponse(); - return message; - }, - toAmino(_: MsgSendPacketResponse): MsgSendPacketResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgSendPacketResponseAminoMsg): MsgSendPacketResponse { - return MsgSendPacketResponse.fromAmino(object.value); - }, fromProtoMsg(message: MsgSendPacketResponseProtoMsg): MsgSendPacketResponse { return MsgSendPacketResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vlocalchain/vlocalchain.ts b/packages/cosmic-proto/src/codegen/agoric/vlocalchain/vlocalchain.ts index 4d6c9afb597..e76371d9791 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vlocalchain/vlocalchain.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vlocalchain/vlocalchain.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** @@ -13,17 +13,6 @@ export interface CosmosTxProtoMsg { typeUrl: '/agoric.vlocalchain.CosmosTx'; value: Uint8Array; } -/** - * CosmosTx contains a list of sdk.Msg's. It should be used when sending - * transactions to a local chain. - */ -export interface CosmosTxAmino { - messages?: AnyAmino[]; -} -export interface CosmosTxAminoMsg { - type: '/agoric.vlocalchain.CosmosTx'; - value: CosmosTxAmino; -} /** * CosmosTx contains a list of sdk.Msg's. It should be used when sending * transactions to a local chain. @@ -42,16 +31,6 @@ export interface QueryRequestProtoMsg { value: Uint8Array; } /** QueryRequest is used internally to describe a query for the local chain. */ -export interface QueryRequestAmino { - full_method?: string; - request?: AnyAmino; - reply_type?: string; -} -export interface QueryRequestAminoMsg { - type: '/agoric.vlocalchain.QueryRequest'; - value: QueryRequestAmino; -} -/** QueryRequest is used internally to describe a query for the local chain. */ export interface QueryRequestSDKType { full_method: string; request?: AnySDKType; @@ -68,16 +47,6 @@ export interface QueryResponseProtoMsg { value: Uint8Array; } /** QueryResponse is used internally to describe a response from the local chain. */ -export interface QueryResponseAmino { - height?: string; - reply?: AnyAmino; - error?: string; -} -export interface QueryResponseAminoMsg { - type: '/agoric.vlocalchain.QueryResponse'; - value: QueryResponseAmino; -} -/** QueryResponse is used internally to describe a response from the local chain. */ export interface QueryResponseSDKType { height: bigint; reply?: AnySDKType; @@ -92,14 +61,6 @@ export interface QueryResponsesProtoMsg { value: Uint8Array; } /** QueryResponses is used to group multiple QueryResponse messages. */ -export interface QueryResponsesAmino { - responses?: QueryResponseAmino[]; -} -export interface QueryResponsesAminoMsg { - type: '/agoric.vlocalchain.QueryResponses'; - value: QueryResponsesAmino; -} -/** QueryResponses is used to group multiple QueryResponse messages. */ export interface QueryResponsesSDKType { responses: QueryResponseSDKType[]; } @@ -158,25 +119,6 @@ export const CosmosTx = { message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: CosmosTxAmino): CosmosTx { - const message = createBaseCosmosTx(); - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: CosmosTx): CosmosTxAmino { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - return obj; - }, - fromAminoMsg(object: CosmosTxAminoMsg): CosmosTx { - return CosmosTx.fromAmino(object.value); - }, fromProtoMsg(message: CosmosTxProtoMsg): CosmosTx { return CosmosTx.decode(message.value); }, @@ -263,30 +205,6 @@ export const QueryRequest = { message.replyType = object.replyType ?? ''; return message; }, - fromAmino(object: QueryRequestAmino): QueryRequest { - const message = createBaseQueryRequest(); - if (object.full_method !== undefined && object.full_method !== null) { - message.fullMethod = object.full_method; - } - if (object.request !== undefined && object.request !== null) { - message.request = Any.fromAmino(object.request); - } - if (object.reply_type !== undefined && object.reply_type !== null) { - message.replyType = object.reply_type; - } - return message; - }, - toAmino(message: QueryRequest): QueryRequestAmino { - const obj: any = {}; - obj.full_method = - message.fullMethod === '' ? undefined : message.fullMethod; - obj.request = message.request ? Any.toAmino(message.request) : undefined; - obj.reply_type = message.replyType === '' ? undefined : message.replyType; - return obj; - }, - fromAminoMsg(object: QueryRequestAminoMsg): QueryRequest { - return QueryRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryRequestProtoMsg): QueryRequest { return QueryRequest.decode(message.value); }, @@ -379,30 +297,6 @@ export const QueryResponse = { message.error = object.error ?? ''; return message; }, - fromAmino(object: QueryResponseAmino): QueryResponse { - const message = createBaseQueryResponse(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.reply !== undefined && object.reply !== null) { - message.reply = Any.fromAmino(object.reply); - } - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } - return message; - }, - toAmino(message: QueryResponse): QueryResponseAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.reply = message.reply ? Any.toAmino(message.reply) : undefined; - obj.error = message.error === '' ? undefined : message.error; - return obj; - }, - fromAminoMsg(object: QueryResponseAminoMsg): QueryResponse { - return QueryResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryResponseProtoMsg): QueryResponse { return QueryResponse.decode(message.value); }, @@ -474,26 +368,6 @@ export const QueryResponses = { object.responses?.map(e => QueryResponse.fromPartial(e)) || []; return message; }, - fromAmino(object: QueryResponsesAmino): QueryResponses { - const message = createBaseQueryResponses(); - message.responses = - object.responses?.map(e => QueryResponse.fromAmino(e)) || []; - return message; - }, - toAmino(message: QueryResponses): QueryResponsesAmino { - const obj: any = {}; - if (message.responses) { - obj.responses = message.responses.map(e => - e ? QueryResponse.toAmino(e) : undefined, - ); - } else { - obj.responses = message.responses; - } - return obj; - }, - fromAminoMsg(object: QueryResponsesAminoMsg): QueryResponses { - return QueryResponses.fromAmino(object.value); - }, fromProtoMsg(message: QueryResponsesProtoMsg): QueryResponses { return QueryResponses.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vstorage/genesis.ts b/packages/cosmic-proto/src/codegen/agoric/vstorage/genesis.ts index 9e3d62fb17e..52cb1bfa8a6 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vstorage/genesis.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vstorage/genesis.ts @@ -10,14 +10,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** The initial or exported state. */ -export interface GenesisStateAmino { - data: DataEntryAmino[]; -} -export interface GenesisStateAminoMsg { - type: '/agoric.vstorage.GenesisState'; - value: GenesisStateAmino; -} -/** The initial or exported state. */ export interface GenesisStateSDKType { data: DataEntrySDKType[]; } @@ -37,22 +29,6 @@ export interface DataEntryProtoMsg { typeUrl: '/agoric.vstorage.DataEntry'; value: Uint8Array; } -/** - * A vstorage entry. The only necessary entries are those with data, as the - * ancestor nodes are reconstructed on import. - */ -export interface DataEntryAmino { - /** - * A "."-separated path with individual path elements matching - * `[-_A-Za-z0-9]+` - */ - path?: string; - value?: string; -} -export interface DataEntryAminoMsg { - type: '/agoric.vstorage.DataEntry'; - value: DataEntryAmino; -} /** * A vstorage entry. The only necessary entries are those with data, as the * ancestor nodes are reconstructed on import. @@ -116,23 +92,6 @@ export const GenesisState = { message.data = object.data?.map(e => DataEntry.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - message.data = object.data?.map(e => DataEntry.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - if (message.data) { - obj.data = message.data.map(e => (e ? DataEntry.toAmino(e) : undefined)); - } else { - obj.data = message.data; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, @@ -205,25 +164,6 @@ export const DataEntry = { message.value = object.value ?? ''; return message; }, - fromAmino(object: DataEntryAmino): DataEntry { - const message = createBaseDataEntry(); - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: DataEntry): DataEntryAmino { - const obj: any = {}; - obj.path = message.path === '' ? undefined : message.path; - obj.value = message.value === '' ? undefined : message.value; - return obj; - }, - fromAminoMsg(object: DataEntryAminoMsg): DataEntry { - return DataEntry.fromAmino(object.value); - }, fromProtoMsg(message: DataEntryProtoMsg): DataEntry { return DataEntry.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vstorage/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/agoric/vstorage/query.rpc.Query.ts deleted file mode 100644 index 0b37969c04d..00000000000 --- a/packages/cosmic-proto/src/codegen/agoric/vstorage/query.rpc.Query.ts +++ /dev/null @@ -1,69 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../helpers.js'; -import { BinaryReader } from '../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryDataRequest, - QueryDataResponse, - QueryCapDataRequest, - QueryCapDataResponse, - QueryChildrenRequest, - QueryChildrenResponse, -} from './query.js'; -/** Query defines the gRPC querier service */ -export interface Query { - /** Return the raw string value of an arbitrary vstorage datum. */ - data(request: QueryDataRequest): Promise; - /** - * Return a formatted representation of a vstorage datum that must be - * a valid StreamCell with CapData values, or standalone CapData. - */ - capData(request: QueryCapDataRequest): Promise; - /** Return the children of a given vstorage path. */ - children(request: QueryChildrenRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.data = this.data.bind(this); - this.capData = this.capData.bind(this); - this.children = this.children.bind(this); - } - data(request: QueryDataRequest): Promise { - const data = QueryDataRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.vstorage.Query', 'Data', data); - return promise.then(data => - QueryDataResponse.decode(new BinaryReader(data)), - ); - } - capData(request: QueryCapDataRequest): Promise { - const data = QueryCapDataRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.vstorage.Query', 'CapData', data); - return promise.then(data => - QueryCapDataResponse.decode(new BinaryReader(data)), - ); - } - children(request: QueryChildrenRequest): Promise { - const data = QueryChildrenRequest.encode(request).finish(); - const promise = this.rpc.request('agoric.vstorage.Query', 'Children', data); - return promise.then(data => - QueryChildrenResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - data(request: QueryDataRequest): Promise { - return queryService.data(request); - }, - capData(request: QueryCapDataRequest): Promise { - return queryService.capData(request); - }, - children(request: QueryChildrenRequest): Promise { - return queryService.children(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/agoric/vstorage/query.ts b/packages/cosmic-proto/src/codegen/agoric/vstorage/query.ts index eff7d75507d..4e087a38bc1 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vstorage/query.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vstorage/query.ts @@ -1,10 +1,8 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../cosmos/base/query/v1beta1/pagination.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; @@ -18,14 +16,6 @@ export interface QueryDataRequestProtoMsg { value: Uint8Array; } /** QueryDataRequest is the vstorage path data query. */ -export interface QueryDataRequestAmino { - path: string; -} -export interface QueryDataRequestAminoMsg { - type: '/agoric.vstorage.QueryDataRequest'; - value: QueryDataRequestAmino; -} -/** QueryDataRequest is the vstorage path data query. */ export interface QueryDataRequestSDKType { path: string; } @@ -38,14 +28,6 @@ export interface QueryDataResponseProtoMsg { value: Uint8Array; } /** QueryDataResponse is the vstorage path data response. */ -export interface QueryDataResponseAmino { - value: string; -} -export interface QueryDataResponseAminoMsg { - type: '/agoric.vstorage.QueryDataResponse'; - value: QueryDataResponseAmino; -} -/** QueryDataResponse is the vstorage path data response. */ export interface QueryDataResponseSDKType { value: string; } @@ -79,35 +61,6 @@ export interface QueryCapDataRequestProtoMsg { value: Uint8Array; } /** QueryCapDataRequest contains a path and formatting configuration. */ -export interface QueryCapDataRequestAmino { - path: string; - /** - * mediaType must be an actual media type in the registry at - * https://www.iana.org/assignments/media-types/media-types.xhtml - * or a special value that does not conflict with the media type syntax. - * The only valid value is "JSON Lines", which is also the default. - */ - media_type: string; - /** - * itemFormat, if present, must be the special value "flat" to indicate that - * the deep structure of each item should be flattened into a single level - * with kebab-case keys (e.g., `{ "metrics": { "min": 0, "max": 88 } }` as - * `{ "metrics-min": 0, "metrics-max": 88 }`). - */ - item_format: string; - /** - * remotableValueFormat indicates how to transform references to opaque but - * distinguishable Remotables into readable embedded representations. - * * "object" represents each Remotable as an `{ id, allegedName }` object, e.g. `{ "id": "board007", "allegedName": "IST brand" }`. - * * "string" represents each Remotable as a string with bracket-wrapped contents including its alleged name and id, e.g. "[Alleged: IST brand ]". - */ - remotable_value_format: string; -} -export interface QueryCapDataRequestAminoMsg { - type: '/agoric.vstorage.QueryCapDataRequest'; - value: QueryCapDataRequestAmino; -} -/** QueryCapDataRequest contains a path and formatting configuration. */ export interface QueryCapDataRequestSDKType { path: string; media_type: string; @@ -126,18 +79,6 @@ export interface QueryCapDataResponseProtoMsg { typeUrl: '/agoric.vstorage.QueryCapDataResponse'; value: Uint8Array; } -/** - * QueryCapDataResponse represents the result with the requested formatting, - * reserving space for future metadata such as media type. - */ -export interface QueryCapDataResponseAmino { - block_height: string; - value: string; -} -export interface QueryCapDataResponseAminoMsg { - type: '/agoric.vstorage.QueryCapDataResponse'; - value: QueryCapDataResponseAmino; -} /** * QueryCapDataResponse represents the result with the requested formatting, * reserving space for future metadata such as media type. @@ -156,15 +97,6 @@ export interface QueryChildrenRequestProtoMsg { value: Uint8Array; } /** QueryChildrenRequest is the vstorage path children query. */ -export interface QueryChildrenRequestAmino { - path: string; - pagination?: PageRequestAmino; -} -export interface QueryChildrenRequestAminoMsg { - type: '/agoric.vstorage.QueryChildrenRequest'; - value: QueryChildrenRequestAmino; -} -/** QueryChildrenRequest is the vstorage path children query. */ export interface QueryChildrenRequestSDKType { path: string; pagination?: PageRequestSDKType; @@ -179,15 +111,6 @@ export interface QueryChildrenResponseProtoMsg { value: Uint8Array; } /** QueryChildrenResponse is the vstorage path children response. */ -export interface QueryChildrenResponseAmino { - children: string[]; - pagination?: PageResponseAmino; -} -export interface QueryChildrenResponseAminoMsg { - type: '/agoric.vstorage.QueryChildrenResponse'; - value: QueryChildrenResponseAmino; -} -/** QueryChildrenResponse is the vstorage path children response. */ export interface QueryChildrenResponseSDKType { children: string[]; pagination?: PageResponseSDKType; @@ -241,21 +164,6 @@ export const QueryDataRequest = { message.path = object.path ?? ''; return message; }, - fromAmino(object: QueryDataRequestAmino): QueryDataRequest { - const message = createBaseQueryDataRequest(); - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - return message; - }, - toAmino(message: QueryDataRequest): QueryDataRequestAmino { - const obj: any = {}; - obj.path = message.path ?? ''; - return obj; - }, - fromAminoMsg(object: QueryDataRequestAminoMsg): QueryDataRequest { - return QueryDataRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryDataRequestProtoMsg): QueryDataRequest { return QueryDataRequest.decode(message.value); }, @@ -318,21 +226,6 @@ export const QueryDataResponse = { message.value = object.value ?? ''; return message; }, - fromAmino(object: QueryDataResponseAmino): QueryDataResponse { - const message = createBaseQueryDataResponse(); - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: QueryDataResponse): QueryDataResponseAmino { - const obj: any = {}; - obj.value = message.value ?? ''; - return obj; - }, - fromAminoMsg(object: QueryDataResponseAminoMsg): QueryDataResponse { - return QueryDataResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryDataResponseProtoMsg): QueryDataResponse { return QueryDataResponse.decode(message.value); }, @@ -431,36 +324,6 @@ export const QueryCapDataRequest = { message.remotableValueFormat = object.remotableValueFormat ?? ''; return message; }, - fromAmino(object: QueryCapDataRequestAmino): QueryCapDataRequest { - const message = createBaseQueryCapDataRequest(); - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - if (object.media_type !== undefined && object.media_type !== null) { - message.mediaType = object.media_type; - } - if (object.item_format !== undefined && object.item_format !== null) { - message.itemFormat = object.item_format; - } - if ( - object.remotable_value_format !== undefined && - object.remotable_value_format !== null - ) { - message.remotableValueFormat = object.remotable_value_format; - } - return message; - }, - toAmino(message: QueryCapDataRequest): QueryCapDataRequestAmino { - const obj: any = {}; - obj.path = message.path ?? ''; - obj.media_type = message.mediaType ?? ''; - obj.item_format = message.itemFormat ?? ''; - obj.remotable_value_format = message.remotableValueFormat ?? ''; - return obj; - }, - fromAminoMsg(object: QueryCapDataRequestAminoMsg): QueryCapDataRequest { - return QueryCapDataRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryCapDataRequestProtoMsg): QueryCapDataRequest { return QueryCapDataRequest.decode(message.value); }, @@ -537,25 +400,6 @@ export const QueryCapDataResponse = { message.value = object.value ?? ''; return message; }, - fromAmino(object: QueryCapDataResponseAmino): QueryCapDataResponse { - const message = createBaseQueryCapDataResponse(); - if (object.block_height !== undefined && object.block_height !== null) { - message.blockHeight = object.block_height; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: QueryCapDataResponse): QueryCapDataResponseAmino { - const obj: any = {}; - obj.block_height = message.blockHeight ?? ''; - obj.value = message.value ?? ''; - return obj; - }, - fromAminoMsg(object: QueryCapDataResponseAminoMsg): QueryCapDataResponse { - return QueryCapDataResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryCapDataResponseProtoMsg): QueryCapDataResponse { return QueryCapDataResponse.decode(message.value); }, @@ -639,27 +483,6 @@ export const QueryChildrenRequest = { : undefined; return message; }, - fromAmino(object: QueryChildrenRequestAmino): QueryChildrenRequest { - const message = createBaseQueryChildrenRequest(); - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryChildrenRequest): QueryChildrenRequestAmino { - const obj: any = {}; - obj.path = message.path ?? ''; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryChildrenRequestAminoMsg): QueryChildrenRequest { - return QueryChildrenRequest.fromAmino(object.value); - }, fromProtoMsg(message: QueryChildrenRequestProtoMsg): QueryChildrenRequest { return QueryChildrenRequest.decode(message.value); }, @@ -752,29 +575,6 @@ export const QueryChildrenResponse = { : undefined; return message; }, - fromAmino(object: QueryChildrenResponseAmino): QueryChildrenResponse { - const message = createBaseQueryChildrenResponse(); - message.children = object.children?.map(e => e) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryChildrenResponse): QueryChildrenResponseAmino { - const obj: any = {}; - if (message.children) { - obj.children = message.children.map(e => e); - } else { - obj.children = message.children; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryChildrenResponseAminoMsg): QueryChildrenResponse { - return QueryChildrenResponse.fromAmino(object.value); - }, fromProtoMsg(message: QueryChildrenResponseProtoMsg): QueryChildrenResponse { return QueryChildrenResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/agoric/vstorage/vstorage.ts b/packages/cosmic-proto/src/codegen/agoric/vstorage/vstorage.ts index a32511936b6..0d88ea11a62 100644 --- a/packages/cosmic-proto/src/codegen/agoric/vstorage/vstorage.ts +++ b/packages/cosmic-proto/src/codegen/agoric/vstorage/vstorage.ts @@ -10,14 +10,6 @@ export interface DataProtoMsg { value: Uint8Array; } /** Data is the vstorage node data. */ -export interface DataAmino { - value: string; -} -export interface DataAminoMsg { - type: '/agoric.vstorage.Data'; - value: DataAmino; -} -/** Data is the vstorage node data. */ export interface DataSDKType { value: string; } @@ -32,17 +24,6 @@ export interface ChildrenProtoMsg { typeUrl: '/agoric.vstorage.Children'; value: Uint8Array; } -/** - * Children are the immediate names (just one level deep) of subnodes leading to - * more data from a given vstorage node. - */ -export interface ChildrenAmino { - children: string[]; -} -export interface ChildrenAminoMsg { - type: '/agoric.vstorage.Children'; - value: ChildrenAmino; -} /** * Children are the immediate names (just one level deep) of subnodes leading to * more data from a given vstorage node. @@ -99,21 +80,6 @@ export const Data = { message.value = object.value ?? ''; return message; }, - fromAmino(object: DataAmino): Data { - const message = createBaseData(); - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: Data): DataAmino { - const obj: any = {}; - obj.value = message.value ?? ''; - return obj; - }, - fromAminoMsg(object: DataAminoMsg): Data { - return Data.fromAmino(object.value); - }, fromProtoMsg(message: DataProtoMsg): Data { return Data.decode(message.value); }, @@ -182,23 +148,6 @@ export const Children = { message.children = object.children?.map(e => e) || []; return message; }, - fromAmino(object: ChildrenAmino): Children { - const message = createBaseChildren(); - message.children = object.children?.map(e => e) || []; - return message; - }, - toAmino(message: Children): ChildrenAmino { - const obj: any = {}; - if (message.children) { - obj.children = message.children.map(e => e); - } else { - obj.children = message.children; - } - return obj; - }, - fromAminoMsg(object: ChildrenAminoMsg): Children { - return Children.fromAmino(object.value); - }, fromProtoMsg(message: ChildrenProtoMsg): Children { return Children.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/auth.ts index cc64302e3d7..2d68ad71c6d 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -18,21 +18,6 @@ export interface BaseAccountProtoMsg { typeUrl: '/cosmos.auth.v1beta1.BaseAccount'; value: Uint8Array; } -/** - * BaseAccount defines a base account type. It contains all the necessary fields - * for basic account functionality. Any custom account type should extend this - * type for additional functionality (e.g. vesting). - */ -export interface BaseAccountAmino { - address?: string; - pub_key?: AnyAmino; - account_number?: string; - sequence?: string; -} -export interface BaseAccountAminoMsg { - type: 'cosmos-sdk/BaseAccount'; - value: BaseAccountAmino; -} /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this @@ -57,16 +42,6 @@ export interface ModuleAccountProtoMsg { value: Uint8Array; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ -export interface ModuleAccountAmino { - base_account?: BaseAccountAmino; - name?: string; - permissions?: string[]; -} -export interface ModuleAccountAminoMsg { - type: 'cosmos-sdk/ModuleAccount'; - value: ModuleAccountAmino; -} -/** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountSDKType { $typeUrl?: '/cosmos.auth.v1beta1.ModuleAccount'; base_account?: BaseAccountSDKType; @@ -86,18 +61,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params defines the parameters for the auth module. */ -export interface ParamsAmino { - max_memo_characters?: string; - tx_sig_limit?: string; - tx_size_cost_per_byte?: string; - sig_verify_cost_ed25519?: string; - sig_verify_cost_secp256k1?: string; -} -export interface ParamsAminoMsg { - type: 'cosmos-sdk/Params'; - value: ParamsAmino; -} -/** Params defines the parameters for the auth module. */ export interface ParamsSDKType { max_memo_characters: bigint; tx_sig_limit: bigint; @@ -201,43 +164,6 @@ export const BaseAccount = { : BigInt(0); return message; }, - fromAmino(object: BaseAccountAmino): BaseAccount { - const message = createBaseBaseAccount(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pubKey = Any.fromAmino(object.pub_key); - } - if (object.account_number !== undefined && object.account_number !== null) { - message.accountNumber = BigInt(object.account_number); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - return message; - }, - toAmino(message: BaseAccount): BaseAccountAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; - obj.account_number = - message.accountNumber !== BigInt(0) - ? message.accountNumber.toString() - : undefined; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - return obj; - }, - fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount { - return BaseAccount.fromAmino(object.value); - }, - toAminoMsg(message: BaseAccount): BaseAccountAminoMsg { - return { - type: 'cosmos-sdk/BaseAccount', - value: BaseAccount.toAmino(message), - }; - }, fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount { return BaseAccount.decode(message.value); }, @@ -338,39 +264,6 @@ export const ModuleAccount = { message.permissions = object.permissions?.map(e => e) || []; return message; }, - fromAmino(object: ModuleAccountAmino): ModuleAccount { - const message = createBaseModuleAccount(); - if (object.base_account !== undefined && object.base_account !== null) { - message.baseAccount = BaseAccount.fromAmino(object.base_account); - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - message.permissions = object.permissions?.map(e => e) || []; - return message; - }, - toAmino(message: ModuleAccount): ModuleAccountAmino { - const obj: any = {}; - obj.base_account = message.baseAccount - ? BaseAccount.toAmino(message.baseAccount) - : undefined; - obj.name = message.name === '' ? undefined : message.name; - if (message.permissions) { - obj.permissions = message.permissions.map(e => e); - } else { - obj.permissions = message.permissions; - } - return obj; - }, - fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount { - return ModuleAccount.fromAmino(object.value); - }, - toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg { - return { - type: 'cosmos-sdk/ModuleAccount', - value: ModuleAccount.toAmino(message), - }; - }, fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount { return ModuleAccount.decode(message.value); }, @@ -515,70 +408,6 @@ export const Params = { : BigInt(0); return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - if ( - object.max_memo_characters !== undefined && - object.max_memo_characters !== null - ) { - message.maxMemoCharacters = BigInt(object.max_memo_characters); - } - if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { - message.txSigLimit = BigInt(object.tx_sig_limit); - } - if ( - object.tx_size_cost_per_byte !== undefined && - object.tx_size_cost_per_byte !== null - ) { - message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); - } - if ( - object.sig_verify_cost_ed25519 !== undefined && - object.sig_verify_cost_ed25519 !== null - ) { - message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); - } - if ( - object.sig_verify_cost_secp256k1 !== undefined && - object.sig_verify_cost_secp256k1 !== null - ) { - message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.max_memo_characters = - message.maxMemoCharacters !== BigInt(0) - ? message.maxMemoCharacters.toString() - : undefined; - obj.tx_sig_limit = - message.txSigLimit !== BigInt(0) - ? message.txSigLimit.toString() - : undefined; - obj.tx_size_cost_per_byte = - message.txSizeCostPerByte !== BigInt(0) - ? message.txSizeCostPerByte.toString() - : undefined; - obj.sig_verify_cost_ed25519 = - message.sigVerifyCostEd25519 !== BigInt(0) - ? message.sigVerifyCostEd25519.toString() - : undefined; - obj.sig_verify_cost_secp256k1 = - message.sigVerifyCostSecp256k1 !== BigInt(0) - ? message.sigVerifyCostSecp256k1.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: 'cosmos-sdk/Params', - value: Params.toAmino(message), - }; - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/genesis.ts index 99bb5e2e859..b6f8ee4690f 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/genesis.ts @@ -1,6 +1,6 @@ //@ts-nocheck -import { Params, ParamsAmino, ParamsSDKType } from './auth.js'; -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Params, ParamsSDKType } from './auth.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** GenesisState defines the auth module's genesis state. */ @@ -15,17 +15,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the auth module's genesis state. */ -export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; - /** accounts are the accounts present at genesis. */ - accounts?: AnyAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the auth module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; accounts: AnySDKType[]; @@ -99,35 +88,6 @@ export const GenesisState = { message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - if (message.accounts) { - obj.accounts = message.accounts.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.accounts = message.accounts; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 65771d27276..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,182 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryAccountsRequest, - QueryAccountsResponse, - QueryAccountRequest, - QueryAccountResponse, - QueryParamsRequest, - QueryParamsResponse, - QueryModuleAccountsRequest, - QueryModuleAccountsResponse, - Bech32PrefixRequest, - Bech32PrefixResponse, - AddressBytesToStringRequest, - AddressBytesToStringResponse, - AddressStringToBytesRequest, - AddressStringToBytesResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Accounts returns all the existing accounts - * - * Since: cosmos-sdk 0.43 - */ - accounts(request?: QueryAccountsRequest): Promise; - /** Account returns account details based on address. */ - account(request: QueryAccountRequest): Promise; - /** Params queries all parameters. */ - params(request?: QueryParamsRequest): Promise; - /** ModuleAccounts returns all the existing module accounts. */ - moduleAccounts( - request?: QueryModuleAccountsRequest, - ): Promise; - /** Bech32 queries bech32Prefix */ - bech32Prefix(request?: Bech32PrefixRequest): Promise; - /** AddressBytesToString converts Account Address bytes to string */ - addressBytesToString( - request: AddressBytesToStringRequest, - ): Promise; - /** AddressStringToBytes converts Address string to bytes */ - addressStringToBytes( - request: AddressStringToBytesRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.accounts = this.accounts.bind(this); - this.account = this.account.bind(this); - this.params = this.params.bind(this); - this.moduleAccounts = this.moduleAccounts.bind(this); - this.bech32Prefix = this.bech32Prefix.bind(this); - this.addressBytesToString = this.addressBytesToString.bind(this); - this.addressStringToBytes = this.addressStringToBytes.bind(this); - } - accounts( - request: QueryAccountsRequest = { - pagination: undefined, - }, - ): Promise { - const data = QueryAccountsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'Accounts', - data, - ); - return promise.then(data => - QueryAccountsResponse.decode(new BinaryReader(data)), - ); - } - account(request: QueryAccountRequest): Promise { - const data = QueryAccountRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'Account', - data, - ); - return promise.then(data => - QueryAccountResponse.decode(new BinaryReader(data)), - ); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - moduleAccounts( - request: QueryModuleAccountsRequest = {}, - ): Promise { - const data = QueryModuleAccountsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'ModuleAccounts', - data, - ); - return promise.then(data => - QueryModuleAccountsResponse.decode(new BinaryReader(data)), - ); - } - bech32Prefix( - request: Bech32PrefixRequest = {}, - ): Promise { - const data = Bech32PrefixRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'Bech32Prefix', - data, - ); - return promise.then(data => - Bech32PrefixResponse.decode(new BinaryReader(data)), - ); - } - addressBytesToString( - request: AddressBytesToStringRequest, - ): Promise { - const data = AddressBytesToStringRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'AddressBytesToString', - data, - ); - return promise.then(data => - AddressBytesToStringResponse.decode(new BinaryReader(data)), - ); - } - addressStringToBytes( - request: AddressStringToBytesRequest, - ): Promise { - const data = AddressStringToBytesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.auth.v1beta1.Query', - 'AddressStringToBytes', - data, - ); - return promise.then(data => - AddressStringToBytesResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - accounts(request?: QueryAccountsRequest): Promise { - return queryService.accounts(request); - }, - account(request: QueryAccountRequest): Promise { - return queryService.account(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - moduleAccounts( - request?: QueryModuleAccountsRequest, - ): Promise { - return queryService.moduleAccounts(request); - }, - bech32Prefix(request?: Bech32PrefixRequest): Promise { - return queryService.bech32Prefix(request); - }, - addressBytesToString( - request: AddressBytesToStringRequest, - ): Promise { - return queryService.addressBytesToString(request); - }, - addressStringToBytes( - request: AddressStringToBytesRequest, - ): Promise { - return queryService.addressStringToBytes(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts index 60df0b723eb..6fbd26bffe1 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts @@ -1,27 +1,17 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { Params, - ParamsAmino, ParamsSDKType, BaseAccount, - BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, - ModuleAccountProtoMsg, ModuleAccountSDKType, } from './auth.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -39,19 +29,6 @@ export interface QueryAccountsRequestProtoMsg { typeUrl: '/cosmos.auth.v1beta1.QueryAccountsRequest'; value: Uint8Array; } -/** - * QueryAccountsRequest is the request type for the Query/Accounts RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryAccountsRequestAmino { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryAccountsRequestAminoMsg { - type: 'cosmos-sdk/QueryAccountsRequest'; - value: QueryAccountsRequestAmino; -} /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -75,30 +52,6 @@ export interface QueryAccountsResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.QueryAccountsResponse'; value: Uint8Array; } -export type QueryAccountsResponseEncoded = Omit< - QueryAccountsResponse, - 'accounts' -> & { - /** accounts are the existing accounts */ accounts: ( - | BaseAccountProtoMsg - | AnyProtoMsg - )[]; -}; -/** - * QueryAccountsResponse is the response type for the Query/Accounts RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryAccountsResponseAmino { - /** accounts are the existing accounts */ - accounts?: AnyAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryAccountsResponseAminoMsg { - type: 'cosmos-sdk/QueryAccountsResponse'; - value: QueryAccountsResponseAmino; -} /** * QueryAccountsResponse is the response type for the Query/Accounts RPC method. * @@ -118,15 +71,6 @@ export interface QueryAccountRequestProtoMsg { value: Uint8Array; } /** QueryAccountRequest is the request type for the Query/Account RPC method. */ -export interface QueryAccountRequestAmino { - /** address defines the address to query for. */ - address?: string; -} -export interface QueryAccountRequestAminoMsg { - type: 'cosmos-sdk/QueryAccountRequest'; - value: QueryAccountRequestAmino; -} -/** QueryAccountRequest is the request type for the Query/Account RPC method. */ export interface QueryAccountRequestSDKType { address: string; } @@ -137,12 +81,6 @@ export interface QueryModuleAccountsRequestProtoMsg { value: Uint8Array; } /** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ -export interface QueryModuleAccountsRequestAmino {} -export interface QueryModuleAccountsRequestAminoMsg { - type: 'cosmos-sdk/QueryModuleAccountsRequest'; - value: QueryModuleAccountsRequestAmino; -} -/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */ export interface QueryModuleAccountsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -154,15 +92,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params defines the parameters of the module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -175,24 +104,6 @@ export interface QueryAccountResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.QueryAccountResponse'; value: Uint8Array; } -export type QueryAccountResponseEncoded = Omit< - QueryAccountResponse, - 'account' -> & { - /** account defines the account of the corresponding address. */ account?: - | BaseAccountProtoMsg - | AnyProtoMsg - | undefined; -}; -/** QueryAccountResponse is the response type for the Query/Account RPC method. */ -export interface QueryAccountResponseAmino { - /** account defines the account of the corresponding address. */ - account?: AnyAmino; -} -export interface QueryAccountResponseAminoMsg { - type: 'cosmos-sdk/QueryAccountResponse'; - value: QueryAccountResponseAmino; -} /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponseSDKType { account?: BaseAccountSDKType | AnySDKType | undefined; @@ -204,12 +115,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ export interface QueryModuleAccountsResponse { @@ -219,20 +124,6 @@ export interface QueryModuleAccountsResponseProtoMsg { typeUrl: '/cosmos.auth.v1beta1.QueryModuleAccountsResponse'; value: Uint8Array; } -export type QueryModuleAccountsResponseEncoded = Omit< - QueryModuleAccountsResponse, - 'accounts' -> & { - accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; -}; -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ -export interface QueryModuleAccountsResponseAmino { - accounts?: AnyAmino[]; -} -export interface QueryModuleAccountsResponseAminoMsg { - type: 'cosmos-sdk/QueryModuleAccountsResponse'; - value: QueryModuleAccountsResponseAmino; -} /** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ export interface QueryModuleAccountsResponseSDKType { accounts: (ModuleAccountSDKType | AnySDKType)[]; @@ -244,12 +135,6 @@ export interface Bech32PrefixRequestProtoMsg { value: Uint8Array; } /** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ -export interface Bech32PrefixRequestAmino {} -export interface Bech32PrefixRequestAminoMsg { - type: 'cosmos-sdk/Bech32PrefixRequest'; - value: Bech32PrefixRequestAmino; -} -/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */ export interface Bech32PrefixRequestSDKType {} /** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ export interface Bech32PrefixResponse { @@ -260,14 +145,6 @@ export interface Bech32PrefixResponseProtoMsg { value: Uint8Array; } /** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ -export interface Bech32PrefixResponseAmino { - bech32_prefix?: string; -} -export interface Bech32PrefixResponseAminoMsg { - type: 'cosmos-sdk/Bech32PrefixResponse'; - value: Bech32PrefixResponseAmino; -} -/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */ export interface Bech32PrefixResponseSDKType { bech32_prefix: string; } @@ -280,14 +157,6 @@ export interface AddressBytesToStringRequestProtoMsg { value: Uint8Array; } /** AddressBytesToStringRequest is the request type for AddressString rpc method */ -export interface AddressBytesToStringRequestAmino { - address_bytes?: string; -} -export interface AddressBytesToStringRequestAminoMsg { - type: 'cosmos-sdk/AddressBytesToStringRequest'; - value: AddressBytesToStringRequestAmino; -} -/** AddressBytesToStringRequest is the request type for AddressString rpc method */ export interface AddressBytesToStringRequestSDKType { address_bytes: Uint8Array; } @@ -300,14 +169,6 @@ export interface AddressBytesToStringResponseProtoMsg { value: Uint8Array; } /** AddressBytesToStringResponse is the response type for AddressString rpc method */ -export interface AddressBytesToStringResponseAmino { - address_string?: string; -} -export interface AddressBytesToStringResponseAminoMsg { - type: 'cosmos-sdk/AddressBytesToStringResponse'; - value: AddressBytesToStringResponseAmino; -} -/** AddressBytesToStringResponse is the response type for AddressString rpc method */ export interface AddressBytesToStringResponseSDKType { address_string: string; } @@ -320,14 +181,6 @@ export interface AddressStringToBytesRequestProtoMsg { value: Uint8Array; } /** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ -export interface AddressStringToBytesRequestAmino { - address_string?: string; -} -export interface AddressStringToBytesRequestAminoMsg { - type: 'cosmos-sdk/AddressStringToBytesRequest'; - value: AddressStringToBytesRequestAmino; -} -/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */ export interface AddressStringToBytesRequestSDKType { address_string: string; } @@ -340,14 +193,6 @@ export interface AddressStringToBytesResponseProtoMsg { value: Uint8Array; } /** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ -export interface AddressStringToBytesResponseAmino { - address_bytes?: string; -} -export interface AddressStringToBytesResponseAminoMsg { - type: 'cosmos-sdk/AddressStringToBytesResponse'; - value: AddressStringToBytesResponseAmino; -} -/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */ export interface AddressStringToBytesResponseSDKType { address_bytes: Uint8Array; } @@ -411,29 +256,6 @@ export const QueryAccountsRequest = { : undefined; return message; }, - fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest { - const message = createBaseQueryAccountsRequest(); - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino { - const obj: any = {}; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryAccountsRequestAminoMsg): QueryAccountsRequest { - return QueryAccountsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryAccountsRequest): QueryAccountsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAccountsRequest', - value: QueryAccountsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryAccountsRequestProtoMsg): QueryAccountsRequest { return QueryAccountsRequest.decode(message.value); }, @@ -526,38 +348,6 @@ export const QueryAccountsResponse = { : undefined; return message; }, - fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { - const message = createBaseQueryAccountsResponse(); - message.accounts = - object.accounts?.map(e => Cosmos_authAccountI_FromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => - e ? Cosmos_authAccountI_ToAmino(e as Any) : undefined, - ); - } else { - obj.accounts = message.accounts; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse { - return QueryAccountsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAccountsResponse', - value: QueryAccountsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse { return QueryAccountsResponse.decode(message.value); }, @@ -623,27 +413,6 @@ export const QueryAccountRequest = { message.address = object.address ?? ''; return message; }, - fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { - const message = createBaseQueryAccountRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest { - return QueryAccountRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryAccountRequest): QueryAccountRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAccountRequest', - value: QueryAccountRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryAccountRequestProtoMsg): QueryAccountRequest { return QueryAccountRequest.decode(message.value); }, @@ -699,27 +468,6 @@ export const QueryModuleAccountsRequest = { const message = createBaseQueryModuleAccountsRequest(); return message; }, - fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { - const message = createBaseQueryModuleAccountsRequest(); - return message; - }, - toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: QueryModuleAccountsRequestAminoMsg, - ): QueryModuleAccountsRequest { - return QueryModuleAccountsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryModuleAccountsRequest, - ): QueryModuleAccountsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryModuleAccountsRequest', - value: QueryModuleAccountsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryModuleAccountsRequestProtoMsg, ): QueryModuleAccountsRequest { @@ -793,27 +541,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -883,29 +610,6 @@ export const QueryAccountResponse = { : undefined; return message; }, - fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { - const message = createBaseQueryAccountResponse(); - if (object.account !== undefined && object.account !== null) { - message.account = Cosmos_authAccountI_FromAmino(object.account); - } - return message; - }, - toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { - const obj: any = {}; - obj.account = message.account - ? Cosmos_authAccountI_ToAmino(message.account as Any) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { - return QueryAccountResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAccountResponse', - value: QueryAccountResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse { return QueryAccountResponse.decode(message.value); }, @@ -959,23 +663,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -1049,40 +736,6 @@ export const QueryModuleAccountsResponse = { message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino( - object: QueryModuleAccountsResponseAmino, - ): QueryModuleAccountsResponse { - const message = createBaseQueryModuleAccountsResponse(); - message.accounts = - object.accounts?.map(e => Cosmos_authModuleAccountI_FromAmino(e)) || []; - return message; - }, - toAmino( - message: QueryModuleAccountsResponse, - ): QueryModuleAccountsResponseAmino { - const obj: any = {}; - if (message.accounts) { - obj.accounts = message.accounts.map(e => - e ? Cosmos_authModuleAccountI_ToAmino(e as Any) : undefined, - ); - } else { - obj.accounts = message.accounts; - } - return obj; - }, - fromAminoMsg( - object: QueryModuleAccountsResponseAminoMsg, - ): QueryModuleAccountsResponse { - return QueryModuleAccountsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryModuleAccountsResponse, - ): QueryModuleAccountsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryModuleAccountsResponse', - value: QueryModuleAccountsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryModuleAccountsResponseProtoMsg, ): QueryModuleAccountsResponse { @@ -1140,23 +793,6 @@ export const Bech32PrefixRequest = { const message = createBaseBech32PrefixRequest(); return message; }, - fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { - const message = createBaseBech32PrefixRequest(); - return message; - }, - toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest { - return Bech32PrefixRequest.fromAmino(object.value); - }, - toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg { - return { - type: 'cosmos-sdk/Bech32PrefixRequest', - value: Bech32PrefixRequest.toAmino(message), - }; - }, fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest { return Bech32PrefixRequest.decode(message.value); }, @@ -1225,28 +861,6 @@ export const Bech32PrefixResponse = { message.bech32Prefix = object.bech32Prefix ?? ''; return message; }, - fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { - const message = createBaseBech32PrefixResponse(); - if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { - message.bech32Prefix = object.bech32_prefix; - } - return message; - }, - toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { - const obj: any = {}; - obj.bech32_prefix = - message.bech32Prefix === '' ? undefined : message.bech32Prefix; - return obj; - }, - fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { - return Bech32PrefixResponse.fromAmino(object.value); - }, - toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg { - return { - type: 'cosmos-sdk/Bech32PrefixResponse', - value: Bech32PrefixResponse.toAmino(message), - }; - }, fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse { return Bech32PrefixResponse.decode(message.value); }, @@ -1321,37 +935,6 @@ export const AddressBytesToStringRequest = { message.addressBytes = object.addressBytes ?? new Uint8Array(); return message; }, - fromAmino( - object: AddressBytesToStringRequestAmino, - ): AddressBytesToStringRequest { - const message = createBaseAddressBytesToStringRequest(); - if (object.address_bytes !== undefined && object.address_bytes !== null) { - message.addressBytes = bytesFromBase64(object.address_bytes); - } - return message; - }, - toAmino( - message: AddressBytesToStringRequest, - ): AddressBytesToStringRequestAmino { - const obj: any = {}; - obj.address_bytes = message.addressBytes - ? base64FromBytes(message.addressBytes) - : undefined; - return obj; - }, - fromAminoMsg( - object: AddressBytesToStringRequestAminoMsg, - ): AddressBytesToStringRequest { - return AddressBytesToStringRequest.fromAmino(object.value); - }, - toAminoMsg( - message: AddressBytesToStringRequest, - ): AddressBytesToStringRequestAminoMsg { - return { - type: 'cosmos-sdk/AddressBytesToStringRequest', - value: AddressBytesToStringRequest.toAmino(message), - }; - }, fromProtoMsg( message: AddressBytesToStringRequestProtoMsg, ): AddressBytesToStringRequest { @@ -1426,36 +1009,6 @@ export const AddressBytesToStringResponse = { message.addressString = object.addressString ?? ''; return message; }, - fromAmino( - object: AddressBytesToStringResponseAmino, - ): AddressBytesToStringResponse { - const message = createBaseAddressBytesToStringResponse(); - if (object.address_string !== undefined && object.address_string !== null) { - message.addressString = object.address_string; - } - return message; - }, - toAmino( - message: AddressBytesToStringResponse, - ): AddressBytesToStringResponseAmino { - const obj: any = {}; - obj.address_string = - message.addressString === '' ? undefined : message.addressString; - return obj; - }, - fromAminoMsg( - object: AddressBytesToStringResponseAminoMsg, - ): AddressBytesToStringResponse { - return AddressBytesToStringResponse.fromAmino(object.value); - }, - toAminoMsg( - message: AddressBytesToStringResponse, - ): AddressBytesToStringResponseAminoMsg { - return { - type: 'cosmos-sdk/AddressBytesToStringResponse', - value: AddressBytesToStringResponse.toAmino(message), - }; - }, fromProtoMsg( message: AddressBytesToStringResponseProtoMsg, ): AddressBytesToStringResponse { @@ -1530,36 +1083,6 @@ export const AddressStringToBytesRequest = { message.addressString = object.addressString ?? ''; return message; }, - fromAmino( - object: AddressStringToBytesRequestAmino, - ): AddressStringToBytesRequest { - const message = createBaseAddressStringToBytesRequest(); - if (object.address_string !== undefined && object.address_string !== null) { - message.addressString = object.address_string; - } - return message; - }, - toAmino( - message: AddressStringToBytesRequest, - ): AddressStringToBytesRequestAmino { - const obj: any = {}; - obj.address_string = - message.addressString === '' ? undefined : message.addressString; - return obj; - }, - fromAminoMsg( - object: AddressStringToBytesRequestAminoMsg, - ): AddressStringToBytesRequest { - return AddressStringToBytesRequest.fromAmino(object.value); - }, - toAminoMsg( - message: AddressStringToBytesRequest, - ): AddressStringToBytesRequestAminoMsg { - return { - type: 'cosmos-sdk/AddressStringToBytesRequest', - value: AddressStringToBytesRequest.toAmino(message), - }; - }, fromProtoMsg( message: AddressStringToBytesRequestProtoMsg, ): AddressStringToBytesRequest { @@ -1638,37 +1161,6 @@ export const AddressStringToBytesResponse = { message.addressBytes = object.addressBytes ?? new Uint8Array(); return message; }, - fromAmino( - object: AddressStringToBytesResponseAmino, - ): AddressStringToBytesResponse { - const message = createBaseAddressStringToBytesResponse(); - if (object.address_bytes !== undefined && object.address_bytes !== null) { - message.addressBytes = bytesFromBase64(object.address_bytes); - } - return message; - }, - toAmino( - message: AddressStringToBytesResponse, - ): AddressStringToBytesResponseAmino { - const obj: any = {}; - obj.address_bytes = message.addressBytes - ? base64FromBytes(message.addressBytes) - : undefined; - return obj; - }, - fromAminoMsg( - object: AddressStringToBytesResponseAminoMsg, - ): AddressStringToBytesResponse { - return AddressStringToBytesResponse.fromAmino(object.value); - }, - toAminoMsg( - message: AddressStringToBytesResponse, - ): AddressStringToBytesResponseAminoMsg { - return { - type: 'cosmos-sdk/AddressStringToBytesResponse', - value: AddressStringToBytesResponse.toAmino(message), - }; - }, fromProtoMsg( message: AddressStringToBytesResponseProtoMsg, ): AddressStringToBytesResponse { @@ -1699,32 +1191,6 @@ export const Cosmos_authAccountI_InterfaceDecoder = ( return data; } }; -export const Cosmos_authAccountI_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/BaseAccount': - return Any.fromPartial({ - typeUrl: '/cosmos.auth.v1beta1.BaseAccount', - value: BaseAccount.encode( - BaseAccount.fromPartial(BaseAccount.fromAmino(content.value)), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_authAccountI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.auth.v1beta1.BaseAccount': - return { - type: 'cosmos-sdk/BaseAccount', - value: BaseAccount.toAmino( - BaseAccount.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; export const Cosmos_authModuleAccountI_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): ModuleAccount | Any => { @@ -1738,29 +1204,3 @@ export const Cosmos_authModuleAccountI_InterfaceDecoder = ( return data; } }; -export const Cosmos_authModuleAccountI_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/ModuleAccount': - return Any.fromPartial({ - typeUrl: '/cosmos.auth.v1beta1.ModuleAccount', - value: ModuleAccount.encode( - ModuleAccount.fromPartial(ModuleAccount.fromAmino(content.value)), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_authModuleAccountI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.auth.v1beta1.ModuleAccount': - return { - type: 'cosmos-sdk/ModuleAccount', - value: ModuleAccount.toAmino( - ModuleAccount.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts index 51ffbf65329..ac9f38c5bf3 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -1,19 +1,12 @@ //@ts-nocheck -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { SendAuthorization, - SendAuthorizationProtoMsg, SendAuthorizationSDKType, } from '../../bank/v1beta1/authz.js'; import { StakeAuthorization, - StakeAuthorizationProtoMsg, StakeAuthorizationSDKType, } from '../../staking/v1beta1/authz.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -36,18 +29,6 @@ export interface GenericAuthorizationProtoMsg { typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization'; value: Uint8Array; } -/** - * GenericAuthorization gives the grantee unrestricted permissions to execute - * the provided method on behalf of the granter's account. - */ -export interface GenericAuthorizationAmino { - /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ - msg?: string; -} -export interface GenericAuthorizationAminoMsg { - type: 'cosmos-sdk/GenericAuthorization'; - value: GenericAuthorizationAmino; -} /** * GenericAuthorization gives the grantee unrestricted permissions to execute * the provided method on behalf of the granter's account. @@ -75,31 +56,6 @@ export interface GrantProtoMsg { typeUrl: '/cosmos.authz.v1beta1.Grant'; value: Uint8Array; } -export type GrantEncoded = Omit & { - authorization?: - | GenericAuthorizationProtoMsg - | SendAuthorizationProtoMsg - | StakeAuthorizationProtoMsg - | AnyProtoMsg - | undefined; -}; -/** - * Grant gives permissions to execute - * the provide method with expiration time. - */ -export interface GrantAmino { - authorization?: AnyAmino; - /** - * time when the grant will expire and will be pruned. If null, then the grant - * doesn't have a time expiration (other conditions in `authorization` - * may apply to invalidate the grant) - */ - expiration?: string; -} -export interface GrantAminoMsg { - type: 'cosmos-sdk/Grant'; - value: GrantAmino; -} /** * Grant gives permissions to execute * the provide method with expiration time. @@ -129,31 +85,6 @@ export interface GrantAuthorizationProtoMsg { typeUrl: '/cosmos.authz.v1beta1.GrantAuthorization'; value: Uint8Array; } -export type GrantAuthorizationEncoded = Omit< - GrantAuthorization, - 'authorization' -> & { - authorization?: - | GenericAuthorizationProtoMsg - | SendAuthorizationProtoMsg - | StakeAuthorizationProtoMsg - | AnyProtoMsg - | undefined; -}; -/** - * GrantAuthorization extends a grant with both the addresses of the grantee and granter. - * It is used in genesis.proto and query.proto - */ -export interface GrantAuthorizationAmino { - granter?: string; - grantee?: string; - authorization?: AnyAmino; - expiration?: string; -} -export interface GrantAuthorizationAminoMsg { - type: 'cosmos-sdk/GrantAuthorization'; - value: GrantAuthorizationAmino; -} /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto @@ -179,15 +110,6 @@ export interface GrantQueueItemProtoMsg { value: Uint8Array; } /** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ -export interface GrantQueueItemAmino { - /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ - msg_type_urls?: string[]; -} -export interface GrantQueueItemAminoMsg { - type: 'cosmos-sdk/GrantQueueItem'; - value: GrantQueueItemAmino; -} -/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ export interface GrantQueueItemSDKType { msg_type_urls: string[]; } @@ -244,27 +166,6 @@ export const GenericAuthorization = { message.msg = object.msg ?? ''; return message; }, - fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { - const message = createBaseGenericAuthorization(); - if (object.msg !== undefined && object.msg !== null) { - message.msg = object.msg; - } - return message; - }, - toAmino(message: GenericAuthorization): GenericAuthorizationAmino { - const obj: any = {}; - obj.msg = message.msg === '' ? undefined : message.msg; - return obj; - }, - fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization { - return GenericAuthorization.fromAmino(object.value); - }, - toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg { - return { - type: 'cosmos-sdk/GenericAuthorization', - value: GenericAuthorization.toAmino(message), - }; - }, fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization { return GenericAuthorization.decode(message.value); }, @@ -358,39 +259,6 @@ export const Grant = { message.expiration = object.expiration ?? undefined; return message; }, - fromAmino(object: GrantAmino): Grant { - const message = createBaseGrant(); - if (object.authorization !== undefined && object.authorization !== null) { - message.authorization = Cosmos_authzAuthorization_FromAmino( - object.authorization, - ); - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = fromTimestamp( - Timestamp.fromAmino(object.expiration), - ); - } - return message; - }, - toAmino(message: Grant): GrantAmino { - const obj: any = {}; - obj.authorization = message.authorization - ? Cosmos_authzAuthorization_ToAmino(message.authorization as Any) - : undefined; - obj.expiration = message.expiration - ? Timestamp.toAmino(toTimestamp(message.expiration)) - : undefined; - return obj; - }, - fromAminoMsg(object: GrantAminoMsg): Grant { - return Grant.fromAmino(object.value); - }, - toAminoMsg(message: Grant): GrantAminoMsg { - return { - type: 'cosmos-sdk/Grant', - value: Grant.toAmino(message), - }; - }, fromProtoMsg(message: GrantProtoMsg): Grant { return Grant.decode(message.value); }, @@ -507,47 +375,6 @@ export const GrantAuthorization = { message.expiration = object.expiration ?? undefined; return message; }, - fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { - const message = createBaseGrantAuthorization(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.authorization !== undefined && object.authorization !== null) { - message.authorization = Cosmos_authzAuthorization_FromAmino( - object.authorization, - ); - } - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = fromTimestamp( - Timestamp.fromAmino(object.expiration), - ); - } - return message; - }, - toAmino(message: GrantAuthorization): GrantAuthorizationAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.authorization = message.authorization - ? Cosmos_authzAuthorization_ToAmino(message.authorization as Any) - : undefined; - obj.expiration = message.expiration - ? Timestamp.toAmino(toTimestamp(message.expiration)) - : undefined; - return obj; - }, - fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { - return GrantAuthorization.fromAmino(object.value); - }, - toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg { - return { - type: 'cosmos-sdk/GrantAuthorization', - value: GrantAuthorization.toAmino(message), - }; - }, fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization { return GrantAuthorization.decode(message.value); }, @@ -616,29 +443,6 @@ export const GrantQueueItem = { message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; return message; }, - fromAmino(object: GrantQueueItemAmino): GrantQueueItem { - const message = createBaseGrantQueueItem(); - message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; - return message; - }, - toAmino(message: GrantQueueItem): GrantQueueItemAmino { - const obj: any = {}; - if (message.msgTypeUrls) { - obj.msg_type_urls = message.msgTypeUrls.map(e => e); - } else { - obj.msg_type_urls = message.msgTypeUrls; - } - return obj; - }, - fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem { - return GrantQueueItem.fromAmino(object.value); - }, - toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg { - return { - type: 'cosmos-sdk/GrantQueueItem', - value: GrantQueueItem.toAmino(message), - }; - }, fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem { return GrantQueueItem.decode(message.value); }, @@ -669,63 +473,3 @@ export const Cosmos_authzAuthorization_InterfaceDecoder = ( return data; } }; -export const Cosmos_authzAuthorization_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/GenericAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization', - value: GenericAuthorization.encode( - GenericAuthorization.fromPartial( - GenericAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/SendAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', - value: SendAuthorization.encode( - SendAuthorization.fromPartial( - SendAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/StakeAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization', - value: StakeAuthorization.encode( - StakeAuthorization.fromPartial( - StakeAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_authzAuthorization_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.authz.v1beta1.GenericAuthorization': - return { - type: 'cosmos-sdk/GenericAuthorization', - value: GenericAuthorization.toAmino( - GenericAuthorization.decode(content.value, undefined), - ), - }; - case '/cosmos.bank.v1beta1.SendAuthorization': - return { - type: 'cosmos-sdk/SendAuthorization', - value: SendAuthorization.toAmino( - SendAuthorization.decode(content.value, undefined), - ), - }; - case '/cosmos.staking.v1beta1.StakeAuthorization': - return { - type: 'cosmos-sdk/StakeAuthorization', - value: StakeAuthorization.toAmino( - StakeAuthorization.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/event.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/event.ts index 060cddb514e..06ed8bb129c 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/event.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/event.ts @@ -15,19 +15,6 @@ export interface EventGrantProtoMsg { value: Uint8Array; } /** EventGrant is emitted on Msg/Grant */ -export interface EventGrantAmino { - /** Msg type URL for which an autorization is granted */ - msg_type_url?: string; - /** Granter account address */ - granter?: string; - /** Grantee account address */ - grantee?: string; -} -export interface EventGrantAminoMsg { - type: 'cosmos-sdk/EventGrant'; - value: EventGrantAmino; -} -/** EventGrant is emitted on Msg/Grant */ export interface EventGrantSDKType { msg_type_url: string; granter: string; @@ -47,19 +34,6 @@ export interface EventRevokeProtoMsg { value: Uint8Array; } /** EventRevoke is emitted on Msg/Revoke */ -export interface EventRevokeAmino { - /** Msg type URL for which an autorization is revoked */ - msg_type_url?: string; - /** Granter account address */ - granter?: string; - /** Grantee account address */ - grantee?: string; -} -export interface EventRevokeAminoMsg { - type: 'cosmos-sdk/EventRevoke'; - value: EventRevokeAmino; -} -/** EventRevoke is emitted on Msg/Revoke */ export interface EventRevokeSDKType { msg_type_url: string; granter: string; @@ -134,36 +108,6 @@ export const EventGrant = { message.grantee = object.grantee ?? ''; return message; }, - fromAmino(object: EventGrantAmino): EventGrant { - const message = createBaseEventGrant(); - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - return message; - }, - toAmino(message: EventGrant): EventGrantAmino { - const obj: any = {}; - obj.msg_type_url = - message.msgTypeUrl === '' ? undefined : message.msgTypeUrl; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - return obj; - }, - fromAminoMsg(object: EventGrantAminoMsg): EventGrant { - return EventGrant.fromAmino(object.value); - }, - toAminoMsg(message: EventGrant): EventGrantAminoMsg { - return { - type: 'cosmos-sdk/EventGrant', - value: EventGrant.toAmino(message), - }; - }, fromProtoMsg(message: EventGrantProtoMsg): EventGrant { return EventGrant.decode(message.value); }, @@ -246,36 +190,6 @@ export const EventRevoke = { message.grantee = object.grantee ?? ''; return message; }, - fromAmino(object: EventRevokeAmino): EventRevoke { - const message = createBaseEventRevoke(); - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - return message; - }, - toAmino(message: EventRevoke): EventRevokeAmino { - const obj: any = {}; - obj.msg_type_url = - message.msgTypeUrl === '' ? undefined : message.msgTypeUrl; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - return obj; - }, - fromAminoMsg(object: EventRevokeAminoMsg): EventRevoke { - return EventRevoke.fromAmino(object.value); - }, - toAminoMsg(message: EventRevoke): EventRevokeAminoMsg { - return { - type: 'cosmos-sdk/EventRevoke', - value: EventRevoke.toAmino(message), - }; - }, fromProtoMsg(message: EventRevokeProtoMsg): EventRevoke { return EventRevoke.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/genesis.ts index b86e422c6f8..3c3daea8868 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/genesis.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - GrantAuthorization, - GrantAuthorizationAmino, - GrantAuthorizationSDKType, -} from './authz.js'; +import { GrantAuthorization, GrantAuthorizationSDKType } from './authz.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { @@ -14,14 +10,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the authz module's genesis state. */ -export interface GenesisStateAmino { - authorization?: GrantAuthorizationAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the authz module's genesis state. */ export interface GenesisStateSDKType { authorization: GrantAuthorizationSDKType[]; } @@ -85,32 +73,6 @@ export const GenesisState = { object.authorization?.map(e => GrantAuthorization.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - message.authorization = - object.authorization?.map(e => GrantAuthorization.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - if (message.authorization) { - obj.authorization = message.authorization.map(e => - e ? GrantAuthorization.toAmino(e) : undefined, - ); - } else { - obj.authorization = message.authorization; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts deleted file mode 100644 index e69bb6a14b3..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,98 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryGrantsRequest, - QueryGrantsResponse, - QueryGranterGrantsRequest, - QueryGranterGrantsResponse, - QueryGranteeGrantsRequest, - QueryGranteeGrantsResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Returns list of `Authorization`, granted to the grantee by the granter. */ - grants(request: QueryGrantsRequest): Promise; - /** - * GranterGrants returns list of `GrantAuthorization`, granted by granter. - * - * Since: cosmos-sdk 0.46 - */ - granterGrants( - request: QueryGranterGrantsRequest, - ): Promise; - /** - * GranteeGrants returns a list of `GrantAuthorization` by grantee. - * - * Since: cosmos-sdk 0.46 - */ - granteeGrants( - request: QueryGranteeGrantsRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.grants = this.grants.bind(this); - this.granterGrants = this.granterGrants.bind(this); - this.granteeGrants = this.granteeGrants.bind(this); - } - grants(request: QueryGrantsRequest): Promise { - const data = QueryGrantsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.authz.v1beta1.Query', - 'Grants', - data, - ); - return promise.then(data => - QueryGrantsResponse.decode(new BinaryReader(data)), - ); - } - granterGrants( - request: QueryGranterGrantsRequest, - ): Promise { - const data = QueryGranterGrantsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.authz.v1beta1.Query', - 'GranterGrants', - data, - ); - return promise.then(data => - QueryGranterGrantsResponse.decode(new BinaryReader(data)), - ); - } - granteeGrants( - request: QueryGranteeGrantsRequest, - ): Promise { - const data = QueryGranteeGrantsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.authz.v1beta1.Query', - 'GranteeGrants', - data, - ); - return promise.then(data => - QueryGranteeGrantsResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - grants(request: QueryGrantsRequest): Promise { - return queryService.grants(request); - }, - granterGrants( - request: QueryGranterGrantsRequest, - ): Promise { - return queryService.granterGrants(request); - }, - granteeGrants( - request: QueryGranteeGrantsRequest, - ): Promise { - return queryService.granteeGrants(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.ts index 791d44a8f46..851b294552a 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/query.ts @@ -1,18 +1,14 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { Grant, - GrantAmino, GrantSDKType, GrantAuthorization, - GrantAuthorizationAmino, GrantAuthorizationSDKType, } from './authz.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -31,19 +27,6 @@ export interface QueryGrantsRequestProtoMsg { value: Uint8Array; } /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ -export interface QueryGrantsRequestAmino { - granter?: string; - grantee?: string; - /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ - msg_type_url?: string; - /** pagination defines an pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGrantsRequestAminoMsg { - type: 'cosmos-sdk/QueryGrantsRequest'; - value: QueryGrantsRequestAmino; -} -/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequestSDKType { granter: string; grantee: string; @@ -62,17 +45,6 @@ export interface QueryGrantsResponseProtoMsg { value: Uint8Array; } /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ -export interface QueryGrantsResponseAmino { - /** authorizations is a list of grants granted for grantee by granter. */ - grants?: GrantAmino[]; - /** pagination defines an pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGrantsResponseAminoMsg { - type: 'cosmos-sdk/QueryGrantsResponse'; - value: QueryGrantsResponseAmino; -} -/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseSDKType { grants: GrantSDKType[]; pagination?: PageResponseSDKType; @@ -88,16 +60,6 @@ export interface QueryGranterGrantsRequestProtoMsg { value: Uint8Array; } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ -export interface QueryGranterGrantsRequestAmino { - granter?: string; - /** pagination defines an pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGranterGrantsRequestAminoMsg { - type: 'cosmos-sdk/QueryGranterGrantsRequest'; - value: QueryGranterGrantsRequestAmino; -} -/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestSDKType { granter: string; pagination?: PageRequestSDKType; @@ -114,17 +76,6 @@ export interface QueryGranterGrantsResponseProtoMsg { value: Uint8Array; } /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ -export interface QueryGranterGrantsResponseAmino { - /** grants is a list of grants granted by the granter. */ - grants?: GrantAuthorizationAmino[]; - /** pagination defines an pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGranterGrantsResponseAminoMsg { - type: 'cosmos-sdk/QueryGranterGrantsResponse'; - value: QueryGranterGrantsResponseAmino; -} -/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; pagination?: PageResponseSDKType; @@ -140,16 +91,6 @@ export interface QueryGranteeGrantsRequestProtoMsg { value: Uint8Array; } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ -export interface QueryGranteeGrantsRequestAmino { - grantee?: string; - /** pagination defines an pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGranteeGrantsRequestAminoMsg { - type: 'cosmos-sdk/QueryGranteeGrantsRequest'; - value: QueryGranteeGrantsRequestAmino; -} -/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; pagination?: PageRequestSDKType; @@ -166,17 +107,6 @@ export interface QueryGranteeGrantsResponseProtoMsg { value: Uint8Array; } /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ -export interface QueryGranteeGrantsResponseAmino { - /** grants is a list of grants granted to the grantee. */ - grants?: GrantAuthorizationAmino[]; - /** pagination defines an pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGranteeGrantsResponseAminoMsg { - type: 'cosmos-sdk/QueryGranteeGrantsResponse'; - value: QueryGranteeGrantsResponseAmino; -} -/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; pagination?: PageResponseSDKType; @@ -271,42 +201,6 @@ export const QueryGrantsRequest = { : undefined; return message; }, - fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest { - const message = createBaseQueryGrantsRequest(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.msg_type_url = - message.msgTypeUrl === '' ? undefined : message.msgTypeUrl; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryGrantsRequestAminoMsg): QueryGrantsRequest { - return QueryGrantsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryGrantsRequest): QueryGrantsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGrantsRequest', - value: QueryGrantsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryGrantsRequestProtoMsg): QueryGrantsRequest { return QueryGrantsRequest.decode(message.value); }, @@ -399,35 +293,6 @@ export const QueryGrantsResponse = { : undefined; return message; }, - fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse { - const message = createBaseQueryGrantsResponse(); - message.grants = object.grants?.map(e => Grant.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino { - const obj: any = {}; - if (message.grants) { - obj.grants = message.grants.map(e => (e ? Grant.toAmino(e) : undefined)); - } else { - obj.grants = message.grants; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryGrantsResponseAminoMsg): QueryGrantsResponse { - return QueryGrantsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryGrantsResponse): QueryGrantsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGrantsResponse', - value: QueryGrantsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryGrantsResponseProtoMsg): QueryGrantsResponse { return QueryGrantsResponse.decode(message.value); }, @@ -513,37 +378,6 @@ export const QueryGranterGrantsRequest = { : undefined; return message; }, - fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest { - const message = createBaseQueryGranterGrantsRequest(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGranterGrantsRequestAminoMsg, - ): QueryGranterGrantsRequest { - return QueryGranterGrantsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGranterGrantsRequest, - ): QueryGranterGrantsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGranterGrantsRequest', - value: QueryGranterGrantsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGranterGrantsRequestProtoMsg, ): QueryGranterGrantsRequest { @@ -647,46 +481,6 @@ export const QueryGranterGrantsResponse = { : undefined; return message; }, - fromAmino( - object: QueryGranterGrantsResponseAmino, - ): QueryGranterGrantsResponse { - const message = createBaseQueryGranterGrantsResponse(); - message.grants = - object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGranterGrantsResponse, - ): QueryGranterGrantsResponseAmino { - const obj: any = {}; - if (message.grants) { - obj.grants = message.grants.map(e => - e ? GrantAuthorization.toAmino(e) : undefined, - ); - } else { - obj.grants = message.grants; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGranterGrantsResponseAminoMsg, - ): QueryGranterGrantsResponse { - return QueryGranterGrantsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGranterGrantsResponse, - ): QueryGranterGrantsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGranterGrantsResponse', - value: QueryGranterGrantsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGranterGrantsResponseProtoMsg, ): QueryGranterGrantsResponse { @@ -776,37 +570,6 @@ export const QueryGranteeGrantsRequest = { : undefined; return message; }, - fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest { - const message = createBaseQueryGranteeGrantsRequest(); - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino { - const obj: any = {}; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGranteeGrantsRequestAminoMsg, - ): QueryGranteeGrantsRequest { - return QueryGranteeGrantsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGranteeGrantsRequest, - ): QueryGranteeGrantsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGranteeGrantsRequest', - value: QueryGranteeGrantsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGranteeGrantsRequestProtoMsg, ): QueryGranteeGrantsRequest { @@ -910,46 +673,6 @@ export const QueryGranteeGrantsResponse = { : undefined; return message; }, - fromAmino( - object: QueryGranteeGrantsResponseAmino, - ): QueryGranteeGrantsResponse { - const message = createBaseQueryGranteeGrantsResponse(); - message.grants = - object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGranteeGrantsResponse, - ): QueryGranteeGrantsResponseAmino { - const obj: any = {}; - if (message.grants) { - obj.grants = message.grants.map(e => - e ? GrantAuthorization.toAmino(e) : undefined, - ); - } else { - obj.grants = message.grants; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGranteeGrantsResponseAminoMsg, - ): QueryGranteeGrantsResponse { - return QueryGranteeGrantsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGranteeGrantsResponse, - ): QueryGranteeGrantsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGranteeGrantsResponse', - value: QueryGranteeGrantsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGranteeGrantsResponseProtoMsg, ): QueryGranteeGrantsResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.amino.ts deleted file mode 100644 index 49f16ed43d1..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.amino.ts +++ /dev/null @@ -1,19 +0,0 @@ -//@ts-nocheck -import { MsgGrant, MsgExec, MsgRevoke } from './tx.js'; -export const AminoConverter = { - '/cosmos.authz.v1beta1.MsgGrant': { - aminoType: 'cosmos-sdk/MsgGrant', - toAmino: MsgGrant.toAmino, - fromAmino: MsgGrant.fromAmino, - }, - '/cosmos.authz.v1beta1.MsgExec': { - aminoType: 'cosmos-sdk/MsgExec', - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino, - }, - '/cosmos.authz.v1beta1.MsgRevoke': { - aminoType: 'cosmos-sdk/MsgRevoke', - toAmino: MsgRevoke.toAmino, - fromAmino: MsgRevoke.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.registry.ts deleted file mode 100644 index be9b03c284c..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.registry.ts +++ /dev/null @@ -1,115 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { MsgGrant, MsgExec, MsgRevoke } from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.authz.v1beta1.MsgGrant', MsgGrant], - ['/cosmos.authz.v1beta1.MsgExec', MsgExec], - ['/cosmos.authz.v1beta1.MsgRevoke', MsgRevoke], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - grant(value: MsgGrant) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value: MsgGrant.encode(value).finish(), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value: MsgExec.encode(value).finish(), - }; - }, - revoke(value: MsgRevoke) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value: MsgRevoke.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - grant(value: MsgGrant) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value, - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value, - }; - }, - revoke(value: MsgRevoke) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value, - }; - }, - }, - toJSON: { - grant(value: MsgGrant) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value: MsgGrant.toJSON(value), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value: MsgExec.toJSON(value), - }; - }, - revoke(value: MsgRevoke) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value: MsgRevoke.toJSON(value), - }; - }, - }, - fromJSON: { - grant(value: any) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value: MsgGrant.fromJSON(value), - }; - }, - exec(value: any) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value: MsgExec.fromJSON(value), - }; - }, - revoke(value: any) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value: MsgRevoke.fromJSON(value), - }; - }, - }, - fromPartial: { - grant(value: MsgGrant) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value: MsgGrant.fromPartial(value), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value: MsgExec.fromPartial(value), - }; - }, - revoke(value: MsgRevoke) { - return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value: MsgRevoke.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 7675d3c4412..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,64 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgGrant, - MsgGrantResponse, - MsgExec, - MsgExecResponse, - MsgRevoke, - MsgRevokeResponse, -} from './tx.js'; -/** Msg defines the authz Msg service. */ -export interface Msg { - /** - * Grant grants the provided authorization to the grantee on the granter's - * account with the provided expiration time. If there is already a grant - * for the given (granter, grantee, Authorization) triple, then the grant - * will be overwritten. - */ - grant(request: MsgGrant): Promise; - /** - * Exec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ - exec(request: MsgExec): Promise; - /** - * Revoke revokes any authorization corresponding to the provided method name on the - * granter's account that has been granted to the grantee. - */ - revoke(request: MsgRevoke): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.grant = this.grant.bind(this); - this.exec = this.exec.bind(this); - this.revoke = this.revoke.bind(this); - } - grant(request: MsgGrant): Promise { - const data = MsgGrant.encode(request).finish(); - const promise = this.rpc.request('cosmos.authz.v1beta1.Msg', 'Grant', data); - return promise.then(data => - MsgGrantResponse.decode(new BinaryReader(data)), - ); - } - exec(request: MsgExec): Promise { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request('cosmos.authz.v1beta1.Msg', 'Exec', data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - } - revoke(request: MsgRevoke): Promise { - const data = MsgRevoke.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.authz.v1beta1.Msg', - 'Revoke', - data, - ); - return promise.then(data => - MsgRevokeResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts index 460c3377395..ae5b631bf73 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,16 +1,6 @@ //@ts-nocheck -import { - Grant, - GrantAmino, - GrantSDKType, - GenericAuthorization, -} from './authz.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Grant, GrantSDKType, GenericAuthorization } from './authz.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { SendAuthorization } from '../../bank/v1beta1/authz.js'; import { StakeAuthorization } from '../../staking/v1beta1/authz.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -28,19 +18,6 @@ export interface MsgGrantProtoMsg { typeUrl: '/cosmos.authz.v1beta1.MsgGrant'; value: Uint8Array; } -/** - * MsgGrant is a request type for Grant method. It declares authorization to the grantee - * on behalf of the granter with the provided expiration time. - */ -export interface MsgGrantAmino { - granter?: string; - grantee?: string; - grant?: GrantAmino; -} -export interface MsgGrantAminoMsg { - type: 'cosmos-sdk/MsgGrant'; - value: MsgGrantAmino; -} /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. @@ -59,14 +36,6 @@ export interface MsgExecResponseProtoMsg { value: Uint8Array; } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponseAmino { - results?: string[]; -} -export interface MsgExecResponseAminoMsg { - type: 'cosmos-sdk/MsgExecResponse'; - value: MsgExecResponseAmino; -} -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseSDKType { results: Uint8Array[]; } @@ -88,32 +57,6 @@ export interface MsgExecProtoMsg { typeUrl: '/cosmos.authz.v1beta1.MsgExec'; value: Uint8Array; } -export type MsgExecEncoded = Omit & { - /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ - msgs: AnyProtoMsg[]; -}; -/** - * MsgExec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ -export interface MsgExecAmino { - grantee?: string; - /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ - msgs?: AnyAmino[]; -} -export interface MsgExecAminoMsg { - type: 'cosmos-sdk/MsgExec'; - value: MsgExecAmino; -} /** * MsgExec attempts to execute the provided messages using * authorizations granted to the grantee. Each message should have only @@ -130,12 +73,6 @@ export interface MsgGrantResponseProtoMsg { value: Uint8Array; } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponseAmino {} -export interface MsgGrantResponseAminoMsg { - type: 'cosmos-sdk/MsgGrantResponse'; - value: MsgGrantResponseAmino; -} -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponseSDKType {} /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the @@ -150,19 +87,6 @@ export interface MsgRevokeProtoMsg { typeUrl: '/cosmos.authz.v1beta1.MsgRevoke'; value: Uint8Array; } -/** - * MsgRevoke revokes any authorization with the provided sdk.Msg type on the - * granter's account with that has been granted to the grantee. - */ -export interface MsgRevokeAmino { - granter?: string; - grantee?: string; - msg_type_url?: string; -} -export interface MsgRevokeAminoMsg { - type: 'cosmos-sdk/MsgRevoke'; - value: MsgRevokeAmino; -} /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. @@ -179,12 +103,6 @@ export interface MsgRevokeResponseProtoMsg { value: Uint8Array; } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ -export interface MsgRevokeResponseAmino {} -export interface MsgRevokeResponseAminoMsg { - type: 'cosmos-sdk/MsgRevokeResponse'; - value: MsgRevokeResponseAmino; -} -/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponseSDKType {} function createBaseMsgGrant(): MsgGrant { return { @@ -259,35 +177,6 @@ export const MsgGrant = { : undefined; return message; }, - fromAmino(object: MsgGrantAmino): MsgGrant { - const message = createBaseMsgGrant(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.grant !== undefined && object.grant !== null) { - message.grant = Grant.fromAmino(object.grant); - } - return message; - }, - toAmino(message: MsgGrant): MsgGrantAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; - return obj; - }, - fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { - return MsgGrant.fromAmino(object.value); - }, - toAminoMsg(message: MsgGrant): MsgGrantAminoMsg { - return { - type: 'cosmos-sdk/MsgGrant', - value: MsgGrant.toAmino(message), - }; - }, fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant { return MsgGrant.decode(message.value); }, @@ -358,29 +247,6 @@ export const MsgExecResponse = { message.results = object.results?.map(e => e) || []; return message; }, - fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: MsgExecResponse): MsgExecResponseAmino { - const obj: any = {}; - if (message.results) { - obj.results = message.results.map(e => base64FromBytes(e)); - } else { - obj.results = message.results; - } - return obj; - }, - fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { - return MsgExecResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgExecResponse', - value: MsgExecResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { return MsgExecResponse.decode(message.value); }, @@ -459,36 +325,6 @@ export const MsgExec = { message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgExecAmino): MsgExec { - const message = createBaseMsgExec(); - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - message.msgs = - object.msgs?.map(e => Sdk_MsgcosmosauthzAuthorization_FromAmino(e)) || []; - return message; - }, - toAmino(message: MsgExec): MsgExecAmino { - const obj: any = {}; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - if (message.msgs) { - obj.msgs = message.msgs.map(e => - e ? Sdk_MsgcosmosauthzAuthorization_ToAmino(e as Any) : undefined, - ); - } else { - obj.msgs = message.msgs; - } - return obj; - }, - fromAminoMsg(object: MsgExecAminoMsg): MsgExec { - return MsgExec.fromAmino(object.value); - }, - toAminoMsg(message: MsgExec): MsgExecAminoMsg { - return { - type: 'cosmos-sdk/MsgExec', - value: MsgExec.toAmino(message), - }; - }, fromProtoMsg(message: MsgExecProtoMsg): MsgExec { return MsgExec.decode(message.value); }, @@ -539,23 +375,6 @@ export const MsgGrantResponse = { const message = createBaseMsgGrantResponse(); return message; }, - fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); - return message; - }, - toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { - return MsgGrantResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgGrantResponse', - value: MsgGrantResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { return MsgGrantResponse.decode(message.value); }, @@ -638,36 +457,6 @@ export const MsgRevoke = { message.msgTypeUrl = object.msgTypeUrl ?? ''; return message; }, - fromAmino(object: MsgRevokeAmino): MsgRevoke { - const message = createBaseMsgRevoke(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - return message; - }, - toAmino(message: MsgRevoke): MsgRevokeAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.msg_type_url = - message.msgTypeUrl === '' ? undefined : message.msgTypeUrl; - return obj; - }, - fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { - return MsgRevoke.fromAmino(object.value); - }, - toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg { - return { - type: 'cosmos-sdk/MsgRevoke', - value: MsgRevoke.toAmino(message), - }; - }, fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke { return MsgRevoke.decode(message.value); }, @@ -718,23 +507,6 @@ export const MsgRevokeResponse = { const message = createBaseMsgRevokeResponse(); return message; }, - fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse(); - return message; - }, - toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { - return MsgRevokeResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgRevokeResponse', - value: MsgRevokeResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse { return MsgRevokeResponse.decode(message.value); }, @@ -759,12 +531,6 @@ export const Sdk_Msg_InterfaceDecoder = ( return data; } }; -export const Sdk_Msg_FromAmino = (content: AnyAmino): Any => { - return Any.fromAmino(content); -}; -export const Sdk_Msg_ToAmino = (content: Any) => { - return Any.toAmino(content); -}; export const Cosmos_authzAuthorization_InterfaceDecoder = ( input: BinaryReader | Uint8Array, ): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { @@ -782,63 +548,3 @@ export const Cosmos_authzAuthorization_InterfaceDecoder = ( return data; } }; -export const Cosmos_authzAuthorization_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/GenericAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.authz.v1beta1.GenericAuthorization', - value: GenericAuthorization.encode( - GenericAuthorization.fromPartial( - GenericAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/SendAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.bank.v1beta1.SendAuthorization', - value: SendAuthorization.encode( - SendAuthorization.fromPartial( - SendAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/StakeAuthorization': - return Any.fromPartial({ - typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization', - value: StakeAuthorization.encode( - StakeAuthorization.fromPartial( - StakeAuthorization.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_authzAuthorization_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.authz.v1beta1.GenericAuthorization': - return { - type: 'cosmos-sdk/GenericAuthorization', - value: GenericAuthorization.toAmino( - GenericAuthorization.decode(content.value, undefined), - ), - }; - case '/cosmos.bank.v1beta1.SendAuthorization': - return { - type: 'cosmos-sdk/SendAuthorization', - value: SendAuthorization.toAmino( - SendAuthorization.decode(content.value, undefined), - ), - }; - case '/cosmos.staking.v1beta1.StakeAuthorization': - return { - type: 'cosmos-sdk/StakeAuthorization', - value: StakeAuthorization.toAmino( - StakeAuthorization.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/authz.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/authz.ts index 3393d73c6fa..cc9ea9babbc 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/authz.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/authz.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; /** * SendAuthorization allows the grantee to spend up to spend_limit coins from @@ -15,19 +15,6 @@ export interface SendAuthorizationProtoMsg { typeUrl: '/cosmos.bank.v1beta1.SendAuthorization'; value: Uint8Array; } -/** - * SendAuthorization allows the grantee to spend up to spend_limit coins from - * the granter's account. - * - * Since: cosmos-sdk 0.43 - */ -export interface SendAuthorizationAmino { - spend_limit?: CoinAmino[]; -} -export interface SendAuthorizationAminoMsg { - type: 'cosmos-sdk/SendAuthorization'; - value: SendAuthorizationAmino; -} /** * SendAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account. @@ -96,31 +83,6 @@ export const SendAuthorization = { message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: SendAuthorizationAmino): SendAuthorization { - const message = createBaseSendAuthorization(); - message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: SendAuthorization): SendAuthorizationAmino { - const obj: any = {}; - if (message.spendLimit) { - obj.spend_limit = message.spendLimit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.spend_limit = message.spendLimit; - } - return obj; - }, - fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { - return SendAuthorization.fromAmino(object.value); - }, - toAminoMsg(message: SendAuthorization): SendAuthorizationAminoMsg { - return { - type: 'cosmos-sdk/SendAuthorization', - value: SendAuthorization.toAmino(message), - }; - }, fromProtoMsg(message: SendAuthorizationProtoMsg): SendAuthorization { return SendAuthorization.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/bank.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/bank.ts index 3375a2f5ae7..ec3ea50e873 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/bank.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/bank.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** Params defines the parameters for the bank module. */ @@ -12,15 +12,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params defines the parameters for the bank module. */ -export interface ParamsAmino { - send_enabled?: SendEnabledAmino[]; - default_send_enabled?: boolean; -} -export interface ParamsAminoMsg { - type: 'cosmos-sdk/Params'; - value: ParamsAmino; -} -/** Params defines the parameters for the bank module. */ export interface ParamsSDKType { send_enabled: SendEnabledSDKType[]; default_send_enabled: boolean; @@ -37,18 +28,6 @@ export interface SendEnabledProtoMsg { typeUrl: '/cosmos.bank.v1beta1.SendEnabled'; value: Uint8Array; } -/** - * SendEnabled maps coin denom to a send_enabled status (whether a denom is - * sendable). - */ -export interface SendEnabledAmino { - denom?: string; - enabled?: boolean; -} -export interface SendEnabledAminoMsg { - type: 'cosmos-sdk/SendEnabled'; - value: SendEnabledAmino; -} /** * SendEnabled maps coin denom to a send_enabled status (whether a denom is * sendable). @@ -67,15 +46,6 @@ export interface InputProtoMsg { value: Uint8Array; } /** Input models transaction input. */ -export interface InputAmino { - address?: string; - coins?: CoinAmino[]; -} -export interface InputAminoMsg { - type: 'cosmos-sdk/Input'; - value: InputAmino; -} -/** Input models transaction input. */ export interface InputSDKType { address: string; coins: CoinSDKType[]; @@ -90,15 +60,6 @@ export interface OutputProtoMsg { value: Uint8Array; } /** Output models transaction outputs. */ -export interface OutputAmino { - address?: string; - coins?: CoinAmino[]; -} -export interface OutputAminoMsg { - type: 'cosmos-sdk/Output'; - value: OutputAmino; -} -/** Output models transaction outputs. */ export interface OutputSDKType { address: string; coins: CoinSDKType[]; @@ -123,19 +84,6 @@ export interface SupplyProtoMsg { * This message is deprecated now that supply is indexed by denom. */ /** @deprecated */ -export interface SupplyAmino { - total?: CoinAmino[]; -} -export interface SupplyAminoMsg { - type: 'cosmos-sdk/Supply'; - value: SupplyAmino; -} -/** - * Supply represents a struct that passively keeps track of the total supply - * amounts in the network. - * This message is deprecated now that supply is indexed by denom. - */ -/** @deprecated */ export interface SupplySDKType { $typeUrl?: '/cosmos.bank.v1beta1.Supply'; total: CoinSDKType[]; @@ -162,28 +110,6 @@ export interface DenomUnitProtoMsg { typeUrl: '/cosmos.bank.v1beta1.DenomUnit'; value: Uint8Array; } -/** - * DenomUnit represents a struct that describes a given - * denomination unit of the basic token. - */ -export interface DenomUnitAmino { - /** denom represents the string name of the given denom unit (e.g uatom). */ - denom?: string; - /** - * exponent represents power of 10 exponent that one must - * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 10^exponent base_denom - * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - * exponent = 6, thus: 1 atom = 10^6 uatom). - */ - exponent?: number; - /** aliases is a list of string aliases for the given denom */ - aliases?: string[]; -} -export interface DenomUnitAminoMsg { - type: 'cosmos-sdk/DenomUnit'; - value: DenomUnitAmino; -} /** * DenomUnit represents a struct that describes a given * denomination unit of the basic token. @@ -239,52 +165,6 @@ export interface MetadataProtoMsg { typeUrl: '/cosmos.bank.v1beta1.Metadata'; value: Uint8Array; } -/** - * Metadata represents a struct that describes - * a basic token. - */ -export interface MetadataAmino { - description?: string; - /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units?: DenomUnitAmino[]; - /** base represents the base denom (should be the DenomUnit with exponent = 0). */ - base?: string; - /** - * display indicates the suggested denom that should be - * displayed in clients. - */ - display?: string; - /** - * name defines the name of the token (eg: Cosmos Atom) - * - * Since: cosmos-sdk 0.43 - */ - name?: string; - /** - * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - * be the same as the display. - * - * Since: cosmos-sdk 0.43 - */ - symbol?: string; - /** - * URI to a document (on or off-chain) that contains additional information. Optional. - * - * Since: cosmos-sdk 0.46 - */ - uri?: string; - /** - * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - * the document didn't change. Optional. - * - * Since: cosmos-sdk 0.46 - */ - uri_hash?: string; -} -export interface MetadataAminoMsg { - type: 'cosmos-sdk/Metadata'; - value: MetadataAmino; -} /** * Metadata represents a struct that describes * a basic token. @@ -370,42 +250,6 @@ export const Params = { message.defaultSendEnabled = object.defaultSendEnabled ?? false; return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - message.sendEnabled = - object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; - if ( - object.default_send_enabled !== undefined && - object.default_send_enabled !== null - ) { - message.defaultSendEnabled = object.default_send_enabled; - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.sendEnabled) { - obj.send_enabled = message.sendEnabled.map(e => - e ? SendEnabled.toAmino(e) : undefined, - ); - } else { - obj.send_enabled = message.sendEnabled; - } - obj.default_send_enabled = - message.defaultSendEnabled === false - ? undefined - : message.defaultSendEnabled; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: 'cosmos-sdk/Params', - value: Params.toAmino(message), - }; - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, @@ -478,31 +322,6 @@ export const SendEnabled = { message.enabled = object.enabled ?? false; return message; }, - fromAmino(object: SendEnabledAmino): SendEnabled { - const message = createBaseSendEnabled(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - if (object.enabled !== undefined && object.enabled !== null) { - message.enabled = object.enabled; - } - return message; - }, - toAmino(message: SendEnabled): SendEnabledAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - obj.enabled = message.enabled === false ? undefined : message.enabled; - return obj; - }, - fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled { - return SendEnabled.fromAmino(object.value); - }, - toAminoMsg(message: SendEnabled): SendEnabledAminoMsg { - return { - type: 'cosmos-sdk/SendEnabled', - value: SendEnabled.toAmino(message), - }; - }, fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled { return SendEnabled.decode(message.value); }, @@ -581,33 +400,6 @@ export const Input = { message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: InputAmino): Input { - const message = createBaseInput(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Input): InputAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - if (message.coins) { - obj.coins = message.coins.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.coins = message.coins; - } - return obj; - }, - fromAminoMsg(object: InputAminoMsg): Input { - return Input.fromAmino(object.value); - }, - toAminoMsg(message: Input): InputAminoMsg { - return { - type: 'cosmos-sdk/Input', - value: Input.toAmino(message), - }; - }, fromProtoMsg(message: InputProtoMsg): Input { return Input.decode(message.value); }, @@ -686,33 +478,6 @@ export const Output = { message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: OutputAmino): Output { - const message = createBaseOutput(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Output): OutputAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - if (message.coins) { - obj.coins = message.coins.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.coins = message.coins; - } - return obj; - }, - fromAminoMsg(object: OutputAminoMsg): Output { - return Output.fromAmino(object.value); - }, - toAminoMsg(message: Output): OutputAminoMsg { - return { - type: 'cosmos-sdk/Output', - value: Output.toAmino(message), - }; - }, fromProtoMsg(message: OutputProtoMsg): Output { return Output.decode(message.value); }, @@ -782,29 +547,6 @@ export const Supply = { message.total = object.total?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: SupplyAmino): Supply { - const message = createBaseSupply(); - message.total = object.total?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Supply): SupplyAmino { - const obj: any = {}; - if (message.total) { - obj.total = message.total.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.total = message.total; - } - return obj; - }, - fromAminoMsg(object: SupplyAminoMsg): Supply { - return Supply.fromAmino(object.value); - }, - toAminoMsg(message: Supply): SupplyAminoMsg { - return { - type: 'cosmos-sdk/Supply', - value: Supply.toAmino(message), - }; - }, fromProtoMsg(message: SupplyProtoMsg): Supply { return Supply.decode(message.value); }, @@ -894,37 +636,6 @@ export const DenomUnit = { message.aliases = object.aliases?.map(e => e) || []; return message; }, - fromAmino(object: DenomUnitAmino): DenomUnit { - const message = createBaseDenomUnit(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - if (object.exponent !== undefined && object.exponent !== null) { - message.exponent = object.exponent; - } - message.aliases = object.aliases?.map(e => e) || []; - return message; - }, - toAmino(message: DenomUnit): DenomUnitAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - obj.exponent = message.exponent === 0 ? undefined : message.exponent; - if (message.aliases) { - obj.aliases = message.aliases.map(e => e); - } else { - obj.aliases = message.aliases; - } - return obj; - }, - fromAminoMsg(object: DenomUnitAminoMsg): DenomUnit { - return DenomUnit.fromAmino(object.value); - }, - toAminoMsg(message: DenomUnit): DenomUnitAminoMsg { - return { - type: 'cosmos-sdk/DenomUnit', - value: DenomUnit.toAmino(message), - }; - }, fromProtoMsg(message: DenomUnitProtoMsg): DenomUnit { return DenomUnit.decode(message.value); }, @@ -1067,61 +778,6 @@ export const Metadata = { message.uriHash = object.uriHash ?? ''; return message; }, - fromAmino(object: MetadataAmino): Metadata { - const message = createBaseMetadata(); - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - message.denomUnits = - object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; - if (object.base !== undefined && object.base !== null) { - message.base = object.base; - } - if (object.display !== undefined && object.display !== null) { - message.display = object.display; - } - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.symbol !== undefined && object.symbol !== null) { - message.symbol = object.symbol; - } - if (object.uri !== undefined && object.uri !== null) { - message.uri = object.uri; - } - if (object.uri_hash !== undefined && object.uri_hash !== null) { - message.uriHash = object.uri_hash; - } - return message; - }, - toAmino(message: Metadata): MetadataAmino { - const obj: any = {}; - obj.description = - message.description === '' ? undefined : message.description; - if (message.denomUnits) { - obj.denom_units = message.denomUnits.map(e => - e ? DenomUnit.toAmino(e) : undefined, - ); - } else { - obj.denom_units = message.denomUnits; - } - obj.base = message.base === '' ? undefined : message.base; - obj.display = message.display === '' ? undefined : message.display; - obj.name = message.name === '' ? undefined : message.name; - obj.symbol = message.symbol === '' ? undefined : message.symbol; - obj.uri = message.uri === '' ? undefined : message.uri; - obj.uri_hash = message.uriHash === '' ? undefined : message.uriHash; - return obj; - }, - fromAminoMsg(object: MetadataAminoMsg): Metadata { - return Metadata.fromAmino(object.value); - }, - toAminoMsg(message: Metadata): MetadataAminoMsg { - return { - type: 'cosmos-sdk/Metadata', - value: Metadata.toAmino(message), - }; - }, fromProtoMsg(message: MetadataProtoMsg): Metadata { return Metadata.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/genesis.ts index 50469f2a6f5..1731c522410 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/genesis.ts @@ -1,13 +1,6 @@ //@ts-nocheck -import { - Params, - ParamsAmino, - ParamsSDKType, - Metadata, - MetadataAmino, - MetadataSDKType, -} from './bank.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Params, ParamsSDKType, Metadata, MetadataSDKType } from './bank.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** GenesisState defines the bank module's genesis state. */ @@ -29,24 +22,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the bank module's genesis state. */ -export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; - /** balances is an array containing the balances of all the accounts. */ - balances?: BalanceAmino[]; - /** - * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - */ - supply?: CoinAmino[]; - /** denom_metadata defines the metadata of the differents coins. */ - denom_metadata?: MetadataAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the bank module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; balances: BalanceSDKType[]; @@ -67,20 +42,6 @@ export interface BalanceProtoMsg { typeUrl: '/cosmos.bank.v1beta1.Balance'; value: Uint8Array; } -/** - * Balance defines an account address and balance pair used in the bank module's - * genesis state. - */ -export interface BalanceAmino { - /** address is the address of the balance holder. */ - address?: string; - /** coins defines the different coins this balance holds. */ - coins?: CoinAmino[]; -} -export interface BalanceAminoMsg { - type: 'cosmos-sdk/Balance'; - value: BalanceAmino; -} /** * Balance defines an account address and balance pair used in the bank module's * genesis state. @@ -195,50 +156,6 @@ export const GenesisState = { object.denomMetadata?.map(e => Metadata.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; - message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; - message.denomMetadata = - object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - if (message.balances) { - obj.balances = message.balances.map(e => - e ? Balance.toAmino(e) : undefined, - ); - } else { - obj.balances = message.balances; - } - if (message.supply) { - obj.supply = message.supply.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.supply = message.supply; - } - if (message.denomMetadata) { - obj.denom_metadata = message.denomMetadata.map(e => - e ? Metadata.toAmino(e) : undefined, - ); - } else { - obj.denom_metadata = message.denomMetadata; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, @@ -317,33 +234,6 @@ export const Balance = { message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: BalanceAmino): Balance { - const message = createBaseBalance(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Balance): BalanceAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - if (message.coins) { - obj.coins = message.coins.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.coins = message.coins; - } - return obj; - }, - fromAminoMsg(object: BalanceAminoMsg): Balance { - return Balance.fromAmino(object.value); - }, - toAminoMsg(message: Balance): BalanceAminoMsg { - return { - type: 'cosmos-sdk/Balance', - value: Balance.toAmino(message), - }; - }, fromProtoMsg(message: BalanceProtoMsg): Balance { return Balance.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 4506788c423..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,241 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryBalanceRequest, - QueryBalanceResponse, - QueryAllBalancesRequest, - QueryAllBalancesResponse, - QuerySpendableBalancesRequest, - QuerySpendableBalancesResponse, - QueryTotalSupplyRequest, - QueryTotalSupplyResponse, - QuerySupplyOfRequest, - QuerySupplyOfResponse, - QueryParamsRequest, - QueryParamsResponse, - QueryDenomMetadataRequest, - QueryDenomMetadataResponse, - QueryDenomsMetadataRequest, - QueryDenomsMetadataResponse, - QueryDenomOwnersRequest, - QueryDenomOwnersResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Balance queries the balance of a single coin for a single account. */ - balance(request: QueryBalanceRequest): Promise; - /** AllBalances queries the balance of all coins for a single account. */ - allBalances( - request: QueryAllBalancesRequest, - ): Promise; - /** - * SpendableBalances queries the spenable balance of all coins for a single - * account. - */ - spendableBalances( - request: QuerySpendableBalancesRequest, - ): Promise; - /** TotalSupply queries the total supply of all coins. */ - totalSupply( - request?: QueryTotalSupplyRequest, - ): Promise; - /** SupplyOf queries the supply of a single coin. */ - supplyOf(request: QuerySupplyOfRequest): Promise; - /** Params queries the parameters of x/bank module. */ - params(request?: QueryParamsRequest): Promise; - /** DenomsMetadata queries the client metadata of a given coin denomination. */ - denomMetadata( - request: QueryDenomMetadataRequest, - ): Promise; - /** - * DenomsMetadata queries the client metadata for all registered coin - * denominations. - */ - denomsMetadata( - request?: QueryDenomsMetadataRequest, - ): Promise; - /** - * DenomOwners queries for all account addresses that own a particular token - * denomination. - */ - denomOwners( - request: QueryDenomOwnersRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.balance = this.balance.bind(this); - this.allBalances = this.allBalances.bind(this); - this.spendableBalances = this.spendableBalances.bind(this); - this.totalSupply = this.totalSupply.bind(this); - this.supplyOf = this.supplyOf.bind(this); - this.params = this.params.bind(this); - this.denomMetadata = this.denomMetadata.bind(this); - this.denomsMetadata = this.denomsMetadata.bind(this); - this.denomOwners = this.denomOwners.bind(this); - } - balance(request: QueryBalanceRequest): Promise { - const data = QueryBalanceRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'Balance', - data, - ); - return promise.then(data => - QueryBalanceResponse.decode(new BinaryReader(data)), - ); - } - allBalances( - request: QueryAllBalancesRequest, - ): Promise { - const data = QueryAllBalancesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'AllBalances', - data, - ); - return promise.then(data => - QueryAllBalancesResponse.decode(new BinaryReader(data)), - ); - } - spendableBalances( - request: QuerySpendableBalancesRequest, - ): Promise { - const data = QuerySpendableBalancesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'SpendableBalances', - data, - ); - return promise.then(data => - QuerySpendableBalancesResponse.decode(new BinaryReader(data)), - ); - } - totalSupply( - request: QueryTotalSupplyRequest = { - pagination: undefined, - }, - ): Promise { - const data = QueryTotalSupplyRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'TotalSupply', - data, - ); - return promise.then(data => - QueryTotalSupplyResponse.decode(new BinaryReader(data)), - ); - } - supplyOf(request: QuerySupplyOfRequest): Promise { - const data = QuerySupplyOfRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'SupplyOf', - data, - ); - return promise.then(data => - QuerySupplyOfResponse.decode(new BinaryReader(data)), - ); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - denomMetadata( - request: QueryDenomMetadataRequest, - ): Promise { - const data = QueryDenomMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'DenomMetadata', - data, - ); - return promise.then(data => - QueryDenomMetadataResponse.decode(new BinaryReader(data)), - ); - } - denomsMetadata( - request: QueryDenomsMetadataRequest = { - pagination: undefined, - }, - ): Promise { - const data = QueryDenomsMetadataRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'DenomsMetadata', - data, - ); - return promise.then(data => - QueryDenomsMetadataResponse.decode(new BinaryReader(data)), - ); - } - denomOwners( - request: QueryDenomOwnersRequest, - ): Promise { - const data = QueryDenomOwnersRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Query', - 'DenomOwners', - data, - ); - return promise.then(data => - QueryDenomOwnersResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - balance(request: QueryBalanceRequest): Promise { - return queryService.balance(request); - }, - allBalances( - request: QueryAllBalancesRequest, - ): Promise { - return queryService.allBalances(request); - }, - spendableBalances( - request: QuerySpendableBalancesRequest, - ): Promise { - return queryService.spendableBalances(request); - }, - totalSupply( - request?: QueryTotalSupplyRequest, - ): Promise { - return queryService.totalSupply(request); - }, - supplyOf(request: QuerySupplyOfRequest): Promise { - return queryService.supplyOf(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - denomMetadata( - request: QueryDenomMetadataRequest, - ): Promise { - return queryService.denomMetadata(request); - }, - denomsMetadata( - request?: QueryDenomsMetadataRequest, - ): Promise { - return queryService.denomsMetadata(request); - }, - denomOwners( - request: QueryDenomOwnersRequest, - ): Promise { - return queryService.denomOwners(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts index bd395253895..1b6edf95469 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts @@ -1,21 +1,12 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; -import { - Params, - ParamsAmino, - ParamsSDKType, - Metadata, - MetadataAmino, - MetadataSDKType, -} from './bank.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Params, ParamsSDKType, Metadata, MetadataSDKType } from './bank.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ @@ -30,17 +21,6 @@ export interface QueryBalanceRequestProtoMsg { value: Uint8Array; } /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ -export interface QueryBalanceRequestAmino { - /** address is the address to query balances for. */ - address?: string; - /** denom is the coin denom to query balances for. */ - denom?: string; -} -export interface QueryBalanceRequestAminoMsg { - type: 'cosmos-sdk/QueryBalanceRequest'; - value: QueryBalanceRequestAmino; -} -/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequestSDKType { address: string; denom: string; @@ -55,15 +35,6 @@ export interface QueryBalanceResponseProtoMsg { value: Uint8Array; } /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ -export interface QueryBalanceResponseAmino { - /** balance is the balance of the coin. */ - balance?: CoinAmino; -} -export interface QueryBalanceResponseAminoMsg { - type: 'cosmos-sdk/QueryBalanceResponse'; - value: QueryBalanceResponseAmino; -} -/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponseSDKType { balance?: CoinSDKType; } @@ -79,17 +50,6 @@ export interface QueryAllBalancesRequestProtoMsg { value: Uint8Array; } /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ -export interface QueryAllBalancesRequestAmino { - /** address is the address to query balances for. */ - address?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryAllBalancesRequestAminoMsg { - type: 'cosmos-sdk/QueryAllBalancesRequest'; - value: QueryAllBalancesRequestAmino; -} -/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestSDKType { address: string; pagination?: PageRequestSDKType; @@ -108,20 +68,6 @@ export interface QueryAllBalancesResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryAllBalancesResponse'; value: Uint8Array; } -/** - * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC - * method. - */ -export interface QueryAllBalancesResponseAmino { - /** balances is the balances of all the coins. */ - balances?: CoinAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryAllBalancesResponseAminoMsg { - type: 'cosmos-sdk/QueryAllBalancesResponse'; - value: QueryAllBalancesResponseAmino; -} /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC * method. @@ -144,20 +90,6 @@ export interface QuerySpendableBalancesRequestProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QuerySpendableBalancesRequest'; value: Uint8Array; } -/** - * QuerySpendableBalancesRequest defines the gRPC request structure for querying - * an account's spendable balances. - */ -export interface QuerySpendableBalancesRequestAmino { - /** address is the address to query spendable balances for. */ - address?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QuerySpendableBalancesRequestAminoMsg { - type: 'cosmos-sdk/QuerySpendableBalancesRequest'; - value: QuerySpendableBalancesRequestAmino; -} /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. @@ -180,20 +112,6 @@ export interface QuerySpendableBalancesResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QuerySpendableBalancesResponse'; value: Uint8Array; } -/** - * QuerySpendableBalancesResponse defines the gRPC response structure for querying - * an account's spendable balances. - */ -export interface QuerySpendableBalancesResponseAmino { - /** balances is the spendable balances of all the coins. */ - balances?: CoinAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QuerySpendableBalancesResponseAminoMsg { - type: 'cosmos-sdk/QuerySpendableBalancesResponse'; - value: QuerySpendableBalancesResponseAmino; -} /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. @@ -218,22 +136,6 @@ export interface QueryTotalSupplyRequestProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryTotalSupplyRequest'; value: Uint8Array; } -/** - * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC - * method. - */ -export interface QueryTotalSupplyRequestAmino { - /** - * pagination defines an optional pagination for the request. - * - * Since: cosmos-sdk 0.43 - */ - pagination?: PageRequestAmino; -} -export interface QueryTotalSupplyRequestAminoMsg { - type: 'cosmos-sdk/QueryTotalSupplyRequest'; - value: QueryTotalSupplyRequestAmino; -} /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC * method. @@ -259,24 +161,6 @@ export interface QueryTotalSupplyResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryTotalSupplyResponse'; value: Uint8Array; } -/** - * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC - * method - */ -export interface QueryTotalSupplyResponseAmino { - /** supply is the supply of the coins */ - supply?: CoinAmino[]; - /** - * pagination defines the pagination in the response. - * - * Since: cosmos-sdk 0.43 - */ - pagination?: PageResponseAmino; -} -export interface QueryTotalSupplyResponseAminoMsg { - type: 'cosmos-sdk/QueryTotalSupplyResponse'; - value: QueryTotalSupplyResponseAmino; -} /** * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC * method @@ -295,15 +179,6 @@ export interface QuerySupplyOfRequestProtoMsg { value: Uint8Array; } /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ -export interface QuerySupplyOfRequestAmino { - /** denom is the coin denom to query balances for. */ - denom?: string; -} -export interface QuerySupplyOfRequestAminoMsg { - type: 'cosmos-sdk/QuerySupplyOfRequest'; - value: QuerySupplyOfRequestAmino; -} -/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequestSDKType { denom: string; } @@ -317,15 +192,6 @@ export interface QuerySupplyOfResponseProtoMsg { value: Uint8Array; } /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ -export interface QuerySupplyOfResponseAmino { - /** amount is the supply of the coin. */ - amount?: CoinAmino; -} -export interface QuerySupplyOfResponseAminoMsg { - type: 'cosmos-sdk/QuerySupplyOfResponse'; - value: QuerySupplyOfResponseAmino; -} -/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponseSDKType { amount: CoinSDKType; } @@ -336,12 +202,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest defines the request type for querying x/bank parameters. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest defines the request type for querying x/bank parameters. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponse { @@ -352,14 +212,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse defines the response type for querying x/bank parameters. */ -export interface QueryParamsResponseAmino { - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -373,15 +225,6 @@ export interface QueryDenomsMetadataRequestProtoMsg { value: Uint8Array; } /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ -export interface QueryDenomsMetadataRequestAmino { - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDenomsMetadataRequestAminoMsg { - type: 'cosmos-sdk/QueryDenomsMetadataRequest'; - value: QueryDenomsMetadataRequestAmino; -} -/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequestSDKType { pagination?: PageRequestSDKType; } @@ -399,20 +242,6 @@ export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryDenomsMetadataResponse'; value: Uint8Array; } -/** - * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC - * method. - */ -export interface QueryDenomsMetadataResponseAmino { - /** metadata provides the client information for all the registered tokens. */ - metadatas?: MetadataAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDenomsMetadataResponseAminoMsg { - type: 'cosmos-sdk/QueryDenomsMetadataResponse'; - value: QueryDenomsMetadataResponseAmino; -} /** * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC * method. @@ -431,15 +260,6 @@ export interface QueryDenomMetadataRequestProtoMsg { value: Uint8Array; } /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ -export interface QueryDenomMetadataRequestAmino { - /** denom is the coin denom to query the metadata for. */ - denom?: string; -} -export interface QueryDenomMetadataRequestAminoMsg { - type: 'cosmos-sdk/QueryDenomMetadataRequest'; - value: QueryDenomMetadataRequestAmino; -} -/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequestSDKType { denom: string; } @@ -455,18 +275,6 @@ export interface QueryDenomMetadataResponseProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryDenomMetadataResponse'; value: Uint8Array; } -/** - * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC - * method. - */ -export interface QueryDenomMetadataResponseAmino { - /** metadata describes and provides all the client information for the requested token. */ - metadata?: MetadataAmino; -} -export interface QueryDenomMetadataResponseAminoMsg { - type: 'cosmos-sdk/QueryDenomMetadataResponse'; - value: QueryDenomMetadataResponseAmino; -} /** * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC * method. @@ -489,21 +297,6 @@ export interface QueryDenomOwnersRequestProtoMsg { typeUrl: '/cosmos.bank.v1beta1.QueryDenomOwnersRequest'; value: Uint8Array; } -/** - * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, - * which queries for a paginated set of all account holders of a particular - * denomination. - */ -export interface QueryDenomOwnersRequestAmino { - /** denom defines the coin denomination to query all account holders for. */ - denom?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDenomOwnersRequestAminoMsg { - type: 'cosmos-sdk/QueryDenomOwnersRequest'; - value: QueryDenomOwnersRequestAmino; -} /** * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, * which queries for a paginated set of all account holders of a particular @@ -528,21 +321,6 @@ export interface DenomOwnerProtoMsg { typeUrl: '/cosmos.bank.v1beta1.DenomOwner'; value: Uint8Array; } -/** - * DenomOwner defines structure representing an account that owns or holds a - * particular denominated token. It contains the account address and account - * balance of the denominated token. - */ -export interface DenomOwnerAmino { - /** address defines the address that owns a particular denomination. */ - address?: string; - /** balance is the balance of the denominated coin for an account. */ - balance?: CoinAmino; -} -export interface DenomOwnerAminoMsg { - type: 'cosmos-sdk/DenomOwner'; - value: DenomOwnerAmino; -} /** * DenomOwner defines structure representing an account that owns or holds a * particular denominated token. It contains the account address and account @@ -563,16 +341,6 @@ export interface QueryDenomOwnersResponseProtoMsg { value: Uint8Array; } /** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ -export interface QueryDenomOwnersResponseAmino { - denom_owners?: DenomOwnerAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDenomOwnersResponseAminoMsg { - type: 'cosmos-sdk/QueryDenomOwnersResponse'; - value: QueryDenomOwnersResponseAmino; -} -/** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ export interface QueryDenomOwnersResponseSDKType { denom_owners: DenomOwnerSDKType[]; pagination?: PageResponseSDKType; @@ -639,31 +407,6 @@ export const QueryBalanceRequest = { message.denom = object.denom ?? ''; return message; }, - fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - const message = createBaseQueryBalanceRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - return message; - }, - toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.denom = message.denom === '' ? undefined : message.denom; - return obj; - }, - fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { - return QueryBalanceRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryBalanceRequest): QueryBalanceRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryBalanceRequest', - value: QueryBalanceRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryBalanceRequestProtoMsg): QueryBalanceRequest { return QueryBalanceRequest.decode(message.value); }, @@ -737,27 +480,6 @@ export const QueryBalanceResponse = { : undefined; return message; }, - fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - const message = createBaseQueryBalanceResponse(); - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromAmino(object.balance); - } - return message; - }, - toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { - const obj: any = {}; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; - return obj; - }, - fromAminoMsg(object: QueryBalanceResponseAminoMsg): QueryBalanceResponse { - return QueryBalanceResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryBalanceResponse): QueryBalanceResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryBalanceResponse', - value: QueryBalanceResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryBalanceResponseProtoMsg): QueryBalanceResponse { return QueryBalanceResponse.decode(message.value); }, @@ -843,37 +565,6 @@ export const QueryAllBalancesRequest = { : undefined; return message; }, - fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { - const message = createBaseQueryAllBalancesRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAllBalancesRequestAminoMsg, - ): QueryAllBalancesRequest { - return QueryAllBalancesRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAllBalancesRequest, - ): QueryAllBalancesRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAllBalancesRequest', - value: QueryAllBalancesRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllBalancesRequestProtoMsg, ): QueryAllBalancesRequest { @@ -974,41 +665,6 @@ export const QueryAllBalancesResponse = { : undefined; return message; }, - fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { - const message = createBaseQueryAllBalancesResponse(); - message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { - const obj: any = {}; - if (message.balances) { - obj.balances = message.balances.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.balances = message.balances; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAllBalancesResponseAminoMsg, - ): QueryAllBalancesResponse { - return QueryAllBalancesResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAllBalancesResponse, - ): QueryAllBalancesResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAllBalancesResponse', - value: QueryAllBalancesResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllBalancesResponseProtoMsg, ): QueryAllBalancesResponse { @@ -1098,41 +754,6 @@ export const QuerySpendableBalancesRequest = { : undefined; return message; }, - fromAmino( - object: QuerySpendableBalancesRequestAmino, - ): QuerySpendableBalancesRequest { - const message = createBaseQuerySpendableBalancesRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QuerySpendableBalancesRequest, - ): QuerySpendableBalancesRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QuerySpendableBalancesRequestAminoMsg, - ): QuerySpendableBalancesRequest { - return QuerySpendableBalancesRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QuerySpendableBalancesRequest, - ): QuerySpendableBalancesRequestAminoMsg { - return { - type: 'cosmos-sdk/QuerySpendableBalancesRequest', - value: QuerySpendableBalancesRequest.toAmino(message), - }; - }, fromProtoMsg( message: QuerySpendableBalancesRequestProtoMsg, ): QuerySpendableBalancesRequest { @@ -1233,45 +854,6 @@ export const QuerySpendableBalancesResponse = { : undefined; return message; }, - fromAmino( - object: QuerySpendableBalancesResponseAmino, - ): QuerySpendableBalancesResponse { - const message = createBaseQuerySpendableBalancesResponse(); - message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QuerySpendableBalancesResponse, - ): QuerySpendableBalancesResponseAmino { - const obj: any = {}; - if (message.balances) { - obj.balances = message.balances.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.balances = message.balances; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QuerySpendableBalancesResponseAminoMsg, - ): QuerySpendableBalancesResponse { - return QuerySpendableBalancesResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QuerySpendableBalancesResponse, - ): QuerySpendableBalancesResponseAminoMsg { - return { - type: 'cosmos-sdk/QuerySpendableBalancesResponse', - value: QuerySpendableBalancesResponse.toAmino(message), - }; - }, fromProtoMsg( message: QuerySpendableBalancesResponseProtoMsg, ): QuerySpendableBalancesResponse { @@ -1351,33 +933,6 @@ export const QueryTotalSupplyRequest = { : undefined; return message; }, - fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { - const message = createBaseQueryTotalSupplyRequest(); - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { - const obj: any = {}; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTotalSupplyRequestAminoMsg, - ): QueryTotalSupplyRequest { - return QueryTotalSupplyRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTotalSupplyRequest, - ): QueryTotalSupplyRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryTotalSupplyRequest', - value: QueryTotalSupplyRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryTotalSupplyRequestProtoMsg, ): QueryTotalSupplyRequest { @@ -1476,39 +1031,6 @@ export const QueryTotalSupplyResponse = { : undefined; return message; }, - fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { - const message = createBaseQueryTotalSupplyResponse(); - message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { - const obj: any = {}; - if (message.supply) { - obj.supply = message.supply.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.supply = message.supply; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTotalSupplyResponseAminoMsg, - ): QueryTotalSupplyResponse { - return QueryTotalSupplyResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTotalSupplyResponse, - ): QueryTotalSupplyResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryTotalSupplyResponse', - value: QueryTotalSupplyResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryTotalSupplyResponseProtoMsg, ): QueryTotalSupplyResponse { @@ -1578,27 +1100,6 @@ export const QuerySupplyOfRequest = { message.denom = object.denom ?? ''; return message; }, - fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { - const message = createBaseQuerySupplyOfRequest(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - return message; - }, - toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - return obj; - }, - fromAminoMsg(object: QuerySupplyOfRequestAminoMsg): QuerySupplyOfRequest { - return QuerySupplyOfRequest.fromAmino(object.value); - }, - toAminoMsg(message: QuerySupplyOfRequest): QuerySupplyOfRequestAminoMsg { - return { - type: 'cosmos-sdk/QuerySupplyOfRequest', - value: QuerySupplyOfRequest.toAmino(message), - }; - }, fromProtoMsg(message: QuerySupplyOfRequestProtoMsg): QuerySupplyOfRequest { return QuerySupplyOfRequest.decode(message.value); }, @@ -1668,27 +1169,6 @@ export const QuerySupplyOfResponse = { : undefined; return message; }, - fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { - const message = createBaseQuerySupplyOfResponse(); - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromAmino(object.amount); - } - return message; - }, - toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { - const obj: any = {}; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - return obj; - }, - fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { - return QuerySupplyOfResponse.fromAmino(object.value); - }, - toAminoMsg(message: QuerySupplyOfResponse): QuerySupplyOfResponseAminoMsg { - return { - type: 'cosmos-sdk/QuerySupplyOfResponse', - value: QuerySupplyOfResponse.toAmino(message), - }; - }, fromProtoMsg(message: QuerySupplyOfResponseProtoMsg): QuerySupplyOfResponse { return QuerySupplyOfResponse.decode(message.value); }, @@ -1742,23 +1222,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -1828,27 +1291,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -1924,37 +1366,6 @@ export const QueryDenomsMetadataRequest = { : undefined; return message; }, - fromAmino( - object: QueryDenomsMetadataRequestAmino, - ): QueryDenomsMetadataRequest { - const message = createBaseQueryDenomsMetadataRequest(); - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDenomsMetadataRequest, - ): QueryDenomsMetadataRequestAmino { - const obj: any = {}; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDenomsMetadataRequestAminoMsg, - ): QueryDenomsMetadataRequest { - return QueryDenomsMetadataRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomsMetadataRequest, - ): QueryDenomsMetadataRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomsMetadataRequest', - value: QueryDenomsMetadataRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomsMetadataRequestProtoMsg, ): QueryDenomsMetadataRequest { @@ -2056,45 +1467,6 @@ export const QueryDenomsMetadataResponse = { : undefined; return message; }, - fromAmino( - object: QueryDenomsMetadataResponseAmino, - ): QueryDenomsMetadataResponse { - const message = createBaseQueryDenomsMetadataResponse(); - message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDenomsMetadataResponse, - ): QueryDenomsMetadataResponseAmino { - const obj: any = {}; - if (message.metadatas) { - obj.metadatas = message.metadatas.map(e => - e ? Metadata.toAmino(e) : undefined, - ); - } else { - obj.metadatas = message.metadatas; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDenomsMetadataResponseAminoMsg, - ): QueryDenomsMetadataResponse { - return QueryDenomsMetadataResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomsMetadataResponse, - ): QueryDenomsMetadataResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomsMetadataResponse', - value: QueryDenomsMetadataResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomsMetadataResponseProtoMsg, ): QueryDenomsMetadataResponse { @@ -2166,31 +1538,6 @@ export const QueryDenomMetadataRequest = { message.denom = object.denom ?? ''; return message; }, - fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { - const message = createBaseQueryDenomMetadataRequest(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - return message; - }, - toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - return obj; - }, - fromAminoMsg( - object: QueryDenomMetadataRequestAminoMsg, - ): QueryDenomMetadataRequest { - return QueryDenomMetadataRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomMetadataRequest, - ): QueryDenomMetadataRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomMetadataRequest', - value: QueryDenomMetadataRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomMetadataRequestProtoMsg, ): QueryDenomMetadataRequest { @@ -2270,37 +1617,6 @@ export const QueryDenomMetadataResponse = { : undefined; return message; }, - fromAmino( - object: QueryDenomMetadataResponseAmino, - ): QueryDenomMetadataResponse { - const message = createBaseQueryDenomMetadataResponse(); - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = Metadata.fromAmino(object.metadata); - } - return message; - }, - toAmino( - message: QueryDenomMetadataResponse, - ): QueryDenomMetadataResponseAmino { - const obj: any = {}; - obj.metadata = message.metadata - ? Metadata.toAmino(message.metadata) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDenomMetadataResponseAminoMsg, - ): QueryDenomMetadataResponse { - return QueryDenomMetadataResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomMetadataResponse, - ): QueryDenomMetadataResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomMetadataResponse', - value: QueryDenomMetadataResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomMetadataResponseProtoMsg, ): QueryDenomMetadataResponse { @@ -2390,37 +1706,6 @@ export const QueryDenomOwnersRequest = { : undefined; return message; }, - fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { - const message = createBaseQueryDenomOwnersRequest(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDenomOwnersRequestAminoMsg, - ): QueryDenomOwnersRequest { - return QueryDenomOwnersRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomOwnersRequest, - ): QueryDenomOwnersRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomOwnersRequest', - value: QueryDenomOwnersRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomOwnersRequestProtoMsg, ): QueryDenomOwnersRequest { @@ -2505,31 +1790,6 @@ export const DenomOwner = { : undefined; return message; }, - fromAmino(object: DenomOwnerAmino): DenomOwner { - const message = createBaseDenomOwner(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromAmino(object.balance); - } - return message; - }, - toAmino(message: DenomOwner): DenomOwnerAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; - return obj; - }, - fromAminoMsg(object: DenomOwnerAminoMsg): DenomOwner { - return DenomOwner.fromAmino(object.value); - }, - toAminoMsg(message: DenomOwner): DenomOwnerAminoMsg { - return { - type: 'cosmos-sdk/DenomOwner', - value: DenomOwner.toAmino(message), - }; - }, fromProtoMsg(message: DenomOwnerProtoMsg): DenomOwner { return DenomOwner.decode(message.value); }, @@ -2627,42 +1887,6 @@ export const QueryDenomOwnersResponse = { : undefined; return message; }, - fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { - const message = createBaseQueryDenomOwnersResponse(); - message.denomOwners = - object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { - const obj: any = {}; - if (message.denomOwners) { - obj.denom_owners = message.denomOwners.map(e => - e ? DenomOwner.toAmino(e) : undefined, - ); - } else { - obj.denom_owners = message.denomOwners; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDenomOwnersResponseAminoMsg, - ): QueryDenomOwnersResponse { - return QueryDenomOwnersResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDenomOwnersResponse, - ): QueryDenomOwnersResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDenomOwnersResponse', - value: QueryDenomOwnersResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDenomOwnersResponseProtoMsg, ): QueryDenomOwnersResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.amino.ts deleted file mode 100644 index 078d1b1417a..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.amino.ts +++ /dev/null @@ -1,14 +0,0 @@ -//@ts-nocheck -import { MsgSend, MsgMultiSend } from './tx.js'; -export const AminoConverter = { - '/cosmos.bank.v1beta1.MsgSend': { - aminoType: 'cosmos-sdk/MsgSend', - toAmino: MsgSend.toAmino, - fromAmino: MsgSend.fromAmino, - }, - '/cosmos.bank.v1beta1.MsgMultiSend': { - aminoType: 'cosmos-sdk/MsgMultiSend', - toAmino: MsgMultiSend.toAmino, - fromAmino: MsgMultiSend.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.registry.ts deleted file mode 100644 index e3e5111c32d..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.registry.ts +++ /dev/null @@ -1,84 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { MsgSend, MsgMultiSend } from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.bank.v1beta1.MsgSend', MsgSend], - ['/cosmos.bank.v1beta1.MsgMultiSend', MsgMultiSend], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - send(value: MsgSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.encode(value).finish(), - }; - }, - multiSend(value: MsgMultiSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', - value: MsgMultiSend.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - send(value: MsgSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value, - }; - }, - multiSend(value: MsgMultiSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', - value, - }; - }, - }, - toJSON: { - send(value: MsgSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.toJSON(value), - }; - }, - multiSend(value: MsgMultiSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', - value: MsgMultiSend.toJSON(value), - }; - }, - }, - fromJSON: { - send(value: any) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.fromJSON(value), - }; - }, - multiSend(value: any) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', - value: MsgMultiSend.fromJSON(value), - }; - }, - }, - fromPartial: { - send(value: MsgSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: MsgSend.fromPartial(value), - }; - }, - multiSend(value: MsgMultiSend) { - return { - typeUrl: '/cosmos.bank.v1beta1.MsgMultiSend', - value: MsgMultiSend.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 88e59d100fd..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,40 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgSend, - MsgSendResponse, - MsgMultiSend, - MsgMultiSendResponse, -} from './tx.js'; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** Send defines a method for sending coins from one account to another account. */ - send(request: MsgSend): Promise; - /** MultiSend defines a method for sending coins from some accounts to other accounts. */ - multiSend(request: MsgMultiSend): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.send = this.send.bind(this); - this.multiSend = this.multiSend.bind(this); - } - send(request: MsgSend): Promise { - const data = MsgSend.encode(request).finish(); - const promise = this.rpc.request('cosmos.bank.v1beta1.Msg', 'Send', data); - return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); - } - multiSend(request: MsgMultiSend): Promise { - const data = MsgMultiSend.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.bank.v1beta1.Msg', - 'MultiSend', - data, - ); - return promise.then(data => - MsgMultiSendResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.ts index 588f50cddd0..3e6c624e85c 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.ts @@ -1,13 +1,6 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; -import { - Input, - InputAmino, - InputSDKType, - Output, - OutputAmino, - OutputSDKType, -} from './bank.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Input, InputSDKType, Output, OutputSDKType } from './bank.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** MsgSend represents a message to send coins from one account to another. */ @@ -21,16 +14,6 @@ export interface MsgSendProtoMsg { value: Uint8Array; } /** MsgSend represents a message to send coins from one account to another. */ -export interface MsgSendAmino { - from_address?: string; - to_address?: string; - amount?: CoinAmino[]; -} -export interface MsgSendAminoMsg { - type: 'cosmos-sdk/MsgSend'; - value: MsgSendAmino; -} -/** MsgSend represents a message to send coins from one account to another. */ export interface MsgSendSDKType { from_address: string; to_address: string; @@ -43,12 +26,6 @@ export interface MsgSendResponseProtoMsg { value: Uint8Array; } /** MsgSendResponse defines the Msg/Send response type. */ -export interface MsgSendResponseAmino {} -export interface MsgSendResponseAminoMsg { - type: 'cosmos-sdk/MsgSendResponse'; - value: MsgSendResponseAmino; -} -/** MsgSendResponse defines the Msg/Send response type. */ export interface MsgSendResponseSDKType {} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { @@ -60,15 +37,6 @@ export interface MsgMultiSendProtoMsg { value: Uint8Array; } /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ -export interface MsgMultiSendAmino { - inputs?: InputAmino[]; - outputs?: OutputAmino[]; -} -export interface MsgMultiSendAminoMsg { - type: 'cosmos-sdk/MsgMultiSend'; - value: MsgMultiSendAmino; -} -/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSendSDKType { inputs: InputSDKType[]; outputs: OutputSDKType[]; @@ -80,12 +48,6 @@ export interface MsgMultiSendResponseProtoMsg { value: Uint8Array; } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ -export interface MsgMultiSendResponseAmino {} -export interface MsgMultiSendResponseAminoMsg { - type: 'cosmos-sdk/MsgMultiSendResponse'; - value: MsgMultiSendResponseAmino; -} -/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponseSDKType {} function createBaseMsgSend(): MsgSend { return { @@ -163,38 +125,6 @@ export const MsgSend = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgSendAmino): MsgSend { - const message = createBaseMsgSend(); - if (object.from_address !== undefined && object.from_address !== null) { - message.fromAddress = object.from_address; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.toAddress = object.to_address; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgSend): MsgSendAmino { - const obj: any = {}; - obj.from_address = - message.fromAddress === '' ? undefined : message.fromAddress; - obj.to_address = message.toAddress === '' ? undefined : message.toAddress; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: MsgSendAminoMsg): MsgSend { - return MsgSend.fromAmino(object.value); - }, - toAminoMsg(message: MsgSend): MsgSendAminoMsg { - return { - type: 'cosmos-sdk/MsgSend', - value: MsgSend.toAmino(message), - }; - }, fromProtoMsg(message: MsgSendProtoMsg): MsgSend { return MsgSend.decode(message.value); }, @@ -245,23 +175,6 @@ export const MsgSendResponse = { const message = createBaseMsgSendResponse(); return message; }, - fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - const message = createBaseMsgSendResponse(); - return message; - }, - toAmino(_: MsgSendResponse): MsgSendResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { - return MsgSendResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgSendResponse', - value: MsgSendResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { return MsgSendResponse.decode(message.value); }, @@ -348,37 +261,6 @@ export const MsgMultiSend = { message.outputs = object.outputs?.map(e => Output.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgMultiSendAmino): MsgMultiSend { - const message = createBaseMsgMultiSend(); - message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; - message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgMultiSend): MsgMultiSendAmino { - const obj: any = {}; - if (message.inputs) { - obj.inputs = message.inputs.map(e => (e ? Input.toAmino(e) : undefined)); - } else { - obj.inputs = message.inputs; - } - if (message.outputs) { - obj.outputs = message.outputs.map(e => - e ? Output.toAmino(e) : undefined, - ); - } else { - obj.outputs = message.outputs; - } - return obj; - }, - fromAminoMsg(object: MsgMultiSendAminoMsg): MsgMultiSend { - return MsgMultiSend.fromAmino(object.value); - }, - toAminoMsg(message: MsgMultiSend): MsgMultiSendAminoMsg { - return { - type: 'cosmos-sdk/MsgMultiSend', - value: MsgMultiSend.toAmino(message), - }; - }, fromProtoMsg(message: MsgMultiSendProtoMsg): MsgMultiSend { return MsgMultiSend.decode(message.value); }, @@ -432,23 +314,6 @@ export const MsgMultiSendResponse = { const message = createBaseMsgMultiSendResponse(); return message; }, - fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { - const message = createBaseMsgMultiSendResponse(); - return message; - }, - toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgMultiSendResponseAminoMsg): MsgMultiSendResponse { - return MsgMultiSendResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgMultiSendResponse): MsgMultiSendResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgMultiSendResponse', - value: MsgMultiSendResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgMultiSendResponseProtoMsg): MsgMultiSendResponse { return MsgMultiSendResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts index 057db595dbc..961b0a68ace 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -1,10 +1,6 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../../google/protobuf/any.js'; -import { - Event, - EventAmino, - EventSDKType, -} from '../../../../tendermint/abci/types.js'; +import { Any, AnySDKType } from '../../../../google/protobuf/any.js'; +import { Event, EventSDKType } from '../../../../tendermint/abci/types.js'; import { BinaryReader, BinaryWriter } from '../../../../binary.js'; import { isSet, @@ -61,56 +57,6 @@ export interface TxResponseProtoMsg { typeUrl: '/cosmos.base.abci.v1beta1.TxResponse'; value: Uint8Array; } -/** - * TxResponse defines a structure containing relevant tx data and metadata. The - * tags are stringified and the log is JSON decoded. - */ -export interface TxResponseAmino { - /** The block height */ - height?: string; - /** The transaction hash. */ - txhash?: string; - /** Namespace for the Code */ - codespace?: string; - /** Response code. */ - code?: number; - /** Result bytes, if any. */ - data?: string; - /** - * The output of the application's logger (raw string). May be - * non-deterministic. - */ - raw_log?: string; - /** The output of the application's logger (typed). May be non-deterministic. */ - logs?: ABCIMessageLogAmino[]; - /** Additional information. May be non-deterministic. */ - info?: string; - /** Amount of gas requested for transaction. */ - gas_wanted?: string; - /** Amount of gas consumed by transaction. */ - gas_used?: string; - /** The request transaction bytes. */ - tx?: AnyAmino; - /** - * Time of the previous block. For heights > 1, it's the weighted median of - * the timestamps of the valid votes in the block.LastCommit. For height == 1, - * it's genesis time. - */ - timestamp?: string; - /** - * Events defines all the events emitted by processing a transaction. Note, - * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with - * additional metadata, emitted only by processing the messages. - * - * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - */ - events?: EventAmino[]; -} -export interface TxResponseAminoMsg { - type: 'cosmos-sdk/TxResponse'; - value: TxResponseAmino; -} /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. @@ -145,20 +91,6 @@ export interface ABCIMessageLogProtoMsg { value: Uint8Array; } /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ -export interface ABCIMessageLogAmino { - msg_index: number; - log?: string; - /** - * Events contains a slice of Event objects that were emitted during some - * execution. - */ - events?: StringEventAmino[]; -} -export interface ABCIMessageLogAminoMsg { - type: 'cosmos-sdk/ABCIMessageLog'; - value: ABCIMessageLogAmino; -} -/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLogSDKType { msg_index: number; log: string; @@ -176,18 +108,6 @@ export interface StringEventProtoMsg { typeUrl: '/cosmos.base.abci.v1beta1.StringEvent'; value: Uint8Array; } -/** - * StringEvent defines en Event object wrapper where all the attributes - * contain key/value pairs that are strings instead of raw bytes. - */ -export interface StringEventAmino { - type?: string; - attributes?: AttributeAmino[]; -} -export interface StringEventAminoMsg { - type: 'cosmos-sdk/StringEvent'; - value: StringEventAmino; -} /** * StringEvent defines en Event object wrapper where all the attributes * contain key/value pairs that are strings instead of raw bytes. @@ -208,18 +128,6 @@ export interface AttributeProtoMsg { typeUrl: '/cosmos.base.abci.v1beta1.Attribute'; value: Uint8Array; } -/** - * Attribute defines an attribute wrapper where the key and value are - * strings instead of raw bytes. - */ -export interface AttributeAmino { - key?: string; - value?: string; -} -export interface AttributeAminoMsg { - type: 'cosmos-sdk/Attribute'; - value: AttributeAmino; -} /** * Attribute defines an attribute wrapper where the key and value are * strings instead of raw bytes. @@ -240,17 +148,6 @@ export interface GasInfoProtoMsg { value: Uint8Array; } /** GasInfo defines tx execution gas context. */ -export interface GasInfoAmino { - /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted?: string; - /** GasUsed is the amount of gas actually consumed. */ - gas_used?: string; -} -export interface GasInfoAminoMsg { - type: 'cosmos-sdk/GasInfo'; - value: GasInfoAmino; -} -/** GasInfo defines tx execution gas context. */ export interface GasInfoSDKType { gas_wanted: bigint; gas_used: bigint; @@ -284,34 +181,6 @@ export interface ResultProtoMsg { value: Uint8Array; } /** Result is the union of ResponseFormat and ResponseCheckTx. */ -export interface ResultAmino { - /** - * Data is any data returned from message or handler execution. It MUST be - * length prefixed in order to separate data from multiple message executions. - * Deprecated. This field is still populated, but prefer msg_response instead - * because it also contains the Msg response typeURL. - */ - /** @deprecated */ - data?: string; - /** Log contains the log information from message or handler execution. */ - log?: string; - /** - * Events contains a slice of Event objects that were emitted during message - * or handler execution. - */ - events?: EventAmino[]; - /** - * msg_responses contains the Msg handler responses type packed in Anys. - * - * Since: cosmos-sdk 0.46 - */ - msg_responses?: AnyAmino[]; -} -export interface ResultAminoMsg { - type: 'cosmos-sdk/Result'; - value: ResultAmino; -} -/** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface ResultSDKType { /** @deprecated */ data: Uint8Array; @@ -331,18 +200,6 @@ export interface SimulationResponseProtoMsg { typeUrl: '/cosmos.base.abci.v1beta1.SimulationResponse'; value: Uint8Array; } -/** - * SimulationResponse defines the response generated when a transaction is - * successfully simulated. - */ -export interface SimulationResponseAmino { - gas_info?: GasInfoAmino; - result?: ResultAmino; -} -export interface SimulationResponseAminoMsg { - type: 'cosmos-sdk/SimulationResponse'; - value: SimulationResponseAmino; -} /** * SimulationResponse defines the response generated when a transaction is * successfully simulated. @@ -369,19 +226,6 @@ export interface MsgDataProtoMsg { * execution. */ /** @deprecated */ -export interface MsgDataAmino { - msg_type?: string; - data?: string; -} -export interface MsgDataAminoMsg { - type: 'cosmos-sdk/MsgData'; - value: MsgDataAmino; -} -/** - * MsgData defines the data returned in a Result object during message - * execution. - */ -/** @deprecated */ export interface MsgDataSDKType { msg_type: string; data: Uint8Array; @@ -405,25 +249,6 @@ export interface TxMsgDataProtoMsg { typeUrl: '/cosmos.base.abci.v1beta1.TxMsgData'; value: Uint8Array; } -/** - * TxMsgData defines a list of MsgData. A transaction will have a MsgData object - * for each message. - */ -export interface TxMsgDataAmino { - /** data field is deprecated and not populated. */ - /** @deprecated */ - data?: MsgDataAmino[]; - /** - * msg_responses contains the Msg handler responses packed into Anys. - * - * Since: cosmos-sdk 0.46 - */ - msg_responses?: AnyAmino[]; -} -export interface TxMsgDataAminoMsg { - type: 'cosmos-sdk/TxMsgData'; - value: TxMsgDataAmino; -} /** * TxMsgData defines a list of MsgData. A transaction will have a MsgData object * for each message. @@ -453,25 +278,6 @@ export interface SearchTxsResultProtoMsg { value: Uint8Array; } /** SearchTxsResult defines a structure for querying txs pageable */ -export interface SearchTxsResultAmino { - /** Count of all txs */ - total_count?: string; - /** Count of txs in current page */ - count?: string; - /** Index of current page, start from 1 */ - page_number?: string; - /** Count of total pages */ - page_total?: string; - /** Max count txs per page */ - limit?: string; - /** List of txs in current page */ - txs?: TxResponseAmino[]; -} -export interface SearchTxsResultAminoMsg { - type: 'cosmos-sdk/SearchTxsResult'; - value: SearchTxsResultAmino; -} -/** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultSDKType { total_count: bigint; count: bigint; @@ -685,86 +491,6 @@ export const TxResponse = { message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, - fromAmino(object: TxResponseAmino): TxResponse { - const message = createBaseTxResponse(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.txhash !== undefined && object.txhash !== null) { - message.txhash = object.txhash; - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } - if (object.raw_log !== undefined && object.raw_log !== null) { - message.rawLog = object.raw_log; - } - message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = Any.fromAmino(object.tx); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = object.timestamp; - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - return message; - }, - toAmino(message: TxResponse): TxResponseAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.txhash = message.txhash === '' ? undefined : message.txhash; - obj.codespace = message.codespace === '' ? undefined : message.codespace; - obj.code = message.code === 0 ? undefined : message.code; - obj.data = message.data === '' ? undefined : message.data; - obj.raw_log = message.rawLog === '' ? undefined : message.rawLog; - if (message.logs) { - obj.logs = message.logs.map(e => - e ? ABCIMessageLog.toAmino(e) : undefined, - ); - } else { - obj.logs = message.logs; - } - obj.info = message.info === '' ? undefined : message.info; - obj.gas_wanted = - message.gasWanted !== BigInt(0) - ? message.gasWanted.toString() - : undefined; - obj.gas_used = - message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - obj.tx = message.tx ? Any.toAmino(message.tx) : undefined; - obj.timestamp = message.timestamp === '' ? undefined : message.timestamp; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - return obj; - }, - fromAminoMsg(object: TxResponseAminoMsg): TxResponse { - return TxResponse.fromAmino(object.value); - }, - toAminoMsg(message: TxResponse): TxResponseAminoMsg { - return { - type: 'cosmos-sdk/TxResponse', - value: TxResponse.toAmino(message), - }; - }, fromProtoMsg(message: TxResponseProtoMsg): TxResponse { return TxResponse.decode(message.value); }, @@ -856,39 +582,6 @@ export const ABCIMessageLog = { message.events = object.events?.map(e => StringEvent.fromPartial(e)) || []; return message; }, - fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { - const message = createBaseABCIMessageLog(); - if (object.msg_index !== undefined && object.msg_index !== null) { - message.msgIndex = object.msg_index; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; - return message; - }, - toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { - const obj: any = {}; - obj.msg_index = message.msgIndex ?? 0; - obj.log = message.log === '' ? undefined : message.log; - if (message.events) { - obj.events = message.events.map(e => - e ? StringEvent.toAmino(e) : undefined, - ); - } else { - obj.events = message.events; - } - return obj; - }, - fromAminoMsg(object: ABCIMessageLogAminoMsg): ABCIMessageLog { - return ABCIMessageLog.fromAmino(object.value); - }, - toAminoMsg(message: ABCIMessageLog): ABCIMessageLogAminoMsg { - return { - type: 'cosmos-sdk/ABCIMessageLog', - value: ABCIMessageLog.toAmino(message), - }; - }, fromProtoMsg(message: ABCIMessageLogProtoMsg): ABCIMessageLog { return ABCIMessageLog.decode(message.value); }, @@ -970,36 +663,6 @@ export const StringEvent = { object.attributes?.map(e => Attribute.fromPartial(e)) || []; return message; }, - fromAmino(object: StringEventAmino): StringEvent { - const message = createBaseStringEvent(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - message.attributes = - object.attributes?.map(e => Attribute.fromAmino(e)) || []; - return message; - }, - toAmino(message: StringEvent): StringEventAmino { - const obj: any = {}; - obj.type = message.type === '' ? undefined : message.type; - if (message.attributes) { - obj.attributes = message.attributes.map(e => - e ? Attribute.toAmino(e) : undefined, - ); - } else { - obj.attributes = message.attributes; - } - return obj; - }, - fromAminoMsg(object: StringEventAminoMsg): StringEvent { - return StringEvent.fromAmino(object.value); - }, - toAminoMsg(message: StringEvent): StringEventAminoMsg { - return { - type: 'cosmos-sdk/StringEvent', - value: StringEvent.toAmino(message), - }; - }, fromProtoMsg(message: StringEventProtoMsg): StringEvent { return StringEvent.decode(message.value); }, @@ -1072,31 +735,6 @@ export const Attribute = { message.value = object.value ?? ''; return message; }, - fromAmino(object: AttributeAmino): Attribute { - const message = createBaseAttribute(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: Attribute): AttributeAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.value = message.value === '' ? undefined : message.value; - return obj; - }, - fromAminoMsg(object: AttributeAminoMsg): Attribute { - return Attribute.fromAmino(object.value); - }, - toAminoMsg(message: Attribute): AttributeAminoMsg { - return { - type: 'cosmos-sdk/Attribute', - value: Attribute.toAmino(message), - }; - }, fromProtoMsg(message: AttributeProtoMsg): Attribute { return Attribute.decode(message.value); }, @@ -1181,35 +819,6 @@ export const GasInfo = { : BigInt(0); return message; }, - fromAmino(object: GasInfoAmino): GasInfo { - const message = createBaseGasInfo(); - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); - } - return message; - }, - toAmino(message: GasInfo): GasInfoAmino { - const obj: any = {}; - obj.gas_wanted = - message.gasWanted !== BigInt(0) - ? message.gasWanted.toString() - : undefined; - obj.gas_used = - message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - return obj; - }, - fromAminoMsg(object: GasInfoAminoMsg): GasInfo { - return GasInfo.fromAmino(object.value); - }, - toAminoMsg(message: GasInfo): GasInfoAminoMsg { - return { - type: 'cosmos-sdk/GasInfo', - value: GasInfo.toAmino(message), - }; - }, fromProtoMsg(message: GasInfoProtoMsg): GasInfo { return GasInfo.decode(message.value); }, @@ -1322,46 +931,6 @@ export const Result = { object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: ResultAmino): Result { - const message = createBaseResult(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - message.msgResponses = - object.msg_responses?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: Result): ResultAmino { - const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.log = message.log === '' ? undefined : message.log; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - if (message.msgResponses) { - obj.msg_responses = message.msgResponses.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.msg_responses = message.msgResponses; - } - return obj; - }, - fromAminoMsg(object: ResultAminoMsg): Result { - return Result.fromAmino(object.value); - }, - toAminoMsg(message: Result): ResultAminoMsg { - return { - type: 'cosmos-sdk/Result', - value: Result.toAmino(message), - }; - }, fromProtoMsg(message: ResultProtoMsg): Result { return Result.decode(message.value); }, @@ -1449,33 +1018,6 @@ export const SimulationResponse = { : undefined; return message; }, - fromAmino(object: SimulationResponseAmino): SimulationResponse { - const message = createBaseSimulationResponse(); - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gasInfo = GasInfo.fromAmino(object.gas_info); - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromAmino(object.result); - } - return message; - }, - toAmino(message: SimulationResponse): SimulationResponseAmino { - const obj: any = {}; - obj.gas_info = message.gasInfo - ? GasInfo.toAmino(message.gasInfo) - : undefined; - obj.result = message.result ? Result.toAmino(message.result) : undefined; - return obj; - }, - fromAminoMsg(object: SimulationResponseAminoMsg): SimulationResponse { - return SimulationResponse.fromAmino(object.value); - }, - toAminoMsg(message: SimulationResponse): SimulationResponseAminoMsg { - return { - type: 'cosmos-sdk/SimulationResponse', - value: SimulationResponse.toAmino(message), - }; - }, fromProtoMsg(message: SimulationResponseProtoMsg): SimulationResponse { return SimulationResponse.decode(message.value); }, @@ -1553,31 +1095,6 @@ export const MsgData = { message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: MsgDataAmino): MsgData { - const message = createBaseMsgData(); - if (object.msg_type !== undefined && object.msg_type !== null) { - message.msgType = object.msg_type; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - toAmino(message: MsgData): MsgDataAmino { - const obj: any = {}; - obj.msg_type = message.msgType === '' ? undefined : message.msgType; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - return obj; - }, - fromAminoMsg(object: MsgDataAminoMsg): MsgData { - return MsgData.fromAmino(object.value); - }, - toAminoMsg(message: MsgData): MsgDataAminoMsg { - return { - type: 'cosmos-sdk/MsgData', - value: MsgData.toAmino(message), - }; - }, fromProtoMsg(message: MsgDataProtoMsg): MsgData { return MsgData.decode(message.value); }, @@ -1665,38 +1182,6 @@ export const TxMsgData = { object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: TxMsgDataAmino): TxMsgData { - const message = createBaseTxMsgData(); - message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; - message.msgResponses = - object.msg_responses?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: TxMsgData): TxMsgDataAmino { - const obj: any = {}; - if (message.data) { - obj.data = message.data.map(e => (e ? MsgData.toAmino(e) : undefined)); - } else { - obj.data = message.data; - } - if (message.msgResponses) { - obj.msg_responses = message.msgResponses.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.msg_responses = message.msgResponses; - } - return obj; - }, - fromAminoMsg(object: TxMsgDataAminoMsg): TxMsgData { - return TxMsgData.fromAmino(object.value); - }, - toAminoMsg(message: TxMsgData): TxMsgDataAminoMsg { - return { - type: 'cosmos-sdk/TxMsgData', - value: TxMsgData.toAmino(message), - }; - }, fromProtoMsg(message: TxMsgDataProtoMsg): TxMsgData { return TxMsgData.decode(message.value); }, @@ -1841,60 +1326,6 @@ export const SearchTxsResult = { message.txs = object.txs?.map(e => TxResponse.fromPartial(e)) || []; return message; }, - fromAmino(object: SearchTxsResultAmino): SearchTxsResult { - const message = createBaseSearchTxsResult(); - if (object.total_count !== undefined && object.total_count !== null) { - message.totalCount = BigInt(object.total_count); - } - if (object.count !== undefined && object.count !== null) { - message.count = BigInt(object.count); - } - if (object.page_number !== undefined && object.page_number !== null) { - message.pageNumber = BigInt(object.page_number); - } - if (object.page_total !== undefined && object.page_total !== null) { - message.pageTotal = BigInt(object.page_total); - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = BigInt(object.limit); - } - message.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; - return message; - }, - toAmino(message: SearchTxsResult): SearchTxsResultAmino { - const obj: any = {}; - obj.total_count = - message.totalCount !== BigInt(0) - ? message.totalCount.toString() - : undefined; - obj.count = - message.count !== BigInt(0) ? message.count.toString() : undefined; - obj.page_number = - message.pageNumber !== BigInt(0) - ? message.pageNumber.toString() - : undefined; - obj.page_total = - message.pageTotal !== BigInt(0) - ? message.pageTotal.toString() - : undefined; - obj.limit = - message.limit !== BigInt(0) ? message.limit.toString() : undefined; - if (message.txs) { - obj.txs = message.txs.map(e => (e ? TxResponse.toAmino(e) : undefined)); - } else { - obj.txs = message.txs; - } - return obj; - }, - fromAminoMsg(object: SearchTxsResultAminoMsg): SearchTxsResult { - return SearchTxsResult.fromAmino(object.value); - }, - toAminoMsg(message: SearchTxsResult): SearchTxsResultAminoMsg { - return { - type: 'cosmos-sdk/SearchTxsResult', - value: SearchTxsResult.toAmino(message), - }; - }, fromProtoMsg(message: SearchTxsResultProtoMsg): SearchTxsResult { return SearchTxsResult.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/cosmic-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts index 495ff7c25c6..e3765dd79d0 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -50,51 +50,6 @@ export interface PageRequestProtoMsg { typeUrl: '/cosmos.base.query.v1beta1.PageRequest'; value: Uint8Array; } -/** - * PageRequest is to be embedded in gRPC request messages for efficient - * pagination. Ex: - * - * message SomeRequest { - * Foo some_parameter = 1; - * PageRequest pagination = 2; - * } - */ -export interface PageRequestAmino { - /** - * key is a value returned in PageResponse.next_key to begin - * querying the next page most efficiently. Only one of offset or key - * should be set. - */ - key?: string; - /** - * offset is a numeric offset that can be used when key is unavailable. - * It is less efficient than using key. Only one of offset or key should - * be set. - */ - offset?: string; - /** - * limit is the total number of results to be returned in the result page. - * If left empty it will default to a value to be set by each app. - */ - limit?: string; - /** - * count_total is set to true to indicate that the result set should include - * a count of the total number of items available for pagination in UIs. - * count_total is only respected when offset is used. It is ignored when key - * is set. - */ - count_total?: boolean; - /** - * reverse is set to true if results are to be returned in the descending order. - * - * Since: cosmos-sdk 0.43 - */ - reverse?: boolean; -} -export interface PageRequestAminoMsg { - type: 'cosmos-sdk/PageRequest'; - value: PageRequestAmino; -} /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -137,32 +92,6 @@ export interface PageResponseProtoMsg { typeUrl: '/cosmos.base.query.v1beta1.PageResponse'; value: Uint8Array; } -/** - * PageResponse is to be embedded in gRPC response messages where the - * corresponding request message has used PageRequest. - * - * message SomeResponse { - * repeated Bar results = 1; - * PageResponse page = 2; - * } - */ -export interface PageResponseAmino { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently. It will be empty if - * there are no more results. - */ - next_key?: string; - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ - total?: string; -} -export interface PageResponseAminoMsg { - type: 'cosmos-sdk/PageResponse'; - value: PageResponseAmino; -} /** * PageResponse is to be embedded in gRPC response messages where the * corresponding request message has used PageRequest. @@ -278,46 +207,6 @@ export const PageRequest = { message.reverse = object.reverse ?? false; return message; }, - fromAmino(object: PageRequestAmino): PageRequest { - const message = createBasePageRequest(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.offset !== undefined && object.offset !== null) { - message.offset = BigInt(object.offset); - } - if (object.limit !== undefined && object.limit !== null) { - message.limit = BigInt(object.limit); - } - if (object.count_total !== undefined && object.count_total !== null) { - message.countTotal = object.count_total; - } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } - return message; - }, - toAmino(message: PageRequest): PageRequestAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.offset = - message.offset !== BigInt(0) ? message.offset.toString() : undefined; - obj.limit = - 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; - return obj; - }, - fromAminoMsg(object: PageRequestAminoMsg): PageRequest { - return PageRequest.fromAmino(object.value); - }, - toAminoMsg(message: PageRequest): PageRequestAminoMsg { - return { - type: 'cosmos-sdk/PageRequest', - value: PageRequest.toAmino(message), - }; - }, fromProtoMsg(message: PageRequestProtoMsg): PageRequest { return PageRequest.decode(message.value); }, @@ -399,34 +288,6 @@ export const PageResponse = { : BigInt(0); return message; }, - fromAmino(object: PageResponseAmino): PageResponse { - const message = createBasePageResponse(); - if (object.next_key !== undefined && object.next_key !== null) { - message.nextKey = bytesFromBase64(object.next_key); - } - if (object.total !== undefined && object.total !== null) { - message.total = BigInt(object.total); - } - return message; - }, - toAmino(message: PageResponse): PageResponseAmino { - const obj: any = {}; - obj.next_key = message.nextKey - ? base64FromBytes(message.nextKey) - : undefined; - obj.total = - message.total !== BigInt(0) ? message.total.toString() : undefined; - return obj; - }, - fromAminoMsg(object: PageResponseAminoMsg): PageResponse { - return PageResponse.fromAmino(object.value); - }, - toAminoMsg(message: PageResponse): PageResponseAminoMsg { - return { - type: 'cosmos-sdk/PageResponse', - value: PageResponse.toAmino(message), - }; - }, fromProtoMsg(message: PageResponseProtoMsg): PageResponse { return PageResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts b/packages/cosmic-proto/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts index 8142c043324..18543cad132 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts @@ -24,28 +24,6 @@ export interface AppDescriptorProtoMsg { value: Uint8Array; } /** AppDescriptor describes a cosmos-sdk based application */ -export interface AppDescriptorAmino { - /** - * AuthnDescriptor provides information on how to authenticate transactions on the application - * NOTE: experimental and subject to change in future releases. - */ - authn?: AuthnDescriptorAmino; - /** chain provides the chain descriptor */ - chain?: ChainDescriptorAmino; - /** codec provides metadata information regarding codec related types */ - codec?: CodecDescriptorAmino; - /** configuration provides metadata information regarding the sdk.Config type */ - configuration?: ConfigurationDescriptorAmino; - /** query_services provides metadata information regarding the available queriable endpoints */ - query_services?: QueryServicesDescriptorAmino; - /** tx provides metadata information regarding how to send transactions to the given application */ - tx?: TxDescriptorAmino; -} -export interface AppDescriptorAminoMsg { - type: 'cosmos-sdk/AppDescriptor'; - value: AppDescriptorAmino; -} -/** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptorSDKType { authn?: AuthnDescriptorSDKType; chain?: ChainDescriptorSDKType; @@ -70,21 +48,6 @@ export interface TxDescriptorProtoMsg { value: Uint8Array; } /** TxDescriptor describes the accepted transaction type */ -export interface TxDescriptorAmino { - /** - * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - * it is not meant to support polymorphism of transaction types, it is supposed to be used by - * reflection clients to understand if they can handle a specific transaction type in an application. - */ - fullname?: string; - /** msgs lists the accepted application messages (sdk.Msg) */ - msgs?: MsgDescriptorAmino[]; -} -export interface TxDescriptorAminoMsg { - type: 'cosmos-sdk/TxDescriptor'; - value: TxDescriptorAmino; -} -/** TxDescriptor describes the accepted transaction type */ export interface TxDescriptorSDKType { fullname: string; msgs: MsgDescriptorSDKType[]; @@ -101,18 +64,6 @@ export interface AuthnDescriptorProtoMsg { typeUrl: '/cosmos.base.reflection.v2alpha1.AuthnDescriptor'; value: Uint8Array; } -/** - * AuthnDescriptor provides information on how to sign transactions without relying - * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures - */ -export interface AuthnDescriptorAmino { - /** sign_modes defines the supported signature algorithm */ - sign_modes?: SigningModeDescriptorAmino[]; -} -export interface AuthnDescriptorAminoMsg { - type: 'cosmos-sdk/AuthnDescriptor'; - value: AuthnDescriptorAmino; -} /** * AuthnDescriptor provides information on how to sign transactions without relying * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures @@ -141,27 +92,6 @@ export interface SigningModeDescriptorProtoMsg { typeUrl: '/cosmos.base.reflection.v2alpha1.SigningModeDescriptor'; value: Uint8Array; } -/** - * SigningModeDescriptor provides information on a signing flow of the application - * NOTE(fdymylja): here we could go as far as providing an entire flow on how - * to sign a message given a SigningModeDescriptor, but it's better to think about - * this another time - */ -export interface SigningModeDescriptorAmino { - /** name defines the unique name of the signing mode */ - name?: string; - /** number is the unique int32 identifier for the sign_mode enum */ - number?: number; - /** - * authn_info_provider_method_fullname defines the fullname of the method to call to get - * the metadata required to authenticate using the provided sign_modes - */ - authn_info_provider_method_fullname?: string; -} -export interface SigningModeDescriptorAminoMsg { - type: 'cosmos-sdk/SigningModeDescriptor'; - value: SigningModeDescriptorAmino; -} /** * SigningModeDescriptor provides information on a signing flow of the application * NOTE(fdymylja): here we could go as far as providing an entire flow on how @@ -183,15 +113,6 @@ export interface ChainDescriptorProtoMsg { value: Uint8Array; } /** ChainDescriptor describes chain information of the application */ -export interface ChainDescriptorAmino { - /** id is the chain id */ - id?: string; -} -export interface ChainDescriptorAminoMsg { - type: 'cosmos-sdk/ChainDescriptor'; - value: ChainDescriptorAmino; -} -/** ChainDescriptor describes chain information of the application */ export interface ChainDescriptorSDKType { id: string; } @@ -205,15 +126,6 @@ export interface CodecDescriptorProtoMsg { value: Uint8Array; } /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ -export interface CodecDescriptorAmino { - /** interfaces is a list of the registerted interfaces descriptors */ - interfaces?: InterfaceDescriptorAmino[]; -} -export interface CodecDescriptorAminoMsg { - type: 'cosmos-sdk/CodecDescriptor'; - value: CodecDescriptorAmino; -} -/** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptorSDKType { interfaces: InterfaceDescriptorSDKType[]; } @@ -234,22 +146,6 @@ export interface InterfaceDescriptorProtoMsg { value: Uint8Array; } /** InterfaceDescriptor describes the implementation of an interface */ -export interface InterfaceDescriptorAmino { - /** fullname is the name of the interface */ - fullname?: string; - /** - * interface_accepting_messages contains information regarding the proto messages which contain the interface as - * google.protobuf.Any field - */ - interface_accepting_messages?: InterfaceAcceptingMessageDescriptorAmino[]; - /** interface_implementers is a list of the descriptors of the interface implementers */ - interface_implementers?: InterfaceImplementerDescriptorAmino[]; -} -export interface InterfaceDescriptorAminoMsg { - type: 'cosmos-sdk/InterfaceDescriptor'; - value: InterfaceDescriptorAmino; -} -/** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptorSDKType { fullname: string; interface_accepting_messages: InterfaceAcceptingMessageDescriptorSDKType[]; @@ -272,22 +168,6 @@ export interface InterfaceImplementerDescriptorProtoMsg { value: Uint8Array; } /** InterfaceImplementerDescriptor describes an interface implementer */ -export interface InterfaceImplementerDescriptorAmino { - /** fullname is the protobuf queryable name of the interface implementer */ - fullname?: string; - /** - * type_url defines the type URL used when marshalling the type as any - * this is required so we can provide type safe google.protobuf.Any marshalling and - * unmarshalling, making sure that we don't accept just 'any' type - * in our interface fields - */ - type_url?: string; -} -export interface InterfaceImplementerDescriptorAminoMsg { - type: 'cosmos-sdk/InterfaceImplementerDescriptor'; - value: InterfaceImplementerDescriptorAmino; -} -/** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptorSDKType { fullname: string; type_url: string; @@ -310,24 +190,6 @@ export interface InterfaceAcceptingMessageDescriptorProtoMsg { typeUrl: '/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor'; value: Uint8Array; } -/** - * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains - * an interface represented as a google.protobuf.Any - */ -export interface InterfaceAcceptingMessageDescriptorAmino { - /** fullname is the protobuf fullname of the type containing the interface */ - fullname?: string; - /** - * field_descriptor_names is a list of the protobuf name (not fullname) of the field - * which contains the interface as google.protobuf.Any (the interface is the same, but - * it can be in multiple fields of the same proto message) - */ - field_descriptor_names?: string[]; -} -export interface InterfaceAcceptingMessageDescriptorAminoMsg { - type: 'cosmos-sdk/InterfaceAcceptingMessageDescriptor'; - value: InterfaceAcceptingMessageDescriptorAmino; -} /** * InterfaceAcceptingMessageDescriptor describes a protobuf message which contains * an interface represented as a google.protobuf.Any @@ -346,15 +208,6 @@ export interface ConfigurationDescriptorProtoMsg { value: Uint8Array; } /** ConfigurationDescriptor contains metadata information on the sdk.Config */ -export interface ConfigurationDescriptorAmino { - /** bech32_account_address_prefix is the account address prefix */ - bech32_account_address_prefix?: string; -} -export interface ConfigurationDescriptorAminoMsg { - type: 'cosmos-sdk/ConfigurationDescriptor'; - value: ConfigurationDescriptorAmino; -} -/** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptorSDKType { bech32_account_address_prefix: string; } @@ -368,15 +221,6 @@ export interface MsgDescriptorProtoMsg { value: Uint8Array; } /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ -export interface MsgDescriptorAmino { - /** msg_type_url contains the TypeURL of a sdk.Msg. */ - msg_type_url?: string; -} -export interface MsgDescriptorAminoMsg { - type: 'cosmos-sdk/MsgDescriptor'; - value: MsgDescriptorAmino; -} -/** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptorSDKType { msg_type_url: string; } @@ -387,12 +231,6 @@ export interface GetAuthnDescriptorRequestProtoMsg { value: Uint8Array; } /** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ -export interface GetAuthnDescriptorRequestAmino {} -export interface GetAuthnDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetAuthnDescriptorRequest'; - value: GetAuthnDescriptorRequestAmino; -} -/** GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorRequestSDKType {} /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponse { @@ -404,15 +242,6 @@ export interface GetAuthnDescriptorResponseProtoMsg { value: Uint8Array; } /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ -export interface GetAuthnDescriptorResponseAmino { - /** authn describes how to authenticate to the application when sending transactions */ - authn?: AuthnDescriptorAmino; -} -export interface GetAuthnDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetAuthnDescriptorResponse'; - value: GetAuthnDescriptorResponseAmino; -} -/** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponseSDKType { authn?: AuthnDescriptorSDKType; } @@ -423,12 +252,6 @@ export interface GetChainDescriptorRequestProtoMsg { value: Uint8Array; } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ -export interface GetChainDescriptorRequestAmino {} -export interface GetChainDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetChainDescriptorRequest'; - value: GetChainDescriptorRequestAmino; -} -/** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ export interface GetChainDescriptorRequestSDKType {} /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponse { @@ -440,15 +263,6 @@ export interface GetChainDescriptorResponseProtoMsg { value: Uint8Array; } /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ -export interface GetChainDescriptorResponseAmino { - /** chain describes application chain information */ - chain?: ChainDescriptorAmino; -} -export interface GetChainDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetChainDescriptorResponse'; - value: GetChainDescriptorResponseAmino; -} -/** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponseSDKType { chain?: ChainDescriptorSDKType; } @@ -459,12 +273,6 @@ export interface GetCodecDescriptorRequestProtoMsg { value: Uint8Array; } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ -export interface GetCodecDescriptorRequestAmino {} -export interface GetCodecDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetCodecDescriptorRequest'; - value: GetCodecDescriptorRequestAmino; -} -/** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ export interface GetCodecDescriptorRequestSDKType {} /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponse { @@ -476,15 +284,6 @@ export interface GetCodecDescriptorResponseProtoMsg { value: Uint8Array; } /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ -export interface GetCodecDescriptorResponseAmino { - /** codec describes the application codec such as registered interfaces and implementations */ - codec?: CodecDescriptorAmino; -} -export interface GetCodecDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetCodecDescriptorResponse'; - value: GetCodecDescriptorResponseAmino; -} -/** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponseSDKType { codec?: CodecDescriptorSDKType; } @@ -495,12 +294,6 @@ export interface GetConfigurationDescriptorRequestProtoMsg { value: Uint8Array; } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ -export interface GetConfigurationDescriptorRequestAmino {} -export interface GetConfigurationDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetConfigurationDescriptorRequest'; - value: GetConfigurationDescriptorRequestAmino; -} -/** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorRequestSDKType {} /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponse { @@ -512,15 +305,6 @@ export interface GetConfigurationDescriptorResponseProtoMsg { value: Uint8Array; } /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ -export interface GetConfigurationDescriptorResponseAmino { - /** config describes the application's sdk.Config */ - config?: ConfigurationDescriptorAmino; -} -export interface GetConfigurationDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetConfigurationDescriptorResponse'; - value: GetConfigurationDescriptorResponseAmino; -} -/** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponseSDKType { config?: ConfigurationDescriptorSDKType; } @@ -531,12 +315,6 @@ export interface GetQueryServicesDescriptorRequestProtoMsg { value: Uint8Array; } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ -export interface GetQueryServicesDescriptorRequestAmino {} -export interface GetQueryServicesDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetQueryServicesDescriptorRequest'; - value: GetQueryServicesDescriptorRequestAmino; -} -/** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorRequestSDKType {} /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponse { @@ -548,15 +326,6 @@ export interface GetQueryServicesDescriptorResponseProtoMsg { value: Uint8Array; } /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ -export interface GetQueryServicesDescriptorResponseAmino { - /** queries provides information on the available queryable services */ - queries?: QueryServicesDescriptorAmino; -} -export interface GetQueryServicesDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetQueryServicesDescriptorResponse'; - value: GetQueryServicesDescriptorResponseAmino; -} -/** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponseSDKType { queries?: QueryServicesDescriptorSDKType; } @@ -567,12 +336,6 @@ export interface GetTxDescriptorRequestProtoMsg { value: Uint8Array; } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ -export interface GetTxDescriptorRequestAmino {} -export interface GetTxDescriptorRequestAminoMsg { - type: 'cosmos-sdk/GetTxDescriptorRequest'; - value: GetTxDescriptorRequestAmino; -} -/** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ export interface GetTxDescriptorRequestSDKType {} /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponse { @@ -587,18 +350,6 @@ export interface GetTxDescriptorResponseProtoMsg { value: Uint8Array; } /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ -export interface GetTxDescriptorResponseAmino { - /** - * tx provides information on msgs that can be forwarded to the application - * alongside the accepted transaction protobuf type - */ - tx?: TxDescriptorAmino; -} -export interface GetTxDescriptorResponseAminoMsg { - type: 'cosmos-sdk/GetTxDescriptorResponse'; - value: GetTxDescriptorResponseAmino; -} -/** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponseSDKType { tx?: TxDescriptorSDKType; } @@ -612,15 +363,6 @@ export interface QueryServicesDescriptorProtoMsg { value: Uint8Array; } /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ -export interface QueryServicesDescriptorAmino { - /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ - query_services?: QueryServiceDescriptorAmino[]; -} -export interface QueryServicesDescriptorAminoMsg { - type: 'cosmos-sdk/QueryServicesDescriptor'; - value: QueryServicesDescriptorAmino; -} -/** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptorSDKType { query_services: QueryServiceDescriptorSDKType[]; } @@ -638,19 +380,6 @@ export interface QueryServiceDescriptorProtoMsg { value: Uint8Array; } /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ -export interface QueryServiceDescriptorAmino { - /** fullname is the protobuf fullname of the service descriptor */ - fullname?: string; - /** is_module describes if this service is actually exposed by an application's module */ - is_module?: boolean; - /** methods provides a list of query service methods */ - methods?: QueryMethodDescriptorAmino[]; -} -export interface QueryServiceDescriptorAminoMsg { - type: 'cosmos-sdk/QueryServiceDescriptor'; - value: QueryServiceDescriptorAmino; -} -/** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptorSDKType { fullname: string; is_module: boolean; @@ -674,24 +403,6 @@ export interface QueryMethodDescriptorProtoMsg { typeUrl: '/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor'; value: Uint8Array; } -/** - * QueryMethodDescriptor describes a queryable method of a query service - * no other info is provided beside method name and tendermint queryable path - * because it would be redundant with the grpc reflection service - */ -export interface QueryMethodDescriptorAmino { - /** name is the protobuf name (not fullname) of the method */ - name?: string; - /** - * full_query_path is the path that can be used to query - * this method via tendermint abci.Query - */ - full_query_path?: string; -} -export interface QueryMethodDescriptorAminoMsg { - type: 'cosmos-sdk/QueryMethodDescriptor'; - value: QueryMethodDescriptorAmino; -} /** * QueryMethodDescriptor describes a queryable method of a query service * no other info is provided beside method name and tendermint queryable path @@ -856,61 +567,6 @@ export const AppDescriptor = { : undefined; return message; }, - fromAmino(object: AppDescriptorAmino): AppDescriptor { - const message = createBaseAppDescriptor(); - if (object.authn !== undefined && object.authn !== null) { - message.authn = AuthnDescriptor.fromAmino(object.authn); - } - if (object.chain !== undefined && object.chain !== null) { - message.chain = ChainDescriptor.fromAmino(object.chain); - } - if (object.codec !== undefined && object.codec !== null) { - message.codec = CodecDescriptor.fromAmino(object.codec); - } - if (object.configuration !== undefined && object.configuration !== null) { - message.configuration = ConfigurationDescriptor.fromAmino( - object.configuration, - ); - } - if (object.query_services !== undefined && object.query_services !== null) { - message.queryServices = QueryServicesDescriptor.fromAmino( - object.query_services, - ); - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = TxDescriptor.fromAmino(object.tx); - } - return message; - }, - toAmino(message: AppDescriptor): AppDescriptorAmino { - const obj: any = {}; - obj.authn = message.authn - ? AuthnDescriptor.toAmino(message.authn) - : undefined; - obj.chain = message.chain - ? ChainDescriptor.toAmino(message.chain) - : undefined; - obj.codec = message.codec - ? CodecDescriptor.toAmino(message.codec) - : undefined; - obj.configuration = message.configuration - ? ConfigurationDescriptor.toAmino(message.configuration) - : undefined; - obj.query_services = message.queryServices - ? QueryServicesDescriptor.toAmino(message.queryServices) - : undefined; - obj.tx = message.tx ? TxDescriptor.toAmino(message.tx) : undefined; - return obj; - }, - fromAminoMsg(object: AppDescriptorAminoMsg): AppDescriptor { - return AppDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: AppDescriptor): AppDescriptorAminoMsg { - return { - type: 'cosmos-sdk/AppDescriptor', - value: AppDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: AppDescriptorProtoMsg): AppDescriptor { return AppDescriptor.decode(message.value); }, @@ -991,35 +647,6 @@ export const TxDescriptor = { message.msgs = object.msgs?.map(e => MsgDescriptor.fromPartial(e)) || []; return message; }, - fromAmino(object: TxDescriptorAmino): TxDescriptor { - const message = createBaseTxDescriptor(); - if (object.fullname !== undefined && object.fullname !== null) { - message.fullname = object.fullname; - } - message.msgs = object.msgs?.map(e => MsgDescriptor.fromAmino(e)) || []; - return message; - }, - toAmino(message: TxDescriptor): TxDescriptorAmino { - const obj: any = {}; - obj.fullname = message.fullname === '' ? undefined : message.fullname; - if (message.msgs) { - obj.msgs = message.msgs.map(e => - e ? MsgDescriptor.toAmino(e) : undefined, - ); - } else { - obj.msgs = message.msgs; - } - return obj; - }, - fromAminoMsg(object: TxDescriptorAminoMsg): TxDescriptor { - return TxDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: TxDescriptor): TxDescriptorAminoMsg { - return { - type: 'cosmos-sdk/TxDescriptor', - value: TxDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: TxDescriptorProtoMsg): TxDescriptor { return TxDescriptor.decode(message.value); }, @@ -1093,32 +720,6 @@ export const AuthnDescriptor = { object.signModes?.map(e => SigningModeDescriptor.fromPartial(e)) || []; return message; }, - fromAmino(object: AuthnDescriptorAmino): AuthnDescriptor { - const message = createBaseAuthnDescriptor(); - message.signModes = - object.sign_modes?.map(e => SigningModeDescriptor.fromAmino(e)) || []; - return message; - }, - toAmino(message: AuthnDescriptor): AuthnDescriptorAmino { - const obj: any = {}; - if (message.signModes) { - obj.sign_modes = message.signModes.map(e => - e ? SigningModeDescriptor.toAmino(e) : undefined, - ); - } else { - obj.sign_modes = message.signModes; - } - return obj; - }, - fromAminoMsg(object: AuthnDescriptorAminoMsg): AuthnDescriptor { - return AuthnDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: AuthnDescriptor): AuthnDescriptorAminoMsg { - return { - type: 'cosmos-sdk/AuthnDescriptor', - value: AuthnDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: AuthnDescriptorProtoMsg): AuthnDescriptor { return AuthnDescriptor.decode(message.value); }, @@ -1211,42 +812,6 @@ export const SigningModeDescriptor = { object.authnInfoProviderMethodFullname ?? ''; return message; }, - fromAmino(object: SigningModeDescriptorAmino): SigningModeDescriptor { - const message = createBaseSigningModeDescriptor(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } - if ( - object.authn_info_provider_method_fullname !== undefined && - object.authn_info_provider_method_fullname !== null - ) { - message.authnInfoProviderMethodFullname = - object.authn_info_provider_method_fullname; - } - return message; - }, - toAmino(message: SigningModeDescriptor): SigningModeDescriptorAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.number = message.number === 0 ? undefined : message.number; - obj.authn_info_provider_method_fullname = - message.authnInfoProviderMethodFullname === '' - ? undefined - : message.authnInfoProviderMethodFullname; - return obj; - }, - fromAminoMsg(object: SigningModeDescriptorAminoMsg): SigningModeDescriptor { - return SigningModeDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: SigningModeDescriptor): SigningModeDescriptorAminoMsg { - return { - type: 'cosmos-sdk/SigningModeDescriptor', - value: SigningModeDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: SigningModeDescriptorProtoMsg): SigningModeDescriptor { return SigningModeDescriptor.decode(message.value); }, @@ -1309,27 +874,6 @@ export const ChainDescriptor = { message.id = object.id ?? ''; return message; }, - fromAmino(object: ChainDescriptorAmino): ChainDescriptor { - const message = createBaseChainDescriptor(); - if (object.id !== undefined && object.id !== null) { - message.id = object.id; - } - return message; - }, - toAmino(message: ChainDescriptor): ChainDescriptorAmino { - const obj: any = {}; - obj.id = message.id === '' ? undefined : message.id; - return obj; - }, - fromAminoMsg(object: ChainDescriptorAminoMsg): ChainDescriptor { - return ChainDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: ChainDescriptor): ChainDescriptorAminoMsg { - return { - type: 'cosmos-sdk/ChainDescriptor', - value: ChainDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: ChainDescriptorProtoMsg): ChainDescriptor { return ChainDescriptor.decode(message.value); }, @@ -1403,32 +947,6 @@ export const CodecDescriptor = { object.interfaces?.map(e => InterfaceDescriptor.fromPartial(e)) || []; return message; }, - fromAmino(object: CodecDescriptorAmino): CodecDescriptor { - const message = createBaseCodecDescriptor(); - message.interfaces = - object.interfaces?.map(e => InterfaceDescriptor.fromAmino(e)) || []; - return message; - }, - toAmino(message: CodecDescriptor): CodecDescriptorAmino { - const obj: any = {}; - if (message.interfaces) { - obj.interfaces = message.interfaces.map(e => - e ? InterfaceDescriptor.toAmino(e) : undefined, - ); - } else { - obj.interfaces = message.interfaces; - } - return obj; - }, - fromAminoMsg(object: CodecDescriptorAminoMsg): CodecDescriptor { - return CodecDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: CodecDescriptor): CodecDescriptorAminoMsg { - return { - type: 'cosmos-sdk/CodecDescriptor', - value: CodecDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: CodecDescriptorProtoMsg): CodecDescriptor { return CodecDescriptor.decode(message.value); }, @@ -1552,49 +1070,6 @@ export const InterfaceDescriptor = { ) || []; return message; }, - fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - const message = createBaseInterfaceDescriptor(); - if (object.fullname !== undefined && object.fullname !== null) { - message.fullname = object.fullname; - } - message.interfaceAcceptingMessages = - object.interface_accepting_messages?.map(e => - InterfaceAcceptingMessageDescriptor.fromAmino(e), - ) || []; - message.interfaceImplementers = - object.interface_implementers?.map(e => - InterfaceImplementerDescriptor.fromAmino(e), - ) || []; - return message; - }, - toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { - const obj: any = {}; - obj.fullname = message.fullname === '' ? undefined : message.fullname; - if (message.interfaceAcceptingMessages) { - obj.interface_accepting_messages = message.interfaceAcceptingMessages.map( - e => (e ? InterfaceAcceptingMessageDescriptor.toAmino(e) : undefined), - ); - } else { - obj.interface_accepting_messages = message.interfaceAcceptingMessages; - } - if (message.interfaceImplementers) { - obj.interface_implementers = message.interfaceImplementers.map(e => - e ? InterfaceImplementerDescriptor.toAmino(e) : undefined, - ); - } else { - obj.interface_implementers = message.interfaceImplementers; - } - return obj; - }, - fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { - return InterfaceDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: InterfaceDescriptor): InterfaceDescriptorAminoMsg { - return { - type: 'cosmos-sdk/InterfaceDescriptor', - value: InterfaceDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { return InterfaceDescriptor.decode(message.value); }, @@ -1668,42 +1143,9 @@ export const InterfaceImplementerDescriptor = { object: Partial, ): InterfaceImplementerDescriptor { const message = createBaseInterfaceImplementerDescriptor(); - message.fullname = object.fullname ?? ''; - message.typeUrl = object.typeUrl ?? ''; - return message; - }, - fromAmino( - object: InterfaceImplementerDescriptorAmino, - ): InterfaceImplementerDescriptor { - const message = createBaseInterfaceImplementerDescriptor(); - if (object.fullname !== undefined && object.fullname !== null) { - message.fullname = object.fullname; - } - if (object.type_url !== undefined && object.type_url !== null) { - message.typeUrl = object.type_url; - } - return message; - }, - toAmino( - message: InterfaceImplementerDescriptor, - ): InterfaceImplementerDescriptorAmino { - const obj: any = {}; - obj.fullname = message.fullname === '' ? undefined : message.fullname; - obj.type_url = message.typeUrl === '' ? undefined : message.typeUrl; - return obj; - }, - fromAminoMsg( - object: InterfaceImplementerDescriptorAminoMsg, - ): InterfaceImplementerDescriptor { - return InterfaceImplementerDescriptor.fromAmino(object.value); - }, - toAminoMsg( - message: InterfaceImplementerDescriptor, - ): InterfaceImplementerDescriptorAminoMsg { - return { - type: 'cosmos-sdk/InterfaceImplementerDescriptor', - value: InterfaceImplementerDescriptor.toAmino(message), - }; + message.fullname = object.fullname ?? ''; + message.typeUrl = object.typeUrl ?? ''; + return message; }, fromProtoMsg( message: InterfaceImplementerDescriptorProtoMsg, @@ -1795,42 +1237,6 @@ export const InterfaceAcceptingMessageDescriptor = { object.fieldDescriptorNames?.map(e => e) || []; return message; }, - fromAmino( - object: InterfaceAcceptingMessageDescriptorAmino, - ): InterfaceAcceptingMessageDescriptor { - const message = createBaseInterfaceAcceptingMessageDescriptor(); - if (object.fullname !== undefined && object.fullname !== null) { - message.fullname = object.fullname; - } - message.fieldDescriptorNames = - object.field_descriptor_names?.map(e => e) || []; - return message; - }, - toAmino( - message: InterfaceAcceptingMessageDescriptor, - ): InterfaceAcceptingMessageDescriptorAmino { - const obj: any = {}; - obj.fullname = message.fullname === '' ? undefined : message.fullname; - if (message.fieldDescriptorNames) { - obj.field_descriptor_names = message.fieldDescriptorNames.map(e => e); - } else { - obj.field_descriptor_names = message.fieldDescriptorNames; - } - return obj; - }, - fromAminoMsg( - object: InterfaceAcceptingMessageDescriptorAminoMsg, - ): InterfaceAcceptingMessageDescriptor { - return InterfaceAcceptingMessageDescriptor.fromAmino(object.value); - }, - toAminoMsg( - message: InterfaceAcceptingMessageDescriptor, - ): InterfaceAcceptingMessageDescriptorAminoMsg { - return { - type: 'cosmos-sdk/InterfaceAcceptingMessageDescriptor', - value: InterfaceAcceptingMessageDescriptor.toAmino(message), - }; - }, fromProtoMsg( message: InterfaceAcceptingMessageDescriptorProtoMsg, ): InterfaceAcceptingMessageDescriptor { @@ -1907,37 +1313,6 @@ export const ConfigurationDescriptor = { object.bech32AccountAddressPrefix ?? ''; return message; }, - fromAmino(object: ConfigurationDescriptorAmino): ConfigurationDescriptor { - const message = createBaseConfigurationDescriptor(); - if ( - object.bech32_account_address_prefix !== undefined && - object.bech32_account_address_prefix !== null - ) { - message.bech32AccountAddressPrefix = object.bech32_account_address_prefix; - } - return message; - }, - toAmino(message: ConfigurationDescriptor): ConfigurationDescriptorAmino { - const obj: any = {}; - obj.bech32_account_address_prefix = - message.bech32AccountAddressPrefix === '' - ? undefined - : message.bech32AccountAddressPrefix; - return obj; - }, - fromAminoMsg( - object: ConfigurationDescriptorAminoMsg, - ): ConfigurationDescriptor { - return ConfigurationDescriptor.fromAmino(object.value); - }, - toAminoMsg( - message: ConfigurationDescriptor, - ): ConfigurationDescriptorAminoMsg { - return { - type: 'cosmos-sdk/ConfigurationDescriptor', - value: ConfigurationDescriptor.toAmino(message), - }; - }, fromProtoMsg( message: ConfigurationDescriptorProtoMsg, ): ConfigurationDescriptor { @@ -2004,28 +1379,6 @@ export const MsgDescriptor = { message.msgTypeUrl = object.msgTypeUrl ?? ''; return message; }, - fromAmino(object: MsgDescriptorAmino): MsgDescriptor { - const message = createBaseMsgDescriptor(); - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - return message; - }, - toAmino(message: MsgDescriptor): MsgDescriptorAmino { - const obj: any = {}; - obj.msg_type_url = - message.msgTypeUrl === '' ? undefined : message.msgTypeUrl; - return obj; - }, - fromAminoMsg(object: MsgDescriptorAminoMsg): MsgDescriptor { - return MsgDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: MsgDescriptor): MsgDescriptorAminoMsg { - return { - type: 'cosmos-sdk/MsgDescriptor', - value: MsgDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: MsgDescriptorProtoMsg): MsgDescriptor { return MsgDescriptor.decode(message.value); }, @@ -2081,27 +1434,6 @@ export const GetAuthnDescriptorRequest = { const message = createBaseGetAuthnDescriptorRequest(); return message; }, - fromAmino(_: GetAuthnDescriptorRequestAmino): GetAuthnDescriptorRequest { - const message = createBaseGetAuthnDescriptorRequest(); - return message; - }, - toAmino(_: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: GetAuthnDescriptorRequestAminoMsg, - ): GetAuthnDescriptorRequest { - return GetAuthnDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: GetAuthnDescriptorRequest, - ): GetAuthnDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetAuthnDescriptorRequest', - value: GetAuthnDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetAuthnDescriptorRequestProtoMsg, ): GetAuthnDescriptorRequest { @@ -2181,37 +1513,6 @@ export const GetAuthnDescriptorResponse = { : undefined; return message; }, - fromAmino( - object: GetAuthnDescriptorResponseAmino, - ): GetAuthnDescriptorResponse { - const message = createBaseGetAuthnDescriptorResponse(); - if (object.authn !== undefined && object.authn !== null) { - message.authn = AuthnDescriptor.fromAmino(object.authn); - } - return message; - }, - toAmino( - message: GetAuthnDescriptorResponse, - ): GetAuthnDescriptorResponseAmino { - const obj: any = {}; - obj.authn = message.authn - ? AuthnDescriptor.toAmino(message.authn) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetAuthnDescriptorResponseAminoMsg, - ): GetAuthnDescriptorResponse { - return GetAuthnDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetAuthnDescriptorResponse, - ): GetAuthnDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetAuthnDescriptorResponse', - value: GetAuthnDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetAuthnDescriptorResponseProtoMsg, ): GetAuthnDescriptorResponse { @@ -2271,27 +1572,6 @@ export const GetChainDescriptorRequest = { const message = createBaseGetChainDescriptorRequest(); return message; }, - fromAmino(_: GetChainDescriptorRequestAmino): GetChainDescriptorRequest { - const message = createBaseGetChainDescriptorRequest(); - return message; - }, - toAmino(_: GetChainDescriptorRequest): GetChainDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: GetChainDescriptorRequestAminoMsg, - ): GetChainDescriptorRequest { - return GetChainDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: GetChainDescriptorRequest, - ): GetChainDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetChainDescriptorRequest', - value: GetChainDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetChainDescriptorRequestProtoMsg, ): GetChainDescriptorRequest { @@ -2371,37 +1651,6 @@ export const GetChainDescriptorResponse = { : undefined; return message; }, - fromAmino( - object: GetChainDescriptorResponseAmino, - ): GetChainDescriptorResponse { - const message = createBaseGetChainDescriptorResponse(); - if (object.chain !== undefined && object.chain !== null) { - message.chain = ChainDescriptor.fromAmino(object.chain); - } - return message; - }, - toAmino( - message: GetChainDescriptorResponse, - ): GetChainDescriptorResponseAmino { - const obj: any = {}; - obj.chain = message.chain - ? ChainDescriptor.toAmino(message.chain) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetChainDescriptorResponseAminoMsg, - ): GetChainDescriptorResponse { - return GetChainDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetChainDescriptorResponse, - ): GetChainDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetChainDescriptorResponse', - value: GetChainDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetChainDescriptorResponseProtoMsg, ): GetChainDescriptorResponse { @@ -2461,27 +1710,6 @@ export const GetCodecDescriptorRequest = { const message = createBaseGetCodecDescriptorRequest(); return message; }, - fromAmino(_: GetCodecDescriptorRequestAmino): GetCodecDescriptorRequest { - const message = createBaseGetCodecDescriptorRequest(); - return message; - }, - toAmino(_: GetCodecDescriptorRequest): GetCodecDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: GetCodecDescriptorRequestAminoMsg, - ): GetCodecDescriptorRequest { - return GetCodecDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: GetCodecDescriptorRequest, - ): GetCodecDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetCodecDescriptorRequest', - value: GetCodecDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetCodecDescriptorRequestProtoMsg, ): GetCodecDescriptorRequest { @@ -2561,37 +1789,6 @@ export const GetCodecDescriptorResponse = { : undefined; return message; }, - fromAmino( - object: GetCodecDescriptorResponseAmino, - ): GetCodecDescriptorResponse { - const message = createBaseGetCodecDescriptorResponse(); - if (object.codec !== undefined && object.codec !== null) { - message.codec = CodecDescriptor.fromAmino(object.codec); - } - return message; - }, - toAmino( - message: GetCodecDescriptorResponse, - ): GetCodecDescriptorResponseAmino { - const obj: any = {}; - obj.codec = message.codec - ? CodecDescriptor.toAmino(message.codec) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetCodecDescriptorResponseAminoMsg, - ): GetCodecDescriptorResponse { - return GetCodecDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetCodecDescriptorResponse, - ): GetCodecDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetCodecDescriptorResponse', - value: GetCodecDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetCodecDescriptorResponseProtoMsg, ): GetCodecDescriptorResponse { @@ -2651,31 +1848,6 @@ export const GetConfigurationDescriptorRequest = { const message = createBaseGetConfigurationDescriptorRequest(); return message; }, - fromAmino( - _: GetConfigurationDescriptorRequestAmino, - ): GetConfigurationDescriptorRequest { - const message = createBaseGetConfigurationDescriptorRequest(); - return message; - }, - toAmino( - _: GetConfigurationDescriptorRequest, - ): GetConfigurationDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: GetConfigurationDescriptorRequestAminoMsg, - ): GetConfigurationDescriptorRequest { - return GetConfigurationDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: GetConfigurationDescriptorRequest, - ): GetConfigurationDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetConfigurationDescriptorRequest', - value: GetConfigurationDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetConfigurationDescriptorRequestProtoMsg, ): GetConfigurationDescriptorRequest { @@ -2763,37 +1935,6 @@ export const GetConfigurationDescriptorResponse = { : undefined; return message; }, - fromAmino( - object: GetConfigurationDescriptorResponseAmino, - ): GetConfigurationDescriptorResponse { - const message = createBaseGetConfigurationDescriptorResponse(); - if (object.config !== undefined && object.config !== null) { - message.config = ConfigurationDescriptor.fromAmino(object.config); - } - return message; - }, - toAmino( - message: GetConfigurationDescriptorResponse, - ): GetConfigurationDescriptorResponseAmino { - const obj: any = {}; - obj.config = message.config - ? ConfigurationDescriptor.toAmino(message.config) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetConfigurationDescriptorResponseAminoMsg, - ): GetConfigurationDescriptorResponse { - return GetConfigurationDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetConfigurationDescriptorResponse, - ): GetConfigurationDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetConfigurationDescriptorResponse', - value: GetConfigurationDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetConfigurationDescriptorResponseProtoMsg, ): GetConfigurationDescriptorResponse { @@ -2854,31 +1995,6 @@ export const GetQueryServicesDescriptorRequest = { const message = createBaseGetQueryServicesDescriptorRequest(); return message; }, - fromAmino( - _: GetQueryServicesDescriptorRequestAmino, - ): GetQueryServicesDescriptorRequest { - const message = createBaseGetQueryServicesDescriptorRequest(); - return message; - }, - toAmino( - _: GetQueryServicesDescriptorRequest, - ): GetQueryServicesDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: GetQueryServicesDescriptorRequestAminoMsg, - ): GetQueryServicesDescriptorRequest { - return GetQueryServicesDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: GetQueryServicesDescriptorRequest, - ): GetQueryServicesDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetQueryServicesDescriptorRequest', - value: GetQueryServicesDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetQueryServicesDescriptorRequestProtoMsg, ): GetQueryServicesDescriptorRequest { @@ -2966,37 +2082,6 @@ export const GetQueryServicesDescriptorResponse = { : undefined; return message; }, - fromAmino( - object: GetQueryServicesDescriptorResponseAmino, - ): GetQueryServicesDescriptorResponse { - const message = createBaseGetQueryServicesDescriptorResponse(); - if (object.queries !== undefined && object.queries !== null) { - message.queries = QueryServicesDescriptor.fromAmino(object.queries); - } - return message; - }, - toAmino( - message: GetQueryServicesDescriptorResponse, - ): GetQueryServicesDescriptorResponseAmino { - const obj: any = {}; - obj.queries = message.queries - ? QueryServicesDescriptor.toAmino(message.queries) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetQueryServicesDescriptorResponseAminoMsg, - ): GetQueryServicesDescriptorResponse { - return GetQueryServicesDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetQueryServicesDescriptorResponse, - ): GetQueryServicesDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetQueryServicesDescriptorResponse', - value: GetQueryServicesDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetQueryServicesDescriptorResponseProtoMsg, ): GetQueryServicesDescriptorResponse { @@ -3055,23 +2140,6 @@ export const GetTxDescriptorRequest = { const message = createBaseGetTxDescriptorRequest(); return message; }, - fromAmino(_: GetTxDescriptorRequestAmino): GetTxDescriptorRequest { - const message = createBaseGetTxDescriptorRequest(); - return message; - }, - toAmino(_: GetTxDescriptorRequest): GetTxDescriptorRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: GetTxDescriptorRequestAminoMsg): GetTxDescriptorRequest { - return GetTxDescriptorRequest.fromAmino(object.value); - }, - toAminoMsg(message: GetTxDescriptorRequest): GetTxDescriptorRequestAminoMsg { - return { - type: 'cosmos-sdk/GetTxDescriptorRequest', - value: GetTxDescriptorRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetTxDescriptorRequestProtoMsg, ): GetTxDescriptorRequest { @@ -3145,31 +2213,6 @@ export const GetTxDescriptorResponse = { : undefined; return message; }, - fromAmino(object: GetTxDescriptorResponseAmino): GetTxDescriptorResponse { - const message = createBaseGetTxDescriptorResponse(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = TxDescriptor.fromAmino(object.tx); - } - return message; - }, - toAmino(message: GetTxDescriptorResponse): GetTxDescriptorResponseAmino { - const obj: any = {}; - obj.tx = message.tx ? TxDescriptor.toAmino(message.tx) : undefined; - return obj; - }, - fromAminoMsg( - object: GetTxDescriptorResponseAminoMsg, - ): GetTxDescriptorResponse { - return GetTxDescriptorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetTxDescriptorResponse, - ): GetTxDescriptorResponseAminoMsg { - return { - type: 'cosmos-sdk/GetTxDescriptorResponse', - value: GetTxDescriptorResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetTxDescriptorResponseProtoMsg, ): GetTxDescriptorResponse { @@ -3255,37 +2298,6 @@ export const QueryServicesDescriptor = { []; return message; }, - fromAmino(object: QueryServicesDescriptorAmino): QueryServicesDescriptor { - const message = createBaseQueryServicesDescriptor(); - message.queryServices = - object.query_services?.map(e => QueryServiceDescriptor.fromAmino(e)) || - []; - return message; - }, - toAmino(message: QueryServicesDescriptor): QueryServicesDescriptorAmino { - const obj: any = {}; - if (message.queryServices) { - obj.query_services = message.queryServices.map(e => - e ? QueryServiceDescriptor.toAmino(e) : undefined, - ); - } else { - obj.query_services = message.queryServices; - } - return obj; - }, - fromAminoMsg( - object: QueryServicesDescriptorAminoMsg, - ): QueryServicesDescriptor { - return QueryServicesDescriptor.fromAmino(object.value); - }, - toAminoMsg( - message: QueryServicesDescriptor, - ): QueryServicesDescriptorAminoMsg { - return { - type: 'cosmos-sdk/QueryServicesDescriptor', - value: QueryServicesDescriptor.toAmino(message), - }; - }, fromProtoMsg( message: QueryServicesDescriptorProtoMsg, ): QueryServicesDescriptor { @@ -3386,40 +2398,6 @@ export const QueryServiceDescriptor = { object.methods?.map(e => QueryMethodDescriptor.fromPartial(e)) || []; return message; }, - fromAmino(object: QueryServiceDescriptorAmino): QueryServiceDescriptor { - const message = createBaseQueryServiceDescriptor(); - if (object.fullname !== undefined && object.fullname !== null) { - message.fullname = object.fullname; - } - if (object.is_module !== undefined && object.is_module !== null) { - message.isModule = object.is_module; - } - message.methods = - object.methods?.map(e => QueryMethodDescriptor.fromAmino(e)) || []; - return message; - }, - toAmino(message: QueryServiceDescriptor): QueryServiceDescriptorAmino { - const obj: any = {}; - obj.fullname = message.fullname === '' ? undefined : message.fullname; - obj.is_module = message.isModule === false ? undefined : message.isModule; - if (message.methods) { - obj.methods = message.methods.map(e => - e ? QueryMethodDescriptor.toAmino(e) : undefined, - ); - } else { - obj.methods = message.methods; - } - return obj; - }, - fromAminoMsg(object: QueryServiceDescriptorAminoMsg): QueryServiceDescriptor { - return QueryServiceDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: QueryServiceDescriptor): QueryServiceDescriptorAminoMsg { - return { - type: 'cosmos-sdk/QueryServiceDescriptor', - value: QueryServiceDescriptor.toAmino(message), - }; - }, fromProtoMsg( message: QueryServiceDescriptorProtoMsg, ): QueryServiceDescriptor { @@ -3500,35 +2478,6 @@ export const QueryMethodDescriptor = { message.fullQueryPath = object.fullQueryPath ?? ''; return message; }, - fromAmino(object: QueryMethodDescriptorAmino): QueryMethodDescriptor { - const message = createBaseQueryMethodDescriptor(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if ( - object.full_query_path !== undefined && - object.full_query_path !== null - ) { - message.fullQueryPath = object.full_query_path; - } - return message; - }, - toAmino(message: QueryMethodDescriptor): QueryMethodDescriptorAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.full_query_path = - message.fullQueryPath === '' ? undefined : message.fullQueryPath; - return obj; - }, - fromAminoMsg(object: QueryMethodDescriptorAminoMsg): QueryMethodDescriptor { - return QueryMethodDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: QueryMethodDescriptor): QueryMethodDescriptorAminoMsg { - return { - type: 'cosmos-sdk/QueryMethodDescriptor', - value: QueryMethodDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: QueryMethodDescriptorProtoMsg): QueryMethodDescriptor { return QueryMethodDescriptor.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/base/v1beta1/coin.ts b/packages/cosmic-proto/src/codegen/cosmos/base/v1beta1/coin.ts index 8452f81ae95..e7df08e6798 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/base/v1beta1/coin.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/base/v1beta1/coin.ts @@ -15,20 +15,6 @@ export interface CoinProtoMsg { typeUrl: '/cosmos.base.v1beta1.Coin'; value: Uint8Array; } -/** - * Coin defines a token with a denomination and an amount. - * - * NOTE: The amount field is an Int which implements the custom method - * signatures required by gogoproto. - */ -export interface CoinAmino { - denom?: string; - amount?: string; -} -export interface CoinAminoMsg { - type: 'cosmos-sdk/Coin'; - value: CoinAmino; -} /** * Coin defines a token with a denomination and an amount. * @@ -53,20 +39,6 @@ export interface DecCoinProtoMsg { typeUrl: '/cosmos.base.v1beta1.DecCoin'; value: Uint8Array; } -/** - * DecCoin defines a token with a denomination and a decimal amount. - * - * NOTE: The amount field is an Dec which implements the custom method - * signatures required by gogoproto. - */ -export interface DecCoinAmino { - denom?: string; - amount?: string; -} -export interface DecCoinAminoMsg { - type: 'cosmos-sdk/DecCoin'; - value: DecCoinAmino; -} /** * DecCoin defines a token with a denomination and a decimal amount. * @@ -86,14 +58,6 @@ export interface IntProtoProtoMsg { value: Uint8Array; } /** IntProto defines a Protobuf wrapper around an Int object. */ -export interface IntProtoAmino { - int?: string; -} -export interface IntProtoAminoMsg { - type: 'cosmos-sdk/IntProto'; - value: IntProtoAmino; -} -/** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProtoSDKType { int: string; } @@ -106,14 +70,6 @@ export interface DecProtoProtoMsg { value: Uint8Array; } /** DecProto defines a Protobuf wrapper around a Dec object. */ -export interface DecProtoAmino { - dec?: string; -} -export interface DecProtoAminoMsg { - type: 'cosmos-sdk/DecProto'; - value: DecProtoAmino; -} -/** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProtoSDKType { dec: string; } @@ -176,31 +132,6 @@ export const Coin = { message.amount = object.amount ?? ''; return message; }, - fromAmino(object: CoinAmino): Coin { - const message = createBaseCoin(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } - return message; - }, - toAmino(message: Coin): CoinAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - obj.amount = message.amount === '' ? undefined : message.amount; - return obj; - }, - fromAminoMsg(object: CoinAminoMsg): Coin { - return Coin.fromAmino(object.value); - }, - toAminoMsg(message: Coin): CoinAminoMsg { - return { - type: 'cosmos-sdk/Coin', - value: Coin.toAmino(message), - }; - }, fromProtoMsg(message: CoinProtoMsg): Coin { return Coin.decode(message.value); }, @@ -273,31 +204,6 @@ export const DecCoin = { message.amount = object.amount ?? ''; return message; }, - fromAmino(object: DecCoinAmino): DecCoin { - const message = createBaseDecCoin(); - if (object.denom !== undefined && object.denom !== null) { - message.denom = object.denom; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } - return message; - }, - toAmino(message: DecCoin): DecCoinAmino { - const obj: any = {}; - obj.denom = message.denom === '' ? undefined : message.denom; - obj.amount = message.amount === '' ? undefined : message.amount; - return obj; - }, - fromAminoMsg(object: DecCoinAminoMsg): DecCoin { - return DecCoin.fromAmino(object.value); - }, - toAminoMsg(message: DecCoin): DecCoinAminoMsg { - return { - type: 'cosmos-sdk/DecCoin', - value: DecCoin.toAmino(message), - }; - }, fromProtoMsg(message: DecCoinProtoMsg): DecCoin { return DecCoin.decode(message.value); }, @@ -360,27 +266,6 @@ export const IntProto = { message.int = object.int ?? ''; return message; }, - fromAmino(object: IntProtoAmino): IntProto { - const message = createBaseIntProto(); - if (object.int !== undefined && object.int !== null) { - message.int = object.int; - } - return message; - }, - toAmino(message: IntProto): IntProtoAmino { - const obj: any = {}; - obj.int = message.int === '' ? undefined : message.int; - return obj; - }, - fromAminoMsg(object: IntProtoAminoMsg): IntProto { - return IntProto.fromAmino(object.value); - }, - toAminoMsg(message: IntProto): IntProtoAminoMsg { - return { - type: 'cosmos-sdk/IntProto', - value: IntProto.toAmino(message), - }; - }, fromProtoMsg(message: IntProtoProtoMsg): IntProto { return IntProto.decode(message.value); }, @@ -443,27 +328,6 @@ export const DecProto = { message.dec = object.dec ?? ''; return message; }, - fromAmino(object: DecProtoAmino): DecProto { - const message = createBaseDecProto(); - if (object.dec !== undefined && object.dec !== null) { - message.dec = object.dec; - } - return message; - }, - toAmino(message: DecProto): DecProtoAmino { - const obj: any = {}; - obj.dec = message.dec === '' ? undefined : message.dec; - return obj; - }, - fromAminoMsg(object: DecProtoAminoMsg): DecProto { - return DecProto.fromAmino(object.value); - }, - toAminoMsg(message: DecProto): DecProtoAminoMsg { - return { - type: 'cosmos-sdk/DecProto', - value: DecProto.toAmino(message), - }; - }, fromProtoMsg(message: DecProtoProtoMsg): DecProto { return DecProto.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/bundle.ts b/packages/cosmic-proto/src/codegen/cosmos/bundle.ts index bc7a50802b9..e672c1e36a7 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/bundle.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/bundle.ts @@ -61,58 +61,12 @@ import * as _75 from './upgrade/v1beta1/tx.js'; import * as _76 from './upgrade/v1beta1/upgrade.js'; import * as _77 from './vesting/v1beta1/tx.js'; import * as _78 from './vesting/v1beta1/vesting.js'; -import * as _107 from './authz/v1beta1/tx.amino.js'; -import * as _108 from './bank/v1beta1/tx.amino.js'; -import * as _109 from './distribution/v1beta1/tx.amino.js'; -import * as _110 from './feegrant/v1beta1/tx.amino.js'; -import * as _111 from './gov/v1/tx.amino.js'; -import * as _112 from './gov/v1beta1/tx.amino.js'; -import * as _113 from './group/v1/tx.amino.js'; -import * as _114 from './staking/v1beta1/tx.amino.js'; -import * as _115 from './upgrade/v1beta1/tx.amino.js'; -import * as _116 from './vesting/v1beta1/tx.amino.js'; -import * as _117 from './authz/v1beta1/tx.registry.js'; -import * as _118 from './bank/v1beta1/tx.registry.js'; -import * as _119 from './distribution/v1beta1/tx.registry.js'; -import * as _120 from './feegrant/v1beta1/tx.registry.js'; -import * as _121 from './gov/v1/tx.registry.js'; -import * as _122 from './gov/v1beta1/tx.registry.js'; -import * as _123 from './group/v1/tx.registry.js'; -import * as _124 from './staking/v1beta1/tx.registry.js'; -import * as _125 from './upgrade/v1beta1/tx.registry.js'; -import * as _126 from './vesting/v1beta1/tx.registry.js'; -import * as _127 from './auth/v1beta1/query.rpc.Query.js'; -import * as _128 from './authz/v1beta1/query.rpc.Query.js'; -import * as _129 from './bank/v1beta1/query.rpc.Query.js'; -import * as _130 from './distribution/v1beta1/query.rpc.Query.js'; -import * as _131 from './feegrant/v1beta1/query.rpc.Query.js'; -import * as _132 from './gov/v1/query.rpc.Query.js'; -import * as _133 from './gov/v1beta1/query.rpc.Query.js'; -import * as _134 from './group/v1/query.rpc.Query.js'; -import * as _135 from './mint/v1beta1/query.rpc.Query.js'; -import * as _136 from './params/v1beta1/query.rpc.Query.js'; -import * as _137 from './staking/v1beta1/query.rpc.Query.js'; -import * as _138 from './tx/v1beta1/service.rpc.Service.js'; -import * as _139 from './upgrade/v1beta1/query.rpc.Query.js'; -import * as _140 from './authz/v1beta1/tx.rpc.msg.js'; -import * as _141 from './bank/v1beta1/tx.rpc.msg.js'; -import * as _142 from './distribution/v1beta1/tx.rpc.msg.js'; -import * as _143 from './feegrant/v1beta1/tx.rpc.msg.js'; -import * as _144 from './gov/v1/tx.rpc.msg.js'; -import * as _145 from './gov/v1beta1/tx.rpc.msg.js'; -import * as _146 from './group/v1/tx.rpc.msg.js'; -import * as _147 from './staking/v1beta1/tx.rpc.msg.js'; -import * as _148 from './upgrade/v1beta1/tx.rpc.msg.js'; -import * as _149 from './vesting/v1beta1/tx.rpc.msg.js'; -import * as _152 from './rpc.query.js'; -import * as _153 from './rpc.tx.js'; export namespace cosmos { export namespace auth { export const v1beta1 = { ..._17, ..._18, ..._19, - ..._127, }; } export namespace authz { @@ -122,10 +76,6 @@ export namespace cosmos { ..._22, ..._23, ..._24, - ..._107, - ..._117, - ..._128, - ..._140, }; } export namespace bank { @@ -135,10 +85,6 @@ export namespace cosmos { ..._27, ..._28, ..._29, - ..._108, - ..._118, - ..._129, - ..._141, }; } export namespace base { @@ -191,10 +137,6 @@ export namespace cosmos { ..._41, ..._42, ..._43, - ..._109, - ..._119, - ..._130, - ..._142, }; } export namespace feegrant { @@ -203,10 +145,6 @@ export namespace cosmos { ..._45, ..._46, ..._47, - ..._110, - ..._120, - ..._131, - ..._143, }; } export namespace gov { @@ -215,20 +153,12 @@ export namespace cosmos { ..._49, ..._50, ..._51, - ..._111, - ..._121, - ..._132, - ..._144, }; export const v1beta1 = { ..._52, ..._53, ..._54, ..._55, - ..._112, - ..._122, - ..._133, - ..._145, }; } export namespace group { @@ -238,10 +168,6 @@ export namespace cosmos { ..._58, ..._59, ..._60, - ..._113, - ..._123, - ..._134, - ..._146, }; } export namespace mint { @@ -249,14 +175,12 @@ export namespace cosmos { ..._61, ..._62, ..._63, - ..._135, }; } export namespace params { export const v1beta1 = { ..._64, ..._65, - ..._136, }; } export namespace staking { @@ -266,10 +190,6 @@ export namespace cosmos { ..._68, ..._69, ..._70, - ..._114, - ..._124, - ..._137, - ..._147, }; } export namespace tx { @@ -281,7 +201,6 @@ export namespace cosmos { export const v1beta1 = { ..._72, ..._73, - ..._138, }; } export namespace upgrade { @@ -289,23 +208,12 @@ export namespace cosmos { ..._74, ..._75, ..._76, - ..._115, - ..._125, - ..._139, - ..._148, }; } export namespace vesting { export const v1beta1 = { ..._77, ..._78, - ..._116, - ..._126, - ..._149, }; } - export const ClientFactory = { - ..._152, - ..._153, - }; } diff --git a/packages/cosmic-proto/src/codegen/cosmos/client.ts b/packages/cosmic-proto/src/codegen/cosmos/client.ts deleted file mode 100644 index ec07cd47908..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/client.ts +++ /dev/null @@ -1,79 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry, OfflineSigner } from '@cosmjs/proto-signing'; -import { AminoTypes, SigningStargateClient } from '@cosmjs/stargate'; -import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; -import * as cosmosAuthzV1beta1TxRegistry from './authz/v1beta1/tx.registry.js'; -import * as cosmosBankV1beta1TxRegistry from './bank/v1beta1/tx.registry.js'; -import * as cosmosDistributionV1beta1TxRegistry from './distribution/v1beta1/tx.registry.js'; -import * as cosmosFeegrantV1beta1TxRegistry from './feegrant/v1beta1/tx.registry.js'; -import * as cosmosGovV1TxRegistry from './gov/v1/tx.registry.js'; -import * as cosmosGovV1beta1TxRegistry from './gov/v1beta1/tx.registry.js'; -import * as cosmosGroupV1TxRegistry from './group/v1/tx.registry.js'; -import * as cosmosStakingV1beta1TxRegistry from './staking/v1beta1/tx.registry.js'; -import * as cosmosUpgradeV1beta1TxRegistry from './upgrade/v1beta1/tx.registry.js'; -import * as cosmosVestingV1beta1TxRegistry from './vesting/v1beta1/tx.registry.js'; -import * as cosmosAuthzV1beta1TxAmino from './authz/v1beta1/tx.amino.js'; -import * as cosmosBankV1beta1TxAmino from './bank/v1beta1/tx.amino.js'; -import * as cosmosDistributionV1beta1TxAmino from './distribution/v1beta1/tx.amino.js'; -import * as cosmosFeegrantV1beta1TxAmino from './feegrant/v1beta1/tx.amino.js'; -import * as cosmosGovV1TxAmino from './gov/v1/tx.amino.js'; -import * as cosmosGovV1beta1TxAmino from './gov/v1beta1/tx.amino.js'; -import * as cosmosGroupV1TxAmino from './group/v1/tx.amino.js'; -import * as cosmosStakingV1beta1TxAmino from './staking/v1beta1/tx.amino.js'; -import * as cosmosUpgradeV1beta1TxAmino from './upgrade/v1beta1/tx.amino.js'; -import * as cosmosVestingV1beta1TxAmino from './vesting/v1beta1/tx.amino.js'; -export const cosmosAminoConverters = { - ...cosmosAuthzV1beta1TxAmino.AminoConverter, - ...cosmosBankV1beta1TxAmino.AminoConverter, - ...cosmosDistributionV1beta1TxAmino.AminoConverter, - ...cosmosFeegrantV1beta1TxAmino.AminoConverter, - ...cosmosGovV1TxAmino.AminoConverter, - ...cosmosGovV1beta1TxAmino.AminoConverter, - ...cosmosGroupV1TxAmino.AminoConverter, - ...cosmosStakingV1beta1TxAmino.AminoConverter, - ...cosmosUpgradeV1beta1TxAmino.AminoConverter, - ...cosmosVestingV1beta1TxAmino.AminoConverter, -}; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ - ...cosmosAuthzV1beta1TxRegistry.registry, - ...cosmosBankV1beta1TxRegistry.registry, - ...cosmosDistributionV1beta1TxRegistry.registry, - ...cosmosFeegrantV1beta1TxRegistry.registry, - ...cosmosGovV1TxRegistry.registry, - ...cosmosGovV1beta1TxRegistry.registry, - ...cosmosGroupV1TxRegistry.registry, - ...cosmosStakingV1beta1TxRegistry.registry, - ...cosmosUpgradeV1beta1TxRegistry.registry, - ...cosmosVestingV1beta1TxRegistry.registry, -]; -export const getSigningCosmosClientOptions = (): { - registry: Registry; - aminoTypes: AminoTypes; -} => { - const registry = new Registry([...cosmosProtoRegistry]); - const aminoTypes = new AminoTypes({ - ...cosmosAminoConverters, - }); - return { - registry, - aminoTypes, - }; -}; -export const getSigningCosmosClient = async ({ - rpcEndpoint, - signer, -}: { - rpcEndpoint: string | HttpEndpoint; - signer: OfflineSigner; -}) => { - const { registry, aminoTypes } = getSigningCosmosClientOptions(); - const client = await SigningStargateClient.connectWithSigner( - rpcEndpoint, - signer, - { - registry: registry as any, - aminoTypes, - }, - ); - return client; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/ed25519/keys.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/ed25519/keys.ts index 086011a517a..923d6c2a0ed 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/ed25519/keys.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/ed25519/keys.ts @@ -15,20 +15,6 @@ export interface PubKeyProtoMsg { typeUrl: '/cosmos.crypto.ed25519.PubKey'; value: Uint8Array; } -/** - * PubKey is an ed25519 public key for handling Tendermint keys in SDK. - * It's needed for Any serialization and SDK compatibility. - * It must not be used in a non Tendermint key context because it doesn't implement - * ADR-28. Nevertheless, you will like to use ed25519 in app user level - * then you must create a new proto message and follow ADR-28 for Address construction. - */ -export interface PubKeyAmino { - key?: string; -} -export interface PubKeyAminoMsg { - type: 'cosmos-sdk/PubKey'; - value: PubKeyAmino; -} /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. * It's needed for Any serialization and SDK compatibility. @@ -50,17 +36,6 @@ export interface PrivKeyProtoMsg { typeUrl: '/cosmos.crypto.ed25519.PrivKey'; value: Uint8Array; } -/** - * Deprecated: PrivKey defines a ed25519 private key. - * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. - */ -export interface PrivKeyAmino { - key?: string; -} -export interface PrivKeyAminoMsg { - type: 'cosmos-sdk/PrivKey'; - value: PrivKeyAmino; -} /** * Deprecated: PrivKey defines a ed25519 private key. * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. @@ -120,27 +95,6 @@ export const PubKey = { message.key = object.key ?? new Uint8Array(); return message; }, - fromAmino(object: PubKeyAmino): PubKey { - const message = createBasePubKey(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - toAmino(message: PubKey): PubKeyAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - return obj; - }, - fromAminoMsg(object: PubKeyAminoMsg): PubKey { - return PubKey.fromAmino(object.value); - }, - toAminoMsg(message: PubKey): PubKeyAminoMsg { - return { - type: 'cosmos-sdk/PubKey', - value: PubKey.toAmino(message), - }; - }, fromProtoMsg(message: PubKeyProtoMsg): PubKey { return PubKey.decode(message.value); }, @@ -206,27 +160,6 @@ export const PrivKey = { message.key = object.key ?? new Uint8Array(); return message; }, - fromAmino(object: PrivKeyAmino): PrivKey { - const message = createBasePrivKey(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - toAmino(message: PrivKey): PrivKeyAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - return obj; - }, - fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { - return PrivKey.fromAmino(object.value); - }, - toAminoMsg(message: PrivKey): PrivKeyAminoMsg { - return { - type: 'cosmos-sdk/PrivKey', - value: PrivKey.toAmino(message), - }; - }, fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { return PrivKey.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/hd/v1/hd.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/hd/v1/hd.ts index d30e6c52fb4..349938fabca 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/hd/v1/hd.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/hd/v1/hd.ts @@ -22,26 +22,6 @@ export interface BIP44ParamsProtoMsg { value: Uint8Array; } /** BIP44Params is used as path field in ledger item in Record. */ -export interface BIP44ParamsAmino { - /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ - purpose?: number; - /** coin_type is a constant that improves privacy */ - coin_type?: number; - /** account splits the key space into independent user identities */ - account?: number; - /** - * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - * chain. - */ - change?: boolean; - /** address_index is used as child index in BIP32 derivation */ - address_index?: number; -} -export interface BIP44ParamsAminoMsg { - type: 'cosmos-sdk/BIP44Params'; - value: BIP44ParamsAmino; -} -/** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44ParamsSDKType { purpose: number; coin_type: number; @@ -144,44 +124,6 @@ export const BIP44Params = { message.addressIndex = object.addressIndex ?? 0; return message; }, - fromAmino(object: BIP44ParamsAmino): BIP44Params { - const message = createBaseBIP44Params(); - if (object.purpose !== undefined && object.purpose !== null) { - message.purpose = object.purpose; - } - if (object.coin_type !== undefined && object.coin_type !== null) { - message.coinType = object.coin_type; - } - if (object.account !== undefined && object.account !== null) { - message.account = object.account; - } - if (object.change !== undefined && object.change !== null) { - message.change = object.change; - } - if (object.address_index !== undefined && object.address_index !== null) { - message.addressIndex = object.address_index; - } - return message; - }, - toAmino(message: BIP44Params): BIP44ParamsAmino { - const obj: any = {}; - obj.purpose = message.purpose === 0 ? undefined : message.purpose; - obj.coin_type = message.coinType === 0 ? undefined : message.coinType; - obj.account = message.account === 0 ? undefined : message.account; - obj.change = message.change === false ? undefined : message.change; - obj.address_index = - message.addressIndex === 0 ? undefined : message.addressIndex; - return obj; - }, - fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { - return BIP44Params.fromAmino(object.value); - }, - toAminoMsg(message: BIP44Params): BIP44ParamsAminoMsg { - return { - type: 'cosmos-sdk/BIP44Params', - value: BIP44Params.toAmino(message), - }; - }, fromProtoMsg(message: BIP44ParamsProtoMsg): BIP44Params { return BIP44Params.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts index c31e9d04e81..293bdbe8e33 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -1,10 +1,6 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../../google/protobuf/any.js'; -import { - BIP44Params, - BIP44ParamsAmino, - BIP44ParamsSDKType, -} from '../../hd/v1/hd.js'; +import { Any, AnySDKType } from '../../../../google/protobuf/any.js'; +import { BIP44Params, BIP44ParamsSDKType } from '../../hd/v1/hd.js'; import { BinaryReader, BinaryWriter } from '../../../../binary.js'; import { isSet } from '../../../../helpers.js'; /** Record is used for representing a key in the keyring. */ @@ -27,25 +23,6 @@ export interface RecordProtoMsg { value: Uint8Array; } /** Record is used for representing a key in the keyring. */ -export interface RecordAmino { - /** name represents a name of Record */ - name?: string; - /** pub_key represents a public key in any format */ - pub_key?: AnyAmino; - /** local stores the public information about a locally stored key */ - local?: Record_LocalAmino; - /** ledger stores the public information about a Ledger key */ - ledger?: Record_LedgerAmino; - /** Multi does not store any information. */ - multi?: Record_MultiAmino; - /** Offline does not store any information. */ - offline?: Record_OfflineAmino; -} -export interface RecordAminoMsg { - type: 'cosmos-sdk/Record'; - value: RecordAmino; -} -/** Record is used for representing a key in the keyring. */ export interface RecordSDKType { name: string; pub_key?: AnySDKType; @@ -66,18 +43,6 @@ export interface Record_LocalProtoMsg { typeUrl: '/cosmos.crypto.keyring.v1.Local'; value: Uint8Array; } -/** - * Item is a keyring item stored in a keyring backend. - * Local item - */ -export interface Record_LocalAmino { - priv_key?: AnyAmino; - priv_key_type?: string; -} -export interface Record_LocalAminoMsg { - type: 'cosmos-sdk/Local'; - value: Record_LocalAmino; -} /** * Item is a keyring item stored in a keyring backend. * Local item @@ -95,14 +60,6 @@ export interface Record_LedgerProtoMsg { value: Uint8Array; } /** Ledger item */ -export interface Record_LedgerAmino { - path?: BIP44ParamsAmino; -} -export interface Record_LedgerAminoMsg { - type: 'cosmos-sdk/Ledger'; - value: Record_LedgerAmino; -} -/** Ledger item */ export interface Record_LedgerSDKType { path?: BIP44ParamsSDKType; } @@ -113,12 +70,6 @@ export interface Record_MultiProtoMsg { value: Uint8Array; } /** Multi item */ -export interface Record_MultiAmino {} -export interface Record_MultiAminoMsg { - type: 'cosmos-sdk/Multi'; - value: Record_MultiAmino; -} -/** Multi item */ export interface Record_MultiSDKType {} /** Offline item */ export interface Record_Offline {} @@ -127,12 +78,6 @@ export interface Record_OfflineProtoMsg { value: Uint8Array; } /** Offline item */ -export interface Record_OfflineAmino {} -export interface Record_OfflineAminoMsg { - type: 'cosmos-sdk/Offline'; - value: Record_OfflineAmino; -} -/** Offline item */ export interface Record_OfflineSDKType {} function createBaseRecord(): Record { return { @@ -269,51 +214,6 @@ export const Record = { : undefined; return message; }, - fromAmino(object: RecordAmino): Record { - const message = createBaseRecord(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pubKey = Any.fromAmino(object.pub_key); - } - if (object.local !== undefined && object.local !== null) { - message.local = Record_Local.fromAmino(object.local); - } - if (object.ledger !== undefined && object.ledger !== null) { - message.ledger = Record_Ledger.fromAmino(object.ledger); - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = Record_Multi.fromAmino(object.multi); - } - if (object.offline !== undefined && object.offline !== null) { - message.offline = Record_Offline.fromAmino(object.offline); - } - return message; - }, - toAmino(message: Record): RecordAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; - obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; - obj.ledger = message.ledger - ? Record_Ledger.toAmino(message.ledger) - : undefined; - obj.multi = message.multi ? Record_Multi.toAmino(message.multi) : undefined; - obj.offline = message.offline - ? Record_Offline.toAmino(message.offline) - : undefined; - return obj; - }, - fromAminoMsg(object: RecordAminoMsg): Record { - return Record.fromAmino(object.value); - }, - toAminoMsg(message: Record): RecordAminoMsg { - return { - type: 'cosmos-sdk/Record', - value: Record.toAmino(message), - }; - }, fromProtoMsg(message: RecordProtoMsg): Record { return Record.decode(message.value); }, @@ -391,32 +291,6 @@ export const Record_Local = { message.privKeyType = object.privKeyType ?? ''; return message; }, - fromAmino(object: Record_LocalAmino): Record_Local { - const message = createBaseRecord_Local(); - if (object.priv_key !== undefined && object.priv_key !== null) { - message.privKey = Any.fromAmino(object.priv_key); - } - if (object.priv_key_type !== undefined && object.priv_key_type !== null) { - message.privKeyType = object.priv_key_type; - } - return message; - }, - toAmino(message: Record_Local): Record_LocalAmino { - const obj: any = {}; - obj.priv_key = message.privKey ? Any.toAmino(message.privKey) : undefined; - obj.priv_key_type = - message.privKeyType === '' ? undefined : message.privKeyType; - return obj; - }, - fromAminoMsg(object: Record_LocalAminoMsg): Record_Local { - return Record_Local.fromAmino(object.value); - }, - toAminoMsg(message: Record_Local): Record_LocalAminoMsg { - return { - type: 'cosmos-sdk/Local', - value: Record_Local.toAmino(message), - }; - }, fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { return Record_Local.decode(message.value); }, @@ -483,27 +357,6 @@ export const Record_Ledger = { : undefined; return message; }, - fromAmino(object: Record_LedgerAmino): Record_Ledger { - const message = createBaseRecord_Ledger(); - if (object.path !== undefined && object.path !== null) { - message.path = BIP44Params.fromAmino(object.path); - } - return message; - }, - toAmino(message: Record_Ledger): Record_LedgerAmino { - const obj: any = {}; - obj.path = message.path ? BIP44Params.toAmino(message.path) : undefined; - return obj; - }, - fromAminoMsg(object: Record_LedgerAminoMsg): Record_Ledger { - return Record_Ledger.fromAmino(object.value); - }, - toAminoMsg(message: Record_Ledger): Record_LedgerAminoMsg { - return { - type: 'cosmos-sdk/Ledger', - value: Record_Ledger.toAmino(message), - }; - }, fromProtoMsg(message: Record_LedgerProtoMsg): Record_Ledger { return Record_Ledger.decode(message.value); }, @@ -554,23 +407,6 @@ export const Record_Multi = { const message = createBaseRecord_Multi(); return message; }, - fromAmino(_: Record_MultiAmino): Record_Multi { - const message = createBaseRecord_Multi(); - return message; - }, - toAmino(_: Record_Multi): Record_MultiAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: Record_MultiAminoMsg): Record_Multi { - return Record_Multi.fromAmino(object.value); - }, - toAminoMsg(message: Record_Multi): Record_MultiAminoMsg { - return { - type: 'cosmos-sdk/Multi', - value: Record_Multi.toAmino(message), - }; - }, fromProtoMsg(message: Record_MultiProtoMsg): Record_Multi { return Record_Multi.decode(message.value); }, @@ -621,23 +457,6 @@ export const Record_Offline = { const message = createBaseRecord_Offline(); return message; }, - fromAmino(_: Record_OfflineAmino): Record_Offline { - const message = createBaseRecord_Offline(); - return message; - }, - toAmino(_: Record_Offline): Record_OfflineAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: Record_OfflineAminoMsg): Record_Offline { - return Record_Offline.fromAmino(object.value); - }, - toAminoMsg(message: Record_Offline): Record_OfflineAminoMsg { - return { - type: 'cosmos-sdk/Offline', - value: Record_Offline.toAmino(message), - }; - }, fromProtoMsg(message: Record_OfflineProtoMsg): Record_Offline { return Record_Offline.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/keys.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/keys.ts index 9a3f7922a80..9edc387e048 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/keys.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/keys.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -15,19 +15,6 @@ export interface LegacyAminoPubKeyProtoMsg { typeUrl: '/cosmos.crypto.multisig.LegacyAminoPubKey'; value: Uint8Array; } -/** - * LegacyAminoPubKey specifies a public key type - * which nests multiple public keys and a threshold, - * it uses legacy amino address rules. - */ -export interface LegacyAminoPubKeyAmino { - threshold?: number; - public_keys?: AnyAmino[]; -} -export interface LegacyAminoPubKeyAminoMsg { - type: 'cosmos-sdk/LegacyAminoPubKey'; - value: LegacyAminoPubKeyAmino; -} /** * LegacyAminoPubKey specifies a public key type * which nests multiple public keys and a threshold, @@ -105,35 +92,6 @@ export const LegacyAminoPubKey = { message.publicKeys = object.publicKeys?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: LegacyAminoPubKeyAmino): LegacyAminoPubKey { - const message = createBaseLegacyAminoPubKey(); - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = object.threshold; - } - message.publicKeys = object.public_keys?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: LegacyAminoPubKey): LegacyAminoPubKeyAmino { - const obj: any = {}; - obj.threshold = message.threshold === 0 ? undefined : message.threshold; - if (message.publicKeys) { - obj.public_keys = message.publicKeys.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.public_keys = message.publicKeys; - } - return obj; - }, - fromAminoMsg(object: LegacyAminoPubKeyAminoMsg): LegacyAminoPubKey { - return LegacyAminoPubKey.fromAmino(object.value); - }, - toAminoMsg(message: LegacyAminoPubKey): LegacyAminoPubKeyAminoMsg { - return { - type: 'cosmos-sdk/LegacyAminoPubKey', - value: LegacyAminoPubKey.toAmino(message), - }; - }, fromProtoMsg(message: LegacyAminoPubKeyProtoMsg): LegacyAminoPubKey { return LegacyAminoPubKey.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts index 068f05c8066..8046c8dbb43 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -17,18 +17,6 @@ export interface MultiSignatureProtoMsg { typeUrl: '/cosmos.crypto.multisig.v1beta1.MultiSignature'; value: Uint8Array; } -/** - * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. - * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers - * signed and with which modes. - */ -export interface MultiSignatureAmino { - signatures?: string[]; -} -export interface MultiSignatureAminoMsg { - type: 'cosmos-sdk/MultiSignature'; - value: MultiSignatureAmino; -} /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers @@ -51,20 +39,6 @@ export interface CompactBitArrayProtoMsg { typeUrl: '/cosmos.crypto.multisig.v1beta1.CompactBitArray'; value: Uint8Array; } -/** - * CompactBitArray is an implementation of a space efficient bit array. - * This is used to ensure that the encoded data takes up a minimal amount of - * space after proto encoding. - * This is not thread safe, and is not intended for concurrent usage. - */ -export interface CompactBitArrayAmino { - extra_bits_stored?: number; - elems?: string; -} -export interface CompactBitArrayAminoMsg { - type: 'cosmos-sdk/CompactBitArray'; - value: CompactBitArrayAmino; -} /** * CompactBitArray is an implementation of a space efficient bit array. * This is used to ensure that the encoded data takes up a minimal amount of @@ -132,29 +106,6 @@ export const MultiSignature = { message.signatures = object.signatures?.map(e => e) || []; return message; }, - fromAmino(object: MultiSignatureAmino): MultiSignature { - const message = createBaseMultiSignature(); - message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: MultiSignature): MultiSignatureAmino { - const obj: any = {}; - if (message.signatures) { - obj.signatures = message.signatures.map(e => base64FromBytes(e)); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg(object: MultiSignatureAminoMsg): MultiSignature { - return MultiSignature.fromAmino(object.value); - }, - toAminoMsg(message: MultiSignature): MultiSignatureAminoMsg { - return { - type: 'cosmos-sdk/MultiSignature', - value: MultiSignature.toAmino(message), - }; - }, fromProtoMsg(message: MultiSignatureProtoMsg): MultiSignature { return MultiSignature.decode(message.value); }, @@ -235,35 +186,6 @@ export const CompactBitArray = { message.elems = object.elems ?? new Uint8Array(); return message; }, - fromAmino(object: CompactBitArrayAmino): CompactBitArray { - const message = createBaseCompactBitArray(); - if ( - object.extra_bits_stored !== undefined && - object.extra_bits_stored !== null - ) { - message.extraBitsStored = object.extra_bits_stored; - } - if (object.elems !== undefined && object.elems !== null) { - message.elems = bytesFromBase64(object.elems); - } - return message; - }, - toAmino(message: CompactBitArray): CompactBitArrayAmino { - const obj: any = {}; - obj.extra_bits_stored = - message.extraBitsStored === 0 ? undefined : message.extraBitsStored; - obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; - return obj; - }, - fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { - return CompactBitArray.fromAmino(object.value); - }, - toAminoMsg(message: CompactBitArray): CompactBitArrayAminoMsg { - return { - type: 'cosmos-sdk/CompactBitArray', - value: CompactBitArray.toAmino(message), - }; - }, fromProtoMsg(message: CompactBitArrayProtoMsg): CompactBitArray { return CompactBitArray.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256k1/keys.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256k1/keys.ts index fcafb6c9f3d..e303c89746b 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256k1/keys.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256k1/keys.ts @@ -15,20 +15,6 @@ export interface PubKeyProtoMsg { typeUrl: '/cosmos.crypto.secp256k1.PubKey'; value: Uint8Array; } -/** - * PubKey defines a secp256k1 public key - * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte - * if the y-coordinate is the lexicographically largest of the two associated with - * the x-coordinate. Otherwise the first byte is a 0x03. - * This prefix is followed with the x-coordinate. - */ -export interface PubKeyAmino { - key?: string; -} -export interface PubKeyAminoMsg { - type: 'cosmos-sdk/PubKey'; - value: PubKeyAmino; -} /** * PubKey defines a secp256k1 public key * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte @@ -48,14 +34,6 @@ export interface PrivKeyProtoMsg { value: Uint8Array; } /** PrivKey defines a secp256k1 private key. */ -export interface PrivKeyAmino { - key?: string; -} -export interface PrivKeyAminoMsg { - type: 'cosmos-sdk/PrivKey'; - value: PrivKeyAmino; -} -/** PrivKey defines a secp256k1 private key. */ export interface PrivKeySDKType { key: Uint8Array; } @@ -111,27 +89,6 @@ export const PubKey = { message.key = object.key ?? new Uint8Array(); return message; }, - fromAmino(object: PubKeyAmino): PubKey { - const message = createBasePubKey(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - toAmino(message: PubKey): PubKeyAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - return obj; - }, - fromAminoMsg(object: PubKeyAminoMsg): PubKey { - return PubKey.fromAmino(object.value); - }, - toAminoMsg(message: PubKey): PubKeyAminoMsg { - return { - type: 'cosmos-sdk/PubKey', - value: PubKey.toAmino(message), - }; - }, fromProtoMsg(message: PubKeyProtoMsg): PubKey { return PubKey.decode(message.value); }, @@ -197,27 +154,6 @@ export const PrivKey = { message.key = object.key ?? new Uint8Array(); return message; }, - fromAmino(object: PrivKeyAmino): PrivKey { - const message = createBasePrivKey(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - toAmino(message: PrivKey): PrivKeyAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - return obj; - }, - fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { - return PrivKey.fromAmino(object.value); - }, - toAminoMsg(message: PrivKey): PrivKeyAminoMsg { - return { - type: 'cosmos-sdk/PrivKey', - value: PrivKey.toAmino(message), - }; - }, fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { return PrivKey.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256r1/keys.ts b/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256r1/keys.ts index a692f054e51..82187458090 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256r1/keys.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/crypto/secp256r1/keys.ts @@ -14,18 +14,6 @@ export interface PubKeyProtoMsg { value: Uint8Array; } /** PubKey defines a secp256r1 ECDSA public key. */ -export interface PubKeyAmino { - /** - * Point on secp256r1 curve in a compressed representation as specified in section - * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - */ - key?: string; -} -export interface PubKeyAminoMsg { - type: 'cosmos-sdk/PubKey'; - value: PubKeyAmino; -} -/** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKeySDKType { key: Uint8Array; } @@ -39,15 +27,6 @@ export interface PrivKeyProtoMsg { value: Uint8Array; } /** PrivKey defines a secp256r1 ECDSA private key. */ -export interface PrivKeyAmino { - /** secret number serialized using big-endian encoding */ - secret?: string; -} -export interface PrivKeyAminoMsg { - type: 'cosmos-sdk/PrivKey'; - value: PrivKeyAmino; -} -/** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKeySDKType { secret: Uint8Array; } @@ -103,27 +82,6 @@ export const PubKey = { message.key = object.key ?? new Uint8Array(); return message; }, - fromAmino(object: PubKeyAmino): PubKey { - const message = createBasePubKey(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - return message; - }, - toAmino(message: PubKey): PubKeyAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - return obj; - }, - fromAminoMsg(object: PubKeyAminoMsg): PubKey { - return PubKey.fromAmino(object.value); - }, - toAminoMsg(message: PubKey): PubKeyAminoMsg { - return { - type: 'cosmos-sdk/PubKey', - value: PubKey.toAmino(message), - }; - }, fromProtoMsg(message: PubKeyProtoMsg): PubKey { return PubKey.decode(message.value); }, @@ -191,27 +149,6 @@ export const PrivKey = { message.secret = object.secret ?? new Uint8Array(); return message; }, - fromAmino(object: PrivKeyAmino): PrivKey { - const message = createBasePrivKey(); - if (object.secret !== undefined && object.secret !== null) { - message.secret = bytesFromBase64(object.secret); - } - return message; - }, - toAmino(message: PrivKey): PrivKeyAmino { - const obj: any = {}; - obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; - return obj; - }, - fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { - return PrivKey.fromAmino(object.value); - }, - toAminoMsg(message: PrivKey): PrivKeyAminoMsg { - return { - type: 'cosmos-sdk/PrivKey', - value: PrivKey.toAmino(message), - }; - }, fromProtoMsg(message: PrivKeyProtoMsg): PrivKey { return PrivKey.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/distribution.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/distribution.ts index 7526f63f6b8..8efcff6deb5 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/distribution.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/distribution.ts @@ -1,10 +1,8 @@ //@ts-nocheck import { DecCoin, - DecCoinAmino, DecCoinSDKType, Coin, - CoinAmino, CoinSDKType, } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -22,17 +20,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params defines the set of params for the distribution module. */ -export interface ParamsAmino { - community_tax?: string; - base_proposer_reward?: string; - bonus_proposer_reward?: string; - withdraw_addr_enabled?: boolean; -} -export interface ParamsAminoMsg { - type: 'cosmos-sdk/Params'; - value: ParamsAmino; -} -/** Params defines the set of params for the distribution module. */ export interface ParamsSDKType { community_tax: string; base_proposer_reward: string; @@ -61,28 +48,6 @@ export interface ValidatorHistoricalRewardsProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorHistoricalRewards'; value: Uint8Array; } -/** - * ValidatorHistoricalRewards represents historical rewards for a validator. - * Height is implicit within the store key. - * Cumulative reward ratio is the sum from the zeroeth period - * until this period of rewards / tokens, per the spec. - * The reference count indicates the number of objects - * which might need to reference this historical entry at any point. - * ReferenceCount = - * number of outstanding delegations which ended the associated period (and - * might need to read that record) - * + number of slashes which ended the associated period (and might need to - * read that record) - * + one per validator for the zeroeth period, set on initialization - */ -export interface ValidatorHistoricalRewardsAmino { - cumulative_reward_ratio?: DecCoinAmino[]; - reference_count?: number; -} -export interface ValidatorHistoricalRewardsAminoMsg { - type: 'cosmos-sdk/ValidatorHistoricalRewards'; - value: ValidatorHistoricalRewardsAmino; -} /** * ValidatorHistoricalRewards represents historical rewards for a validator. * Height is implicit within the store key. @@ -114,19 +79,6 @@ export interface ValidatorCurrentRewardsProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorCurrentRewards'; value: Uint8Array; } -/** - * ValidatorCurrentRewards represents current rewards and current - * period for a validator kept as a running counter and incremented - * each block as long as the validator's tokens remain constant. - */ -export interface ValidatorCurrentRewardsAmino { - rewards?: DecCoinAmino[]; - period?: string; -} -export interface ValidatorCurrentRewardsAminoMsg { - type: 'cosmos-sdk/ValidatorCurrentRewards'; - value: ValidatorCurrentRewardsAmino; -} /** * ValidatorCurrentRewards represents current rewards and current * period for a validator kept as a running counter and incremented @@ -147,17 +99,6 @@ export interface ValidatorAccumulatedCommissionProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission'; value: Uint8Array; } -/** - * ValidatorAccumulatedCommission represents accumulated commission - * for a validator kept as a running counter, can be withdrawn at any time. - */ -export interface ValidatorAccumulatedCommissionAmino { - commission?: DecCoinAmino[]; -} -export interface ValidatorAccumulatedCommissionAminoMsg { - type: 'cosmos-sdk/ValidatorAccumulatedCommission'; - value: ValidatorAccumulatedCommissionAmino; -} /** * ValidatorAccumulatedCommission represents accumulated commission * for a validator kept as a running counter, can be withdrawn at any time. @@ -176,17 +117,6 @@ export interface ValidatorOutstandingRewardsProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorOutstandingRewards'; value: Uint8Array; } -/** - * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - * for a validator inexpensive to track, allows simple sanity checks. - */ -export interface ValidatorOutstandingRewardsAmino { - rewards?: DecCoinAmino[]; -} -export interface ValidatorOutstandingRewardsAminoMsg { - type: 'cosmos-sdk/ValidatorOutstandingRewards'; - value: ValidatorOutstandingRewardsAmino; -} /** * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards * for a validator inexpensive to track, allows simple sanity checks. @@ -208,20 +138,6 @@ export interface ValidatorSlashEventProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorSlashEvent'; value: Uint8Array; } -/** - * ValidatorSlashEvent represents a validator slash event. - * Height is implicit within the store key. - * This is needed to calculate appropriate amount of staking tokens - * for delegations which are withdrawn after a slash has occurred. - */ -export interface ValidatorSlashEventAmino { - validator_period?: string; - fraction?: string; -} -export interface ValidatorSlashEventAminoMsg { - type: 'cosmos-sdk/ValidatorSlashEvent'; - value: ValidatorSlashEventAmino; -} /** * ValidatorSlashEvent represents a validator slash event. * Height is implicit within the store key. @@ -241,14 +157,6 @@ export interface ValidatorSlashEventsProtoMsg { value: Uint8Array; } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ -export interface ValidatorSlashEventsAmino { - validator_slash_events?: ValidatorSlashEventAmino[]; -} -export interface ValidatorSlashEventsAminoMsg { - type: 'cosmos-sdk/ValidatorSlashEvents'; - value: ValidatorSlashEventsAmino; -} -/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ export interface ValidatorSlashEventsSDKType { validator_slash_events: ValidatorSlashEventSDKType[]; } @@ -261,14 +169,6 @@ export interface FeePoolProtoMsg { value: Uint8Array; } /** FeePool is the global fee pool for distribution. */ -export interface FeePoolAmino { - community_pool?: DecCoinAmino[]; -} -export interface FeePoolAminoMsg { - type: 'cosmos-sdk/FeePool'; - value: FeePoolAmino; -} -/** FeePool is the global fee pool for distribution. */ export interface FeePoolSDKType { community_pool: DecCoinSDKType[]; } @@ -288,21 +188,6 @@ export interface CommunityPoolSpendProposalProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal'; value: Uint8Array; } -/** - * CommunityPoolSpendProposal details a proposal for use of community funds, - * together with how many coins are proposed to be spent, and to which - * recipient account. - */ -export interface CommunityPoolSpendProposalAmino { - title?: string; - description?: string; - recipient?: string; - amount?: CoinAmino[]; -} -export interface CommunityPoolSpendProposalAminoMsg { - type: 'cosmos-sdk/CommunityPoolSpendProposal'; - value: CommunityPoolSpendProposalAmino; -} /** * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which @@ -332,23 +217,6 @@ export interface DelegatorStartingInfoProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.DelegatorStartingInfo'; value: Uint8Array; } -/** - * DelegatorStartingInfo represents the starting info for a delegator reward - * period. It tracks the previous validator period, the delegation's amount of - * staking token, and the creation height (to check later on if any slashes have - * occurred). NOTE: Even though validators are slashed to whole staking tokens, - * the delegators within the validator may be left with less than a full token, - * thus sdk.Dec is used. - */ -export interface DelegatorStartingInfoAmino { - previous_period?: string; - stake?: string; - height: string; -} -export interface DelegatorStartingInfoAminoMsg { - type: 'cosmos-sdk/DelegatorStartingInfo'; - value: DelegatorStartingInfoAmino; -} /** * DelegatorStartingInfo represents the starting info for a delegator reward * period. It tracks the previous validator period, the delegation's amount of @@ -374,18 +242,6 @@ export interface DelegationDelegatorRewardProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.DelegationDelegatorReward'; value: Uint8Array; } -/** - * DelegationDelegatorReward represents the properties - * of a delegator's delegation reward. - */ -export interface DelegationDelegatorRewardAmino { - validator_address?: string; - reward?: DecCoinAmino[]; -} -export interface DelegationDelegatorRewardAminoMsg { - type: 'cosmos-sdk/DelegationDelegatorReward'; - value: DelegationDelegatorRewardAmino; -} /** * DelegationDelegatorReward represents the properties * of a delegator's delegation reward. @@ -410,21 +266,6 @@ export interface CommunityPoolSpendProposalWithDepositProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit'; value: Uint8Array; } -/** - * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal - * with a deposit - */ -export interface CommunityPoolSpendProposalWithDepositAmino { - title?: string; - description?: string; - recipient?: string; - amount?: string; - deposit?: string; -} -export interface CommunityPoolSpendProposalWithDepositAminoMsg { - type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit'; - value: CommunityPoolSpendProposalWithDepositAmino; -} /** * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal * with a deposit @@ -543,58 +384,6 @@ export const Params = { message.withdrawAddrEnabled = object.withdrawAddrEnabled ?? false; return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - if (object.community_tax !== undefined && object.community_tax !== null) { - message.communityTax = object.community_tax; - } - if ( - object.base_proposer_reward !== undefined && - object.base_proposer_reward !== null - ) { - message.baseProposerReward = object.base_proposer_reward; - } - if ( - object.bonus_proposer_reward !== undefined && - object.bonus_proposer_reward !== null - ) { - message.bonusProposerReward = object.bonus_proposer_reward; - } - if ( - object.withdraw_addr_enabled !== undefined && - object.withdraw_addr_enabled !== null - ) { - message.withdrawAddrEnabled = object.withdraw_addr_enabled; - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.community_tax = - message.communityTax === '' ? undefined : message.communityTax; - obj.base_proposer_reward = - message.baseProposerReward === '' - ? undefined - : message.baseProposerReward; - obj.bonus_proposer_reward = - message.bonusProposerReward === '' - ? undefined - : message.bonusProposerReward; - obj.withdraw_addr_enabled = - message.withdrawAddrEnabled === false - ? undefined - : message.withdrawAddrEnabled; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: 'cosmos-sdk/Params', - value: Params.toAmino(message), - }; - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, @@ -686,48 +475,6 @@ export const ValidatorHistoricalRewards = { message.referenceCount = object.referenceCount ?? 0; return message; }, - fromAmino( - object: ValidatorHistoricalRewardsAmino, - ): ValidatorHistoricalRewards { - const message = createBaseValidatorHistoricalRewards(); - message.cumulativeRewardRatio = - object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; - if ( - object.reference_count !== undefined && - object.reference_count !== null - ) { - message.referenceCount = object.reference_count; - } - return message; - }, - toAmino( - message: ValidatorHistoricalRewards, - ): ValidatorHistoricalRewardsAmino { - const obj: any = {}; - if (message.cumulativeRewardRatio) { - obj.cumulative_reward_ratio = message.cumulativeRewardRatio.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.cumulative_reward_ratio = message.cumulativeRewardRatio; - } - obj.reference_count = - message.referenceCount === 0 ? undefined : message.referenceCount; - return obj; - }, - fromAminoMsg( - object: ValidatorHistoricalRewardsAminoMsg, - ): ValidatorHistoricalRewards { - return ValidatorHistoricalRewards.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorHistoricalRewards, - ): ValidatorHistoricalRewardsAminoMsg { - return { - type: 'cosmos-sdk/ValidatorHistoricalRewards', - value: ValidatorHistoricalRewards.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorHistoricalRewardsProtoMsg, ): ValidatorHistoricalRewards { @@ -823,40 +570,6 @@ export const ValidatorCurrentRewards = { : BigInt(0); return message; }, - fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { - const message = createBaseValidatorCurrentRewards(); - message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; - if (object.period !== undefined && object.period !== null) { - message.period = BigInt(object.period); - } - return message; - }, - toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.rewards = message.rewards; - } - obj.period = - message.period !== BigInt(0) ? message.period.toString() : undefined; - return obj; - }, - fromAminoMsg( - object: ValidatorCurrentRewardsAminoMsg, - ): ValidatorCurrentRewards { - return ValidatorCurrentRewards.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorCurrentRewards, - ): ValidatorCurrentRewardsAminoMsg { - return { - type: 'cosmos-sdk/ValidatorCurrentRewards', - value: ValidatorCurrentRewards.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorCurrentRewardsProtoMsg, ): ValidatorCurrentRewards { @@ -937,40 +650,6 @@ export const ValidatorAccumulatedCommission = { object.commission?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: ValidatorAccumulatedCommissionAmino, - ): ValidatorAccumulatedCommission { - const message = createBaseValidatorAccumulatedCommission(); - message.commission = - object.commission?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: ValidatorAccumulatedCommission, - ): ValidatorAccumulatedCommissionAmino { - const obj: any = {}; - if (message.commission) { - obj.commission = message.commission.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.commission = message.commission; - } - return obj; - }, - fromAminoMsg( - object: ValidatorAccumulatedCommissionAminoMsg, - ): ValidatorAccumulatedCommission { - return ValidatorAccumulatedCommission.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorAccumulatedCommission, - ): ValidatorAccumulatedCommissionAminoMsg { - return { - type: 'cosmos-sdk/ValidatorAccumulatedCommission', - value: ValidatorAccumulatedCommission.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorAccumulatedCommissionProtoMsg, ): ValidatorAccumulatedCommission { @@ -1050,39 +729,6 @@ export const ValidatorOutstandingRewards = { message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: ValidatorOutstandingRewardsAmino, - ): ValidatorOutstandingRewards { - const message = createBaseValidatorOutstandingRewards(); - message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: ValidatorOutstandingRewards, - ): ValidatorOutstandingRewardsAmino { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.rewards = message.rewards; - } - return obj; - }, - fromAminoMsg( - object: ValidatorOutstandingRewardsAminoMsg, - ): ValidatorOutstandingRewards { - return ValidatorOutstandingRewards.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorOutstandingRewards, - ): ValidatorOutstandingRewardsAminoMsg { - return { - type: 'cosmos-sdk/ValidatorOutstandingRewards', - value: ValidatorOutstandingRewards.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorOutstandingRewardsProtoMsg, ): ValidatorOutstandingRewards { @@ -1173,37 +819,6 @@ export const ValidatorSlashEvent = { message.fraction = object.fraction ?? ''; return message; }, - fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { - const message = createBaseValidatorSlashEvent(); - if ( - object.validator_period !== undefined && - object.validator_period !== null - ) { - message.validatorPeriod = BigInt(object.validator_period); - } - if (object.fraction !== undefined && object.fraction !== null) { - message.fraction = object.fraction; - } - return message; - }, - toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { - const obj: any = {}; - obj.validator_period = - message.validatorPeriod !== BigInt(0) - ? message.validatorPeriod.toString() - : undefined; - obj.fraction = message.fraction === '' ? undefined : message.fraction; - return obj; - }, - fromAminoMsg(object: ValidatorSlashEventAminoMsg): ValidatorSlashEvent { - return ValidatorSlashEvent.fromAmino(object.value); - }, - toAminoMsg(message: ValidatorSlashEvent): ValidatorSlashEventAminoMsg { - return { - type: 'cosmos-sdk/ValidatorSlashEvent', - value: ValidatorSlashEvent.toAmino(message), - }; - }, fromProtoMsg(message: ValidatorSlashEventProtoMsg): ValidatorSlashEvent { return ValidatorSlashEvent.decode(message.value); }, @@ -1284,34 +899,6 @@ export const ValidatorSlashEvents = { ) || []; return message; }, - fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { - const message = createBaseValidatorSlashEvents(); - message.validatorSlashEvents = - object.validator_slash_events?.map(e => - ValidatorSlashEvent.fromAmino(e), - ) || []; - return message; - }, - toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { - const obj: any = {}; - if (message.validatorSlashEvents) { - obj.validator_slash_events = message.validatorSlashEvents.map(e => - e ? ValidatorSlashEvent.toAmino(e) : undefined, - ); - } else { - obj.validator_slash_events = message.validatorSlashEvents; - } - return obj; - }, - fromAminoMsg(object: ValidatorSlashEventsAminoMsg): ValidatorSlashEvents { - return ValidatorSlashEvents.fromAmino(object.value); - }, - toAminoMsg(message: ValidatorSlashEvents): ValidatorSlashEventsAminoMsg { - return { - type: 'cosmos-sdk/ValidatorSlashEvents', - value: ValidatorSlashEvents.toAmino(message), - }; - }, fromProtoMsg(message: ValidatorSlashEventsProtoMsg): ValidatorSlashEvents { return ValidatorSlashEvents.decode(message.value); }, @@ -1383,32 +970,6 @@ export const FeePool = { object.communityPool?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino(object: FeePoolAmino): FeePool { - const message = createBaseFeePool(); - message.communityPool = - object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino(message: FeePool): FeePoolAmino { - const obj: any = {}; - if (message.communityPool) { - obj.community_pool = message.communityPool.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.community_pool = message.communityPool; - } - return obj; - }, - fromAminoMsg(object: FeePoolAminoMsg): FeePool { - return FeePool.fromAmino(object.value); - }, - toAminoMsg(message: FeePool): FeePoolAminoMsg { - return { - type: 'cosmos-sdk/FeePool', - value: FeePool.toAmino(message), - }; - }, fromProtoMsg(message: FeePoolProtoMsg): FeePool { return FeePool.decode(message.value); }, @@ -1514,50 +1075,6 @@ export const CommunityPoolSpendProposal = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino( - object: CommunityPoolSpendProposalAmino, - ): CommunityPoolSpendProposal { - const message = createBaseCommunityPoolSpendProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: CommunityPoolSpendProposal, - ): CommunityPoolSpendProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - obj.recipient = message.recipient === '' ? undefined : message.recipient; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg( - object: CommunityPoolSpendProposalAminoMsg, - ): CommunityPoolSpendProposal { - return CommunityPoolSpendProposal.fromAmino(object.value); - }, - toAminoMsg( - message: CommunityPoolSpendProposal, - ): CommunityPoolSpendProposalAminoMsg { - return { - type: 'cosmos-sdk/CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.toAmino(message), - }; - }, fromProtoMsg( message: CommunityPoolSpendProposalProtoMsg, ): CommunityPoolSpendProposal { @@ -1661,41 +1178,6 @@ export const DelegatorStartingInfo = { : BigInt(0); return message; }, - fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { - const message = createBaseDelegatorStartingInfo(); - if ( - object.previous_period !== undefined && - object.previous_period !== null - ) { - message.previousPeriod = BigInt(object.previous_period); - } - if (object.stake !== undefined && object.stake !== null) { - message.stake = object.stake; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - return message; - }, - toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { - const obj: any = {}; - obj.previous_period = - message.previousPeriod !== BigInt(0) - ? message.previousPeriod.toString() - : undefined; - obj.stake = message.stake === '' ? undefined : message.stake; - obj.height = message.height ? message.height.toString() : '0'; - return obj; - }, - fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { - return DelegatorStartingInfo.fromAmino(object.value); - }, - toAminoMsg(message: DelegatorStartingInfo): DelegatorStartingInfoAminoMsg { - return { - type: 'cosmos-sdk/DelegatorStartingInfo', - value: DelegatorStartingInfo.toAmino(message), - }; - }, fromProtoMsg(message: DelegatorStartingInfoProtoMsg): DelegatorStartingInfo { return DelegatorStartingInfo.decode(message.value); }, @@ -1782,43 +1264,6 @@ export const DelegationDelegatorReward = { message.reward = object.reward?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { - const message = createBaseDelegationDelegatorReward(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - if (message.reward) { - obj.reward = message.reward.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.reward = message.reward; - } - return obj; - }, - fromAminoMsg( - object: DelegationDelegatorRewardAminoMsg, - ): DelegationDelegatorReward { - return DelegationDelegatorReward.fromAmino(object.value); - }, - toAminoMsg( - message: DelegationDelegatorReward, - ): DelegationDelegatorRewardAminoMsg { - return { - type: 'cosmos-sdk/DelegationDelegatorReward', - value: DelegationDelegatorReward.toAmino(message), - }; - }, fromProtoMsg( message: DelegationDelegatorRewardProtoMsg, ): DelegationDelegatorReward { @@ -1933,52 +1378,6 @@ export const CommunityPoolSpendProposalWithDeposit = { message.deposit = object.deposit ?? ''; return message; }, - fromAmino( - object: CommunityPoolSpendProposalWithDepositAmino, - ): CommunityPoolSpendProposalWithDeposit { - const message = createBaseCommunityPoolSpendProposalWithDeposit(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - if (object.recipient !== undefined && object.recipient !== null) { - message.recipient = object.recipient; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = object.amount; - } - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = object.deposit; - } - return message; - }, - toAmino( - message: CommunityPoolSpendProposalWithDeposit, - ): CommunityPoolSpendProposalWithDepositAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - obj.recipient = message.recipient === '' ? undefined : message.recipient; - obj.amount = message.amount === '' ? undefined : message.amount; - obj.deposit = message.deposit === '' ? undefined : message.deposit; - return obj; - }, - fromAminoMsg( - object: CommunityPoolSpendProposalWithDepositAminoMsg, - ): CommunityPoolSpendProposalWithDeposit { - return CommunityPoolSpendProposalWithDeposit.fromAmino(object.value); - }, - toAminoMsg( - message: CommunityPoolSpendProposalWithDeposit, - ): CommunityPoolSpendProposalWithDepositAminoMsg { - return { - type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.toAmino(message), - }; - }, fromProtoMsg( message: CommunityPoolSpendProposalWithDepositProtoMsg, ): CommunityPoolSpendProposalWithDeposit { diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/genesis.ts index a82a1ade641..2f47219dddd 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/genesis.ts @@ -1,30 +1,19 @@ //@ts-nocheck -import { - DecCoin, - DecCoinAmino, - DecCoinSDKType, -} from '../../base/v1beta1/coin.js'; +import { DecCoin, DecCoinSDKType } from '../../base/v1beta1/coin.js'; import { ValidatorAccumulatedCommission, - ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorHistoricalRewards, - ValidatorHistoricalRewardsAmino, ValidatorHistoricalRewardsSDKType, ValidatorCurrentRewards, - ValidatorCurrentRewardsAmino, ValidatorCurrentRewardsSDKType, DelegatorStartingInfo, - DelegatorStartingInfoAmino, DelegatorStartingInfoSDKType, ValidatorSlashEvent, - ValidatorSlashEventAmino, ValidatorSlashEventSDKType, Params, - ParamsAmino, ParamsSDKType, FeePool, - FeePoolAmino, FeePoolSDKType, } from './distribution.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -44,21 +33,6 @@ export interface DelegatorWithdrawInfoProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.DelegatorWithdrawInfo'; value: Uint8Array; } -/** - * DelegatorWithdrawInfo is the address for where distributions rewards are - * withdrawn to by default this struct is only used at genesis to feed in - * default withdraw addresses. - */ -export interface DelegatorWithdrawInfoAmino { - /** delegator_address is the address of the delegator. */ - delegator_address?: string; - /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address?: string; -} -export interface DelegatorWithdrawInfoAminoMsg { - type: 'cosmos-sdk/DelegatorWithdrawInfo'; - value: DelegatorWithdrawInfoAmino; -} /** * DelegatorWithdrawInfo is the address for where distributions rewards are * withdrawn to by default this struct is only used at genesis to feed in @@ -80,17 +54,6 @@ export interface ValidatorOutstandingRewardsRecordProtoMsg { value: Uint8Array; } /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ -export interface ValidatorOutstandingRewardsRecordAmino { - /** validator_address is the address of the validator. */ - validator_address?: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstanding_rewards?: DecCoinAmino[]; -} -export interface ValidatorOutstandingRewardsRecordAminoMsg { - type: 'cosmos-sdk/ValidatorOutstandingRewardsRecord'; - value: ValidatorOutstandingRewardsRecordAmino; -} -/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecordSDKType { validator_address: string; outstanding_rewards: DecCoinSDKType[]; @@ -109,20 +72,6 @@ export interface ValidatorAccumulatedCommissionRecordProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord'; value: Uint8Array; } -/** - * ValidatorAccumulatedCommissionRecord is used for import / export via genesis - * json. - */ -export interface ValidatorAccumulatedCommissionRecordAmino { - /** validator_address is the address of the validator. */ - validator_address?: string; - /** accumulated is the accumulated commission of a validator. */ - accumulated?: ValidatorAccumulatedCommissionAmino; -} -export interface ValidatorAccumulatedCommissionRecordAminoMsg { - type: 'cosmos-sdk/ValidatorAccumulatedCommissionRecord'; - value: ValidatorAccumulatedCommissionRecordAmino; -} /** * ValidatorAccumulatedCommissionRecord is used for import / export via genesis * json. @@ -147,22 +96,6 @@ export interface ValidatorHistoricalRewardsRecordProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord'; value: Uint8Array; } -/** - * ValidatorHistoricalRewardsRecord is used for import / export via genesis - * json. - */ -export interface ValidatorHistoricalRewardsRecordAmino { - /** validator_address is the address of the validator. */ - validator_address?: string; - /** period defines the period the historical rewards apply to. */ - period?: string; - /** rewards defines the historical rewards of a validator. */ - rewards?: ValidatorHistoricalRewardsAmino; -} -export interface ValidatorHistoricalRewardsRecordAminoMsg { - type: 'cosmos-sdk/ValidatorHistoricalRewardsRecord'; - value: ValidatorHistoricalRewardsRecordAmino; -} /** * ValidatorHistoricalRewardsRecord is used for import / export via genesis * json. @@ -184,17 +117,6 @@ export interface ValidatorCurrentRewardsRecordProtoMsg { value: Uint8Array; } /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ -export interface ValidatorCurrentRewardsRecordAmino { - /** validator_address is the address of the validator. */ - validator_address?: string; - /** rewards defines the current rewards of a validator. */ - rewards?: ValidatorCurrentRewardsAmino; -} -export interface ValidatorCurrentRewardsRecordAminoMsg { - type: 'cosmos-sdk/ValidatorCurrentRewardsRecord'; - value: ValidatorCurrentRewardsRecordAmino; -} -/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecordSDKType { validator_address: string; rewards: ValidatorCurrentRewardsSDKType; @@ -213,19 +135,6 @@ export interface DelegatorStartingInfoRecordProtoMsg { value: Uint8Array; } /** DelegatorStartingInfoRecord used for import / export via genesis json. */ -export interface DelegatorStartingInfoRecordAmino { - /** delegator_address is the address of the delegator. */ - delegator_address?: string; - /** validator_address is the address of the validator. */ - validator_address?: string; - /** starting_info defines the starting info of a delegator. */ - starting_info?: DelegatorStartingInfoAmino; -} -export interface DelegatorStartingInfoRecordAminoMsg { - type: 'cosmos-sdk/DelegatorStartingInfoRecord'; - value: DelegatorStartingInfoRecordAmino; -} -/** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecordSDKType { delegator_address: string; validator_address: string; @@ -247,21 +156,6 @@ export interface ValidatorSlashEventRecordProtoMsg { value: Uint8Array; } /** ValidatorSlashEventRecord is used for import / export via genesis json. */ -export interface ValidatorSlashEventRecordAmino { - /** validator_address is the address of the validator. */ - validator_address?: string; - /** height defines the block height at which the slash event occured. */ - height?: string; - /** period is the period of the slash event. */ - period?: string; - /** validator_slash_event describes the slash event. */ - validator_slash_event?: ValidatorSlashEventAmino; -} -export interface ValidatorSlashEventRecordAminoMsg { - type: 'cosmos-sdk/ValidatorSlashEventRecord'; - value: ValidatorSlashEventRecordAmino; -} -/** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordSDKType { validator_address: string; height: bigint; @@ -296,33 +190,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the distribution module's genesis state. */ -export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; - /** fee_pool defines the fee pool at genesis. */ - fee_pool?: FeePoolAmino; - /** fee_pool defines the delegator withdraw infos at genesis. */ - delegator_withdraw_infos?: DelegatorWithdrawInfoAmino[]; - /** fee_pool defines the previous proposer at genesis. */ - previous_proposer?: string; - /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstanding_rewards?: ValidatorOutstandingRewardsRecordAmino[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validator_accumulated_commissions?: ValidatorAccumulatedCommissionRecordAmino[]; - /** fee_pool defines the historical rewards of all validators at genesis. */ - validator_historical_rewards?: ValidatorHistoricalRewardsRecordAmino[]; - /** fee_pool defines the current rewards of all validators at genesis. */ - validator_current_rewards?: ValidatorCurrentRewardsRecordAmino[]; - /** fee_pool defines the delegator starting infos at genesis. */ - delegator_starting_infos?: DelegatorStartingInfoRecordAmino[]; - /** fee_pool defines the validator slash events at genesis. */ - validator_slash_events?: ValidatorSlashEventRecordAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the distribution module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; fee_pool: FeePoolSDKType; @@ -403,39 +270,6 @@ export const DelegatorWithdrawInfo = { message.withdrawAddress = object.withdrawAddress ?? ''; return message; }, - fromAmino(object: DelegatorWithdrawInfoAmino): DelegatorWithdrawInfo { - const message = createBaseDelegatorWithdrawInfo(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdrawAddress = object.withdraw_address; - } - return message; - }, - toAmino(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.withdraw_address = - message.withdrawAddress === '' ? undefined : message.withdrawAddress; - return obj; - }, - fromAminoMsg(object: DelegatorWithdrawInfoAminoMsg): DelegatorWithdrawInfo { - return DelegatorWithdrawInfo.fromAmino(object.value); - }, - toAminoMsg(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAminoMsg { - return { - type: 'cosmos-sdk/DelegatorWithdrawInfo', - value: DelegatorWithdrawInfo.toAmino(message), - }; - }, fromProtoMsg(message: DelegatorWithdrawInfoProtoMsg): DelegatorWithdrawInfo { return DelegatorWithdrawInfo.decode(message.value); }, @@ -527,48 +361,6 @@ export const ValidatorOutstandingRewardsRecord = { object.outstandingRewards?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: ValidatorOutstandingRewardsRecordAmino, - ): ValidatorOutstandingRewardsRecord { - const message = createBaseValidatorOutstandingRewardsRecord(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - message.outstandingRewards = - object.outstanding_rewards?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: ValidatorOutstandingRewardsRecord, - ): ValidatorOutstandingRewardsRecordAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - if (message.outstandingRewards) { - obj.outstanding_rewards = message.outstandingRewards.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.outstanding_rewards = message.outstandingRewards; - } - return obj; - }, - fromAminoMsg( - object: ValidatorOutstandingRewardsRecordAminoMsg, - ): ValidatorOutstandingRewardsRecord { - return ValidatorOutstandingRewardsRecord.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorOutstandingRewardsRecord, - ): ValidatorOutstandingRewardsRecordAminoMsg { - return { - type: 'cosmos-sdk/ValidatorOutstandingRewardsRecord', - value: ValidatorOutstandingRewardsRecord.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorOutstandingRewardsRecordProtoMsg, ): ValidatorOutstandingRewardsRecord { @@ -667,47 +459,6 @@ export const ValidatorAccumulatedCommissionRecord = { : undefined; return message; }, - fromAmino( - object: ValidatorAccumulatedCommissionRecordAmino, - ): ValidatorAccumulatedCommissionRecord { - const message = createBaseValidatorAccumulatedCommissionRecord(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.accumulated !== undefined && object.accumulated !== null) { - message.accumulated = ValidatorAccumulatedCommission.fromAmino( - object.accumulated, - ); - } - return message; - }, - toAmino( - message: ValidatorAccumulatedCommissionRecord, - ): ValidatorAccumulatedCommissionRecordAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.accumulated = message.accumulated - ? ValidatorAccumulatedCommission.toAmino(message.accumulated) - : undefined; - return obj; - }, - fromAminoMsg( - object: ValidatorAccumulatedCommissionRecordAminoMsg, - ): ValidatorAccumulatedCommissionRecord { - return ValidatorAccumulatedCommissionRecord.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorAccumulatedCommissionRecord, - ): ValidatorAccumulatedCommissionRecordAminoMsg { - return { - type: 'cosmos-sdk/ValidatorAccumulatedCommissionRecord', - value: ValidatorAccumulatedCommissionRecord.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorAccumulatedCommissionRecordProtoMsg, ): ValidatorAccumulatedCommissionRecord { @@ -823,50 +574,6 @@ export const ValidatorHistoricalRewardsRecord = { : undefined; return message; }, - fromAmino( - object: ValidatorHistoricalRewardsRecordAmino, - ): ValidatorHistoricalRewardsRecord { - const message = createBaseValidatorHistoricalRewardsRecord(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.period !== undefined && object.period !== null) { - message.period = BigInt(object.period); - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorHistoricalRewards.fromAmino(object.rewards); - } - return message; - }, - toAmino( - message: ValidatorHistoricalRewardsRecord, - ): ValidatorHistoricalRewardsRecordAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.period = - message.period !== BigInt(0) ? message.period.toString() : undefined; - obj.rewards = message.rewards - ? ValidatorHistoricalRewards.toAmino(message.rewards) - : undefined; - return obj; - }, - fromAminoMsg( - object: ValidatorHistoricalRewardsRecordAminoMsg, - ): ValidatorHistoricalRewardsRecord { - return ValidatorHistoricalRewardsRecord.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorHistoricalRewardsRecord, - ): ValidatorHistoricalRewardsRecordAminoMsg { - return { - type: 'cosmos-sdk/ValidatorHistoricalRewardsRecord', - value: ValidatorHistoricalRewardsRecord.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorHistoricalRewardsRecordProtoMsg, ): ValidatorHistoricalRewardsRecord { @@ -965,45 +672,6 @@ export const ValidatorCurrentRewardsRecord = { : undefined; return message; }, - fromAmino( - object: ValidatorCurrentRewardsRecordAmino, - ): ValidatorCurrentRewardsRecord { - const message = createBaseValidatorCurrentRewardsRecord(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorCurrentRewards.fromAmino(object.rewards); - } - return message; - }, - toAmino( - message: ValidatorCurrentRewardsRecord, - ): ValidatorCurrentRewardsRecordAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.rewards = message.rewards - ? ValidatorCurrentRewards.toAmino(message.rewards) - : undefined; - return obj; - }, - fromAminoMsg( - object: ValidatorCurrentRewardsRecordAminoMsg, - ): ValidatorCurrentRewardsRecord { - return ValidatorCurrentRewardsRecord.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorCurrentRewardsRecord, - ): ValidatorCurrentRewardsRecordAminoMsg { - return { - type: 'cosmos-sdk/ValidatorCurrentRewardsRecord', - value: ValidatorCurrentRewardsRecord.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorCurrentRewardsRecordProtoMsg, ): ValidatorCurrentRewardsRecord { @@ -1115,55 +783,6 @@ export const DelegatorStartingInfoRecord = { : undefined; return message; }, - fromAmino( - object: DelegatorStartingInfoRecordAmino, - ): DelegatorStartingInfoRecord { - const message = createBaseDelegatorStartingInfoRecord(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.starting_info !== undefined && object.starting_info !== null) { - message.startingInfo = DelegatorStartingInfo.fromAmino( - object.starting_info, - ); - } - return message; - }, - toAmino( - message: DelegatorStartingInfoRecord, - ): DelegatorStartingInfoRecordAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.starting_info = message.startingInfo - ? DelegatorStartingInfo.toAmino(message.startingInfo) - : undefined; - return obj; - }, - fromAminoMsg( - object: DelegatorStartingInfoRecordAminoMsg, - ): DelegatorStartingInfoRecord { - return DelegatorStartingInfoRecord.fromAmino(object.value); - }, - toAminoMsg( - message: DelegatorStartingInfoRecord, - ): DelegatorStartingInfoRecordAminoMsg { - return { - type: 'cosmos-sdk/DelegatorStartingInfoRecord', - value: DelegatorStartingInfoRecord.toAmino(message), - }; - }, fromProtoMsg( message: DelegatorStartingInfoRecordProtoMsg, ): DelegatorStartingInfoRecord { @@ -1295,56 +914,6 @@ export const ValidatorSlashEventRecord = { : undefined; return message; }, - fromAmino(object: ValidatorSlashEventRecordAmino): ValidatorSlashEventRecord { - const message = createBaseValidatorSlashEventRecord(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.period !== undefined && object.period !== null) { - message.period = BigInt(object.period); - } - if ( - object.validator_slash_event !== undefined && - object.validator_slash_event !== null - ) { - message.validatorSlashEvent = ValidatorSlashEvent.fromAmino( - object.validator_slash_event, - ); - } - return message; - }, - toAmino(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.period = - message.period !== BigInt(0) ? message.period.toString() : undefined; - obj.validator_slash_event = message.validatorSlashEvent - ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) - : undefined; - return obj; - }, - fromAminoMsg( - object: ValidatorSlashEventRecordAminoMsg, - ): ValidatorSlashEventRecord { - return ValidatorSlashEventRecord.fromAmino(object.value); - }, - toAminoMsg( - message: ValidatorSlashEventRecord, - ): ValidatorSlashEventRecordAminoMsg { - return { - type: 'cosmos-sdk/ValidatorSlashEventRecord', - value: ValidatorSlashEventRecord.toAmino(message), - }; - }, fromProtoMsg( message: ValidatorSlashEventRecordProtoMsg, ): ValidatorSlashEventRecord { @@ -1641,120 +1210,6 @@ export const GenesisState = { ) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - if (object.fee_pool !== undefined && object.fee_pool !== null) { - message.feePool = FeePool.fromAmino(object.fee_pool); - } - message.delegatorWithdrawInfos = - object.delegator_withdraw_infos?.map(e => - DelegatorWithdrawInfo.fromAmino(e), - ) || []; - if ( - object.previous_proposer !== undefined && - object.previous_proposer !== null - ) { - message.previousProposer = object.previous_proposer; - } - message.outstandingRewards = - object.outstanding_rewards?.map(e => - ValidatorOutstandingRewardsRecord.fromAmino(e), - ) || []; - message.validatorAccumulatedCommissions = - object.validator_accumulated_commissions?.map(e => - ValidatorAccumulatedCommissionRecord.fromAmino(e), - ) || []; - message.validatorHistoricalRewards = - object.validator_historical_rewards?.map(e => - ValidatorHistoricalRewardsRecord.fromAmino(e), - ) || []; - message.validatorCurrentRewards = - object.validator_current_rewards?.map(e => - ValidatorCurrentRewardsRecord.fromAmino(e), - ) || []; - message.delegatorStartingInfos = - object.delegator_starting_infos?.map(e => - DelegatorStartingInfoRecord.fromAmino(e), - ) || []; - message.validatorSlashEvents = - object.validator_slash_events?.map(e => - ValidatorSlashEventRecord.fromAmino(e), - ) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.fee_pool = message.feePool - ? FeePool.toAmino(message.feePool) - : undefined; - if (message.delegatorWithdrawInfos) { - obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => - e ? DelegatorWithdrawInfo.toAmino(e) : undefined, - ); - } else { - obj.delegator_withdraw_infos = message.delegatorWithdrawInfos; - } - obj.previous_proposer = - message.previousProposer === '' ? undefined : message.previousProposer; - if (message.outstandingRewards) { - obj.outstanding_rewards = message.outstandingRewards.map(e => - e ? ValidatorOutstandingRewardsRecord.toAmino(e) : undefined, - ); - } else { - obj.outstanding_rewards = message.outstandingRewards; - } - if (message.validatorAccumulatedCommissions) { - obj.validator_accumulated_commissions = - message.validatorAccumulatedCommissions.map(e => - e ? ValidatorAccumulatedCommissionRecord.toAmino(e) : undefined, - ); - } else { - obj.validator_accumulated_commissions = - message.validatorAccumulatedCommissions; - } - if (message.validatorHistoricalRewards) { - obj.validator_historical_rewards = message.validatorHistoricalRewards.map( - e => (e ? ValidatorHistoricalRewardsRecord.toAmino(e) : undefined), - ); - } else { - obj.validator_historical_rewards = message.validatorHistoricalRewards; - } - if (message.validatorCurrentRewards) { - obj.validator_current_rewards = message.validatorCurrentRewards.map(e => - e ? ValidatorCurrentRewardsRecord.toAmino(e) : undefined, - ); - } else { - obj.validator_current_rewards = message.validatorCurrentRewards; - } - if (message.delegatorStartingInfos) { - obj.delegator_starting_infos = message.delegatorStartingInfos.map(e => - e ? DelegatorStartingInfoRecord.toAmino(e) : undefined, - ); - } else { - obj.delegator_starting_infos = message.delegatorStartingInfos; - } - if (message.validatorSlashEvents) { - obj.validator_slash_events = message.validatorSlashEvents.map(e => - e ? ValidatorSlashEventRecord.toAmino(e) : undefined, - ); - } else { - obj.validator_slash_events = message.validatorSlashEvents; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 5c6a1c3d496..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,245 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryParamsRequest, - QueryParamsResponse, - QueryValidatorOutstandingRewardsRequest, - QueryValidatorOutstandingRewardsResponse, - QueryValidatorCommissionRequest, - QueryValidatorCommissionResponse, - QueryValidatorSlashesRequest, - QueryValidatorSlashesResponse, - QueryDelegationRewardsRequest, - QueryDelegationRewardsResponse, - QueryDelegationTotalRewardsRequest, - QueryDelegationTotalRewardsResponse, - QueryDelegatorValidatorsRequest, - QueryDelegatorValidatorsResponse, - QueryDelegatorWithdrawAddressRequest, - QueryDelegatorWithdrawAddressResponse, - QueryCommunityPoolRequest, - QueryCommunityPoolResponse, -} from './query.js'; -/** Query defines the gRPC querier service for distribution module. */ -export interface Query { - /** Params queries params of the distribution module. */ - params(request?: QueryParamsRequest): Promise; - /** ValidatorOutstandingRewards queries rewards of a validator address. */ - validatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest, - ): Promise; - /** ValidatorCommission queries accumulated commission for a validator. */ - validatorCommission( - request: QueryValidatorCommissionRequest, - ): Promise; - /** ValidatorSlashes queries slash events of a validator. */ - validatorSlashes( - request: QueryValidatorSlashesRequest, - ): Promise; - /** DelegationRewards queries the total rewards accrued by a delegation. */ - delegationRewards( - request: QueryDelegationRewardsRequest, - ): Promise; - /** - * DelegationTotalRewards queries the total rewards accrued by a each - * validator. - */ - delegationTotalRewards( - request: QueryDelegationTotalRewardsRequest, - ): Promise; - /** DelegatorValidators queries the validators of a delegator. */ - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise; - /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ - delegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest, - ): Promise; - /** CommunityPool queries the community pool coins. */ - communityPool( - request?: QueryCommunityPoolRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.params = this.params.bind(this); - this.validatorOutstandingRewards = - this.validatorOutstandingRewards.bind(this); - this.validatorCommission = this.validatorCommission.bind(this); - this.validatorSlashes = this.validatorSlashes.bind(this); - this.delegationRewards = this.delegationRewards.bind(this); - this.delegationTotalRewards = this.delegationTotalRewards.bind(this); - this.delegatorValidators = this.delegatorValidators.bind(this); - this.delegatorWithdrawAddress = this.delegatorWithdrawAddress.bind(this); - this.communityPool = this.communityPool.bind(this); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - validatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest, - ): Promise { - const data = - QueryValidatorOutstandingRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'ValidatorOutstandingRewards', - data, - ); - return promise.then(data => - QueryValidatorOutstandingRewardsResponse.decode(new BinaryReader(data)), - ); - } - validatorCommission( - request: QueryValidatorCommissionRequest, - ): Promise { - const data = QueryValidatorCommissionRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'ValidatorCommission', - data, - ); - return promise.then(data => - QueryValidatorCommissionResponse.decode(new BinaryReader(data)), - ); - } - validatorSlashes( - request: QueryValidatorSlashesRequest, - ): Promise { - const data = QueryValidatorSlashesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'ValidatorSlashes', - data, - ); - return promise.then(data => - QueryValidatorSlashesResponse.decode(new BinaryReader(data)), - ); - } - delegationRewards( - request: QueryDelegationRewardsRequest, - ): Promise { - const data = QueryDelegationRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'DelegationRewards', - data, - ); - return promise.then(data => - QueryDelegationRewardsResponse.decode(new BinaryReader(data)), - ); - } - delegationTotalRewards( - request: QueryDelegationTotalRewardsRequest, - ): Promise { - const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'DelegationTotalRewards', - data, - ); - return promise.then(data => - QueryDelegationTotalRewardsResponse.decode(new BinaryReader(data)), - ); - } - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'DelegatorValidators', - data, - ); - return promise.then(data => - QueryDelegatorValidatorsResponse.decode(new BinaryReader(data)), - ); - } - delegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest, - ): Promise { - const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'DelegatorWithdrawAddress', - data, - ); - return promise.then(data => - QueryDelegatorWithdrawAddressResponse.decode(new BinaryReader(data)), - ); - } - communityPool( - request: QueryCommunityPoolRequest = {}, - ): Promise { - const data = QueryCommunityPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Query', - 'CommunityPool', - data, - ); - return promise.then(data => - QueryCommunityPoolResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - validatorOutstandingRewards( - request: QueryValidatorOutstandingRewardsRequest, - ): Promise { - return queryService.validatorOutstandingRewards(request); - }, - validatorCommission( - request: QueryValidatorCommissionRequest, - ): Promise { - return queryService.validatorCommission(request); - }, - validatorSlashes( - request: QueryValidatorSlashesRequest, - ): Promise { - return queryService.validatorSlashes(request); - }, - delegationRewards( - request: QueryDelegationRewardsRequest, - ): Promise { - return queryService.delegationRewards(request); - }, - delegationTotalRewards( - request: QueryDelegationTotalRewardsRequest, - ): Promise { - return queryService.delegationTotalRewards(request); - }, - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise { - return queryService.delegatorValidators(request); - }, - delegatorWithdrawAddress( - request: QueryDelegatorWithdrawAddressRequest, - ): Promise { - return queryService.delegatorWithdrawAddress(request); - }, - communityPool( - request?: QueryCommunityPoolRequest, - ): Promise { - return queryService.communityPool(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.ts index c3b05fe6c07..fc6920a5097 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.ts @@ -1,34 +1,23 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { Params, - ParamsAmino, ParamsSDKType, ValidatorOutstandingRewards, - ValidatorOutstandingRewardsAmino, ValidatorOutstandingRewardsSDKType, ValidatorAccumulatedCommission, - ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorSlashEvent, - ValidatorSlashEventAmino, ValidatorSlashEventSDKType, DelegationDelegatorReward, - DelegationDelegatorRewardAmino, DelegationDelegatorRewardSDKType, } from './distribution.js'; -import { - DecCoin, - DecCoinAmino, - DecCoinSDKType, -} from '../../base/v1beta1/coin.js'; +import { DecCoin, DecCoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ @@ -38,12 +27,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -55,15 +38,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params defines the parameters of the module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -79,18 +53,6 @@ export interface QueryValidatorOutstandingRewardsRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest'; value: Uint8Array; } -/** - * QueryValidatorOutstandingRewardsRequest is the request type for the - * Query/ValidatorOutstandingRewards RPC method. - */ -export interface QueryValidatorOutstandingRewardsRequestAmino { - /** validator_address defines the validator address to query for. */ - validator_address?: string; -} -export interface QueryValidatorOutstandingRewardsRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorOutstandingRewardsRequest'; - value: QueryValidatorOutstandingRewardsRequestAmino; -} /** * QueryValidatorOutstandingRewardsRequest is the request type for the * Query/ValidatorOutstandingRewards RPC method. @@ -109,17 +71,6 @@ export interface QueryValidatorOutstandingRewardsResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse'; value: Uint8Array; } -/** - * QueryValidatorOutstandingRewardsResponse is the response type for the - * Query/ValidatorOutstandingRewards RPC method. - */ -export interface QueryValidatorOutstandingRewardsResponseAmino { - rewards?: ValidatorOutstandingRewardsAmino; -} -export interface QueryValidatorOutstandingRewardsResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorOutstandingRewardsResponse'; - value: QueryValidatorOutstandingRewardsResponseAmino; -} /** * QueryValidatorOutstandingRewardsResponse is the response type for the * Query/ValidatorOutstandingRewards RPC method. @@ -139,18 +90,6 @@ export interface QueryValidatorCommissionRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest'; value: Uint8Array; } -/** - * QueryValidatorCommissionRequest is the request type for the - * Query/ValidatorCommission RPC method - */ -export interface QueryValidatorCommissionRequestAmino { - /** validator_address defines the validator address to query for. */ - validator_address?: string; -} -export interface QueryValidatorCommissionRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorCommissionRequest'; - value: QueryValidatorCommissionRequestAmino; -} /** * QueryValidatorCommissionRequest is the request type for the * Query/ValidatorCommission RPC method @@ -170,18 +109,6 @@ export interface QueryValidatorCommissionResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse'; value: Uint8Array; } -/** - * QueryValidatorCommissionResponse is the response type for the - * Query/ValidatorCommission RPC method - */ -export interface QueryValidatorCommissionResponseAmino { - /** commission defines the commision the validator received. */ - commission?: ValidatorAccumulatedCommissionAmino; -} -export interface QueryValidatorCommissionResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorCommissionResponse'; - value: QueryValidatorCommissionResponseAmino; -} /** * QueryValidatorCommissionResponse is the response type for the * Query/ValidatorCommission RPC method @@ -207,24 +134,6 @@ export interface QueryValidatorSlashesRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest'; value: Uint8Array; } -/** - * QueryValidatorSlashesRequest is the request type for the - * Query/ValidatorSlashes RPC method - */ -export interface QueryValidatorSlashesRequestAmino { - /** validator_address defines the validator address to query for. */ - validator_address?: string; - /** starting_height defines the optional starting height to query the slashes. */ - starting_height?: string; - /** starting_height defines the optional ending height to query the slashes. */ - ending_height?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryValidatorSlashesRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorSlashesRequest'; - value: QueryValidatorSlashesRequestAmino; -} /** * QueryValidatorSlashesRequest is the request type for the * Query/ValidatorSlashes RPC method @@ -249,20 +158,6 @@ export interface QueryValidatorSlashesResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse'; value: Uint8Array; } -/** - * QueryValidatorSlashesResponse is the response type for the - * Query/ValidatorSlashes RPC method. - */ -export interface QueryValidatorSlashesResponseAmino { - /** slashes defines the slashes the validator received. */ - slashes?: ValidatorSlashEventAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryValidatorSlashesResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorSlashesResponse'; - value: QueryValidatorSlashesResponseAmino; -} /** * QueryValidatorSlashesResponse is the response type for the * Query/ValidatorSlashes RPC method. @@ -285,20 +180,6 @@ export interface QueryDelegationRewardsRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest'; value: Uint8Array; } -/** - * QueryDelegationRewardsRequest is the request type for the - * Query/DelegationRewards RPC method. - */ -export interface QueryDelegationRewardsRequestAmino { - /** delegator_address defines the delegator address to query for. */ - delegator_address?: string; - /** validator_address defines the validator address to query for. */ - validator_address?: string; -} -export interface QueryDelegationRewardsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegationRewardsRequest'; - value: QueryDelegationRewardsRequestAmino; -} /** * QueryDelegationRewardsRequest is the request type for the * Query/DelegationRewards RPC method. @@ -319,18 +200,6 @@ export interface QueryDelegationRewardsResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse'; value: Uint8Array; } -/** - * QueryDelegationRewardsResponse is the response type for the - * Query/DelegationRewards RPC method. - */ -export interface QueryDelegationRewardsResponseAmino { - /** rewards defines the rewards accrued by a delegation. */ - rewards?: DecCoinAmino[]; -} -export interface QueryDelegationRewardsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegationRewardsResponse'; - value: QueryDelegationRewardsResponseAmino; -} /** * QueryDelegationRewardsResponse is the response type for the * Query/DelegationRewards RPC method. @@ -350,18 +219,6 @@ export interface QueryDelegationTotalRewardsRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest'; value: Uint8Array; } -/** - * QueryDelegationTotalRewardsRequest is the request type for the - * Query/DelegationTotalRewards RPC method. - */ -export interface QueryDelegationTotalRewardsRequestAmino { - /** delegator_address defines the delegator address to query for. */ - delegator_address?: string; -} -export interface QueryDelegationTotalRewardsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegationTotalRewardsRequest'; - value: QueryDelegationTotalRewardsRequestAmino; -} /** * QueryDelegationTotalRewardsRequest is the request type for the * Query/DelegationTotalRewards RPC method. @@ -383,20 +240,6 @@ export interface QueryDelegationTotalRewardsResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse'; value: Uint8Array; } -/** - * QueryDelegationTotalRewardsResponse is the response type for the - * Query/DelegationTotalRewards RPC method. - */ -export interface QueryDelegationTotalRewardsResponseAmino { - /** rewards defines all the rewards accrued by a delegator. */ - rewards?: DelegationDelegatorRewardAmino[]; - /** total defines the sum of all the rewards. */ - total?: DecCoinAmino[]; -} -export interface QueryDelegationTotalRewardsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegationTotalRewardsResponse'; - value: QueryDelegationTotalRewardsResponseAmino; -} /** * QueryDelegationTotalRewardsResponse is the response type for the * Query/DelegationTotalRewards RPC method. @@ -417,18 +260,6 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest'; value: Uint8Array; } -/** - * QueryDelegatorValidatorsRequest is the request type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsRequestAmino { - /** delegator_address defines the delegator address to query for. */ - delegator_address?: string; -} -export interface QueryDelegatorValidatorsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorsRequest'; - value: QueryDelegatorValidatorsRequestAmino; -} /** * QueryDelegatorValidatorsRequest is the request type for the * Query/DelegatorValidators RPC method. @@ -448,18 +279,6 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse'; value: Uint8Array; } -/** - * QueryDelegatorValidatorsResponse is the response type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsResponseAmino { - /** validators defines the validators a delegator is delegating for. */ - validators?: string[]; -} -export interface QueryDelegatorValidatorsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorsResponse'; - value: QueryDelegatorValidatorsResponseAmino; -} /** * QueryDelegatorValidatorsResponse is the response type for the * Query/DelegatorValidators RPC method. @@ -479,18 +298,6 @@ export interface QueryDelegatorWithdrawAddressRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest'; value: Uint8Array; } -/** - * QueryDelegatorWithdrawAddressRequest is the request type for the - * Query/DelegatorWithdrawAddress RPC method. - */ -export interface QueryDelegatorWithdrawAddressRequestAmino { - /** delegator_address defines the delegator address to query for. */ - delegator_address?: string; -} -export interface QueryDelegatorWithdrawAddressRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorWithdrawAddressRequest'; - value: QueryDelegatorWithdrawAddressRequestAmino; -} /** * QueryDelegatorWithdrawAddressRequest is the request type for the * Query/DelegatorWithdrawAddress RPC method. @@ -510,18 +317,6 @@ export interface QueryDelegatorWithdrawAddressResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse'; value: Uint8Array; } -/** - * QueryDelegatorWithdrawAddressResponse is the response type for the - * Query/DelegatorWithdrawAddress RPC method. - */ -export interface QueryDelegatorWithdrawAddressResponseAmino { - /** withdraw_address defines the delegator address to query for. */ - withdraw_address?: string; -} -export interface QueryDelegatorWithdrawAddressResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorWithdrawAddressResponse'; - value: QueryDelegatorWithdrawAddressResponseAmino; -} /** * QueryDelegatorWithdrawAddressResponse is the response type for the * Query/DelegatorWithdrawAddress RPC method. @@ -538,15 +333,6 @@ export interface QueryCommunityPoolRequestProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryCommunityPoolRequest'; value: Uint8Array; } -/** - * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC - * method. - */ -export interface QueryCommunityPoolRequestAmino {} -export interface QueryCommunityPoolRequestAminoMsg { - type: 'cosmos-sdk/QueryCommunityPoolRequest'; - value: QueryCommunityPoolRequestAmino; -} /** * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC * method. @@ -564,18 +350,6 @@ export interface QueryCommunityPoolResponseProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.QueryCommunityPoolResponse'; value: Uint8Array; } -/** - * QueryCommunityPoolResponse is the response type for the Query/CommunityPool - * RPC method. - */ -export interface QueryCommunityPoolResponseAmino { - /** pool defines community pool's coins. */ - pool?: DecCoinAmino[]; -} -export interface QueryCommunityPoolResponseAminoMsg { - type: 'cosmos-sdk/QueryCommunityPoolResponse'; - value: QueryCommunityPoolResponseAmino; -} /** * QueryCommunityPoolResponse is the response type for the Query/CommunityPool * RPC method. @@ -623,23 +397,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -709,27 +466,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -801,39 +537,6 @@ export const QueryValidatorOutstandingRewardsRequest = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino( - object: QueryValidatorOutstandingRewardsRequestAmino, - ): QueryValidatorOutstandingRewardsRequest { - const message = createBaseQueryValidatorOutstandingRewardsRequest(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino( - message: QueryValidatorOutstandingRewardsRequest, - ): QueryValidatorOutstandingRewardsRequestAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryValidatorOutstandingRewardsRequestAminoMsg, - ): QueryValidatorOutstandingRewardsRequest { - return QueryValidatorOutstandingRewardsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorOutstandingRewardsRequest, - ): QueryValidatorOutstandingRewardsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorOutstandingRewardsRequest', - value: QueryValidatorOutstandingRewardsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorOutstandingRewardsRequestProtoMsg, ): QueryValidatorOutstandingRewardsRequest { @@ -921,37 +624,6 @@ export const QueryValidatorOutstandingRewardsResponse = { : undefined; return message; }, - fromAmino( - object: QueryValidatorOutstandingRewardsResponseAmino, - ): QueryValidatorOutstandingRewardsResponse { - const message = createBaseQueryValidatorOutstandingRewardsResponse(); - if (object.rewards !== undefined && object.rewards !== null) { - message.rewards = ValidatorOutstandingRewards.fromAmino(object.rewards); - } - return message; - }, - toAmino( - message: QueryValidatorOutstandingRewardsResponse, - ): QueryValidatorOutstandingRewardsResponseAmino { - const obj: any = {}; - obj.rewards = message.rewards - ? ValidatorOutstandingRewards.toAmino(message.rewards) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorOutstandingRewardsResponseAminoMsg, - ): QueryValidatorOutstandingRewardsResponse { - return QueryValidatorOutstandingRewardsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorOutstandingRewardsResponse, - ): QueryValidatorOutstandingRewardsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorOutstandingRewardsResponse', - value: QueryValidatorOutstandingRewardsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorOutstandingRewardsResponseProtoMsg, ): QueryValidatorOutstandingRewardsResponse { @@ -1027,39 +699,6 @@ export const QueryValidatorCommissionRequest = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino( - object: QueryValidatorCommissionRequestAmino, - ): QueryValidatorCommissionRequest { - const message = createBaseQueryValidatorCommissionRequest(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino( - message: QueryValidatorCommissionRequest, - ): QueryValidatorCommissionRequestAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryValidatorCommissionRequestAminoMsg, - ): QueryValidatorCommissionRequest { - return QueryValidatorCommissionRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorCommissionRequest, - ): QueryValidatorCommissionRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorCommissionRequest', - value: QueryValidatorCommissionRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorCommissionRequestProtoMsg, ): QueryValidatorCommissionRequest { @@ -1145,39 +784,6 @@ export const QueryValidatorCommissionResponse = { : undefined; return message; }, - fromAmino( - object: QueryValidatorCommissionResponseAmino, - ): QueryValidatorCommissionResponse { - const message = createBaseQueryValidatorCommissionResponse(); - if (object.commission !== undefined && object.commission !== null) { - message.commission = ValidatorAccumulatedCommission.fromAmino( - object.commission, - ); - } - return message; - }, - toAmino( - message: QueryValidatorCommissionResponse, - ): QueryValidatorCommissionResponseAmino { - const obj: any = {}; - obj.commission = message.commission - ? ValidatorAccumulatedCommission.toAmino(message.commission) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorCommissionResponseAminoMsg, - ): QueryValidatorCommissionResponse { - return QueryValidatorCommissionResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorCommissionResponse, - ): QueryValidatorCommissionResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorCommissionResponse', - value: QueryValidatorCommissionResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorCommissionResponseProtoMsg, ): QueryValidatorCommissionResponse { @@ -1302,62 +908,6 @@ export const QueryValidatorSlashesRequest = { : undefined; return message; }, - fromAmino( - object: QueryValidatorSlashesRequestAmino, - ): QueryValidatorSlashesRequest { - const message = createBaseQueryValidatorSlashesRequest(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if ( - object.starting_height !== undefined && - object.starting_height !== null - ) { - message.startingHeight = BigInt(object.starting_height); - } - if (object.ending_height !== undefined && object.ending_height !== null) { - message.endingHeight = BigInt(object.ending_height); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorSlashesRequest, - ): QueryValidatorSlashesRequestAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.starting_height = - message.startingHeight !== BigInt(0) - ? message.startingHeight.toString() - : undefined; - obj.ending_height = - message.endingHeight !== BigInt(0) - ? message.endingHeight.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorSlashesRequestAminoMsg, - ): QueryValidatorSlashesRequest { - return QueryValidatorSlashesRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorSlashesRequest, - ): QueryValidatorSlashesRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorSlashesRequest', - value: QueryValidatorSlashesRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorSlashesRequestProtoMsg, ): QueryValidatorSlashesRequest { @@ -1461,46 +1011,6 @@ export const QueryValidatorSlashesResponse = { : undefined; return message; }, - fromAmino( - object: QueryValidatorSlashesResponseAmino, - ): QueryValidatorSlashesResponse { - const message = createBaseQueryValidatorSlashesResponse(); - message.slashes = - object.slashes?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorSlashesResponse, - ): QueryValidatorSlashesResponseAmino { - const obj: any = {}; - if (message.slashes) { - obj.slashes = message.slashes.map(e => - e ? ValidatorSlashEvent.toAmino(e) : undefined, - ); - } else { - obj.slashes = message.slashes; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorSlashesResponseAminoMsg, - ): QueryValidatorSlashesResponse { - return QueryValidatorSlashesResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorSlashesResponse, - ): QueryValidatorSlashesResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorSlashesResponse', - value: QueryValidatorSlashesResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorSlashesResponseProtoMsg, ): QueryValidatorSlashesResponse { @@ -1588,47 +1098,6 @@ export const QueryDelegationRewardsRequest = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino( - object: QueryDelegationRewardsRequestAmino, - ): QueryDelegationRewardsRequest { - const message = createBaseQueryDelegationRewardsRequest(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino( - message: QueryDelegationRewardsRequest, - ): QueryDelegationRewardsRequestAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryDelegationRewardsRequestAminoMsg, - ): QueryDelegationRewardsRequest { - return QueryDelegationRewardsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegationRewardsRequest, - ): QueryDelegationRewardsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationRewardsRequest', - value: QueryDelegationRewardsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationRewardsRequestProtoMsg, ): QueryDelegationRewardsRequest { @@ -1708,39 +1177,6 @@ export const QueryDelegationRewardsResponse = { message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: QueryDelegationRewardsResponseAmino, - ): QueryDelegationRewardsResponse { - const message = createBaseQueryDelegationRewardsResponse(); - message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: QueryDelegationRewardsResponse, - ): QueryDelegationRewardsResponseAmino { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map(e => - e ? DecCoin.toAmino(e) : undefined, - ); - } else { - obj.rewards = message.rewards; - } - return obj; - }, - fromAminoMsg( - object: QueryDelegationRewardsResponseAminoMsg, - ): QueryDelegationRewardsResponse { - return QueryDelegationRewardsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegationRewardsResponse, - ): QueryDelegationRewardsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationRewardsResponse', - value: QueryDelegationRewardsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationRewardsResponseProtoMsg, ): QueryDelegationRewardsResponse { @@ -1815,39 +1251,6 @@ export const QueryDelegationTotalRewardsRequest = { message.delegatorAddress = object.delegatorAddress ?? ''; return message; }, - fromAmino( - object: QueryDelegationTotalRewardsRequestAmino, - ): QueryDelegationTotalRewardsRequest { - const message = createBaseQueryDelegationTotalRewardsRequest(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - return message; - }, - toAmino( - message: QueryDelegationTotalRewardsRequest, - ): QueryDelegationTotalRewardsRequestAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryDelegationTotalRewardsRequestAminoMsg, - ): QueryDelegationTotalRewardsRequest { - return QueryDelegationTotalRewardsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegationTotalRewardsRequest, - ): QueryDelegationTotalRewardsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationTotalRewardsRequest', - value: QueryDelegationTotalRewardsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationTotalRewardsRequestProtoMsg, ): QueryDelegationTotalRewardsRequest { @@ -1947,46 +1350,6 @@ export const QueryDelegationTotalRewardsResponse = { message.total = object.total?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: QueryDelegationTotalRewardsResponseAmino, - ): QueryDelegationTotalRewardsResponse { - const message = createBaseQueryDelegationTotalRewardsResponse(); - message.rewards = - object.rewards?.map(e => DelegationDelegatorReward.fromAmino(e)) || []; - message.total = object.total?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: QueryDelegationTotalRewardsResponse, - ): QueryDelegationTotalRewardsResponseAmino { - const obj: any = {}; - if (message.rewards) { - obj.rewards = message.rewards.map(e => - e ? DelegationDelegatorReward.toAmino(e) : undefined, - ); - } else { - obj.rewards = message.rewards; - } - if (message.total) { - obj.total = message.total.map(e => (e ? DecCoin.toAmino(e) : undefined)); - } else { - obj.total = message.total; - } - return obj; - }, - fromAminoMsg( - object: QueryDelegationTotalRewardsResponseAminoMsg, - ): QueryDelegationTotalRewardsResponse { - return QueryDelegationTotalRewardsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegationTotalRewardsResponse, - ): QueryDelegationTotalRewardsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationTotalRewardsResponse', - value: QueryDelegationTotalRewardsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationTotalRewardsResponseProtoMsg, ): QueryDelegationTotalRewardsResponse { @@ -2062,39 +1425,6 @@ export const QueryDelegatorValidatorsRequest = { message.delegatorAddress = object.delegatorAddress ?? ''; return message; }, - fromAmino( - object: QueryDelegatorValidatorsRequestAmino, - ): QueryDelegatorValidatorsRequest { - const message = createBaseQueryDelegatorValidatorsRequest(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - return message; - }, - toAmino( - message: QueryDelegatorValidatorsRequest, - ): QueryDelegatorValidatorsRequestAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorsRequestAminoMsg, - ): QueryDelegatorValidatorsRequest { - return QueryDelegatorValidatorsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorsRequest, - ): QueryDelegatorValidatorsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorsRequest', - value: QueryDelegatorValidatorsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorsRequestProtoMsg, ): QueryDelegatorValidatorsRequest { @@ -2172,37 +1502,6 @@ export const QueryDelegatorValidatorsResponse = { message.validators = object.validators?.map(e => e) || []; return message; }, - fromAmino( - object: QueryDelegatorValidatorsResponseAmino, - ): QueryDelegatorValidatorsResponse { - const message = createBaseQueryDelegatorValidatorsResponse(); - message.validators = object.validators?.map(e => e) || []; - return message; - }, - toAmino( - message: QueryDelegatorValidatorsResponse, - ): QueryDelegatorValidatorsResponseAmino { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map(e => e); - } else { - obj.validators = message.validators; - } - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorsResponseAminoMsg, - ): QueryDelegatorValidatorsResponse { - return QueryDelegatorValidatorsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorsResponse, - ): QueryDelegatorValidatorsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorsResponse', - value: QueryDelegatorValidatorsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorsResponseProtoMsg, ): QueryDelegatorValidatorsResponse { @@ -2277,39 +1576,6 @@ export const QueryDelegatorWithdrawAddressRequest = { message.delegatorAddress = object.delegatorAddress ?? ''; return message; }, - fromAmino( - object: QueryDelegatorWithdrawAddressRequestAmino, - ): QueryDelegatorWithdrawAddressRequest { - const message = createBaseQueryDelegatorWithdrawAddressRequest(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - return message; - }, - toAmino( - message: QueryDelegatorWithdrawAddressRequest, - ): QueryDelegatorWithdrawAddressRequestAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorWithdrawAddressRequestAminoMsg, - ): QueryDelegatorWithdrawAddressRequest { - return QueryDelegatorWithdrawAddressRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorWithdrawAddressRequest, - ): QueryDelegatorWithdrawAddressRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorWithdrawAddressRequest', - value: QueryDelegatorWithdrawAddressRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorWithdrawAddressRequestProtoMsg, ): QueryDelegatorWithdrawAddressRequest { @@ -2385,39 +1651,6 @@ export const QueryDelegatorWithdrawAddressResponse = { message.withdrawAddress = object.withdrawAddress ?? ''; return message; }, - fromAmino( - object: QueryDelegatorWithdrawAddressResponseAmino, - ): QueryDelegatorWithdrawAddressResponse { - const message = createBaseQueryDelegatorWithdrawAddressResponse(); - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdrawAddress = object.withdraw_address; - } - return message; - }, - toAmino( - message: QueryDelegatorWithdrawAddressResponse, - ): QueryDelegatorWithdrawAddressResponseAmino { - const obj: any = {}; - obj.withdraw_address = - message.withdrawAddress === '' ? undefined : message.withdrawAddress; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorWithdrawAddressResponseAminoMsg, - ): QueryDelegatorWithdrawAddressResponse { - return QueryDelegatorWithdrawAddressResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorWithdrawAddressResponse, - ): QueryDelegatorWithdrawAddressResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorWithdrawAddressResponse', - value: QueryDelegatorWithdrawAddressResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorWithdrawAddressResponseProtoMsg, ): QueryDelegatorWithdrawAddressResponse { @@ -2478,27 +1711,6 @@ export const QueryCommunityPoolRequest = { const message = createBaseQueryCommunityPoolRequest(); return message; }, - fromAmino(_: QueryCommunityPoolRequestAmino): QueryCommunityPoolRequest { - const message = createBaseQueryCommunityPoolRequest(); - return message; - }, - toAmino(_: QueryCommunityPoolRequest): QueryCommunityPoolRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: QueryCommunityPoolRequestAminoMsg, - ): QueryCommunityPoolRequest { - return QueryCommunityPoolRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryCommunityPoolRequest, - ): QueryCommunityPoolRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryCommunityPoolRequest', - value: QueryCommunityPoolRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryCommunityPoolRequestProtoMsg, ): QueryCommunityPoolRequest { @@ -2576,37 +1788,6 @@ export const QueryCommunityPoolResponse = { message.pool = object.pool?.map(e => DecCoin.fromPartial(e)) || []; return message; }, - fromAmino( - object: QueryCommunityPoolResponseAmino, - ): QueryCommunityPoolResponse { - const message = createBaseQueryCommunityPoolResponse(); - message.pool = object.pool?.map(e => DecCoin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: QueryCommunityPoolResponse, - ): QueryCommunityPoolResponseAmino { - const obj: any = {}; - if (message.pool) { - obj.pool = message.pool.map(e => (e ? DecCoin.toAmino(e) : undefined)); - } else { - obj.pool = message.pool; - } - return obj; - }, - fromAminoMsg( - object: QueryCommunityPoolResponseAminoMsg, - ): QueryCommunityPoolResponse { - return QueryCommunityPoolResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryCommunityPoolResponse, - ): QueryCommunityPoolResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryCommunityPoolResponse', - value: QueryCommunityPoolResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryCommunityPoolResponseProtoMsg, ): QueryCommunityPoolResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts deleted file mode 100644 index 334214bd472..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts +++ /dev/null @@ -1,29 +0,0 @@ -//@ts-nocheck -import { - MsgSetWithdrawAddress, - MsgWithdrawDelegatorReward, - MsgWithdrawValidatorCommission, - MsgFundCommunityPool, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress': { - aminoType: 'cosmos-sdk/MsgModifyWithdrawAddress', - toAmino: MsgSetWithdrawAddress.toAmino, - fromAmino: MsgSetWithdrawAddress.fromAmino, - }, - '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward': { - aminoType: 'cosmos-sdk/MsgWithdrawDelegationReward', - toAmino: MsgWithdrawDelegatorReward.toAmino, - fromAmino: MsgWithdrawDelegatorReward.fromAmino, - }, - '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission': { - aminoType: 'cosmos-sdk/MsgWithdrawValidatorCommission', - toAmino: MsgWithdrawValidatorCommission.toAmino, - fromAmino: MsgWithdrawValidatorCommission.fromAmino, - }, - '/cosmos.distribution.v1beta1.MsgFundCommunityPool': { - aminoType: 'cosmos-sdk/MsgFundCommunityPool', - toAmino: MsgFundCommunityPool.toAmino, - fromAmino: MsgFundCommunityPool.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts deleted file mode 100644 index 8e4b7fbd652..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts +++ /dev/null @@ -1,157 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgSetWithdrawAddress, - MsgWithdrawDelegatorReward, - MsgWithdrawValidatorCommission, - MsgFundCommunityPool, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', MsgSetWithdrawAddress], - [ - '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - MsgWithdrawDelegatorReward, - ], - [ - '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - MsgWithdrawValidatorCommission, - ], - ['/cosmos.distribution.v1beta1.MsgFundCommunityPool', MsgFundCommunityPool], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - setWithdrawAddress(value: MsgSetWithdrawAddress) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', - value: MsgSetWithdrawAddress.encode(value).finish(), - }; - }, - withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - value: MsgWithdrawDelegatorReward.encode(value).finish(), - }; - }, - withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - value: MsgWithdrawValidatorCommission.encode(value).finish(), - }; - }, - fundCommunityPool(value: MsgFundCommunityPool) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', - value: MsgFundCommunityPool.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - setWithdrawAddress(value: MsgSetWithdrawAddress) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', - value, - }; - }, - withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - value, - }; - }, - withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - value, - }; - }, - fundCommunityPool(value: MsgFundCommunityPool) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', - value, - }; - }, - }, - toJSON: { - setWithdrawAddress(value: MsgSetWithdrawAddress) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', - value: MsgSetWithdrawAddress.toJSON(value), - }; - }, - withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - value: MsgWithdrawDelegatorReward.toJSON(value), - }; - }, - withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - value: MsgWithdrawValidatorCommission.toJSON(value), - }; - }, - fundCommunityPool(value: MsgFundCommunityPool) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', - value: MsgFundCommunityPool.toJSON(value), - }; - }, - }, - fromJSON: { - setWithdrawAddress(value: any) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', - value: MsgSetWithdrawAddress.fromJSON(value), - }; - }, - withdrawDelegatorReward(value: any) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - value: MsgWithdrawDelegatorReward.fromJSON(value), - }; - }, - withdrawValidatorCommission(value: any) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - value: MsgWithdrawValidatorCommission.fromJSON(value), - }; - }, - fundCommunityPool(value: any) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', - value: MsgFundCommunityPool.fromJSON(value), - }; - }, - }, - fromPartial: { - setWithdrawAddress(value: MsgSetWithdrawAddress) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress', - value: MsgSetWithdrawAddress.fromPartial(value), - }; - }, - withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward', - value: MsgWithdrawDelegatorReward.fromPartial(value), - }; - }, - withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission', - value: MsgWithdrawValidatorCommission.fromPartial(value), - }; - }, - fundCommunityPool(value: MsgFundCommunityPool) { - return { - typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool', - value: MsgFundCommunityPool.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 416545a2d72..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,107 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgSetWithdrawAddress, - MsgSetWithdrawAddressResponse, - MsgWithdrawDelegatorReward, - MsgWithdrawDelegatorRewardResponse, - MsgWithdrawValidatorCommission, - MsgWithdrawValidatorCommissionResponse, - MsgFundCommunityPool, - MsgFundCommunityPoolResponse, -} from './tx.js'; -/** Msg defines the distribution Msg service. */ -export interface Msg { - /** - * SetWithdrawAddress defines a method to change the withdraw address - * for a delegator (or validator self-delegation). - */ - setWithdrawAddress( - request: MsgSetWithdrawAddress, - ): Promise; - /** - * WithdrawDelegatorReward defines a method to withdraw rewards of delegator - * from a single validator. - */ - withdrawDelegatorReward( - request: MsgWithdrawDelegatorReward, - ): Promise; - /** - * WithdrawValidatorCommission defines a method to withdraw the - * full commission to the validator address. - */ - withdrawValidatorCommission( - request: MsgWithdrawValidatorCommission, - ): Promise; - /** - * FundCommunityPool defines a method to allow an account to directly - * fund the community pool. - */ - fundCommunityPool( - request: MsgFundCommunityPool, - ): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.setWithdrawAddress = this.setWithdrawAddress.bind(this); - this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); - this.withdrawValidatorCommission = - this.withdrawValidatorCommission.bind(this); - this.fundCommunityPool = this.fundCommunityPool.bind(this); - } - setWithdrawAddress( - request: MsgSetWithdrawAddress, - ): Promise { - const data = MsgSetWithdrawAddress.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Msg', - 'SetWithdrawAddress', - data, - ); - return promise.then(data => - MsgSetWithdrawAddressResponse.decode(new BinaryReader(data)), - ); - } - withdrawDelegatorReward( - request: MsgWithdrawDelegatorReward, - ): Promise { - const data = MsgWithdrawDelegatorReward.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Msg', - 'WithdrawDelegatorReward', - data, - ); - return promise.then(data => - MsgWithdrawDelegatorRewardResponse.decode(new BinaryReader(data)), - ); - } - withdrawValidatorCommission( - request: MsgWithdrawValidatorCommission, - ): Promise { - const data = MsgWithdrawValidatorCommission.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Msg', - 'WithdrawValidatorCommission', - data, - ); - return promise.then(data => - MsgWithdrawValidatorCommissionResponse.decode(new BinaryReader(data)), - ); - } - fundCommunityPool( - request: MsgFundCommunityPool, - ): Promise { - const data = MsgFundCommunityPool.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.distribution.v1beta1.Msg', - 'FundCommunityPool', - data, - ); - return promise.then(data => - MsgFundCommunityPoolResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts index 58706155b52..ac708857dca 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -14,18 +14,6 @@ export interface MsgSetWithdrawAddressProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress'; value: Uint8Array; } -/** - * MsgSetWithdrawAddress sets the withdraw address for - * a delegator (or validator self-delegation). - */ -export interface MsgSetWithdrawAddressAmino { - delegator_address?: string; - withdraw_address?: string; -} -export interface MsgSetWithdrawAddressAminoMsg { - type: 'cosmos-sdk/MsgModifyWithdrawAddress'; - value: MsgSetWithdrawAddressAmino; -} /** * MsgSetWithdrawAddress sets the withdraw address for * a delegator (or validator self-delegation). @@ -41,12 +29,6 @@ export interface MsgSetWithdrawAddressResponseProtoMsg { value: Uint8Array; } /** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ -export interface MsgSetWithdrawAddressResponseAmino {} -export interface MsgSetWithdrawAddressResponseAminoMsg { - type: 'cosmos-sdk/MsgSetWithdrawAddressResponse'; - value: MsgSetWithdrawAddressResponseAmino; -} -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ export interface MsgSetWithdrawAddressResponseSDKType {} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator @@ -60,18 +42,6 @@ export interface MsgWithdrawDelegatorRewardProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward'; value: Uint8Array; } -/** - * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator - * from a single validator. - */ -export interface MsgWithdrawDelegatorRewardAmino { - delegator_address?: string; - validator_address?: string; -} -export interface MsgWithdrawDelegatorRewardAminoMsg { - type: 'cosmos-sdk/MsgWithdrawDelegationReward'; - value: MsgWithdrawDelegatorRewardAmino; -} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator * from a single validator. @@ -89,14 +59,6 @@ export interface MsgWithdrawDelegatorRewardResponseProtoMsg { value: Uint8Array; } /** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseAmino { - amount?: CoinAmino[]; -} -export interface MsgWithdrawDelegatorRewardResponseAminoMsg { - type: 'cosmos-sdk/MsgWithdrawDelegatorRewardResponse'; - value: MsgWithdrawDelegatorRewardResponseAmino; -} -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ export interface MsgWithdrawDelegatorRewardResponseSDKType { amount: CoinSDKType[]; } @@ -111,17 +73,6 @@ export interface MsgWithdrawValidatorCommissionProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission'; value: Uint8Array; } -/** - * MsgWithdrawValidatorCommission withdraws the full commission to the validator - * address. - */ -export interface MsgWithdrawValidatorCommissionAmino { - validator_address?: string; -} -export interface MsgWithdrawValidatorCommissionAminoMsg { - type: 'cosmos-sdk/MsgWithdrawValidatorCommission'; - value: MsgWithdrawValidatorCommissionAmino; -} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. @@ -138,14 +89,6 @@ export interface MsgWithdrawValidatorCommissionResponseProtoMsg { value: Uint8Array; } /** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseAmino { - amount?: CoinAmino[]; -} -export interface MsgWithdrawValidatorCommissionResponseAminoMsg { - type: 'cosmos-sdk/MsgWithdrawValidatorCommissionResponse'; - value: MsgWithdrawValidatorCommissionResponseAmino; -} -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ export interface MsgWithdrawValidatorCommissionResponseSDKType { amount: CoinSDKType[]; } @@ -161,18 +104,6 @@ export interface MsgFundCommunityPoolProtoMsg { typeUrl: '/cosmos.distribution.v1beta1.MsgFundCommunityPool'; value: Uint8Array; } -/** - * MsgFundCommunityPool allows an account to directly - * fund the community pool. - */ -export interface MsgFundCommunityPoolAmino { - amount?: CoinAmino[]; - depositor?: string; -} -export interface MsgFundCommunityPoolAminoMsg { - type: 'cosmos-sdk/MsgFundCommunityPool'; - value: MsgFundCommunityPoolAmino; -} /** * MsgFundCommunityPool allows an account to directly * fund the community pool. @@ -188,12 +119,6 @@ export interface MsgFundCommunityPoolResponseProtoMsg { value: Uint8Array; } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ -export interface MsgFundCommunityPoolResponseAmino {} -export interface MsgFundCommunityPoolResponseAminoMsg { - type: 'cosmos-sdk/MsgFundCommunityPoolResponse'; - value: MsgFundCommunityPoolResponseAmino; -} -/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponseSDKType {} function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { return { @@ -263,39 +188,6 @@ export const MsgSetWithdrawAddress = { message.withdrawAddress = object.withdrawAddress ?? ''; return message; }, - fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { - const message = createBaseMsgSetWithdrawAddress(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.withdraw_address !== undefined && - object.withdraw_address !== null - ) { - message.withdrawAddress = object.withdraw_address; - } - return message; - }, - toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.withdraw_address = - message.withdrawAddress === '' ? undefined : message.withdrawAddress; - return obj; - }, - fromAminoMsg(object: MsgSetWithdrawAddressAminoMsg): MsgSetWithdrawAddress { - return MsgSetWithdrawAddress.fromAmino(object.value); - }, - toAminoMsg(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoMsg { - return { - type: 'cosmos-sdk/MsgModifyWithdrawAddress', - value: MsgSetWithdrawAddress.toAmino(message), - }; - }, fromProtoMsg(message: MsgSetWithdrawAddressProtoMsg): MsgSetWithdrawAddress { return MsgSetWithdrawAddress.decode(message.value); }, @@ -351,31 +243,6 @@ export const MsgSetWithdrawAddressResponse = { const message = createBaseMsgSetWithdrawAddressResponse(); return message; }, - fromAmino( - _: MsgSetWithdrawAddressResponseAmino, - ): MsgSetWithdrawAddressResponse { - const message = createBaseMsgSetWithdrawAddressResponse(); - return message; - }, - toAmino( - _: MsgSetWithdrawAddressResponse, - ): MsgSetWithdrawAddressResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgSetWithdrawAddressResponseAminoMsg, - ): MsgSetWithdrawAddressResponse { - return MsgSetWithdrawAddressResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgSetWithdrawAddressResponse, - ): MsgSetWithdrawAddressResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgSetWithdrawAddressResponse', - value: MsgSetWithdrawAddressResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgSetWithdrawAddressResponseProtoMsg, ): MsgSetWithdrawAddressResponse { @@ -463,47 +330,6 @@ export const MsgWithdrawDelegatorReward = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino( - object: MsgWithdrawDelegatorRewardAmino, - ): MsgWithdrawDelegatorReward { - const message = createBaseMsgWithdrawDelegatorReward(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino( - message: MsgWithdrawDelegatorReward, - ): MsgWithdrawDelegatorRewardAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg( - object: MsgWithdrawDelegatorRewardAminoMsg, - ): MsgWithdrawDelegatorReward { - return MsgWithdrawDelegatorReward.fromAmino(object.value); - }, - toAminoMsg( - message: MsgWithdrawDelegatorReward, - ): MsgWithdrawDelegatorRewardAminoMsg { - return { - type: 'cosmos-sdk/MsgWithdrawDelegationReward', - value: MsgWithdrawDelegatorReward.toAmino(message), - }; - }, fromProtoMsg( message: MsgWithdrawDelegatorRewardProtoMsg, ): MsgWithdrawDelegatorReward { @@ -581,37 +407,6 @@ export const MsgWithdrawDelegatorRewardResponse = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino( - object: MsgWithdrawDelegatorRewardResponseAmino, - ): MsgWithdrawDelegatorRewardResponse { - const message = createBaseMsgWithdrawDelegatorRewardResponse(); - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: MsgWithdrawDelegatorRewardResponse, - ): MsgWithdrawDelegatorRewardResponseAmino { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg( - object: MsgWithdrawDelegatorRewardResponseAminoMsg, - ): MsgWithdrawDelegatorRewardResponse { - return MsgWithdrawDelegatorRewardResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgWithdrawDelegatorRewardResponse, - ): MsgWithdrawDelegatorRewardResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgWithdrawDelegatorRewardResponse', - value: MsgWithdrawDelegatorRewardResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgWithdrawDelegatorRewardResponseProtoMsg, ): MsgWithdrawDelegatorRewardResponse { @@ -687,39 +482,6 @@ export const MsgWithdrawValidatorCommission = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino( - object: MsgWithdrawValidatorCommissionAmino, - ): MsgWithdrawValidatorCommission { - const message = createBaseMsgWithdrawValidatorCommission(); - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino( - message: MsgWithdrawValidatorCommission, - ): MsgWithdrawValidatorCommissionAmino { - const obj: any = {}; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg( - object: MsgWithdrawValidatorCommissionAminoMsg, - ): MsgWithdrawValidatorCommission { - return MsgWithdrawValidatorCommission.fromAmino(object.value); - }, - toAminoMsg( - message: MsgWithdrawValidatorCommission, - ): MsgWithdrawValidatorCommissionAminoMsg { - return { - type: 'cosmos-sdk/MsgWithdrawValidatorCommission', - value: MsgWithdrawValidatorCommission.toAmino(message), - }; - }, fromProtoMsg( message: MsgWithdrawValidatorCommissionProtoMsg, ): MsgWithdrawValidatorCommission { @@ -798,37 +560,6 @@ export const MsgWithdrawValidatorCommissionResponse = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino( - object: MsgWithdrawValidatorCommissionResponseAmino, - ): MsgWithdrawValidatorCommissionResponse { - const message = createBaseMsgWithdrawValidatorCommissionResponse(); - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: MsgWithdrawValidatorCommissionResponse, - ): MsgWithdrawValidatorCommissionResponseAmino { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg( - object: MsgWithdrawValidatorCommissionResponseAminoMsg, - ): MsgWithdrawValidatorCommissionResponse { - return MsgWithdrawValidatorCommissionResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgWithdrawValidatorCommissionResponse, - ): MsgWithdrawValidatorCommissionResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgWithdrawValidatorCommissionResponse', - value: MsgWithdrawValidatorCommissionResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgWithdrawValidatorCommissionResponseProtoMsg, ): MsgWithdrawValidatorCommissionResponse { @@ -915,33 +646,6 @@ export const MsgFundCommunityPool = { message.depositor = object.depositor ?? ''; return message; }, - fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { - const message = createBaseMsgFundCommunityPool(); - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - return message; - }, - toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - obj.depositor = message.depositor === '' ? undefined : message.depositor; - return obj; - }, - fromAminoMsg(object: MsgFundCommunityPoolAminoMsg): MsgFundCommunityPool { - return MsgFundCommunityPool.fromAmino(object.value); - }, - toAminoMsg(message: MsgFundCommunityPool): MsgFundCommunityPoolAminoMsg { - return { - type: 'cosmos-sdk/MsgFundCommunityPool', - value: MsgFundCommunityPool.toAmino(message), - }; - }, fromProtoMsg(message: MsgFundCommunityPoolProtoMsg): MsgFundCommunityPool { return MsgFundCommunityPool.decode(message.value); }, @@ -997,29 +701,6 @@ export const MsgFundCommunityPoolResponse = { const message = createBaseMsgFundCommunityPoolResponse(); return message; }, - fromAmino( - _: MsgFundCommunityPoolResponseAmino, - ): MsgFundCommunityPoolResponse { - const message = createBaseMsgFundCommunityPoolResponse(); - return message; - }, - toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgFundCommunityPoolResponseAminoMsg, - ): MsgFundCommunityPoolResponse { - return MsgFundCommunityPoolResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgFundCommunityPoolResponse, - ): MsgFundCommunityPoolResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgFundCommunityPoolResponse', - value: MsgFundCommunityPoolResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgFundCommunityPoolResponseProtoMsg, ): MsgFundCommunityPoolResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts index 9d93f7e3542..4abdaf33c9d 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -1,17 +1,11 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { Duration, - DurationAmino, DurationSDKType, } from '../../../google/protobuf/duration.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { toTimestamp, @@ -38,24 +32,6 @@ export interface BasicAllowanceProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.BasicAllowance'; value: Uint8Array; } -/** - * BasicAllowance implements Allowance with a one-time grant of tokens - * that optionally expires. The grantee can use up to SpendLimit to cover fees. - */ -export interface BasicAllowanceAmino { - /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is - * empty, there is no spend limit and any amount of coins can be spent. - */ - spend_limit?: CoinAmino[]; - /** expiration specifies an optional time when this allowance expires */ - expiration?: string; -} -export interface BasicAllowanceAminoMsg { - type: 'cosmos-sdk/BasicAllowance'; - value: BasicAllowanceAmino; -} /** * BasicAllowance implements Allowance with a one-time grant of tokens * that optionally expires. The grantee can use up to SpendLimit to cover fees. @@ -96,36 +72,6 @@ export interface PeriodicAllowanceProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.PeriodicAllowance'; value: Uint8Array; } -/** - * PeriodicAllowance extends Allowance to allow for both a maximum cap, - * as well as a limit per time period. - */ -export interface PeriodicAllowanceAmino { - /** basic specifies a struct of `BasicAllowance` */ - basic?: BasicAllowanceAmino; - /** - * period specifies the time duration in which period_spend_limit coins can - * be spent before that allowance is reset - */ - period?: DurationAmino; - /** - * period_spend_limit specifies the maximum number of coins that can be spent - * in the period - */ - period_spend_limit?: CoinAmino[]; - /** period_can_spend is the number of coins left to be spent before the period_reset time */ - period_can_spend?: CoinAmino[]; - /** - * period_reset is the time at which this period resets and a new one begins, - * it is calculated from the start time of the first transaction after the - * last period ended - */ - period_reset?: string; -} -export interface PeriodicAllowanceAminoMsg { - type: 'cosmos-sdk/PeriodicAllowance'; - value: PeriodicAllowanceAmino; -} /** * PeriodicAllowance extends Allowance to allow for both a maximum cap, * as well as a limit per time period. @@ -152,28 +98,6 @@ export interface AllowedMsgAllowanceProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.AllowedMsgAllowance'; value: Uint8Array; } -export type AllowedMsgAllowanceEncoded = Omit< - AllowedMsgAllowance, - 'allowance' -> & { - /** allowance can be any of basic and periodic fee allowance. */ allowance?: - | BasicAllowanceProtoMsg - | PeriodicAllowanceProtoMsg - | AllowedMsgAllowanceProtoMsg - | AnyProtoMsg - | undefined; -}; -/** AllowedMsgAllowance creates allowance only for specified message types. */ -export interface AllowedMsgAllowanceAmino { - /** allowance can be any of basic and periodic fee allowance. */ - allowance?: AnyAmino; - /** allowed_messages are the messages for which the grantee has the access. */ - allowed_messages?: string[]; -} -export interface AllowedMsgAllowanceAminoMsg { - type: 'cosmos-sdk/AllowedMsgAllowance'; - value: AllowedMsgAllowanceAmino; -} /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowanceSDKType { $typeUrl?: '/cosmos.feegrant.v1beta1.AllowedMsgAllowance'; @@ -200,27 +124,6 @@ export interface GrantProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.Grant'; value: Uint8Array; } -export type GrantEncoded = Omit & { - /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: - | BasicAllowanceProtoMsg - | PeriodicAllowanceProtoMsg - | AllowedMsgAllowanceProtoMsg - | AnyProtoMsg - | undefined; -}; -/** Grant is stored in the KVStore to record a grant with full context */ -export interface GrantAmino { - /** granter is the address of the user granting an allowance of their funds. */ - granter?: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee?: string; - /** allowance can be any of basic, periodic, allowed fee allowance. */ - allowance?: AnyAmino; -} -export interface GrantAminoMsg { - type: 'cosmos-sdk/Grant'; - value: GrantAmino; -} /** Grant is stored in the KVStore to record a grant with full context */ export interface GrantSDKType { granter: string; @@ -308,39 +211,6 @@ export const BasicAllowance = { message.expiration = object.expiration ?? undefined; return message; }, - fromAmino(object: BasicAllowanceAmino): BasicAllowance { - const message = createBaseBasicAllowance(); - message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; - if (object.expiration !== undefined && object.expiration !== null) { - message.expiration = fromTimestamp( - Timestamp.fromAmino(object.expiration), - ); - } - return message; - }, - toAmino(message: BasicAllowance): BasicAllowanceAmino { - const obj: any = {}; - if (message.spendLimit) { - obj.spend_limit = message.spendLimit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.spend_limit = message.spendLimit; - } - obj.expiration = message.expiration - ? Timestamp.toAmino(toTimestamp(message.expiration)) - : undefined; - return obj; - }, - fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { - return BasicAllowance.fromAmino(object.value); - }, - toAminoMsg(message: BasicAllowance): BasicAllowanceAminoMsg { - return { - type: 'cosmos-sdk/BasicAllowance', - value: BasicAllowance.toAmino(message), - }; - }, fromProtoMsg(message: BasicAllowanceProtoMsg): BasicAllowance { return BasicAllowance.decode(message.value); }, @@ -486,59 +356,6 @@ export const PeriodicAllowance = { message.periodReset = object.periodReset ?? undefined; return message; }, - fromAmino(object: PeriodicAllowanceAmino): PeriodicAllowance { - const message = createBasePeriodicAllowance(); - if (object.basic !== undefined && object.basic !== null) { - message.basic = BasicAllowance.fromAmino(object.basic); - } - if (object.period !== undefined && object.period !== null) { - message.period = Duration.fromAmino(object.period); - } - message.periodSpendLimit = - object.period_spend_limit?.map(e => Coin.fromAmino(e)) || []; - message.periodCanSpend = - object.period_can_spend?.map(e => Coin.fromAmino(e)) || []; - if (object.period_reset !== undefined && object.period_reset !== null) { - message.periodReset = fromTimestamp( - Timestamp.fromAmino(object.period_reset), - ); - } - return message; - }, - toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { - const obj: any = {}; - obj.basic = message.basic - ? BasicAllowance.toAmino(message.basic) - : undefined; - obj.period = message.period ? Duration.toAmino(message.period) : undefined; - if (message.periodSpendLimit) { - obj.period_spend_limit = message.periodSpendLimit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.period_spend_limit = message.periodSpendLimit; - } - if (message.periodCanSpend) { - obj.period_can_spend = message.periodCanSpend.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.period_can_spend = message.periodCanSpend; - } - obj.period_reset = message.periodReset - ? Timestamp.toAmino(toTimestamp(message.periodReset)) - : undefined; - return obj; - }, - fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { - return PeriodicAllowance.fromAmino(object.value); - }, - toAminoMsg(message: PeriodicAllowance): PeriodicAllowanceAminoMsg { - return { - type: 'cosmos-sdk/PeriodicAllowance', - value: PeriodicAllowance.toAmino(message), - }; - }, fromProtoMsg(message: PeriodicAllowanceProtoMsg): PeriodicAllowance { return PeriodicAllowance.decode(message.value); }, @@ -631,37 +448,6 @@ export const AllowedMsgAllowance = { message.allowedMessages = object.allowedMessages?.map(e => e) || []; return message; }, - fromAmino(object: AllowedMsgAllowanceAmino): AllowedMsgAllowance { - const message = createBaseAllowedMsgAllowance(); - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino( - object.allowance, - ); - } - message.allowedMessages = object.allowed_messages?.map(e => e) || []; - return message; - }, - toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino { - const obj: any = {}; - obj.allowance = message.allowance - ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) - : undefined; - if (message.allowedMessages) { - obj.allowed_messages = message.allowedMessages.map(e => e); - } else { - obj.allowed_messages = message.allowedMessages; - } - return obj; - }, - fromAminoMsg(object: AllowedMsgAllowanceAminoMsg): AllowedMsgAllowance { - return AllowedMsgAllowance.fromAmino(object.value); - }, - toAminoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceAminoMsg { - return { - type: 'cosmos-sdk/AllowedMsgAllowance', - value: AllowedMsgAllowance.toAmino(message), - }; - }, fromProtoMsg(message: AllowedMsgAllowanceProtoMsg): AllowedMsgAllowance { return AllowedMsgAllowance.decode(message.value); }, @@ -754,39 +540,6 @@ export const Grant = { : undefined; return message; }, - fromAmino(object: GrantAmino): Grant { - const message = createBaseGrant(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino( - object.allowance, - ); - } - return message; - }, - toAmino(message: Grant): GrantAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.allowance = message.allowance - ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) - : undefined; - return obj; - }, - fromAminoMsg(object: GrantAminoMsg): Grant { - return Grant.fromAmino(object.value); - }, - toAminoMsg(message: Grant): GrantAminoMsg { - return { - type: 'cosmos-sdk/Grant', - value: Grant.toAmino(message), - }; - }, fromProtoMsg(message: GrantProtoMsg): Grant { return Grant.decode(message.value); }, @@ -817,63 +570,3 @@ export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = ( return data; } }; -export const Cosmos_feegrantFeeAllowanceI_FromAmino = ( - content: AnyAmino, -): Any => { - switch (content.type) { - case 'cosmos-sdk/BasicAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.BasicAllowance', - value: BasicAllowance.encode( - BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value)), - ).finish(), - }); - case 'cosmos-sdk/PeriodicAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.PeriodicAllowance', - value: PeriodicAllowance.encode( - PeriodicAllowance.fromPartial( - PeriodicAllowance.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/AllowedMsgAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.AllowedMsgAllowance', - value: AllowedMsgAllowance.encode( - AllowedMsgAllowance.fromPartial( - AllowedMsgAllowance.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_feegrantFeeAllowanceI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.feegrant.v1beta1.BasicAllowance': - return { - type: 'cosmos-sdk/BasicAllowance', - value: BasicAllowance.toAmino( - BasicAllowance.decode(content.value, undefined), - ), - }; - case '/cosmos.feegrant.v1beta1.PeriodicAllowance': - return { - type: 'cosmos-sdk/PeriodicAllowance', - value: PeriodicAllowance.toAmino( - PeriodicAllowance.decode(content.value, undefined), - ), - }; - case '/cosmos.feegrant.v1beta1.AllowedMsgAllowance': - return { - type: 'cosmos-sdk/AllowedMsgAllowance', - value: AllowedMsgAllowance.toAmino( - AllowedMsgAllowance.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts index e9128a7951f..163e7c30e77 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Grant, GrantAmino, GrantSDKType } from './feegrant.js'; +import { Grant, GrantSDKType } from './feegrant.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisState { @@ -10,14 +10,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState contains a set of fee allowances, persisted from the store */ -export interface GenesisStateAmino { - allowances?: GrantAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisStateSDKType { allowances: GrantSDKType[]; } @@ -79,31 +71,6 @@ export const GenesisState = { object.allowances?.map(e => Grant.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - if (message.allowances) { - obj.allowances = message.allowances.map(e => - e ? Grant.toAmino(e) : undefined, - ); - } else { - obj.allowances = message.allowances; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 6a0c5b08cea..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,91 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryAllowanceRequest, - QueryAllowanceResponse, - QueryAllowancesRequest, - QueryAllowancesResponse, - QueryAllowancesByGranterRequest, - QueryAllowancesByGranterResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Allowance returns fee granted to the grantee by the granter. */ - allowance(request: QueryAllowanceRequest): Promise; - /** Allowances returns all the grants for address. */ - allowances(request: QueryAllowancesRequest): Promise; - /** - * AllowancesByGranter returns all the grants given by an address - * Since v0.46 - */ - allowancesByGranter( - request: QueryAllowancesByGranterRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.allowance = this.allowance.bind(this); - this.allowances = this.allowances.bind(this); - this.allowancesByGranter = this.allowancesByGranter.bind(this); - } - allowance(request: QueryAllowanceRequest): Promise { - const data = QueryAllowanceRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.feegrant.v1beta1.Query', - 'Allowance', - data, - ); - return promise.then(data => - QueryAllowanceResponse.decode(new BinaryReader(data)), - ); - } - allowances( - request: QueryAllowancesRequest, - ): Promise { - const data = QueryAllowancesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.feegrant.v1beta1.Query', - 'Allowances', - data, - ); - return promise.then(data => - QueryAllowancesResponse.decode(new BinaryReader(data)), - ); - } - allowancesByGranter( - request: QueryAllowancesByGranterRequest, - ): Promise { - const data = QueryAllowancesByGranterRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.feegrant.v1beta1.Query', - 'AllowancesByGranter', - data, - ); - return promise.then(data => - QueryAllowancesByGranterResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - allowance(request: QueryAllowanceRequest): Promise { - return queryService.allowance(request); - }, - allowances( - request: QueryAllowancesRequest, - ): Promise { - return queryService.allowances(request); - }, - allowancesByGranter( - request: QueryAllowancesByGranterRequest, - ): Promise { - return queryService.allowancesByGranter(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts index c74c51f77ee..4cfc27c9c67 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/query.ts @@ -1,13 +1,11 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; -import { Grant, GrantAmino, GrantSDKType } from './feegrant.js'; +import { Grant, GrantSDKType } from './feegrant.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ @@ -22,17 +20,6 @@ export interface QueryAllowanceRequestProtoMsg { value: Uint8Array; } /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ -export interface QueryAllowanceRequestAmino { - /** granter is the address of the user granting an allowance of their funds. */ - granter?: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee?: string; -} -export interface QueryAllowanceRequestAminoMsg { - type: 'cosmos-sdk/QueryAllowanceRequest'; - value: QueryAllowanceRequestAmino; -} -/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequestSDKType { granter: string; grantee: string; @@ -47,15 +34,6 @@ export interface QueryAllowanceResponseProtoMsg { value: Uint8Array; } /** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ -export interface QueryAllowanceResponseAmino { - /** allowance is a allowance granted for grantee by granter. */ - allowance?: GrantAmino; -} -export interface QueryAllowanceResponseAminoMsg { - type: 'cosmos-sdk/QueryAllowanceResponse'; - value: QueryAllowanceResponseAmino; -} -/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ export interface QueryAllowanceResponseSDKType { allowance?: GrantSDKType; } @@ -70,16 +48,6 @@ export interface QueryAllowancesRequestProtoMsg { value: Uint8Array; } /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ -export interface QueryAllowancesRequestAmino { - grantee?: string; - /** pagination defines an pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryAllowancesRequestAminoMsg { - type: 'cosmos-sdk/QueryAllowancesRequest'; - value: QueryAllowancesRequestAmino; -} -/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequestSDKType { grantee: string; pagination?: PageRequestSDKType; @@ -96,17 +64,6 @@ export interface QueryAllowancesResponseProtoMsg { value: Uint8Array; } /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ -export interface QueryAllowancesResponseAmino { - /** allowances are allowance's granted for grantee by granter. */ - allowances?: GrantAmino[]; - /** pagination defines an pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface QueryAllowancesResponseAminoMsg { - type: 'cosmos-sdk/QueryAllowancesResponse'; - value: QueryAllowancesResponseAmino; -} -/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; @@ -122,16 +79,6 @@ export interface QueryAllowancesByGranterRequestProtoMsg { value: Uint8Array; } /** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ -export interface QueryAllowancesByGranterRequestAmino { - granter?: string; - /** pagination defines an pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryAllowancesByGranterRequestAminoMsg { - type: 'cosmos-sdk/QueryAllowancesByGranterRequest'; - value: QueryAllowancesByGranterRequestAmino; -} -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterRequestSDKType { granter: string; pagination?: PageRequestSDKType; @@ -148,17 +95,6 @@ export interface QueryAllowancesByGranterResponseProtoMsg { value: Uint8Array; } /** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ -export interface QueryAllowancesByGranterResponseAmino { - /** allowances that have been issued by the granter. */ - allowances?: GrantAmino[]; - /** pagination defines an pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface QueryAllowancesByGranterResponseAminoMsg { - type: 'cosmos-sdk/QueryAllowancesByGranterResponse'; - value: QueryAllowancesByGranterResponseAmino; -} -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; @@ -225,31 +161,6 @@ export const QueryAllowanceRequest = { message.grantee = object.grantee ?? ''; return message; }, - fromAmino(object: QueryAllowanceRequestAmino): QueryAllowanceRequest { - const message = createBaseQueryAllowanceRequest(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - return message; - }, - toAmino(message: QueryAllowanceRequest): QueryAllowanceRequestAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - return obj; - }, - fromAminoMsg(object: QueryAllowanceRequestAminoMsg): QueryAllowanceRequest { - return QueryAllowanceRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryAllowanceRequest): QueryAllowanceRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowanceRequest', - value: QueryAllowanceRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryAllowanceRequestProtoMsg): QueryAllowanceRequest { return QueryAllowanceRequest.decode(message.value); }, @@ -323,29 +234,6 @@ export const QueryAllowanceResponse = { : undefined; return message; }, - fromAmino(object: QueryAllowanceResponseAmino): QueryAllowanceResponse { - const message = createBaseQueryAllowanceResponse(); - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Grant.fromAmino(object.allowance); - } - return message; - }, - toAmino(message: QueryAllowanceResponse): QueryAllowanceResponseAmino { - const obj: any = {}; - obj.allowance = message.allowance - ? Grant.toAmino(message.allowance) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryAllowanceResponseAminoMsg): QueryAllowanceResponse { - return QueryAllowanceResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryAllowanceResponse): QueryAllowanceResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowanceResponse', - value: QueryAllowanceResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllowanceResponseProtoMsg, ): QueryAllowanceResponse { @@ -431,33 +319,6 @@ export const QueryAllowancesRequest = { : undefined; return message; }, - fromAmino(object: QueryAllowancesRequestAmino): QueryAllowancesRequest { - const message = createBaseQueryAllowancesRequest(); - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAllowancesRequest): QueryAllowancesRequestAmino { - const obj: any = {}; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryAllowancesRequestAminoMsg): QueryAllowancesRequest { - return QueryAllowancesRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryAllowancesRequest): QueryAllowancesRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowancesRequest', - value: QueryAllowancesRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllowancesRequestProtoMsg, ): QueryAllowancesRequest { @@ -557,41 +418,6 @@ export const QueryAllowancesResponse = { : undefined; return message; }, - fromAmino(object: QueryAllowancesResponseAmino): QueryAllowancesResponse { - const message = createBaseQueryAllowancesResponse(); - message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryAllowancesResponse): QueryAllowancesResponseAmino { - const obj: any = {}; - if (message.allowances) { - obj.allowances = message.allowances.map(e => - e ? Grant.toAmino(e) : undefined, - ); - } else { - obj.allowances = message.allowances; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAllowancesResponseAminoMsg, - ): QueryAllowancesResponse { - return QueryAllowancesResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAllowancesResponse, - ): QueryAllowancesResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowancesResponse', - value: QueryAllowancesResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllowancesResponseProtoMsg, ): QueryAllowancesResponse { @@ -681,41 +507,6 @@ export const QueryAllowancesByGranterRequest = { : undefined; return message; }, - fromAmino( - object: QueryAllowancesByGranterRequestAmino, - ): QueryAllowancesByGranterRequest { - const message = createBaseQueryAllowancesByGranterRequest(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryAllowancesByGranterRequest, - ): QueryAllowancesByGranterRequestAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAllowancesByGranterRequestAminoMsg, - ): QueryAllowancesByGranterRequest { - return QueryAllowancesByGranterRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAllowancesByGranterRequest, - ): QueryAllowancesByGranterRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowancesByGranterRequest', - value: QueryAllowancesByGranterRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllowancesByGranterRequestProtoMsg, ): QueryAllowancesByGranterRequest { @@ -817,45 +608,6 @@ export const QueryAllowancesByGranterResponse = { : undefined; return message; }, - fromAmino( - object: QueryAllowancesByGranterResponseAmino, - ): QueryAllowancesByGranterResponse { - const message = createBaseQueryAllowancesByGranterResponse(); - message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryAllowancesByGranterResponse, - ): QueryAllowancesByGranterResponseAmino { - const obj: any = {}; - if (message.allowances) { - obj.allowances = message.allowances.map(e => - e ? Grant.toAmino(e) : undefined, - ); - } else { - obj.allowances = message.allowances; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAllowancesByGranterResponseAminoMsg, - ): QueryAllowancesByGranterResponse { - return QueryAllowancesByGranterResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAllowancesByGranterResponse, - ): QueryAllowancesByGranterResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAllowancesByGranterResponse', - value: QueryAllowancesByGranterResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAllowancesByGranterResponseProtoMsg, ): QueryAllowancesByGranterResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts deleted file mode 100644 index 4e89183a5a1..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts +++ /dev/null @@ -1,14 +0,0 @@ -//@ts-nocheck -import { MsgGrantAllowance, MsgRevokeAllowance } from './tx.js'; -export const AminoConverter = { - '/cosmos.feegrant.v1beta1.MsgGrantAllowance': { - aminoType: 'cosmos-sdk/MsgGrantAllowance', - toAmino: MsgGrantAllowance.toAmino, - fromAmino: MsgGrantAllowance.fromAmino, - }, - '/cosmos.feegrant.v1beta1.MsgRevokeAllowance': { - aminoType: 'cosmos-sdk/MsgRevokeAllowance', - toAmino: MsgRevokeAllowance.toAmino, - fromAmino: MsgRevokeAllowance.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts deleted file mode 100644 index c4c2f440cf6..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts +++ /dev/null @@ -1,84 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { MsgGrantAllowance, MsgRevokeAllowance } from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.feegrant.v1beta1.MsgGrantAllowance', MsgGrantAllowance], - ['/cosmos.feegrant.v1beta1.MsgRevokeAllowance', MsgRevokeAllowance], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - grantAllowance(value: MsgGrantAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance', - value: MsgGrantAllowance.encode(value).finish(), - }; - }, - revokeAllowance(value: MsgRevokeAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgRevokeAllowance', - value: MsgRevokeAllowance.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - grantAllowance(value: MsgGrantAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance', - value, - }; - }, - revokeAllowance(value: MsgRevokeAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgRevokeAllowance', - value, - }; - }, - }, - toJSON: { - grantAllowance(value: MsgGrantAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance', - value: MsgGrantAllowance.toJSON(value), - }; - }, - revokeAllowance(value: MsgRevokeAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgRevokeAllowance', - value: MsgRevokeAllowance.toJSON(value), - }; - }, - }, - fromJSON: { - grantAllowance(value: any) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance', - value: MsgGrantAllowance.fromJSON(value), - }; - }, - revokeAllowance(value: any) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgRevokeAllowance', - value: MsgRevokeAllowance.fromJSON(value), - }; - }, - }, - fromPartial: { - grantAllowance(value: MsgGrantAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance', - value: MsgGrantAllowance.fromPartial(value), - }; - }, - revokeAllowance(value: MsgRevokeAllowance) { - return { - typeUrl: '/cosmos.feegrant.v1beta1.MsgRevokeAllowance', - value: MsgRevokeAllowance.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 18ab684f2b5..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,60 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgGrantAllowance, - MsgGrantAllowanceResponse, - MsgRevokeAllowance, - MsgRevokeAllowanceResponse, -} from './tx.js'; -/** Msg defines the feegrant msg service. */ -export interface Msg { - /** - * GrantAllowance grants fee allowance to the grantee on the granter's - * account with the provided expiration time. - */ - grantAllowance( - request: MsgGrantAllowance, - ): Promise; - /** - * RevokeAllowance revokes any fee allowance of granter's account that - * has been granted to the grantee. - */ - revokeAllowance( - request: MsgRevokeAllowance, - ): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.grantAllowance = this.grantAllowance.bind(this); - this.revokeAllowance = this.revokeAllowance.bind(this); - } - grantAllowance( - request: MsgGrantAllowance, - ): Promise { - const data = MsgGrantAllowance.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.feegrant.v1beta1.Msg', - 'GrantAllowance', - data, - ); - return promise.then(data => - MsgGrantAllowanceResponse.decode(new BinaryReader(data)), - ); - } - revokeAllowance( - request: MsgRevokeAllowance, - ): Promise { - const data = MsgRevokeAllowance.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.feegrant.v1beta1.Msg', - 'RevokeAllowance', - data, - ); - return promise.then(data => - MsgRevokeAllowanceResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts index 3ccc0d04abf..83dffbcf63a 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -1,19 +1,11 @@ //@ts-nocheck -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BasicAllowance, - BasicAllowanceProtoMsg, BasicAllowanceSDKType, PeriodicAllowance, - PeriodicAllowanceProtoMsg, PeriodicAllowanceSDKType, AllowedMsgAllowance, - AllowedMsgAllowanceProtoMsg, AllowedMsgAllowanceSDKType, } from './feegrant.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -36,30 +28,6 @@ export interface MsgGrantAllowanceProtoMsg { typeUrl: '/cosmos.feegrant.v1beta1.MsgGrantAllowance'; value: Uint8Array; } -export type MsgGrantAllowanceEncoded = Omit & { - /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: - | BasicAllowanceProtoMsg - | PeriodicAllowanceProtoMsg - | AllowedMsgAllowanceProtoMsg - | AnyProtoMsg - | undefined; -}; -/** - * MsgGrantAllowance adds permission for Grantee to spend up to Allowance - * of fees from the account of Granter. - */ -export interface MsgGrantAllowanceAmino { - /** granter is the address of the user granting an allowance of their funds. */ - granter?: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee?: string; - /** allowance can be any of basic, periodic, allowed fee allowance. */ - allowance?: AnyAmino; -} -export interface MsgGrantAllowanceAminoMsg { - type: 'cosmos-sdk/MsgGrantAllowance'; - value: MsgGrantAllowanceAmino; -} /** * MsgGrantAllowance adds permission for Grantee to spend up to Allowance * of fees from the account of Granter. @@ -81,12 +49,6 @@ export interface MsgGrantAllowanceResponseProtoMsg { value: Uint8Array; } /** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ -export interface MsgGrantAllowanceResponseAmino {} -export interface MsgGrantAllowanceResponseAminoMsg { - type: 'cosmos-sdk/MsgGrantAllowanceResponse'; - value: MsgGrantAllowanceResponseAmino; -} -/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ export interface MsgGrantAllowanceResponseSDKType {} /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowance { @@ -100,17 +62,6 @@ export interface MsgRevokeAllowanceProtoMsg { value: Uint8Array; } /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ -export interface MsgRevokeAllowanceAmino { - /** granter is the address of the user granting an allowance of their funds. */ - granter?: string; - /** grantee is the address of the user being granted an allowance of another user's funds. */ - grantee?: string; -} -export interface MsgRevokeAllowanceAminoMsg { - type: 'cosmos-sdk/MsgRevokeAllowance'; - value: MsgRevokeAllowanceAmino; -} -/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowanceSDKType { granter: string; grantee: string; @@ -122,12 +73,6 @@ export interface MsgRevokeAllowanceResponseProtoMsg { value: Uint8Array; } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ -export interface MsgRevokeAllowanceResponseAmino {} -export interface MsgRevokeAllowanceResponseAminoMsg { - type: 'cosmos-sdk/MsgRevokeAllowanceResponse'; - value: MsgRevokeAllowanceResponseAmino; -} -/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ export interface MsgRevokeAllowanceResponseSDKType {} function createBaseMsgGrantAllowance(): MsgGrantAllowance { return { @@ -208,39 +153,6 @@ export const MsgGrantAllowance = { : undefined; return message; }, - fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { - const message = createBaseMsgGrantAllowance(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.allowance !== undefined && object.allowance !== null) { - message.allowance = Cosmos_feegrantFeeAllowanceI_FromAmino( - object.allowance, - ); - } - return message; - }, - toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - obj.allowance = message.allowance - ? Cosmos_feegrantFeeAllowanceI_ToAmino(message.allowance as Any) - : undefined; - return obj; - }, - fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { - return MsgGrantAllowance.fromAmino(object.value); - }, - toAminoMsg(message: MsgGrantAllowance): MsgGrantAllowanceAminoMsg { - return { - type: 'cosmos-sdk/MsgGrantAllowance', - value: MsgGrantAllowance.toAmino(message), - }; - }, fromProtoMsg(message: MsgGrantAllowanceProtoMsg): MsgGrantAllowance { return MsgGrantAllowance.decode(message.value); }, @@ -296,27 +208,6 @@ export const MsgGrantAllowanceResponse = { const message = createBaseMsgGrantAllowanceResponse(); return message; }, - fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { - const message = createBaseMsgGrantAllowanceResponse(); - return message; - }, - toAmino(_: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgGrantAllowanceResponseAminoMsg, - ): MsgGrantAllowanceResponse { - return MsgGrantAllowanceResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgGrantAllowanceResponse, - ): MsgGrantAllowanceResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgGrantAllowanceResponse', - value: MsgGrantAllowanceResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgGrantAllowanceResponseProtoMsg, ): MsgGrantAllowanceResponse { @@ -396,31 +287,6 @@ export const MsgRevokeAllowance = { message.grantee = object.grantee ?? ''; return message; }, - fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { - const message = createBaseMsgRevokeAllowance(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - return message; - }, - toAmino(message: MsgRevokeAllowance): MsgRevokeAllowanceAmino { - const obj: any = {}; - obj.granter = message.granter === '' ? undefined : message.granter; - obj.grantee = message.grantee === '' ? undefined : message.grantee; - return obj; - }, - fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { - return MsgRevokeAllowance.fromAmino(object.value); - }, - toAminoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceAminoMsg { - return { - type: 'cosmos-sdk/MsgRevokeAllowance', - value: MsgRevokeAllowance.toAmino(message), - }; - }, fromProtoMsg(message: MsgRevokeAllowanceProtoMsg): MsgRevokeAllowance { return MsgRevokeAllowance.decode(message.value); }, @@ -476,27 +342,6 @@ export const MsgRevokeAllowanceResponse = { const message = createBaseMsgRevokeAllowanceResponse(); return message; }, - fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { - const message = createBaseMsgRevokeAllowanceResponse(); - return message; - }, - toAmino(_: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgRevokeAllowanceResponseAminoMsg, - ): MsgRevokeAllowanceResponse { - return MsgRevokeAllowanceResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgRevokeAllowanceResponse, - ): MsgRevokeAllowanceResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgRevokeAllowanceResponse', - value: MsgRevokeAllowanceResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgRevokeAllowanceResponseProtoMsg, ): MsgRevokeAllowanceResponse { @@ -531,63 +376,3 @@ export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = ( return data; } }; -export const Cosmos_feegrantFeeAllowanceI_FromAmino = ( - content: AnyAmino, -): Any => { - switch (content.type) { - case 'cosmos-sdk/BasicAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.BasicAllowance', - value: BasicAllowance.encode( - BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value)), - ).finish(), - }); - case 'cosmos-sdk/PeriodicAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.PeriodicAllowance', - value: PeriodicAllowance.encode( - PeriodicAllowance.fromPartial( - PeriodicAllowance.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/AllowedMsgAllowance': - return Any.fromPartial({ - typeUrl: '/cosmos.feegrant.v1beta1.AllowedMsgAllowance', - value: AllowedMsgAllowance.encode( - AllowedMsgAllowance.fromPartial( - AllowedMsgAllowance.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_feegrantFeeAllowanceI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.feegrant.v1beta1.BasicAllowance': - return { - type: 'cosmos-sdk/BasicAllowance', - value: BasicAllowance.toAmino( - BasicAllowance.decode(content.value, undefined), - ), - }; - case '/cosmos.feegrant.v1beta1.PeriodicAllowance': - return { - type: 'cosmos-sdk/PeriodicAllowance', - value: PeriodicAllowance.toAmino( - PeriodicAllowance.decode(content.value, undefined), - ), - }; - case '/cosmos.feegrant.v1beta1.AllowedMsgAllowance': - return { - type: 'cosmos-sdk/AllowedMsgAllowance', - value: AllowedMsgAllowance.toAmino( - AllowedMsgAllowance.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/genesis.ts index d751357672b..99744170adc 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/genesis.ts @@ -1,22 +1,16 @@ //@ts-nocheck import { Deposit, - DepositAmino, DepositSDKType, Vote, - VoteAmino, VoteSDKType, Proposal, - ProposalAmino, ProposalSDKType, DepositParams, - DepositParamsAmino, DepositParamsSDKType, VotingParams, - VotingParamsAmino, VotingParamsSDKType, TallyParams, - TallyParamsAmino, TallyParamsSDKType, } from './gov.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -43,27 +37,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the gov module's genesis state. */ -export interface GenesisStateAmino { - /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id?: string; - /** deposits defines all the deposits present at genesis. */ - deposits?: DepositAmino[]; - /** votes defines all the votes present at genesis. */ - votes?: VoteAmino[]; - /** proposals defines all the proposals present at genesis. */ - proposals?: ProposalAmino[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params?: DepositParamsAmino; - /** params defines all the paramaters of related to voting. */ - voting_params?: VotingParamsAmino; - /** params defines all the paramaters of related to tally. */ - tally_params?: TallyParamsAmino; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/v1/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { starting_proposal_id: bigint; deposits: DepositSDKType[]; @@ -247,73 +220,6 @@ export const GenesisState = { : undefined; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.startingProposalId = BigInt(object.starting_proposal_id); - } - message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.depositParams = DepositParams.fromAmino(object.deposit_params); - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.votingParams = VotingParams.fromAmino(object.voting_params); - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tallyParams = TallyParams.fromAmino(object.tally_params); - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.starting_proposal_id = - message.startingProposalId !== BigInt(0) - ? message.startingProposalId.toString() - : undefined; - if (message.deposits) { - obj.deposits = message.deposits.map(e => - e ? Deposit.toAmino(e) : undefined, - ); - } else { - obj.deposits = message.deposits; - } - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - obj.deposit_params = message.depositParams - ? DepositParams.toAmino(message.depositParams) - : undefined; - obj.voting_params = message.votingParams - ? VotingParams.toAmino(message.votingParams) - : undefined; - obj.tally_params = message.tallyParams - ? TallyParams.toAmino(message.tallyParams) - : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/v1/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts index 515295a84a8..dedb2493a84 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/gov.ts @@ -1,10 +1,9 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { Duration, - DurationAmino, DurationSDKType, } from '../../../google/protobuf/duration.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -29,7 +28,6 @@ export enum VoteOption { UNRECOGNIZED = -1, } export const VoteOptionSDKType = VoteOption; -export const VoteOptionAmino = VoteOption; export function voteOptionFromJSON(object: any): VoteOption { switch (object) { case 0: @@ -102,7 +100,6 @@ export enum ProposalStatus { UNRECOGNIZED = -1, } export const ProposalStatusSDKType = ProposalStatus; -export const ProposalStatusAmino = ProposalStatus; export function proposalStatusFromJSON(object: any): ProposalStatus { switch (object) { case 0: @@ -158,15 +155,6 @@ export interface WeightedVoteOptionProtoMsg { value: Uint8Array; } /** WeightedVoteOption defines a unit of vote for vote split. */ -export interface WeightedVoteOptionAmino { - option?: VoteOption; - weight?: string; -} -export interface WeightedVoteOptionAminoMsg { - type: 'cosmos-sdk/v1/WeightedVoteOption'; - value: WeightedVoteOptionAmino; -} -/** WeightedVoteOption defines a unit of vote for vote split. */ export interface WeightedVoteOptionSDKType { option: VoteOption; weight: string; @@ -184,19 +172,6 @@ export interface DepositProtoMsg { typeUrl: '/cosmos.gov.v1.Deposit'; value: Uint8Array; } -/** - * Deposit defines an amount deposited by an account address to an active - * proposal. - */ -export interface DepositAmino { - proposal_id?: string; - depositor?: string; - amount?: CoinAmino[]; -} -export interface DepositAminoMsg { - type: 'cosmos-sdk/v1/Deposit'; - value: DepositAmino; -} /** * Deposit defines an amount deposited by an account address to an active * proposal. @@ -230,29 +205,6 @@ export interface ProposalProtoMsg { value: Uint8Array; } /** Proposal defines the core field members of a governance proposal. */ -export interface ProposalAmino { - id?: string; - messages?: AnyAmino[]; - status?: ProposalStatus; - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ - final_tally_result?: TallyResultAmino; - submit_time?: string; - deposit_end_time?: string; - total_deposit?: CoinAmino[]; - voting_start_time?: string; - voting_end_time?: string; - /** metadata is any arbitrary metadata attached to the proposal. */ - metadata?: string; -} -export interface ProposalAminoMsg { - type: 'cosmos-sdk/v1/Proposal'; - value: ProposalAmino; -} -/** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { id: bigint; messages: AnySDKType[]; @@ -277,17 +229,6 @@ export interface TallyResultProtoMsg { value: Uint8Array; } /** TallyResult defines a standard tally for a governance proposal. */ -export interface TallyResultAmino { - yes_count?: string; - abstain_count?: string; - no_count?: string; - no_with_veto_count?: string; -} -export interface TallyResultAminoMsg { - type: 'cosmos-sdk/v1/TallyResult'; - value: TallyResultAmino; -} -/** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultSDKType { yes_count: string; abstain_count: string; @@ -309,21 +250,6 @@ export interface VoteProtoMsg { typeUrl: '/cosmos.gov.v1.Vote'; value: Uint8Array; } -/** - * Vote defines a vote on a governance proposal. - * A Vote consists of a proposal ID, the voter, and the vote option. - */ -export interface VoteAmino { - proposal_id?: string; - voter?: string; - options?: WeightedVoteOptionAmino[]; - /** metadata is any arbitrary metadata to attached to the vote. */ - metadata?: string; -} -export interface VoteAminoMsg { - type: 'cosmos-sdk/v1/Vote'; - value: VoteAmino; -} /** * Vote defines a vote on a governance proposal. * A Vote consists of a proposal ID, the voter, and the vote option. @@ -349,20 +275,6 @@ export interface DepositParamsProtoMsg { value: Uint8Array; } /** DepositParams defines the params for deposits on governance proposals. */ -export interface DepositParamsAmino { - /** Minimum deposit for a proposal to enter voting period. */ - min_deposit?: CoinAmino[]; - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ - max_deposit_period?: DurationAmino; -} -export interface DepositParamsAminoMsg { - type: 'cosmos-sdk/v1/DepositParams'; - value: DepositParamsAmino; -} -/** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsSDKType { min_deposit: CoinSDKType[]; max_deposit_period?: DurationSDKType; @@ -377,15 +289,6 @@ export interface VotingParamsProtoMsg { value: Uint8Array; } /** VotingParams defines the params for voting on governance proposals. */ -export interface VotingParamsAmino { - /** Length of the voting period. */ - voting_period?: DurationAmino; -} -export interface VotingParamsAminoMsg { - type: 'cosmos-sdk/v1/VotingParams'; - value: VotingParamsAmino; -} -/** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { voting_period?: DurationSDKType; } @@ -409,25 +312,6 @@ export interface TallyParamsProtoMsg { value: Uint8Array; } /** TallyParams defines the params for tallying votes on governance proposals. */ -export interface TallyParamsAmino { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - */ - quorum?: string; - /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold?: string; - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - */ - veto_threshold?: string; -} -export interface TallyParamsAminoMsg { - type: 'cosmos-sdk/v1/TallyParams'; - value: TallyParamsAmino; -} -/** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParamsSDKType { quorum: string; threshold: string; @@ -496,31 +380,6 @@ export const WeightedVoteOption = { message.weight = object.weight ?? ''; return message; }, - fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - const message = createBaseWeightedVoteOption(); - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = object.weight; - } - return message; - }, - toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { - const obj: any = {}; - obj.option = message.option === 0 ? undefined : message.option; - obj.weight = message.weight === '' ? undefined : message.weight; - return obj; - }, - fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { - return WeightedVoteOption.fromAmino(object.value); - }, - toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { - return { - type: 'cosmos-sdk/v1/WeightedVoteOption', - value: WeightedVoteOption.toAmino(message), - }; - }, fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { return WeightedVoteOption.decode(message.value); }, @@ -615,40 +474,6 @@ export const Deposit = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: DepositAmino): Deposit { - const message = createBaseDeposit(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Deposit): DepositAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: DepositAminoMsg): Deposit { - return Deposit.fromAmino(object.value); - }, - toAminoMsg(message: Deposit): DepositAminoMsg { - return { - type: 'cosmos-sdk/v1/Deposit', - value: Deposit.toAmino(message), - }; - }, fromProtoMsg(message: DepositProtoMsg): Deposit { return Deposit.decode(message.value); }, @@ -866,104 +691,6 @@ export const Proposal = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: ProposalAmino): Proposal { - const message = createBaseProposal(); - if (object.id !== undefined && object.id !== null) { - message.id = BigInt(object.id); - } - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.finalTallyResult = TallyResult.fromAmino( - object.final_tally_result, - ); - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submitTime = fromTimestamp( - Timestamp.fromAmino(object.submit_time), - ); - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.depositEndTime = fromTimestamp( - Timestamp.fromAmino(object.deposit_end_time), - ); - } - message.totalDeposit = - object.total_deposit?.map(e => Coin.fromAmino(e)) || []; - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.votingStartTime = fromTimestamp( - Timestamp.fromAmino(object.voting_start_time), - ); - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.votingEndTime = fromTimestamp( - Timestamp.fromAmino(object.voting_end_time), - ); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: Proposal): ProposalAmino { - const obj: any = {}; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - obj.status = message.status === 0 ? undefined : message.status; - obj.final_tally_result = message.finalTallyResult - ? TallyResult.toAmino(message.finalTallyResult) - : undefined; - obj.submit_time = message.submitTime - ? Timestamp.toAmino(toTimestamp(message.submitTime)) - : undefined; - obj.deposit_end_time = message.depositEndTime - ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) - : undefined; - if (message.totalDeposit) { - obj.total_deposit = message.totalDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.total_deposit = message.totalDeposit; - } - obj.voting_start_time = message.votingStartTime - ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) - : undefined; - obj.voting_end_time = message.votingEndTime - ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) - : undefined; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: ProposalAminoMsg): Proposal { - return Proposal.fromAmino(object.value); - }, - toAminoMsg(message: Proposal): ProposalAminoMsg { - return { - type: 'cosmos-sdk/v1/Proposal', - value: Proposal.toAmino(message), - }; - }, fromProtoMsg(message: ProposalProtoMsg): Proposal { return Proposal.decode(message.value); }, @@ -1062,44 +789,6 @@ export const TallyResult = { message.noWithVetoCount = object.noWithVetoCount ?? ''; return message; }, - fromAmino(object: TallyResultAmino): TallyResult { - const message = createBaseTallyResult(); - if (object.yes_count !== undefined && object.yes_count !== null) { - message.yesCount = object.yes_count; - } - if (object.abstain_count !== undefined && object.abstain_count !== null) { - message.abstainCount = object.abstain_count; - } - if (object.no_count !== undefined && object.no_count !== null) { - message.noCount = object.no_count; - } - if ( - object.no_with_veto_count !== undefined && - object.no_with_veto_count !== null - ) { - message.noWithVetoCount = object.no_with_veto_count; - } - return message; - }, - toAmino(message: TallyResult): TallyResultAmino { - const obj: any = {}; - obj.yes_count = message.yesCount === '' ? undefined : message.yesCount; - obj.abstain_count = - message.abstainCount === '' ? undefined : message.abstainCount; - obj.no_count = message.noCount === '' ? undefined : message.noCount; - obj.no_with_veto_count = - message.noWithVetoCount === '' ? undefined : message.noWithVetoCount; - return obj; - }, - fromAminoMsg(object: TallyResultAminoMsg): TallyResult { - return TallyResult.fromAmino(object.value); - }, - toAminoMsg(message: TallyResult): TallyResultAminoMsg { - return { - type: 'cosmos-sdk/v1/TallyResult', - value: TallyResult.toAmino(message), - }; - }, fromProtoMsg(message: TallyResultProtoMsg): TallyResult { return TallyResult.decode(message.value); }, @@ -1209,47 +898,6 @@ export const Vote = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: VoteAmino): Vote { - const message = createBaseVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - message.options = - object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: Vote): VoteAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - if (message.options) { - obj.options = message.options.map(e => - e ? WeightedVoteOption.toAmino(e) : undefined, - ); - } else { - obj.options = message.options; - } - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: VoteAminoMsg): Vote { - return Vote.fromAmino(object.value); - }, - toAminoMsg(message: Vote): VoteAminoMsg { - return { - type: 'cosmos-sdk/v1/Vote', - value: Vote.toAmino(message), - }; - }, fromProtoMsg(message: VoteProtoMsg): Vote { return Vote.decode(message.value); }, @@ -1341,40 +989,6 @@ export const DepositParams = { : undefined; return message; }, - fromAmino(object: DepositParamsAmino): DepositParams { - const message = createBaseDepositParams(); - message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); - } - return message; - }, - toAmino(message: DepositParams): DepositParamsAmino { - const obj: any = {}; - if (message.minDeposit) { - obj.min_deposit = message.minDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.min_deposit = message.minDeposit; - } - obj.max_deposit_period = message.maxDepositPeriod - ? Duration.toAmino(message.maxDepositPeriod) - : undefined; - return obj; - }, - fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { - return DepositParams.fromAmino(object.value); - }, - toAminoMsg(message: DepositParams): DepositParamsAminoMsg { - return { - type: 'cosmos-sdk/v1/DepositParams', - value: DepositParams.toAmino(message), - }; - }, fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { return DepositParams.decode(message.value); }, @@ -1445,29 +1059,6 @@ export const VotingParams = { : undefined; return message; }, - fromAmino(object: VotingParamsAmino): VotingParams { - const message = createBaseVotingParams(); - if (object.voting_period !== undefined && object.voting_period !== null) { - message.votingPeriod = Duration.fromAmino(object.voting_period); - } - return message; - }, - toAmino(message: VotingParams): VotingParamsAmino { - const obj: any = {}; - obj.voting_period = message.votingPeriod - ? Duration.toAmino(message.votingPeriod) - : undefined; - return obj; - }, - fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { - return VotingParams.fromAmino(object.value); - }, - toAminoMsg(message: VotingParams): VotingParamsAminoMsg { - return { - type: 'cosmos-sdk/v1/VotingParams', - value: VotingParams.toAmino(message), - }; - }, fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { return VotingParams.decode(message.value); }, @@ -1553,36 +1144,6 @@ export const TallyParams = { message.vetoThreshold = object.vetoThreshold ?? ''; return message; }, - fromAmino(object: TallyParamsAmino): TallyParams { - const message = createBaseTallyParams(); - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = object.quorum; - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = object.threshold; - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.vetoThreshold = object.veto_threshold; - } - return message; - }, - toAmino(message: TallyParams): TallyParamsAmino { - const obj: any = {}; - obj.quorum = message.quorum === '' ? undefined : message.quorum; - obj.threshold = message.threshold === '' ? undefined : message.threshold; - obj.veto_threshold = - message.vetoThreshold === '' ? undefined : message.vetoThreshold; - return obj; - }, - fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { - return TallyParams.fromAmino(object.value); - }, - toAminoMsg(message: TallyParams): TallyParamsAminoMsg { - return { - type: 'cosmos-sdk/v1/TallyParams', - value: TallyParams.toAmino(message), - }; - }, fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { return TallyParams.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.rpc.Query.ts deleted file mode 100644 index cf8c74d9b58..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.rpc.Query.ts +++ /dev/null @@ -1,151 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryProposalRequest, - QueryProposalResponse, - QueryProposalsRequest, - QueryProposalsResponse, - QueryVoteRequest, - QueryVoteResponse, - QueryVotesRequest, - QueryVotesResponse, - QueryParamsRequest, - QueryParamsResponse, - QueryDepositRequest, - QueryDepositResponse, - QueryDepositsRequest, - QueryDepositsResponse, - QueryTallyResultRequest, - QueryTallyResultResponse, -} from './query.js'; -/** Query defines the gRPC querier service for gov module */ -export interface Query { - /** Proposal queries proposal details based on ProposalID. */ - proposal(request: QueryProposalRequest): Promise; - /** Proposals queries all proposals based on given status. */ - proposals(request: QueryProposalsRequest): Promise; - /** Vote queries voted information based on proposalID, voterAddr. */ - vote(request: QueryVoteRequest): Promise; - /** Votes queries votes of a given proposal. */ - votes(request: QueryVotesRequest): Promise; - /** Params queries all parameters of the gov module. */ - params(request: QueryParamsRequest): Promise; - /** Deposit queries single deposit information based proposalID, depositAddr. */ - deposit(request: QueryDepositRequest): Promise; - /** Deposits queries all deposits of a single proposal. */ - deposits(request: QueryDepositsRequest): Promise; - /** TallyResult queries the tally of a proposal vote. */ - tallyResult( - request: QueryTallyResultRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.proposal = this.proposal.bind(this); - this.proposals = this.proposals.bind(this); - this.vote = this.vote.bind(this); - this.votes = this.votes.bind(this); - this.params = this.params.bind(this); - this.deposit = this.deposit.bind(this); - this.deposits = this.deposits.bind(this); - this.tallyResult = this.tallyResult.bind(this); - } - proposal(request: QueryProposalRequest): Promise { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Proposal', data); - return promise.then(data => - QueryProposalResponse.decode(new BinaryReader(data)), - ); - } - proposals(request: QueryProposalsRequest): Promise { - const data = QueryProposalsRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Proposals', data); - return promise.then(data => - QueryProposalsResponse.decode(new BinaryReader(data)), - ); - } - vote(request: QueryVoteRequest): Promise { - const data = QueryVoteRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Vote', data); - return promise.then(data => - QueryVoteResponse.decode(new BinaryReader(data)), - ); - } - votes(request: QueryVotesRequest): Promise { - const data = QueryVotesRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Votes', data); - return promise.then(data => - QueryVotesResponse.decode(new BinaryReader(data)), - ); - } - params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Params', data); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - deposit(request: QueryDepositRequest): Promise { - const data = QueryDepositRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Deposit', data); - return promise.then(data => - QueryDepositResponse.decode(new BinaryReader(data)), - ); - } - deposits(request: QueryDepositsRequest): Promise { - const data = QueryDepositsRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Query', 'Deposits', data); - return promise.then(data => - QueryDepositsResponse.decode(new BinaryReader(data)), - ); - } - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1.Query', - 'TallyResult', - data, - ); - return promise.then(data => - QueryTallyResultResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposals(request: QueryProposalsRequest): Promise { - return queryService.proposals(request); - }, - vote(request: QueryVoteRequest): Promise { - return queryService.vote(request); - }, - votes(request: QueryVotesRequest): Promise { - return queryService.votes(request); - }, - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - deposit(request: QueryDepositRequest): Promise { - return queryService.deposit(request); - }, - deposits(request: QueryDepositsRequest): Promise { - return queryService.deposits(request); - }, - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - return queryService.tallyResult(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts index 7c884b37e93..54e70dda194 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/query.ts @@ -2,35 +2,26 @@ import { ProposalStatus, Proposal, - ProposalAmino, ProposalSDKType, Vote, - VoteAmino, VoteSDKType, VotingParams, - VotingParamsAmino, VotingParamsSDKType, DepositParams, - DepositParamsAmino, DepositParamsSDKType, TallyParams, - TallyParamsAmino, TallyParamsSDKType, Deposit, - DepositAmino, DepositSDKType, TallyResult, - TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON, } from './gov.js'; import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -45,15 +36,6 @@ export interface QueryProposalRequestProtoMsg { value: Uint8Array; } /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ -export interface QueryProposalRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; -} -export interface QueryProposalRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryProposalRequest'; - value: QueryProposalRequestAmino; -} -/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { proposal_id: bigint; } @@ -66,14 +48,6 @@ export interface QueryProposalResponseProtoMsg { value: Uint8Array; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ -export interface QueryProposalResponseAmino { - proposal?: ProposalAmino; -} -export interface QueryProposalResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryProposalResponse'; - value: QueryProposalResponseAmino; -} -/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseSDKType { proposal?: ProposalSDKType; } @@ -93,21 +67,6 @@ export interface QueryProposalsRequestProtoMsg { value: Uint8Array; } /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ -export interface QueryProposalsRequestAmino { - /** proposal_status defines the status of the proposals. */ - proposal_status?: ProposalStatus; - /** voter defines the voter address for the proposals. */ - voter?: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryProposalsRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryProposalsRequest'; - value: QueryProposalsRequestAmino; -} -/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; @@ -127,19 +86,6 @@ export interface QueryProposalsResponseProtoMsg { typeUrl: '/cosmos.gov.v1.QueryProposalsResponse'; value: Uint8Array; } -/** - * QueryProposalsResponse is the response type for the Query/Proposals RPC - * method. - */ -export interface QueryProposalsResponseAmino { - proposals?: ProposalAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryProposalsResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryProposalsResponse'; - value: QueryProposalsResponseAmino; -} /** * QueryProposalsResponse is the response type for the Query/Proposals RPC * method. @@ -160,17 +106,6 @@ export interface QueryVoteRequestProtoMsg { value: Uint8Array; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ -export interface QueryVoteRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** voter defines the oter address for the proposals. */ - voter?: string; -} -export interface QueryVoteRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryVoteRequest'; - value: QueryVoteRequestAmino; -} -/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { proposal_id: bigint; voter: string; @@ -185,15 +120,6 @@ export interface QueryVoteResponseProtoMsg { value: Uint8Array; } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ -export interface QueryVoteResponseAmino { - /** vote defined the queried vote. */ - vote?: VoteAmino; -} -export interface QueryVoteResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryVoteResponse'; - value: QueryVoteResponseAmino; -} -/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseSDKType { vote?: VoteSDKType; } @@ -209,17 +135,6 @@ export interface QueryVotesRequestProtoMsg { value: Uint8Array; } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ -export interface QueryVotesRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryVotesRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryVotesRequest'; - value: QueryVotesRequestAmino; -} -/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { proposal_id: bigint; pagination?: PageRequestSDKType; @@ -236,17 +151,6 @@ export interface QueryVotesResponseProtoMsg { value: Uint8Array; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ -export interface QueryVotesResponseAmino { - /** votes defined the queried votes. */ - votes?: VoteAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryVotesResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryVotesResponse'; - value: QueryVotesResponseAmino; -} -/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; pagination?: PageResponseSDKType; @@ -264,18 +168,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino { - /** - * params_type defines which parameters to query for, can be one of "voting", - * "tallying" or "deposit". - */ - params_type?: string; -} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { params_type: string; } @@ -293,19 +185,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** voting_params defines the parameters related to voting. */ - voting_params?: VotingParamsAmino; - /** deposit_params defines the parameters related to deposit. */ - deposit_params?: DepositParamsAmino; - /** tally_params defines the parameters related to tally. */ - tally_params?: TallyParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { voting_params?: VotingParamsSDKType; deposit_params?: DepositParamsSDKType; @@ -323,17 +202,6 @@ export interface QueryDepositRequestProtoMsg { value: Uint8Array; } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ -export interface QueryDepositRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor?: string; -} -export interface QueryDepositRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryDepositRequest'; - value: QueryDepositRequestAmino; -} -/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { proposal_id: bigint; depositor: string; @@ -348,15 +216,6 @@ export interface QueryDepositResponseProtoMsg { value: Uint8Array; } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ -export interface QueryDepositResponseAmino { - /** deposit defines the requested deposit. */ - deposit?: DepositAmino; -} -export interface QueryDepositResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryDepositResponse'; - value: QueryDepositResponseAmino; -} -/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseSDKType { deposit?: DepositSDKType; } @@ -372,17 +231,6 @@ export interface QueryDepositsRequestProtoMsg { value: Uint8Array; } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ -export interface QueryDepositsRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDepositsRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryDepositsRequest'; - value: QueryDepositsRequestAmino; -} -/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { proposal_id: bigint; pagination?: PageRequestSDKType; @@ -398,16 +246,6 @@ export interface QueryDepositsResponseProtoMsg { value: Uint8Array; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ -export interface QueryDepositsResponseAmino { - deposits?: DepositAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDepositsResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryDepositsResponse'; - value: QueryDepositsResponseAmino; -} -/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; pagination?: PageResponseSDKType; @@ -422,15 +260,6 @@ export interface QueryTallyResultRequestProtoMsg { value: Uint8Array; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ -export interface QueryTallyResultRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; -} -export interface QueryTallyResultRequestAminoMsg { - type: 'cosmos-sdk/v1/QueryTallyResultRequest'; - value: QueryTallyResultRequestAmino; -} -/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { proposal_id: bigint; } @@ -444,15 +273,6 @@ export interface QueryTallyResultResponseProtoMsg { value: Uint8Array; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ -export interface QueryTallyResultResponseAmino { - /** tally defines the requested tally. */ - tally?: TallyResultAmino; -} -export interface QueryTallyResultResponseAminoMsg { - type: 'cosmos-sdk/v1/QueryTallyResultResponse'; - value: QueryTallyResultResponseAmino; -} -/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseSDKType { tally?: TallyResultSDKType; } @@ -514,30 +334,6 @@ export const QueryProposalRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - const message = createBaseQueryProposalRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { - return QueryProposalRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryProposalRequest', - value: QueryProposalRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { return QueryProposalRequest.decode(message.value); }, @@ -611,29 +407,6 @@ export const QueryProposalResponse = { : undefined; return message; }, - fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - const message = createBaseQueryProposalResponse(); - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromAmino(object.proposal); - } - return message; - }, - toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { - const obj: any = {}; - obj.proposal = message.proposal - ? Proposal.toAmino(message.proposal) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { - return QueryProposalResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryProposalResponse', - value: QueryProposalResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { return QueryProposalResponse.decode(message.value); }, @@ -740,45 +513,6 @@ export const QueryProposalsRequest = { : undefined; return message; }, - fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - const message = createBaseQueryProposalsRequest(); - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposalStatus = object.proposal_status; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { - const obj: any = {}; - obj.proposal_status = - message.proposalStatus === 0 ? undefined : message.proposalStatus; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalsRequestAminoMsg): QueryProposalsRequest { - return QueryProposalsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalsRequest): QueryProposalsRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryProposalsRequest', - value: QueryProposalsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalsRequestProtoMsg): QueryProposalsRequest { return QueryProposalsRequest.decode(message.value); }, @@ -874,37 +608,6 @@ export const QueryProposalsResponse = { : undefined; return message; }, - fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - const message = createBaseQueryProposalsResponse(); - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { - const obj: any = {}; - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { - return QueryProposalsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalsResponse): QueryProposalsResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryProposalsResponse', - value: QueryProposalsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryProposalsResponseProtoMsg, ): QueryProposalsResponse { @@ -985,34 +688,6 @@ export const QueryVoteRequest = { message.voter = object.voter ?? ''; return message; }, - fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - const message = createBaseQueryVoteRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - return message; - }, - toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - return obj; - }, - fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { - return QueryVoteRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryVoteRequest): QueryVoteRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryVoteRequest', - value: QueryVoteRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryVoteRequestProtoMsg): QueryVoteRequest { return QueryVoteRequest.decode(message.value); }, @@ -1079,27 +754,6 @@ export const QueryVoteResponse = { : undefined; return message; }, - fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - const message = createBaseQueryVoteResponse(); - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromAmino(object.vote); - } - return message; - }, - toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { - const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; - return obj; - }, - fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { - return QueryVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryVoteResponse', - value: QueryVoteResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryVoteResponseProtoMsg): QueryVoteResponse { return QueryVoteResponse.decode(message.value); }, @@ -1186,36 +840,6 @@ export const QueryVotesRequest = { : undefined; return message; }, - fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - const message = createBaseQueryVotesRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryVotesRequestAminoMsg): QueryVotesRequest { - return QueryVotesRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryVotesRequest): QueryVotesRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryVotesRequest', - value: QueryVotesRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryVotesRequestProtoMsg): QueryVotesRequest { return QueryVotesRequest.decode(message.value); }, @@ -1308,35 +932,6 @@ export const QueryVotesResponse = { : undefined; return message; }, - fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - const message = createBaseQueryVotesResponse(); - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { - const obj: any = {}; - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryVotesResponseAminoMsg): QueryVotesResponse { - return QueryVotesResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryVotesResponse): QueryVotesResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryVotesResponse', - value: QueryVotesResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryVotesResponseProtoMsg): QueryVotesResponse { return QueryVotesResponse.decode(message.value); }, @@ -1402,28 +997,6 @@ export const QueryParamsRequest = { message.paramsType = object.paramsType ?? ''; return message; }, - fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - if (object.params_type !== undefined && object.params_type !== null) { - message.paramsType = object.params_type; - } - return message; - }, - toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - obj.params_type = - message.paramsType === '' ? undefined : message.paramsType; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -1542,41 +1115,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.voting_params !== undefined && object.voting_params !== null) { - message.votingParams = VotingParams.fromAmino(object.voting_params); - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.depositParams = DepositParams.fromAmino(object.deposit_params); - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tallyParams = TallyParams.fromAmino(object.tally_params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.voting_params = message.votingParams - ? VotingParams.toAmino(message.votingParams) - : undefined; - obj.deposit_params = message.depositParams - ? DepositParams.toAmino(message.depositParams) - : undefined; - obj.tally_params = message.tallyParams - ? TallyParams.toAmino(message.tallyParams) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -1658,34 +1196,6 @@ export const QueryDepositRequest = { message.depositor = object.depositor ?? ''; return message; }, - fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - const message = createBaseQueryDepositRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - return message; - }, - toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - return obj; - }, - fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { - return QueryDepositRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositRequest): QueryDepositRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryDepositRequest', - value: QueryDepositRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositRequestProtoMsg): QueryDepositRequest { return QueryDepositRequest.decode(message.value); }, @@ -1759,29 +1269,6 @@ export const QueryDepositResponse = { : undefined; return message; }, - fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - const message = createBaseQueryDepositResponse(); - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromAmino(object.deposit); - } - return message; - }, - toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { - const obj: any = {}; - obj.deposit = message.deposit - ? Deposit.toAmino(message.deposit) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { - return QueryDepositResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryDepositResponse', - value: QueryDepositResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositResponseProtoMsg): QueryDepositResponse { return QueryDepositResponse.decode(message.value); }, @@ -1871,36 +1358,6 @@ export const QueryDepositsRequest = { : undefined; return message; }, - fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - const message = createBaseQueryDepositsRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { - return QueryDepositsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositsRequest): QueryDepositsRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryDepositsRequest', - value: QueryDepositsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositsRequestProtoMsg): QueryDepositsRequest { return QueryDepositsRequest.decode(message.value); }, @@ -1995,37 +1452,6 @@ export const QueryDepositsResponse = { : undefined; return message; }, - fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - const message = createBaseQueryDepositsResponse(); - message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { - const obj: any = {}; - if (message.deposits) { - obj.deposits = message.deposits.map(e => - e ? Deposit.toAmino(e) : undefined, - ); - } else { - obj.deposits = message.deposits; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { - return QueryDepositsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositsResponse): QueryDepositsResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryDepositsResponse', - value: QueryDepositsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositsResponseProtoMsg): QueryDepositsResponse { return QueryDepositsResponse.decode(message.value); }, @@ -2099,34 +1525,6 @@ export const QueryTallyResultRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - const message = createBaseQueryTallyResultRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultRequestAminoMsg, - ): QueryTallyResultRequest { - return QueryTallyResultRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultRequest, - ): QueryTallyResultRequestAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryTallyResultRequest', - value: QueryTallyResultRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultRequestProtoMsg, ): QueryTallyResultRequest { @@ -2206,31 +1604,6 @@ export const QueryTallyResultResponse = { : undefined; return message; }, - fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - const message = createBaseQueryTallyResultResponse(); - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromAmino(object.tally); - } - return message; - }, - toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { - const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultResponseAminoMsg, - ): QueryTallyResultResponse { - return QueryTallyResultResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultResponse, - ): QueryTallyResultResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/QueryTallyResultResponse', - value: QueryTallyResultResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultResponseProtoMsg, ): QueryTallyResultResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.amino.ts deleted file mode 100644 index 47780dba02c..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.amino.ts +++ /dev/null @@ -1,35 +0,0 @@ -//@ts-nocheck -import { - MsgSubmitProposal, - MsgExecLegacyContent, - MsgVote, - MsgVoteWeighted, - MsgDeposit, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.gov.v1.MsgSubmitProposal': { - aminoType: 'cosmos-sdk/v1/MsgSubmitProposal', - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino, - }, - '/cosmos.gov.v1.MsgExecLegacyContent': { - aminoType: 'cosmos-sdk/v1/MsgExecLegacyContent', - toAmino: MsgExecLegacyContent.toAmino, - fromAmino: MsgExecLegacyContent.fromAmino, - }, - '/cosmos.gov.v1.MsgVote': { - aminoType: 'cosmos-sdk/v1/MsgVote', - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino, - }, - '/cosmos.gov.v1.MsgVoteWeighted': { - aminoType: 'cosmos-sdk/v1/MsgVoteWeighted', - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino, - }, - '/cosmos.gov.v1.MsgDeposit': { - aminoType: 'cosmos-sdk/v1/MsgDeposit', - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.registry.ts deleted file mode 100644 index d80bf9b1fe8..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.registry.ts +++ /dev/null @@ -1,183 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgSubmitProposal, - MsgExecLegacyContent, - MsgVote, - MsgVoteWeighted, - MsgDeposit, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.gov.v1.MsgSubmitProposal', MsgSubmitProposal], - ['/cosmos.gov.v1.MsgExecLegacyContent', MsgExecLegacyContent], - ['/cosmos.gov.v1.MsgVote', MsgVote], - ['/cosmos.gov.v1.MsgVoteWeighted', MsgVoteWeighted], - ['/cosmos.gov.v1.MsgDeposit', MsgDeposit], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value: MsgSubmitProposal.encode(value).finish(), - }; - }, - execLegacyContent(value: MsgExecLegacyContent) { - return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value: MsgExecLegacyContent.encode(value).finish(), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value: MsgVote.encode(value).finish(), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value: MsgVoteWeighted.encode(value).finish(), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value: MsgDeposit.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value, - }; - }, - execLegacyContent(value: MsgExecLegacyContent) { - return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value, - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value, - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value, - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value, - }; - }, - }, - toJSON: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value: MsgSubmitProposal.toJSON(value), - }; - }, - execLegacyContent(value: MsgExecLegacyContent) { - return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value: MsgExecLegacyContent.toJSON(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value: MsgVote.toJSON(value), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value: MsgVoteWeighted.toJSON(value), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value: MsgDeposit.toJSON(value), - }; - }, - }, - fromJSON: { - submitProposal(value: any) { - return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value: MsgSubmitProposal.fromJSON(value), - }; - }, - execLegacyContent(value: any) { - return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value: MsgExecLegacyContent.fromJSON(value), - }; - }, - vote(value: any) { - return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value: MsgVote.fromJSON(value), - }; - }, - voteWeighted(value: any) { - return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value: MsgVoteWeighted.fromJSON(value), - }; - }, - deposit(value: any) { - return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value: MsgDeposit.fromJSON(value), - }; - }, - }, - fromPartial: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value: MsgSubmitProposal.fromPartial(value), - }; - }, - execLegacyContent(value: MsgExecLegacyContent) { - return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value: MsgExecLegacyContent.fromPartial(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value: MsgVote.fromPartial(value), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value: MsgVoteWeighted.fromPartial(value), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value: MsgDeposit.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts deleted file mode 100644 index 212d1dcf4a4..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,91 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgSubmitProposal, - MsgSubmitProposalResponse, - MsgExecLegacyContent, - MsgExecLegacyContentResponse, - MsgVote, - MsgVoteResponse, - MsgVoteWeighted, - MsgVoteWeightedResponse, - MsgDeposit, - MsgDepositResponse, -} from './tx.js'; -/** Msg defines the gov Msg service. */ -export interface Msg { - /** SubmitProposal defines a method to create new proposal given a content. */ - submitProposal( - request: MsgSubmitProposal, - ): Promise; - /** - * ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - * to execute a legacy content-based proposal. - */ - execLegacyContent( - request: MsgExecLegacyContent, - ): Promise; - /** Vote defines a method to add a vote on a specific proposal. */ - vote(request: MsgVote): Promise; - /** VoteWeighted defines a method to add a weighted vote on a specific proposal. */ - voteWeighted(request: MsgVoteWeighted): Promise; - /** Deposit defines a method to add deposit on a specific proposal. */ - deposit(request: MsgDeposit): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.submitProposal = this.submitProposal.bind(this); - this.execLegacyContent = this.execLegacyContent.bind(this); - this.vote = this.vote.bind(this); - this.voteWeighted = this.voteWeighted.bind(this); - this.deposit = this.deposit.bind(this); - } - submitProposal( - request: MsgSubmitProposal, - ): Promise { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1.Msg', - 'SubmitProposal', - data, - ); - return promise.then(data => - MsgSubmitProposalResponse.decode(new BinaryReader(data)), - ); - } - execLegacyContent( - request: MsgExecLegacyContent, - ): Promise { - const data = MsgExecLegacyContent.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1.Msg', - 'ExecLegacyContent', - data, - ); - return promise.then(data => - MsgExecLegacyContentResponse.decode(new BinaryReader(data)), - ); - } - vote(request: MsgVote): Promise { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Msg', 'Vote', data); - return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); - } - voteWeighted(request: MsgVoteWeighted): Promise { - const data = MsgVoteWeighted.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Msg', 'VoteWeighted', data); - return promise.then(data => - MsgVoteWeightedResponse.decode(new BinaryReader(data)), - ); - } - deposit(request: MsgDeposit): Promise { - const data = MsgDeposit.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1.Msg', 'Deposit', data); - return promise.then(data => - MsgDepositResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts index 1680abb51fa..0583c7ec1e0 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts @@ -1,51 +1,34 @@ //@ts-nocheck -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { VoteOption, WeightedVoteOption, - WeightedVoteOptionAmino, WeightedVoteOptionSDKType, voteOptionFromJSON, voteOptionToJSON, } from './gov.js'; import { CommunityPoolSpendProposal, - CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType, } from '../../distribution/v1beta1/distribution.js'; -import { - TextProposal, - TextProposalProtoMsg, - TextProposalSDKType, -} from '../v1beta1/gov.js'; +import { TextProposal, TextProposalSDKType } from '../v1beta1/gov.js'; import { ParameterChangeProposal, - ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType, } from '../../params/v1beta1/params.js'; import { SoftwareUpgradeProposal, - SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType, } from '../../upgrade/v1beta1/upgrade.js'; import { ClientUpdateProposal, - ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, - UpgradeProposalProtoMsg, UpgradeProposalSDKType, } from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -65,21 +48,6 @@ export interface MsgSubmitProposalProtoMsg { typeUrl: '/cosmos.gov.v1.MsgSubmitProposal'; value: Uint8Array; } -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposalAmino { - messages?: AnyAmino[]; - initial_deposit?: CoinAmino[]; - proposer?: string; - /** metadata is any arbitrary metadata attached to the proposal. */ - metadata?: string; -} -export interface MsgSubmitProposalAminoMsg { - type: 'cosmos-sdk/v1/MsgSubmitProposal'; - value: MsgSubmitProposalAmino; -} /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -99,14 +67,6 @@ export interface MsgSubmitProposalResponseProtoMsg { value: Uint8Array; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponseAmino { - proposal_id?: string; -} -export interface MsgSubmitProposalResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgSubmitProposalResponse'; - value: MsgSubmitProposalResponseAmino; -} -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { proposal_id: bigint; } @@ -134,36 +94,6 @@ export interface MsgExecLegacyContentProtoMsg { typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent'; value: Uint8Array; } -export type MsgExecLegacyContentEncoded = Omit< - MsgExecLegacyContent, - 'content' -> & { - /** content is the proposal's content. */ content?: - | CommunityPoolSpendProposalProtoMsg - | CommunityPoolSpendProposalWithDepositProtoMsg - | TextProposalProtoMsg - | ParameterChangeProposalProtoMsg - | SoftwareUpgradeProposalProtoMsg - | CancelSoftwareUpgradeProposalProtoMsg - | ClientUpdateProposalProtoMsg - | UpgradeProposalProtoMsg - | AnyProtoMsg - | undefined; -}; -/** - * MsgExecLegacyContent is used to wrap the legacy content field into a message. - * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. - */ -export interface MsgExecLegacyContentAmino { - /** content is the proposal's content. */ - content?: AnyAmino; - /** authority must be the gov module address. */ - authority?: string; -} -export interface MsgExecLegacyContentAminoMsg { - type: 'cosmos-sdk/v1/MsgExecLegacyContent'; - value: MsgExecLegacyContentAmino; -} /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. @@ -189,12 +119,6 @@ export interface MsgExecLegacyContentResponseProtoMsg { value: Uint8Array; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ -export interface MsgExecLegacyContentResponseAmino {} -export interface MsgExecLegacyContentResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse'; - value: MsgExecLegacyContentResponseAmino; -} -/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponseSDKType {} /** MsgVote defines a message to cast a vote. */ export interface MsgVote { @@ -208,17 +132,6 @@ export interface MsgVoteProtoMsg { value: Uint8Array; } /** MsgVote defines a message to cast a vote. */ -export interface MsgVoteAmino { - proposal_id: string; - voter?: string; - option?: VoteOption; - metadata?: string; -} -export interface MsgVoteAminoMsg { - type: 'cosmos-sdk/v1/MsgVote'; - value: MsgVoteAmino; -} -/** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { proposal_id: bigint; voter: string; @@ -232,12 +145,6 @@ export interface MsgVoteResponseProtoMsg { value: Uint8Array; } /** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponseAmino {} -export interface MsgVoteResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteResponse'; - value: MsgVoteResponseAmino; -} -/** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseSDKType {} /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeighted { @@ -251,17 +158,6 @@ export interface MsgVoteWeightedProtoMsg { value: Uint8Array; } /** MsgVoteWeighted defines a message to cast a vote. */ -export interface MsgVoteWeightedAmino { - proposal_id: string; - voter?: string; - options?: WeightedVoteOptionAmino[]; - metadata?: string; -} -export interface MsgVoteWeightedAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteWeighted'; - value: MsgVoteWeightedAmino; -} -/** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedSDKType { proposal_id: bigint; voter: string; @@ -275,12 +171,6 @@ export interface MsgVoteWeightedResponseProtoMsg { value: Uint8Array; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ -export interface MsgVoteWeightedResponseAmino {} -export interface MsgVoteWeightedResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteWeightedResponse'; - value: MsgVoteWeightedResponseAmino; -} -/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { @@ -293,16 +183,6 @@ export interface MsgDepositProtoMsg { value: Uint8Array; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDepositAmino { - proposal_id: string; - depositor?: string; - amount?: CoinAmino[]; -} -export interface MsgDepositAminoMsg { - type: 'cosmos-sdk/v1/MsgDeposit'; - value: MsgDepositAmino; -} -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { proposal_id: bigint; depositor: string; @@ -315,12 +195,6 @@ export interface MsgDepositResponseProtoMsg { value: Uint8Array; } /** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponseAmino {} -export interface MsgDepositResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgDepositResponse'; - value: MsgDepositResponseAmino; -} -/** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseSDKType {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { @@ -416,48 +290,6 @@ export const MsgSubmitProposal = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - message.initialDeposit = - object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - if (message.initialDeposit) { - obj.initial_deposit = message.initialDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.initial_deposit = message.initialDeposit; - } - obj.proposer = message.proposer === '' ? undefined : message.proposer; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { - return MsgSubmitProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgSubmitProposal', - value: MsgSubmitProposal.toAmino(message), - }; - }, fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { return MsgSubmitProposal.decode(message.value); }, @@ -531,34 +363,6 @@ export const MsgSubmitProposalResponse = { : BigInt(0); return message; }, - fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: MsgSubmitProposalResponseAminoMsg, - ): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgSubmitProposalResponse, - ): MsgSubmitProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgSubmitProposalResponse', - value: MsgSubmitProposalResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgSubmitProposalResponseProtoMsg, ): MsgSubmitProposalResponse { @@ -644,33 +448,6 @@ export const MsgExecLegacyContent = { message.authority = object.authority ?? ''; return message; }, - fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { - const message = createBaseMsgExecLegacyContent(); - if (object.content !== undefined && object.content !== null) { - message.content = Cosmos_govv1beta1Content_FromAmino(object.content); - } - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - return message; - }, - toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { - const obj: any = {}; - obj.content = message.content - ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) - : undefined; - obj.authority = message.authority === '' ? undefined : message.authority; - return obj; - }, - fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { - return MsgExecLegacyContent.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgExecLegacyContent', - value: MsgExecLegacyContent.toAmino(message), - }; - }, fromProtoMsg(message: MsgExecLegacyContentProtoMsg): MsgExecLegacyContent { return MsgExecLegacyContent.decode(message.value); }, @@ -726,29 +503,6 @@ export const MsgExecLegacyContentResponse = { const message = createBaseMsgExecLegacyContentResponse(); return message; }, - fromAmino( - _: MsgExecLegacyContentResponseAmino, - ): MsgExecLegacyContentResponse { - const message = createBaseMsgExecLegacyContentResponse(); - return message; - }, - toAmino(_: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgExecLegacyContentResponseAminoMsg, - ): MsgExecLegacyContentResponse { - return MsgExecLegacyContentResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgExecLegacyContentResponse, - ): MsgExecLegacyContentResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse', - value: MsgExecLegacyContentResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgExecLegacyContentResponseProtoMsg, ): MsgExecLegacyContentResponse { @@ -852,39 +606,6 @@ export const MsgVote = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: MsgVoteAmino): MsgVote { - const message = createBaseMsgVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgVote): MsgVoteAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.option = message.option === 0 ? undefined : message.option; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { - return MsgVote.fromAmino(object.value); - }, - toAminoMsg(message: MsgVote): MsgVoteAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgVote', - value: MsgVote.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { return MsgVote.decode(message.value); }, @@ -935,23 +656,6 @@ export const MsgVoteResponse = { const message = createBaseMsgVoteResponse(); return message; }, - fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; - }, - toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { - return MsgVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgVoteResponse', - value: MsgVoteResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { return MsgVoteResponse.decode(message.value); }, @@ -1061,44 +765,6 @@ export const MsgVoteWeighted = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - message.options = - object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.voter = message.voter === '' ? undefined : message.voter; - if (message.options) { - obj.options = message.options.map(e => - e ? WeightedVoteOption.toAmino(e) : undefined, - ); - } else { - obj.options = message.options; - } - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { - return MsgVoteWeighted.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgVoteWeighted', - value: MsgVoteWeighted.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { return MsgVoteWeighted.decode(message.value); }, @@ -1152,27 +818,6 @@ export const MsgVoteWeightedResponse = { const message = createBaseMsgVoteWeightedResponse(); return message; }, - fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse(); - return message; - }, - toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgVoteWeightedResponseAminoMsg, - ): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgVoteWeightedResponse, - ): MsgVoteWeightedResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgVoteWeightedResponse', - value: MsgVoteWeightedResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgVoteWeightedResponseProtoMsg, ): MsgVoteWeightedResponse { @@ -1271,37 +916,6 @@ export const MsgDeposit = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgDepositAmino): MsgDeposit { - const message = createBaseMsgDeposit(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgDeposit): MsgDepositAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { - return MsgDeposit.fromAmino(object.value); - }, - toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgDeposit', - value: MsgDeposit.toAmino(message), - }; - }, fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { return MsgDeposit.decode(message.value); }, @@ -1355,23 +969,6 @@ export const MsgDepositResponse = { const message = createBaseMsgDepositResponse(); return message; }, - fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - const message = createBaseMsgDepositResponse(); - return message; - }, - toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { - return MsgDepositResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgDepositResponse', - value: MsgDepositResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { return MsgDepositResponse.decode(message.value); }, @@ -1421,143 +1018,3 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = ( return data; } }; -export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/v1/CommunityPoolSpendProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.encode( - CommunityPoolSpendProposal.fromPartial( - CommunityPoolSpendProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit': - return Any.fromPartial({ - typeUrl: - '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.encode( - CommunityPoolSpendProposalWithDeposit.fromPartial( - CommunityPoolSpendProposalWithDeposit.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/v1/TextProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.gov.v1beta1.TextProposal', - value: TextProposal.encode( - TextProposal.fromPartial(TextProposal.fromAmino(content.value)), - ).finish(), - }); - case 'cosmos-sdk/v1/ParameterChangeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.params.v1beta1.ParameterChangeProposal', - value: ParameterChangeProposal.encode( - ParameterChangeProposal.fromPartial( - ParameterChangeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/v1/SoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.encode( - SoftwareUpgradeProposal.fromPartial( - SoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/v1/CancelSoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.encode( - CancelSoftwareUpgradeProposal.fromPartial( - CancelSoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/ClientUpdateProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', - value: ClientUpdateProposal.encode( - ClientUpdateProposal.fromPartial( - ClientUpdateProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/UpgradeProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.UpgradeProposal', - value: UpgradeProposal.encode( - UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value)), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return { - type: 'cosmos-sdk/v1/CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.toAmino( - CommunityPoolSpendProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return { - type: 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.toAmino( - CommunityPoolSpendProposalWithDeposit.decode( - content.value, - undefined, - ), - ), - }; - case '/cosmos.gov.v1beta1.TextProposal': - return { - type: 'cosmos-sdk/v1/TextProposal', - value: TextProposal.toAmino( - TextProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return { - type: 'cosmos-sdk/v1/ParameterChangeProposal', - value: ParameterChangeProposal.toAmino( - ParameterChangeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/v1/SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.toAmino( - SoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/v1/CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.toAmino( - CancelSoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.ClientUpdateProposal': - return { - type: 'cosmos-sdk/ClientUpdateProposal', - value: ClientUpdateProposal.toAmino( - ClientUpdateProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.UpgradeProposal': - return { - type: 'cosmos-sdk/UpgradeProposal', - value: UpgradeProposal.toAmino( - UpgradeProposal.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/genesis.ts index 464044db013..460d29e0a33 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/genesis.ts @@ -1,22 +1,16 @@ //@ts-nocheck import { Deposit, - DepositAmino, DepositSDKType, Vote, - VoteAmino, VoteSDKType, Proposal, - ProposalAmino, ProposalSDKType, DepositParams, - DepositParamsAmino, DepositParamsSDKType, VotingParams, - VotingParamsAmino, VotingParamsSDKType, TallyParams, - TallyParamsAmino, TallyParamsSDKType, } from './gov.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -43,27 +37,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the gov module's genesis state. */ -export interface GenesisStateAmino { - /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id?: string; - /** deposits defines all the deposits present at genesis. */ - deposits?: DepositAmino[]; - /** votes defines all the votes present at genesis. */ - votes?: VoteAmino[]; - /** proposals defines all the proposals present at genesis. */ - proposals?: ProposalAmino[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params?: DepositParamsAmino; - /** params defines all the paramaters of related to voting. */ - voting_params?: VotingParamsAmino; - /** params defines all the paramaters of related to tally. */ - tally_params?: TallyParamsAmino; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { starting_proposal_id: bigint; deposits: DepositSDKType[]; @@ -247,73 +220,6 @@ export const GenesisState = { : undefined; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if ( - object.starting_proposal_id !== undefined && - object.starting_proposal_id !== null - ) { - message.startingProposalId = BigInt(object.starting_proposal_id); - } - message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.depositParams = DepositParams.fromAmino(object.deposit_params); - } - if (object.voting_params !== undefined && object.voting_params !== null) { - message.votingParams = VotingParams.fromAmino(object.voting_params); - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tallyParams = TallyParams.fromAmino(object.tally_params); - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.starting_proposal_id = - message.startingProposalId !== BigInt(0) - ? message.startingProposalId.toString() - : undefined; - if (message.deposits) { - obj.deposits = message.deposits.map(e => - e ? Deposit.toAmino(e) : undefined, - ); - } else { - obj.deposits = message.deposits; - } - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - obj.deposit_params = message.depositParams - ? DepositParams.toAmino(message.depositParams) - : undefined; - obj.voting_params = message.votingParams - ? VotingParams.toAmino(message.votingParams) - : undefined; - obj.tally_params = message.tallyParams - ? TallyParams.toAmino(message.tallyParams) - : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts index 42b63071f71..ef7aa729053 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -1,44 +1,31 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { Duration, - DurationAmino, DurationSDKType, } from '../../../google/protobuf/duration.js'; import { CommunityPoolSpendProposal, - CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType, } from '../../distribution/v1beta1/distribution.js'; import { ParameterChangeProposal, - ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType, } from '../../params/v1beta1/params.js'; import { SoftwareUpgradeProposal, - SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType, } from '../../upgrade/v1beta1/upgrade.js'; import { ClientUpdateProposal, - ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, - UpgradeProposalProtoMsg, UpgradeProposalSDKType, } from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -66,7 +53,6 @@ export enum VoteOption { UNRECOGNIZED = -1, } export const VoteOptionSDKType = VoteOption; -export const VoteOptionAmino = VoteOption; export function voteOptionFromJSON(object: any): VoteOption { switch (object) { case 0: @@ -139,7 +125,6 @@ export enum ProposalStatus { UNRECOGNIZED = -1, } export const ProposalStatusSDKType = ProposalStatus; -export const ProposalStatusAmino = ProposalStatus; export function proposalStatusFromJSON(object: any): ProposalStatus { switch (object) { case 0: @@ -198,19 +183,6 @@ export interface WeightedVoteOptionProtoMsg { typeUrl: '/cosmos.gov.v1beta1.WeightedVoteOption'; value: Uint8Array; } -/** - * WeightedVoteOption defines a unit of vote for vote split. - * - * Since: cosmos-sdk 0.43 - */ -export interface WeightedVoteOptionAmino { - option?: VoteOption; - weight?: string; -} -export interface WeightedVoteOptionAminoMsg { - type: 'cosmos-sdk/WeightedVoteOption'; - value: WeightedVoteOptionAmino; -} /** * WeightedVoteOption defines a unit of vote for vote split. * @@ -233,18 +205,6 @@ export interface TextProposalProtoMsg { typeUrl: '/cosmos.gov.v1beta1.TextProposal'; value: Uint8Array; } -/** - * TextProposal defines a standard text proposal whose changes need to be - * manually updated in case of approval. - */ -export interface TextProposalAmino { - title?: string; - description?: string; -} -export interface TextProposalAminoMsg { - type: 'cosmos-sdk/TextProposal'; - value: TextProposalAmino; -} /** * TextProposal defines a standard text proposal whose changes need to be * manually updated in case of approval. @@ -267,19 +227,6 @@ export interface DepositProtoMsg { typeUrl: '/cosmos.gov.v1beta1.Deposit'; value: Uint8Array; } -/** - * Deposit defines an amount deposited by an account address to an active - * proposal. - */ -export interface DepositAmino { - proposal_id?: string; - depositor?: string; - amount?: CoinAmino[]; -} -export interface DepositAminoMsg { - type: 'cosmos-sdk/Deposit'; - value: DepositAmino; -} /** * Deposit defines an amount deposited by an account address to an active * proposal. @@ -320,40 +267,6 @@ export interface ProposalProtoMsg { typeUrl: '/cosmos.gov.v1beta1.Proposal'; value: Uint8Array; } -export type ProposalEncoded = Omit & { - content?: - | TextProposalProtoMsg - | CommunityPoolSpendProposalProtoMsg - | CommunityPoolSpendProposalWithDepositProtoMsg - | ParameterChangeProposalProtoMsg - | SoftwareUpgradeProposalProtoMsg - | CancelSoftwareUpgradeProposalProtoMsg - | ClientUpdateProposalProtoMsg - | UpgradeProposalProtoMsg - | AnyProtoMsg - | undefined; -}; -/** Proposal defines the core field members of a governance proposal. */ -export interface ProposalAmino { - proposal_id?: string; - content?: AnyAmino; - status?: ProposalStatus; - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ - final_tally_result?: TallyResultAmino; - submit_time?: string; - deposit_end_time?: string; - total_deposit?: CoinAmino[]; - voting_start_time?: string; - voting_end_time?: string; -} -export interface ProposalAminoMsg { - type: 'cosmos-sdk/Proposal'; - value: ProposalAmino; -} /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { proposal_id: bigint; @@ -388,17 +301,6 @@ export interface TallyResultProtoMsg { value: Uint8Array; } /** TallyResult defines a standard tally for a governance proposal. */ -export interface TallyResultAmino { - yes?: string; - abstain?: string; - no?: string; - no_with_veto?: string; -} -export interface TallyResultAminoMsg { - type: 'cosmos-sdk/TallyResult'; - value: TallyResultAmino; -} -/** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultSDKType { yes: string; abstain: string; @@ -426,27 +328,6 @@ export interface VoteProtoMsg { typeUrl: '/cosmos.gov.v1beta1.Vote'; value: Uint8Array; } -/** - * Vote defines a vote on a governance proposal. - * A Vote consists of a proposal ID, the voter, and the vote option. - */ -export interface VoteAmino { - proposal_id: string; - voter?: string; - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - */ - /** @deprecated */ - option?: VoteOption; - /** Since: cosmos-sdk 0.43 */ - options?: WeightedVoteOptionAmino[]; -} -export interface VoteAminoMsg { - type: 'cosmos-sdk/Vote'; - value: VoteAmino; -} /** * Vote defines a vote on a governance proposal. * A Vote consists of a proposal ID, the voter, and the vote option. @@ -473,20 +354,6 @@ export interface DepositParamsProtoMsg { value: Uint8Array; } /** DepositParams defines the params for deposits on governance proposals. */ -export interface DepositParamsAmino { - /** Minimum deposit for a proposal to enter voting period. */ - min_deposit?: CoinAmino[]; - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ - max_deposit_period?: DurationAmino; -} -export interface DepositParamsAminoMsg { - type: 'cosmos-sdk/DepositParams'; - value: DepositParamsAmino; -} -/** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsSDKType { min_deposit: CoinSDKType[]; max_deposit_period: DurationSDKType; @@ -501,15 +368,6 @@ export interface VotingParamsProtoMsg { value: Uint8Array; } /** VotingParams defines the params for voting on governance proposals. */ -export interface VotingParamsAmino { - /** Length of the voting period. */ - voting_period?: DurationAmino; -} -export interface VotingParamsAminoMsg { - type: 'cosmos-sdk/VotingParams'; - value: VotingParamsAmino; -} -/** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { voting_period: DurationSDKType; } @@ -533,25 +391,6 @@ export interface TallyParamsProtoMsg { value: Uint8Array; } /** TallyParams defines the params for tallying votes on governance proposals. */ -export interface TallyParamsAmino { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - */ - quorum?: string; - /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold?: string; - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - */ - veto_threshold?: string; -} -export interface TallyParamsAminoMsg { - type: 'cosmos-sdk/TallyParams'; - value: TallyParamsAmino; -} -/** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParamsSDKType { quorum: Uint8Array; threshold: Uint8Array; @@ -622,31 +461,6 @@ export const WeightedVoteOption = { message.weight = object.weight ?? ''; return message; }, - fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - const message = createBaseWeightedVoteOption(); - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = object.weight; - } - return message; - }, - toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { - const obj: any = {}; - obj.option = message.option === 0 ? undefined : message.option; - obj.weight = message.weight === '' ? undefined : message.weight; - return obj; - }, - fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { - return WeightedVoteOption.fromAmino(object.value); - }, - toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { - return { - type: 'cosmos-sdk/WeightedVoteOption', - value: WeightedVoteOption.toAmino(message), - }; - }, fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { return WeightedVoteOption.decode(message.value); }, @@ -721,32 +535,6 @@ export const TextProposal = { message.description = object.description ?? ''; return message; }, - fromAmino(object: TextProposalAmino): TextProposal { - const message = createBaseTextProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - return message; - }, - toAmino(message: TextProposal): TextProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - return obj; - }, - fromAminoMsg(object: TextProposalAminoMsg): TextProposal { - return TextProposal.fromAmino(object.value); - }, - toAminoMsg(message: TextProposal): TextProposalAminoMsg { - return { - type: 'cosmos-sdk/TextProposal', - value: TextProposal.toAmino(message), - }; - }, fromProtoMsg(message: TextProposalProtoMsg): TextProposal { return TextProposal.decode(message.value); }, @@ -841,40 +629,6 @@ export const Deposit = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: DepositAmino): Deposit { - const message = createBaseDeposit(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Deposit): DepositAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: DepositAminoMsg): Deposit { - return Deposit.fromAmino(object.value); - }, - toAminoMsg(message: Deposit): DepositAminoMsg { - return { - type: 'cosmos-sdk/Deposit', - value: Deposit.toAmino(message), - }; - }, fromProtoMsg(message: DepositProtoMsg): Deposit { return Deposit.decode(message.value); }, @@ -1085,101 +839,6 @@ export const Proposal = { message.votingEndTime = object.votingEndTime ?? undefined; return message; }, - fromAmino(object: ProposalAmino): Proposal { - const message = createBaseProposal(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.content !== undefined && object.content !== null) { - message.content = Cosmos_govv1beta1Content_FromAmino(object.content); - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.finalTallyResult = TallyResult.fromAmino( - object.final_tally_result, - ); - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submitTime = fromTimestamp( - Timestamp.fromAmino(object.submit_time), - ); - } - if ( - object.deposit_end_time !== undefined && - object.deposit_end_time !== null - ) { - message.depositEndTime = fromTimestamp( - Timestamp.fromAmino(object.deposit_end_time), - ); - } - message.totalDeposit = - object.total_deposit?.map(e => Coin.fromAmino(e)) || []; - if ( - object.voting_start_time !== undefined && - object.voting_start_time !== null - ) { - message.votingStartTime = fromTimestamp( - Timestamp.fromAmino(object.voting_start_time), - ); - } - if ( - object.voting_end_time !== undefined && - object.voting_end_time !== null - ) { - message.votingEndTime = fromTimestamp( - Timestamp.fromAmino(object.voting_end_time), - ); - } - return message; - }, - toAmino(message: Proposal): ProposalAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.content = message.content - ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) - : undefined; - obj.status = message.status === 0 ? undefined : message.status; - obj.final_tally_result = message.finalTallyResult - ? TallyResult.toAmino(message.finalTallyResult) - : undefined; - obj.submit_time = message.submitTime - ? Timestamp.toAmino(toTimestamp(message.submitTime)) - : undefined; - obj.deposit_end_time = message.depositEndTime - ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) - : undefined; - if (message.totalDeposit) { - obj.total_deposit = message.totalDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.total_deposit = message.totalDeposit; - } - obj.voting_start_time = message.votingStartTime - ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) - : undefined; - obj.voting_end_time = message.votingEndTime - ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) - : undefined; - return obj; - }, - fromAminoMsg(object: ProposalAminoMsg): Proposal { - return Proposal.fromAmino(object.value); - }, - toAminoMsg(message: Proposal): ProposalAminoMsg { - return { - type: 'cosmos-sdk/Proposal', - value: Proposal.toAmino(message), - }; - }, fromProtoMsg(message: ProposalProtoMsg): Proposal { return Proposal.decode(message.value); }, @@ -1272,40 +931,6 @@ export const TallyResult = { message.noWithVeto = object.noWithVeto ?? ''; return message; }, - fromAmino(object: TallyResultAmino): TallyResult { - const message = createBaseTallyResult(); - if (object.yes !== undefined && object.yes !== null) { - message.yes = object.yes; - } - if (object.abstain !== undefined && object.abstain !== null) { - message.abstain = object.abstain; - } - if (object.no !== undefined && object.no !== null) { - message.no = object.no; - } - if (object.no_with_veto !== undefined && object.no_with_veto !== null) { - message.noWithVeto = object.no_with_veto; - } - return message; - }, - toAmino(message: TallyResult): TallyResultAmino { - const obj: any = {}; - obj.yes = message.yes === '' ? undefined : message.yes; - obj.abstain = message.abstain === '' ? undefined : message.abstain; - obj.no = message.no === '' ? undefined : message.no; - obj.no_with_veto = - message.noWithVeto === '' ? undefined : message.noWithVeto; - return obj; - }, - fromAminoMsg(object: TallyResultAminoMsg): TallyResult { - return TallyResult.fromAmino(object.value); - }, - toAminoMsg(message: TallyResult): TallyResultAminoMsg { - return { - type: 'cosmos-sdk/TallyResult', - value: TallyResult.toAmino(message), - }; - }, fromProtoMsg(message: TallyResultProtoMsg): TallyResult { return TallyResult.decode(message.value); }, @@ -1416,44 +1041,6 @@ export const Vote = { object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; return message; }, - fromAmino(object: VoteAmino): Vote { - const message = createBaseVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - message.options = - object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; - return message; - }, - toAmino(message: Vote): VoteAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.option = message.option === 0 ? undefined : message.option; - if (message.options) { - obj.options = message.options.map(e => - e ? WeightedVoteOption.toAmino(e) : undefined, - ); - } else { - obj.options = message.options; - } - return obj; - }, - fromAminoMsg(object: VoteAminoMsg): Vote { - return Vote.fromAmino(object.value); - }, - toAminoMsg(message: Vote): VoteAminoMsg { - return { - type: 'cosmos-sdk/Vote', - value: Vote.toAmino(message), - }; - }, fromProtoMsg(message: VoteProtoMsg): Vote { return Vote.decode(message.value); }, @@ -1545,40 +1132,6 @@ export const DepositParams = { : undefined; return message; }, - fromAmino(object: DepositParamsAmino): DepositParams { - const message = createBaseDepositParams(); - message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; - if ( - object.max_deposit_period !== undefined && - object.max_deposit_period !== null - ) { - message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); - } - return message; - }, - toAmino(message: DepositParams): DepositParamsAmino { - const obj: any = {}; - if (message.minDeposit) { - obj.min_deposit = message.minDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.min_deposit = message.minDeposit; - } - obj.max_deposit_period = message.maxDepositPeriod - ? Duration.toAmino(message.maxDepositPeriod) - : undefined; - return obj; - }, - fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { - return DepositParams.fromAmino(object.value); - }, - toAminoMsg(message: DepositParams): DepositParamsAminoMsg { - return { - type: 'cosmos-sdk/DepositParams', - value: DepositParams.toAmino(message), - }; - }, fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { return DepositParams.decode(message.value); }, @@ -1649,29 +1202,6 @@ export const VotingParams = { : undefined; return message; }, - fromAmino(object: VotingParamsAmino): VotingParams { - const message = createBaseVotingParams(); - if (object.voting_period !== undefined && object.voting_period !== null) { - message.votingPeriod = Duration.fromAmino(object.voting_period); - } - return message; - }, - toAmino(message: VotingParams): VotingParamsAmino { - const obj: any = {}; - obj.voting_period = message.votingPeriod - ? Duration.toAmino(message.votingPeriod) - : undefined; - return obj; - }, - fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { - return VotingParams.fromAmino(object.value); - }, - toAminoMsg(message: VotingParams): VotingParamsAminoMsg { - return { - type: 'cosmos-sdk/VotingParams', - value: VotingParams.toAmino(message), - }; - }, fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { return VotingParams.decode(message.value); }, @@ -1771,39 +1301,6 @@ export const TallyParams = { message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); return message; }, - fromAmino(object: TallyParamsAmino): TallyParams { - const message = createBaseTallyParams(); - if (object.quorum !== undefined && object.quorum !== null) { - message.quorum = bytesFromBase64(object.quorum); - } - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = bytesFromBase64(object.threshold); - } - if (object.veto_threshold !== undefined && object.veto_threshold !== null) { - message.vetoThreshold = bytesFromBase64(object.veto_threshold); - } - return message; - }, - toAmino(message: TallyParams): TallyParamsAmino { - const obj: any = {}; - obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; - obj.threshold = message.threshold - ? base64FromBytes(message.threshold) - : undefined; - obj.veto_threshold = message.vetoThreshold - ? base64FromBytes(message.vetoThreshold) - : undefined; - return obj; - }, - fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { - return TallyParams.fromAmino(object.value); - }, - toAminoMsg(message: TallyParams): TallyParamsAminoMsg { - return { - type: 'cosmos-sdk/TallyParams', - value: TallyParams.toAmino(message), - }; - }, fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { return TallyParams.decode(message.value); }, @@ -1853,143 +1350,3 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = ( return data; } }; -export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/CommunityPoolSpendProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.encode( - CommunityPoolSpendProposal.fromPartial( - CommunityPoolSpendProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit': - return Any.fromPartial({ - typeUrl: - '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.encode( - CommunityPoolSpendProposalWithDeposit.fromPartial( - CommunityPoolSpendProposalWithDeposit.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/TextProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.gov.v1beta1.TextProposal', - value: TextProposal.encode( - TextProposal.fromPartial(TextProposal.fromAmino(content.value)), - ).finish(), - }); - case 'cosmos-sdk/ParameterChangeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.params.v1beta1.ParameterChangeProposal', - value: ParameterChangeProposal.encode( - ParameterChangeProposal.fromPartial( - ParameterChangeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/SoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.encode( - SoftwareUpgradeProposal.fromPartial( - SoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/CancelSoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.encode( - CancelSoftwareUpgradeProposal.fromPartial( - CancelSoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/ClientUpdateProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', - value: ClientUpdateProposal.encode( - ClientUpdateProposal.fromPartial( - ClientUpdateProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/UpgradeProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.UpgradeProposal', - value: UpgradeProposal.encode( - UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value)), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return { - type: 'cosmos-sdk/CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.toAmino( - CommunityPoolSpendProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return { - type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.toAmino( - CommunityPoolSpendProposalWithDeposit.decode( - content.value, - undefined, - ), - ), - }; - case '/cosmos.gov.v1beta1.TextProposal': - return { - type: 'cosmos-sdk/TextProposal', - value: TextProposal.toAmino( - TextProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return { - type: 'cosmos-sdk/ParameterChangeProposal', - value: ParameterChangeProposal.toAmino( - ParameterChangeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.toAmino( - SoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.toAmino( - CancelSoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.ClientUpdateProposal': - return { - type: 'cosmos-sdk/ClientUpdateProposal', - value: ClientUpdateProposal.toAmino( - ClientUpdateProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.UpgradeProposal': - return { - type: 'cosmos-sdk/UpgradeProposal', - value: UpgradeProposal.toAmino( - UpgradeProposal.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 74f56c5d7e0..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,171 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryProposalRequest, - QueryProposalResponse, - QueryProposalsRequest, - QueryProposalsResponse, - QueryVoteRequest, - QueryVoteResponse, - QueryVotesRequest, - QueryVotesResponse, - QueryParamsRequest, - QueryParamsResponse, - QueryDepositRequest, - QueryDepositResponse, - QueryDepositsRequest, - QueryDepositsResponse, - QueryTallyResultRequest, - QueryTallyResultResponse, -} from './query.js'; -/** Query defines the gRPC querier service for gov module */ -export interface Query { - /** Proposal queries proposal details based on ProposalID. */ - proposal(request: QueryProposalRequest): Promise; - /** Proposals queries all proposals based on given status. */ - proposals(request: QueryProposalsRequest): Promise; - /** Vote queries voted information based on proposalID, voterAddr. */ - vote(request: QueryVoteRequest): Promise; - /** Votes queries votes of a given proposal. */ - votes(request: QueryVotesRequest): Promise; - /** Params queries all parameters of the gov module. */ - params(request: QueryParamsRequest): Promise; - /** Deposit queries single deposit information based proposalID, depositAddr. */ - deposit(request: QueryDepositRequest): Promise; - /** Deposits queries all deposits of a single proposal. */ - deposits(request: QueryDepositsRequest): Promise; - /** TallyResult queries the tally of a proposal vote. */ - tallyResult( - request: QueryTallyResultRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.proposal = this.proposal.bind(this); - this.proposals = this.proposals.bind(this); - this.vote = this.vote.bind(this); - this.votes = this.votes.bind(this); - this.params = this.params.bind(this); - this.deposit = this.deposit.bind(this); - this.deposits = this.deposits.bind(this); - this.tallyResult = this.tallyResult.bind(this); - } - proposal(request: QueryProposalRequest): Promise { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'Proposal', - data, - ); - return promise.then(data => - QueryProposalResponse.decode(new BinaryReader(data)), - ); - } - proposals(request: QueryProposalsRequest): Promise { - const data = QueryProposalsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'Proposals', - data, - ); - return promise.then(data => - QueryProposalsResponse.decode(new BinaryReader(data)), - ); - } - vote(request: QueryVoteRequest): Promise { - const data = QueryVoteRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1beta1.Query', 'Vote', data); - return promise.then(data => - QueryVoteResponse.decode(new BinaryReader(data)), - ); - } - votes(request: QueryVotesRequest): Promise { - const data = QueryVotesRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1beta1.Query', 'Votes', data); - return promise.then(data => - QueryVotesResponse.decode(new BinaryReader(data)), - ); - } - params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - deposit(request: QueryDepositRequest): Promise { - const data = QueryDepositRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'Deposit', - data, - ); - return promise.then(data => - QueryDepositResponse.decode(new BinaryReader(data)), - ); - } - deposits(request: QueryDepositsRequest): Promise { - const data = QueryDepositsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'Deposits', - data, - ); - return promise.then(data => - QueryDepositsResponse.decode(new BinaryReader(data)), - ); - } - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Query', - 'TallyResult', - data, - ); - return promise.then(data => - QueryTallyResultResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposals(request: QueryProposalsRequest): Promise { - return queryService.proposals(request); - }, - vote(request: QueryVoteRequest): Promise { - return queryService.vote(request); - }, - votes(request: QueryVotesRequest): Promise { - return queryService.votes(request); - }, - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - deposit(request: QueryDepositRequest): Promise { - return queryService.deposit(request); - }, - deposits(request: QueryDepositsRequest): Promise { - return queryService.deposits(request); - }, - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - return queryService.tallyResult(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts index 2ba05f4c4ee..8505b1bed41 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts @@ -2,35 +2,26 @@ import { ProposalStatus, Proposal, - ProposalAmino, ProposalSDKType, Vote, - VoteAmino, VoteSDKType, VotingParams, - VotingParamsAmino, VotingParamsSDKType, DepositParams, - DepositParamsAmino, DepositParamsSDKType, TallyParams, - TallyParamsAmino, TallyParamsSDKType, Deposit, - DepositAmino, DepositSDKType, TallyResult, - TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON, } from './gov.js'; import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -45,15 +36,6 @@ export interface QueryProposalRequestProtoMsg { value: Uint8Array; } /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ -export interface QueryProposalRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; -} -export interface QueryProposalRequestAminoMsg { - type: 'cosmos-sdk/QueryProposalRequest'; - value: QueryProposalRequestAmino; -} -/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { proposal_id: bigint; } @@ -66,14 +48,6 @@ export interface QueryProposalResponseProtoMsg { value: Uint8Array; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ -export interface QueryProposalResponseAmino { - proposal?: ProposalAmino; -} -export interface QueryProposalResponseAminoMsg { - type: 'cosmos-sdk/QueryProposalResponse'; - value: QueryProposalResponseAmino; -} -/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseSDKType { proposal: ProposalSDKType; } @@ -93,21 +67,6 @@ export interface QueryProposalsRequestProtoMsg { value: Uint8Array; } /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ -export interface QueryProposalsRequestAmino { - /** proposal_status defines the status of the proposals. */ - proposal_status?: ProposalStatus; - /** voter defines the voter address for the proposals. */ - voter?: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryProposalsRequestAminoMsg { - type: 'cosmos-sdk/QueryProposalsRequest'; - value: QueryProposalsRequestAmino; -} -/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; @@ -127,19 +86,6 @@ export interface QueryProposalsResponseProtoMsg { typeUrl: '/cosmos.gov.v1beta1.QueryProposalsResponse'; value: Uint8Array; } -/** - * QueryProposalsResponse is the response type for the Query/Proposals RPC - * method. - */ -export interface QueryProposalsResponseAmino { - proposals?: ProposalAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryProposalsResponseAminoMsg { - type: 'cosmos-sdk/QueryProposalsResponse'; - value: QueryProposalsResponseAmino; -} /** * QueryProposalsResponse is the response type for the Query/Proposals RPC * method. @@ -160,17 +106,6 @@ export interface QueryVoteRequestProtoMsg { value: Uint8Array; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ -export interface QueryVoteRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** voter defines the oter address for the proposals. */ - voter?: string; -} -export interface QueryVoteRequestAminoMsg { - type: 'cosmos-sdk/QueryVoteRequest'; - value: QueryVoteRequestAmino; -} -/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { proposal_id: bigint; voter: string; @@ -185,15 +120,6 @@ export interface QueryVoteResponseProtoMsg { value: Uint8Array; } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ -export interface QueryVoteResponseAmino { - /** vote defined the queried vote. */ - vote?: VoteAmino; -} -export interface QueryVoteResponseAminoMsg { - type: 'cosmos-sdk/QueryVoteResponse'; - value: QueryVoteResponseAmino; -} -/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseSDKType { vote: VoteSDKType; } @@ -209,17 +135,6 @@ export interface QueryVotesRequestProtoMsg { value: Uint8Array; } /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ -export interface QueryVotesRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryVotesRequestAminoMsg { - type: 'cosmos-sdk/QueryVotesRequest'; - value: QueryVotesRequestAmino; -} -/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { proposal_id: bigint; pagination?: PageRequestSDKType; @@ -236,17 +151,6 @@ export interface QueryVotesResponseProtoMsg { value: Uint8Array; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ -export interface QueryVotesResponseAmino { - /** votes defined the queried votes. */ - votes?: VoteAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryVotesResponseAminoMsg { - type: 'cosmos-sdk/QueryVotesResponse'; - value: QueryVotesResponseAmino; -} -/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; pagination?: PageResponseSDKType; @@ -264,18 +168,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino { - /** - * params_type defines which parameters to query for, can be one of "voting", - * "tallying" or "deposit". - */ - params_type?: string; -} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { params_type: string; } @@ -293,19 +185,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** voting_params defines the parameters related to voting. */ - voting_params?: VotingParamsAmino; - /** deposit_params defines the parameters related to deposit. */ - deposit_params?: DepositParamsAmino; - /** tally_params defines the parameters related to tally. */ - tally_params?: TallyParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { voting_params: VotingParamsSDKType; deposit_params: DepositParamsSDKType; @@ -323,17 +202,6 @@ export interface QueryDepositRequestProtoMsg { value: Uint8Array; } /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ -export interface QueryDepositRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor?: string; -} -export interface QueryDepositRequestAminoMsg { - type: 'cosmos-sdk/QueryDepositRequest'; - value: QueryDepositRequestAmino; -} -/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { proposal_id: bigint; depositor: string; @@ -348,15 +216,6 @@ export interface QueryDepositResponseProtoMsg { value: Uint8Array; } /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ -export interface QueryDepositResponseAmino { - /** deposit defines the requested deposit. */ - deposit?: DepositAmino; -} -export interface QueryDepositResponseAminoMsg { - type: 'cosmos-sdk/QueryDepositResponse'; - value: QueryDepositResponseAmino; -} -/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseSDKType { deposit: DepositSDKType; } @@ -372,17 +231,6 @@ export interface QueryDepositsRequestProtoMsg { value: Uint8Array; } /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ -export interface QueryDepositsRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDepositsRequestAminoMsg { - type: 'cosmos-sdk/QueryDepositsRequest'; - value: QueryDepositsRequestAmino; -} -/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { proposal_id: bigint; pagination?: PageRequestSDKType; @@ -398,16 +246,6 @@ export interface QueryDepositsResponseProtoMsg { value: Uint8Array; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ -export interface QueryDepositsResponseAmino { - deposits?: DepositAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDepositsResponseAminoMsg { - type: 'cosmos-sdk/QueryDepositsResponse'; - value: QueryDepositsResponseAmino; -} -/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; pagination?: PageResponseSDKType; @@ -422,15 +260,6 @@ export interface QueryTallyResultRequestProtoMsg { value: Uint8Array; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ -export interface QueryTallyResultRequestAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; -} -export interface QueryTallyResultRequestAminoMsg { - type: 'cosmos-sdk/QueryTallyResultRequest'; - value: QueryTallyResultRequestAmino; -} -/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { proposal_id: bigint; } @@ -444,15 +273,6 @@ export interface QueryTallyResultResponseProtoMsg { value: Uint8Array; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ -export interface QueryTallyResultResponseAmino { - /** tally defines the requested tally. */ - tally?: TallyResultAmino; -} -export interface QueryTallyResultResponseAminoMsg { - type: 'cosmos-sdk/QueryTallyResultResponse'; - value: QueryTallyResultResponseAmino; -} -/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseSDKType { tally: TallyResultSDKType; } @@ -514,30 +334,6 @@ export const QueryProposalRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - const message = createBaseQueryProposalRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { - return QueryProposalRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalRequest', - value: QueryProposalRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { return QueryProposalRequest.decode(message.value); }, @@ -611,29 +407,6 @@ export const QueryProposalResponse = { : undefined; return message; }, - fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - const message = createBaseQueryProposalResponse(); - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromAmino(object.proposal); - } - return message; - }, - toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { - const obj: any = {}; - obj.proposal = message.proposal - ? Proposal.toAmino(message.proposal) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { - return QueryProposalResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalResponse', - value: QueryProposalResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { return QueryProposalResponse.decode(message.value); }, @@ -740,45 +513,6 @@ export const QueryProposalsRequest = { : undefined; return message; }, - fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - const message = createBaseQueryProposalsRequest(); - if ( - object.proposal_status !== undefined && - object.proposal_status !== null - ) { - message.proposalStatus = object.proposal_status; - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { - const obj: any = {}; - obj.proposal_status = - message.proposalStatus === 0 ? undefined : message.proposalStatus; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalsRequestAminoMsg): QueryProposalsRequest { - return QueryProposalsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalsRequest): QueryProposalsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalsRequest', - value: QueryProposalsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalsRequestProtoMsg): QueryProposalsRequest { return QueryProposalsRequest.decode(message.value); }, @@ -874,37 +608,6 @@ export const QueryProposalsResponse = { : undefined; return message; }, - fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - const message = createBaseQueryProposalsResponse(); - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { - const obj: any = {}; - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { - return QueryProposalsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalsResponse): QueryProposalsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalsResponse', - value: QueryProposalsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryProposalsResponseProtoMsg, ): QueryProposalsResponse { @@ -985,34 +688,6 @@ export const QueryVoteRequest = { message.voter = object.voter ?? ''; return message; }, - fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - const message = createBaseQueryVoteRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - return message; - }, - toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - return obj; - }, - fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { - return QueryVoteRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryVoteRequest): QueryVoteRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryVoteRequest', - value: QueryVoteRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryVoteRequestProtoMsg): QueryVoteRequest { return QueryVoteRequest.decode(message.value); }, @@ -1079,27 +754,6 @@ export const QueryVoteResponse = { : undefined; return message; }, - fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - const message = createBaseQueryVoteResponse(); - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromAmino(object.vote); - } - return message; - }, - toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { - const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; - return obj; - }, - fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { - return QueryVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryVoteResponse', - value: QueryVoteResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryVoteResponseProtoMsg): QueryVoteResponse { return QueryVoteResponse.decode(message.value); }, @@ -1186,36 +840,6 @@ export const QueryVotesRequest = { : undefined; return message; }, - fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - const message = createBaseQueryVotesRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryVotesRequestAminoMsg): QueryVotesRequest { - return QueryVotesRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryVotesRequest): QueryVotesRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesRequest', - value: QueryVotesRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryVotesRequestProtoMsg): QueryVotesRequest { return QueryVotesRequest.decode(message.value); }, @@ -1308,35 +932,6 @@ export const QueryVotesResponse = { : undefined; return message; }, - fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - const message = createBaseQueryVotesResponse(); - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { - const obj: any = {}; - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryVotesResponseAminoMsg): QueryVotesResponse { - return QueryVotesResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryVotesResponse): QueryVotesResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesResponse', - value: QueryVotesResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryVotesResponseProtoMsg): QueryVotesResponse { return QueryVotesResponse.decode(message.value); }, @@ -1402,28 +997,6 @@ export const QueryParamsRequest = { message.paramsType = object.paramsType ?? ''; return message; }, - fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - if (object.params_type !== undefined && object.params_type !== null) { - message.paramsType = object.params_type; - } - return message; - }, - toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - obj.params_type = - message.paramsType === '' ? undefined : message.paramsType; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -1542,41 +1115,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.voting_params !== undefined && object.voting_params !== null) { - message.votingParams = VotingParams.fromAmino(object.voting_params); - } - if (object.deposit_params !== undefined && object.deposit_params !== null) { - message.depositParams = DepositParams.fromAmino(object.deposit_params); - } - if (object.tally_params !== undefined && object.tally_params !== null) { - message.tallyParams = TallyParams.fromAmino(object.tally_params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.voting_params = message.votingParams - ? VotingParams.toAmino(message.votingParams) - : undefined; - obj.deposit_params = message.depositParams - ? DepositParams.toAmino(message.depositParams) - : undefined; - obj.tally_params = message.tallyParams - ? TallyParams.toAmino(message.tallyParams) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -1658,34 +1196,6 @@ export const QueryDepositRequest = { message.depositor = object.depositor ?? ''; return message; }, - fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - const message = createBaseQueryDepositRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - return message; - }, - toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - return obj; - }, - fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { - return QueryDepositRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositRequest): QueryDepositRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDepositRequest', - value: QueryDepositRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositRequestProtoMsg): QueryDepositRequest { return QueryDepositRequest.decode(message.value); }, @@ -1759,29 +1269,6 @@ export const QueryDepositResponse = { : undefined; return message; }, - fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - const message = createBaseQueryDepositResponse(); - if (object.deposit !== undefined && object.deposit !== null) { - message.deposit = Deposit.fromAmino(object.deposit); - } - return message; - }, - toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { - const obj: any = {}; - obj.deposit = message.deposit - ? Deposit.toAmino(message.deposit) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { - return QueryDepositResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDepositResponse', - value: QueryDepositResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositResponseProtoMsg): QueryDepositResponse { return QueryDepositResponse.decode(message.value); }, @@ -1871,36 +1358,6 @@ export const QueryDepositsRequest = { : undefined; return message; }, - fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - const message = createBaseQueryDepositsRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { - return QueryDepositsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositsRequest): QueryDepositsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDepositsRequest', - value: QueryDepositsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositsRequestProtoMsg): QueryDepositsRequest { return QueryDepositsRequest.decode(message.value); }, @@ -1995,37 +1452,6 @@ export const QueryDepositsResponse = { : undefined; return message; }, - fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - const message = createBaseQueryDepositsResponse(); - message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { - const obj: any = {}; - if (message.deposits) { - obj.deposits = message.deposits.map(e => - e ? Deposit.toAmino(e) : undefined, - ); - } else { - obj.deposits = message.deposits; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { - return QueryDepositsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryDepositsResponse): QueryDepositsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDepositsResponse', - value: QueryDepositsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryDepositsResponseProtoMsg): QueryDepositsResponse { return QueryDepositsResponse.decode(message.value); }, @@ -2099,34 +1525,6 @@ export const QueryTallyResultRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - const message = createBaseQueryTallyResultRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultRequestAminoMsg, - ): QueryTallyResultRequest { - return QueryTallyResultRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultRequest, - ): QueryTallyResultRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryTallyResultRequest', - value: QueryTallyResultRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultRequestProtoMsg, ): QueryTallyResultRequest { @@ -2206,31 +1604,6 @@ export const QueryTallyResultResponse = { : undefined; return message; }, - fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - const message = createBaseQueryTallyResultResponse(); - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromAmino(object.tally); - } - return message; - }, - toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { - const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultResponseAminoMsg, - ): QueryTallyResultResponse { - return QueryTallyResultResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultResponse, - ): QueryTallyResultResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryTallyResultResponse', - value: QueryTallyResultResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultResponseProtoMsg, ): QueryTallyResultResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.amino.ts deleted file mode 100644 index 38e65126f82..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.amino.ts +++ /dev/null @@ -1,29 +0,0 @@ -//@ts-nocheck -import { - MsgSubmitProposal, - MsgVote, - MsgVoteWeighted, - MsgDeposit, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.gov.v1beta1.MsgSubmitProposal': { - aminoType: 'cosmos-sdk/MsgSubmitProposal', - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino, - }, - '/cosmos.gov.v1beta1.MsgVote': { - aminoType: 'cosmos-sdk/MsgVote', - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino, - }, - '/cosmos.gov.v1beta1.MsgVoteWeighted': { - aminoType: 'cosmos-sdk/MsgVoteWeighted', - toAmino: MsgVoteWeighted.toAmino, - fromAmino: MsgVoteWeighted.fromAmino, - }, - '/cosmos.gov.v1beta1.MsgDeposit': { - aminoType: 'cosmos-sdk/MsgDeposit', - toAmino: MsgDeposit.toAmino, - fromAmino: MsgDeposit.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.registry.ts deleted file mode 100644 index 7ef119dc177..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.registry.ts +++ /dev/null @@ -1,151 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgSubmitProposal, - MsgVote, - MsgVoteWeighted, - MsgDeposit, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.gov.v1beta1.MsgSubmitProposal', MsgSubmitProposal], - ['/cosmos.gov.v1beta1.MsgVote', MsgVote], - ['/cosmos.gov.v1beta1.MsgVoteWeighted', MsgVoteWeighted], - ['/cosmos.gov.v1beta1.MsgDeposit', MsgDeposit], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', - value: MsgSubmitProposal.encode(value).finish(), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVote', - value: MsgVote.encode(value).finish(), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', - value: MsgVoteWeighted.encode(value).finish(), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', - value: MsgDeposit.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', - value, - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVote', - value, - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', - value, - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', - value, - }; - }, - }, - toJSON: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', - value: MsgSubmitProposal.toJSON(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVote', - value: MsgVote.toJSON(value), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', - value: MsgVoteWeighted.toJSON(value), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', - value: MsgDeposit.toJSON(value), - }; - }, - }, - fromJSON: { - submitProposal(value: any) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', - value: MsgSubmitProposal.fromJSON(value), - }; - }, - vote(value: any) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVote', - value: MsgVote.fromJSON(value), - }; - }, - voteWeighted(value: any) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', - value: MsgVoteWeighted.fromJSON(value), - }; - }, - deposit(value: any) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', - value: MsgDeposit.fromJSON(value), - }; - }, - }, - fromPartial: { - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal', - value: MsgSubmitProposal.fromPartial(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVote', - value: MsgVote.fromPartial(value), - }; - }, - voteWeighted(value: MsgVoteWeighted) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted', - value: MsgVoteWeighted.fromPartial(value), - }; - }, - deposit(value: MsgDeposit) { - return { - typeUrl: '/cosmos.gov.v1beta1.MsgDeposit', - value: MsgDeposit.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 38b3e953842..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,76 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgSubmitProposal, - MsgSubmitProposalResponse, - MsgVote, - MsgVoteResponse, - MsgVoteWeighted, - MsgVoteWeightedResponse, - MsgDeposit, - MsgDepositResponse, -} from './tx.js'; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** SubmitProposal defines a method to create new proposal given a content. */ - submitProposal( - request: MsgSubmitProposal, - ): Promise; - /** Vote defines a method to add a vote on a specific proposal. */ - vote(request: MsgVote): Promise; - /** - * VoteWeighted defines a method to add a weighted vote on a specific proposal. - * - * Since: cosmos-sdk 0.43 - */ - voteWeighted(request: MsgVoteWeighted): Promise; - /** Deposit defines a method to add deposit on a specific proposal. */ - deposit(request: MsgDeposit): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.submitProposal = this.submitProposal.bind(this); - this.vote = this.vote.bind(this); - this.voteWeighted = this.voteWeighted.bind(this); - this.deposit = this.deposit.bind(this); - } - submitProposal( - request: MsgSubmitProposal, - ): Promise { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Msg', - 'SubmitProposal', - data, - ); - return promise.then(data => - MsgSubmitProposalResponse.decode(new BinaryReader(data)), - ); - } - vote(request: MsgVote): Promise { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1beta1.Msg', 'Vote', data); - return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); - } - voteWeighted(request: MsgVoteWeighted): Promise { - const data = MsgVoteWeighted.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.gov.v1beta1.Msg', - 'VoteWeighted', - data, - ); - return promise.then(data => - MsgVoteWeightedResponse.decode(new BinaryReader(data)), - ); - } - deposit(request: MsgDeposit): Promise { - const data = MsgDeposit.encode(request).finish(); - const promise = this.rpc.request('cosmos.gov.v1beta1.Msg', 'Deposit', data); - return promise.then(data => - MsgDepositResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts index b2098b7deb0..aaaaa69b5a9 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,49 +1,35 @@ //@ts-nocheck -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { VoteOption, WeightedVoteOption, - WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, - TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON, voteOptionToJSON, } from './gov.js'; import { CommunityPoolSpendProposal, - CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType, } from '../../distribution/v1beta1/distribution.js'; import { ParameterChangeProposal, - ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType, } from '../../params/v1beta1/params.js'; import { SoftwareUpgradeProposal, - SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType, } from '../../upgrade/v1beta1/upgrade.js'; import { ClientUpdateProposal, - ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, - UpgradeProposalProtoMsg, UpgradeProposalSDKType, } from '../../../ibc/core/client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -71,32 +57,6 @@ export interface MsgSubmitProposalProtoMsg { typeUrl: '/cosmos.gov.v1beta1.MsgSubmitProposal'; value: Uint8Array; } -export type MsgSubmitProposalEncoded = Omit & { - content?: - | CommunityPoolSpendProposalProtoMsg - | CommunityPoolSpendProposalWithDepositProtoMsg - | TextProposalProtoMsg - | ParameterChangeProposalProtoMsg - | SoftwareUpgradeProposalProtoMsg - | CancelSoftwareUpgradeProposalProtoMsg - | ClientUpdateProposalProtoMsg - | UpgradeProposalProtoMsg - | AnyProtoMsg - | undefined; -}; -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposalAmino { - content?: AnyAmino; - initial_deposit?: CoinAmino[]; - proposer?: string; -} -export interface MsgSubmitProposalAminoMsg { - type: 'cosmos-sdk/MsgSubmitProposal'; - value: MsgSubmitProposalAmino; -} /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. @@ -125,14 +85,6 @@ export interface MsgSubmitProposalResponseProtoMsg { value: Uint8Array; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponseAmino { - proposal_id: string; -} -export interface MsgSubmitProposalResponseAminoMsg { - type: 'cosmos-sdk/MsgSubmitProposalResponse'; - value: MsgSubmitProposalResponseAmino; -} -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { proposal_id: bigint; } @@ -147,16 +99,6 @@ export interface MsgVoteProtoMsg { value: Uint8Array; } /** MsgVote defines a message to cast a vote. */ -export interface MsgVoteAmino { - proposal_id?: string; - voter?: string; - option?: VoteOption; -} -export interface MsgVoteAminoMsg { - type: 'cosmos-sdk/MsgVote'; - value: MsgVoteAmino; -} -/** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { proposal_id: bigint; voter: string; @@ -169,12 +111,6 @@ export interface MsgVoteResponseProtoMsg { value: Uint8Array; } /** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponseAmino {} -export interface MsgVoteResponseAminoMsg { - type: 'cosmos-sdk/MsgVoteResponse'; - value: MsgVoteResponseAmino; -} -/** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseSDKType {} /** * MsgVoteWeighted defines a message to cast a vote. @@ -190,20 +126,6 @@ export interface MsgVoteWeightedProtoMsg { typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeighted'; value: Uint8Array; } -/** - * MsgVoteWeighted defines a message to cast a vote. - * - * Since: cosmos-sdk 0.43 - */ -export interface MsgVoteWeightedAmino { - proposal_id: string; - voter?: string; - options?: WeightedVoteOptionAmino[]; -} -export interface MsgVoteWeightedAminoMsg { - type: 'cosmos-sdk/MsgVoteWeighted'; - value: MsgVoteWeightedAmino; -} /** * MsgVoteWeighted defines a message to cast a vote. * @@ -224,16 +146,6 @@ export interface MsgVoteWeightedResponseProtoMsg { typeUrl: '/cosmos.gov.v1beta1.MsgVoteWeightedResponse'; value: Uint8Array; } -/** - * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - * - * Since: cosmos-sdk 0.43 - */ -export interface MsgVoteWeightedResponseAmino {} -export interface MsgVoteWeightedResponseAminoMsg { - type: 'cosmos-sdk/MsgVoteWeightedResponse'; - value: MsgVoteWeightedResponseAmino; -} /** * MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. * @@ -251,16 +163,6 @@ export interface MsgDepositProtoMsg { value: Uint8Array; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDepositAmino { - proposal_id: string; - depositor?: string; - amount?: CoinAmino[]; -} -export interface MsgDepositAminoMsg { - type: 'cosmos-sdk/MsgDeposit'; - value: MsgDepositAmino; -} -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { proposal_id: bigint; depositor: string; @@ -273,12 +175,6 @@ export interface MsgDepositResponseProtoMsg { value: Uint8Array; } /** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponseAmino {} -export interface MsgDepositResponseAminoMsg { - type: 'cosmos-sdk/MsgDepositResponse'; - value: MsgDepositResponseAmino; -} -/** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseSDKType {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { @@ -364,42 +260,6 @@ export const MsgSubmitProposal = { message.proposer = object.proposer ?? ''; return message; }, - fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - if (object.content !== undefined && object.content !== null) { - message.content = Cosmos_govv1beta1Content_FromAmino(object.content); - } - message.initialDeposit = - object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } - return message; - }, - toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { - const obj: any = {}; - obj.content = message.content - ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) - : undefined; - if (message.initialDeposit) { - obj.initial_deposit = message.initialDeposit.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.initial_deposit = message.initialDeposit; - } - obj.proposer = message.proposer === '' ? undefined : message.proposer; - return obj; - }, - fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { - return MsgSubmitProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { - return { - type: 'cosmos-sdk/MsgSubmitProposal', - value: MsgSubmitProposal.toAmino(message), - }; - }, fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { return MsgSubmitProposal.decode(message.value); }, @@ -473,31 +333,6 @@ export const MsgSubmitProposalResponse = { : BigInt(0); return message; }, - fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - return obj; - }, - fromAminoMsg( - object: MsgSubmitProposalResponseAminoMsg, - ): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgSubmitProposalResponse, - ): MsgSubmitProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgSubmitProposalResponse', - value: MsgSubmitProposalResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgSubmitProposalResponseProtoMsg, ): MsgSubmitProposalResponse { @@ -591,38 +426,6 @@ export const MsgVote = { message.option = object.option ?? 0; return message; }, - fromAmino(object: MsgVoteAmino): MsgVote { - const message = createBaseMsgVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - return message; - }, - toAmino(message: MsgVote): MsgVoteAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.option = message.option === 0 ? undefined : message.option; - return obj; - }, - fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { - return MsgVote.fromAmino(object.value); - }, - toAminoMsg(message: MsgVote): MsgVoteAminoMsg { - return { - type: 'cosmos-sdk/MsgVote', - value: MsgVote.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { return MsgVote.decode(message.value); }, @@ -673,23 +476,6 @@ export const MsgVoteResponse = { const message = createBaseMsgVoteResponse(); return message; }, - fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; - }, - toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { - return MsgVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgVoteResponse', - value: MsgVoteResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { return MsgVoteResponse.decode(message.value); }, @@ -789,40 +575,6 @@ export const MsgVoteWeighted = { object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - message.options = - object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.voter = message.voter === '' ? undefined : message.voter; - if (message.options) { - obj.options = message.options.map(e => - e ? WeightedVoteOption.toAmino(e) : undefined, - ); - } else { - obj.options = message.options; - } - return obj; - }, - fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { - return MsgVoteWeighted.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { - return { - type: 'cosmos-sdk/MsgVoteWeighted', - value: MsgVoteWeighted.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { return MsgVoteWeighted.decode(message.value); }, @@ -876,27 +628,6 @@ export const MsgVoteWeightedResponse = { const message = createBaseMsgVoteWeightedResponse(); return message; }, - fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse(); - return message; - }, - toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgVoteWeightedResponseAminoMsg, - ): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgVoteWeightedResponse, - ): MsgVoteWeightedResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgVoteWeightedResponse', - value: MsgVoteWeightedResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgVoteWeightedResponseProtoMsg, ): MsgVoteWeightedResponse { @@ -995,37 +726,6 @@ export const MsgDeposit = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgDepositAmino): MsgDeposit { - const message = createBaseMsgDeposit(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgDeposit): MsgDepositAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0'; - obj.depositor = message.depositor === '' ? undefined : message.depositor; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { - return MsgDeposit.fromAmino(object.value); - }, - toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { - return { - type: 'cosmos-sdk/MsgDeposit', - value: MsgDeposit.toAmino(message), - }; - }, fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { return MsgDeposit.decode(message.value); }, @@ -1079,23 +779,6 @@ export const MsgDepositResponse = { const message = createBaseMsgDepositResponse(); return message; }, - fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - const message = createBaseMsgDepositResponse(); - return message; - }, - toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { - return MsgDepositResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgDepositResponse', - value: MsgDepositResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { return MsgDepositResponse.decode(message.value); }, @@ -1145,143 +828,3 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = ( return data; } }; -export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino): Any => { - switch (content.type) { - case 'cosmos-sdk/CommunityPoolSpendProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.encode( - CommunityPoolSpendProposal.fromPartial( - CommunityPoolSpendProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit': - return Any.fromPartial({ - typeUrl: - '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.encode( - CommunityPoolSpendProposalWithDeposit.fromPartial( - CommunityPoolSpendProposalWithDeposit.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/TextProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.gov.v1beta1.TextProposal', - value: TextProposal.encode( - TextProposal.fromPartial(TextProposal.fromAmino(content.value)), - ).finish(), - }); - case 'cosmos-sdk/ParameterChangeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.params.v1beta1.ParameterChangeProposal', - value: ParameterChangeProposal.encode( - ParameterChangeProposal.fromPartial( - ParameterChangeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/SoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.encode( - SoftwareUpgradeProposal.fromPartial( - SoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/CancelSoftwareUpgradeProposal': - return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.encode( - CancelSoftwareUpgradeProposal.fromPartial( - CancelSoftwareUpgradeProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/ClientUpdateProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', - value: ClientUpdateProposal.encode( - ClientUpdateProposal.fromPartial( - ClientUpdateProposal.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/UpgradeProposal': - return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.UpgradeProposal', - value: UpgradeProposal.encode( - UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value)), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return { - type: 'cosmos-sdk/CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.toAmino( - CommunityPoolSpendProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return { - type: 'cosmos-sdk/CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.toAmino( - CommunityPoolSpendProposalWithDeposit.decode( - content.value, - undefined, - ), - ), - }; - case '/cosmos.gov.v1beta1.TextProposal': - return { - type: 'cosmos-sdk/TextProposal', - value: TextProposal.toAmino( - TextProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return { - type: 'cosmos-sdk/ParameterChangeProposal', - value: ParameterChangeProposal.toAmino( - ParameterChangeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.toAmino( - SoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return { - type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.toAmino( - CancelSoftwareUpgradeProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.ClientUpdateProposal': - return { - type: 'cosmos-sdk/ClientUpdateProposal', - value: ClientUpdateProposal.toAmino( - ClientUpdateProposal.decode(content.value, undefined), - ), - }; - case '/ibc.core.client.v1.UpgradeProposal': - return { - type: 'cosmos-sdk/UpgradeProposal', - value: UpgradeProposal.toAmino( - UpgradeProposal.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts index 6810c17109f..fd2577ef7dd 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/events.ts @@ -16,15 +16,6 @@ export interface EventCreateGroupProtoMsg { value: Uint8Array; } /** EventCreateGroup is an event emitted when a group is created. */ -export interface EventCreateGroupAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; -} -export interface EventCreateGroupAminoMsg { - type: 'cosmos-sdk/EventCreateGroup'; - value: EventCreateGroupAmino; -} -/** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroupSDKType { group_id: bigint; } @@ -38,15 +29,6 @@ export interface EventUpdateGroupProtoMsg { value: Uint8Array; } /** EventUpdateGroup is an event emitted when a group is updated. */ -export interface EventUpdateGroupAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; -} -export interface EventUpdateGroupAminoMsg { - type: 'cosmos-sdk/EventUpdateGroup'; - value: EventUpdateGroupAmino; -} -/** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroupSDKType { group_id: bigint; } @@ -60,15 +42,6 @@ export interface EventCreateGroupPolicyProtoMsg { value: Uint8Array; } /** EventCreateGroupPolicy is an event emitted when a group policy is created. */ -export interface EventCreateGroupPolicyAmino { - /** address is the account address of the group policy. */ - address?: string; -} -export interface EventCreateGroupPolicyAminoMsg { - type: 'cosmos-sdk/EventCreateGroupPolicy'; - value: EventCreateGroupPolicyAmino; -} -/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ export interface EventCreateGroupPolicySDKType { address: string; } @@ -82,15 +55,6 @@ export interface EventUpdateGroupPolicyProtoMsg { value: Uint8Array; } /** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ -export interface EventUpdateGroupPolicyAmino { - /** address is the account address of the group policy. */ - address?: string; -} -export interface EventUpdateGroupPolicyAminoMsg { - type: 'cosmos-sdk/EventUpdateGroupPolicy'; - value: EventUpdateGroupPolicyAmino; -} -/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ export interface EventUpdateGroupPolicySDKType { address: string; } @@ -104,15 +68,6 @@ export interface EventSubmitProposalProtoMsg { value: Uint8Array; } /** EventSubmitProposal is an event emitted when a proposal is created. */ -export interface EventSubmitProposalAmino { - /** proposal_id is the unique ID of the proposal. */ - proposal_id?: string; -} -export interface EventSubmitProposalAminoMsg { - type: 'cosmos-sdk/EventSubmitProposal'; - value: EventSubmitProposalAmino; -} -/** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposalSDKType { proposal_id: bigint; } @@ -126,15 +81,6 @@ export interface EventWithdrawProposalProtoMsg { value: Uint8Array; } /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ -export interface EventWithdrawProposalAmino { - /** proposal_id is the unique ID of the proposal. */ - proposal_id?: string; -} -export interface EventWithdrawProposalAminoMsg { - type: 'cosmos-sdk/EventWithdrawProposal'; - value: EventWithdrawProposalAmino; -} -/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposalSDKType { proposal_id: bigint; } @@ -148,15 +94,6 @@ export interface EventVoteProtoMsg { value: Uint8Array; } /** EventVote is an event emitted when a voter votes on a proposal. */ -export interface EventVoteAmino { - /** proposal_id is the unique ID of the proposal. */ - proposal_id?: string; -} -export interface EventVoteAminoMsg { - type: 'cosmos-sdk/EventVote'; - value: EventVoteAmino; -} -/** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVoteSDKType { proposal_id: bigint; } @@ -172,17 +109,6 @@ export interface EventExecProtoMsg { value: Uint8Array; } /** EventExec is an event emitted when a proposal is executed. */ -export interface EventExecAmino { - /** proposal_id is the unique ID of the proposal. */ - proposal_id?: string; - /** result is the proposal execution result. */ - result?: ProposalExecutorResult; -} -export interface EventExecAminoMsg { - type: 'cosmos-sdk/EventExec'; - value: EventExecAmino; -} -/** EventExec is an event emitted when a proposal is executed. */ export interface EventExecSDKType { proposal_id: bigint; result: ProposalExecutorResult; @@ -199,17 +125,6 @@ export interface EventLeaveGroupProtoMsg { value: Uint8Array; } /** EventLeaveGroup is an event emitted when group member leaves the group. */ -export interface EventLeaveGroupAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; - /** address is the account address of the group member. */ - address?: string; -} -export interface EventLeaveGroupAminoMsg { - type: 'cosmos-sdk/EventLeaveGroup'; - value: EventLeaveGroupAmino; -} -/** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroupSDKType { group_id: bigint; address: string; @@ -269,28 +184,6 @@ export const EventCreateGroup = { : BigInt(0); return message; }, - fromAmino(object: EventCreateGroupAmino): EventCreateGroup { - const message = createBaseEventCreateGroup(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - return message; - }, - toAmino(message: EventCreateGroup): EventCreateGroupAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: EventCreateGroupAminoMsg): EventCreateGroup { - return EventCreateGroup.fromAmino(object.value); - }, - toAminoMsg(message: EventCreateGroup): EventCreateGroupAminoMsg { - return { - type: 'cosmos-sdk/EventCreateGroup', - value: EventCreateGroup.toAmino(message), - }; - }, fromProtoMsg(message: EventCreateGroupProtoMsg): EventCreateGroup { return EventCreateGroup.decode(message.value); }, @@ -359,28 +252,6 @@ export const EventUpdateGroup = { : BigInt(0); return message; }, - fromAmino(object: EventUpdateGroupAmino): EventUpdateGroup { - const message = createBaseEventUpdateGroup(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - return message; - }, - toAmino(message: EventUpdateGroup): EventUpdateGroupAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: EventUpdateGroupAminoMsg): EventUpdateGroup { - return EventUpdateGroup.fromAmino(object.value); - }, - toAminoMsg(message: EventUpdateGroup): EventUpdateGroupAminoMsg { - return { - type: 'cosmos-sdk/EventUpdateGroup', - value: EventUpdateGroup.toAmino(message), - }; - }, fromProtoMsg(message: EventUpdateGroupProtoMsg): EventUpdateGroup { return EventUpdateGroup.decode(message.value); }, @@ -446,27 +317,6 @@ export const EventCreateGroupPolicy = { message.address = object.address ?? ''; return message; }, - fromAmino(object: EventCreateGroupPolicyAmino): EventCreateGroupPolicy { - const message = createBaseEventCreateGroupPolicy(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: EventCreateGroupPolicy): EventCreateGroupPolicyAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: EventCreateGroupPolicyAminoMsg): EventCreateGroupPolicy { - return EventCreateGroupPolicy.fromAmino(object.value); - }, - toAminoMsg(message: EventCreateGroupPolicy): EventCreateGroupPolicyAminoMsg { - return { - type: 'cosmos-sdk/EventCreateGroupPolicy', - value: EventCreateGroupPolicy.toAmino(message), - }; - }, fromProtoMsg( message: EventCreateGroupPolicyProtoMsg, ): EventCreateGroupPolicy { @@ -534,27 +384,6 @@ export const EventUpdateGroupPolicy = { message.address = object.address ?? ''; return message; }, - fromAmino(object: EventUpdateGroupPolicyAmino): EventUpdateGroupPolicy { - const message = createBaseEventUpdateGroupPolicy(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: EventUpdateGroupPolicyAminoMsg): EventUpdateGroupPolicy { - return EventUpdateGroupPolicy.fromAmino(object.value); - }, - toAminoMsg(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAminoMsg { - return { - type: 'cosmos-sdk/EventUpdateGroupPolicy', - value: EventUpdateGroupPolicy.toAmino(message), - }; - }, fromProtoMsg( message: EventUpdateGroupPolicyProtoMsg, ): EventUpdateGroupPolicy { @@ -628,30 +457,6 @@ export const EventSubmitProposal = { : BigInt(0); return message; }, - fromAmino(object: EventSubmitProposalAmino): EventSubmitProposal { - const message = createBaseEventSubmitProposal(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: EventSubmitProposal): EventSubmitProposalAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: EventSubmitProposalAminoMsg): EventSubmitProposal { - return EventSubmitProposal.fromAmino(object.value); - }, - toAminoMsg(message: EventSubmitProposal): EventSubmitProposalAminoMsg { - return { - type: 'cosmos-sdk/EventSubmitProposal', - value: EventSubmitProposal.toAmino(message), - }; - }, fromProtoMsg(message: EventSubmitProposalProtoMsg): EventSubmitProposal { return EventSubmitProposal.decode(message.value); }, @@ -723,30 +528,6 @@ export const EventWithdrawProposal = { : BigInt(0); return message; }, - fromAmino(object: EventWithdrawProposalAmino): EventWithdrawProposal { - const message = createBaseEventWithdrawProposal(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: EventWithdrawProposal): EventWithdrawProposalAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: EventWithdrawProposalAminoMsg): EventWithdrawProposal { - return EventWithdrawProposal.fromAmino(object.value); - }, - toAminoMsg(message: EventWithdrawProposal): EventWithdrawProposalAminoMsg { - return { - type: 'cosmos-sdk/EventWithdrawProposal', - value: EventWithdrawProposal.toAmino(message), - }; - }, fromProtoMsg(message: EventWithdrawProposalProtoMsg): EventWithdrawProposal { return EventWithdrawProposal.decode(message.value); }, @@ -815,30 +596,6 @@ export const EventVote = { : BigInt(0); return message; }, - fromAmino(object: EventVoteAmino): EventVote { - const message = createBaseEventVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: EventVote): EventVoteAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: EventVoteAminoMsg): EventVote { - return EventVote.fromAmino(object.value); - }, - toAminoMsg(message: EventVote): EventVoteAminoMsg { - return { - type: 'cosmos-sdk/EventVote', - value: EventVote.toAmino(message), - }; - }, fromProtoMsg(message: EventVoteProtoMsg): EventVote { return EventVote.decode(message.value); }, @@ -920,34 +677,6 @@ export const EventExec = { message.result = object.result ?? 0; return message; }, - fromAmino(object: EventExecAmino): EventExec { - const message = createBaseEventExec(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } - return message; - }, - toAmino(message: EventExec): EventExecAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.result = message.result === 0 ? undefined : message.result; - return obj; - }, - fromAminoMsg(object: EventExecAminoMsg): EventExec { - return EventExec.fromAmino(object.value); - }, - toAminoMsg(message: EventExec): EventExecAminoMsg { - return { - type: 'cosmos-sdk/EventExec', - value: EventExec.toAmino(message), - }; - }, fromProtoMsg(message: EventExecProtoMsg): EventExec { return EventExec.decode(message.value); }, @@ -1026,32 +755,6 @@ export const EventLeaveGroup = { message.address = object.address ?? ''; return message; }, - fromAmino(object: EventLeaveGroupAmino): EventLeaveGroup { - const message = createBaseEventLeaveGroup(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: EventLeaveGroup): EventLeaveGroupAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: EventLeaveGroupAminoMsg): EventLeaveGroup { - return EventLeaveGroup.fromAmino(object.value); - }, - toAminoMsg(message: EventLeaveGroup): EventLeaveGroupAminoMsg { - return { - type: 'cosmos-sdk/EventLeaveGroup', - value: EventLeaveGroup.toAmino(message), - }; - }, fromProtoMsg(message: EventLeaveGroupProtoMsg): EventLeaveGroup { return EventLeaveGroup.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/genesis.ts index 1e5d1f7cf20..a3b21674beb 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/genesis.ts @@ -1,19 +1,14 @@ //@ts-nocheck import { GroupInfo, - GroupInfoAmino, GroupInfoSDKType, GroupMember, - GroupMemberAmino, GroupMemberSDKType, GroupPolicyInfo, - GroupPolicyInfoAmino, GroupPolicyInfoSDKType, Proposal, - ProposalAmino, ProposalSDKType, Vote, - VoteAmino, VoteSDKType, } from './types.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -51,38 +46,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the group module's genesis state. */ -export interface GenesisStateAmino { - /** - * group_seq is the group table orm.Sequence, - * it is used to get the next group ID. - */ - group_seq?: string; - /** groups is the list of groups info. */ - groups?: GroupInfoAmino[]; - /** group_members is the list of groups members. */ - group_members?: GroupMemberAmino[]; - /** - * group_policy_seq is the group policy table orm.Sequence, - * it is used to generate the next group policy account address. - */ - group_policy_seq?: string; - /** group_policies is the list of group policies info. */ - group_policies?: GroupPolicyInfoAmino[]; - /** - * proposal_seq is the proposal table orm.Sequence, - * it is used to get the next proposal ID. - */ - proposal_seq?: string; - /** proposals is the list of proposals. */ - proposals?: ProposalAmino[]; - /** votes is the list of votes. */ - votes?: VoteAmino[]; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the group module's genesis state. */ export interface GenesisStateSDKType { group_seq: bigint; groups: GroupInfoSDKType[]; @@ -275,85 +238,6 @@ export const GenesisState = { message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.group_seq !== undefined && object.group_seq !== null) { - message.groupSeq = BigInt(object.group_seq); - } - message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; - message.groupMembers = - object.group_members?.map(e => GroupMember.fromAmino(e)) || []; - if ( - object.group_policy_seq !== undefined && - object.group_policy_seq !== null - ) { - message.groupPolicySeq = BigInt(object.group_policy_seq); - } - message.groupPolicies = - object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; - if (object.proposal_seq !== undefined && object.proposal_seq !== null) { - message.proposalSeq = BigInt(object.proposal_seq); - } - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.group_seq = - message.groupSeq !== BigInt(0) ? message.groupSeq.toString() : undefined; - if (message.groups) { - obj.groups = message.groups.map(e => - e ? GroupInfo.toAmino(e) : undefined, - ); - } else { - obj.groups = message.groups; - } - if (message.groupMembers) { - obj.group_members = message.groupMembers.map(e => - e ? GroupMember.toAmino(e) : undefined, - ); - } else { - obj.group_members = message.groupMembers; - } - obj.group_policy_seq = - message.groupPolicySeq !== BigInt(0) - ? message.groupPolicySeq.toString() - : undefined; - if (message.groupPolicies) { - obj.group_policies = message.groupPolicies.map(e => - e ? GroupPolicyInfo.toAmino(e) : undefined, - ); - } else { - obj.group_policies = message.groupPolicies; - } - obj.proposal_seq = - message.proposalSeq !== BigInt(0) - ? message.proposalSeq.toString() - : undefined; - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.rpc.Query.ts deleted file mode 100644 index b0a1e349c59..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.rpc.Query.ts +++ /dev/null @@ -1,330 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryGroupInfoRequest, - QueryGroupInfoResponse, - QueryGroupPolicyInfoRequest, - QueryGroupPolicyInfoResponse, - QueryGroupMembersRequest, - QueryGroupMembersResponse, - QueryGroupsByAdminRequest, - QueryGroupsByAdminResponse, - QueryGroupPoliciesByGroupRequest, - QueryGroupPoliciesByGroupResponse, - QueryGroupPoliciesByAdminRequest, - QueryGroupPoliciesByAdminResponse, - QueryProposalRequest, - QueryProposalResponse, - QueryProposalsByGroupPolicyRequest, - QueryProposalsByGroupPolicyResponse, - QueryVoteByProposalVoterRequest, - QueryVoteByProposalVoterResponse, - QueryVotesByProposalRequest, - QueryVotesByProposalResponse, - QueryVotesByVoterRequest, - QueryVotesByVoterResponse, - QueryGroupsByMemberRequest, - QueryGroupsByMemberResponse, - QueryTallyResultRequest, - QueryTallyResultResponse, -} from './query.js'; -/** Query is the cosmos.group.v1 Query service. */ -export interface Query { - /** GroupInfo queries group info based on group id. */ - groupInfo(request: QueryGroupInfoRequest): Promise; - /** GroupPolicyInfo queries group policy info based on account address of group policy. */ - groupPolicyInfo( - request: QueryGroupPolicyInfoRequest, - ): Promise; - /** GroupMembers queries members of a group */ - groupMembers( - request: QueryGroupMembersRequest, - ): Promise; - /** GroupsByAdmin queries groups by admin address. */ - groupsByAdmin( - request: QueryGroupsByAdminRequest, - ): Promise; - /** GroupPoliciesByGroup queries group policies by group id. */ - groupPoliciesByGroup( - request: QueryGroupPoliciesByGroupRequest, - ): Promise; - /** GroupsByAdmin queries group policies by admin address. */ - groupPoliciesByAdmin( - request: QueryGroupPoliciesByAdminRequest, - ): Promise; - /** Proposal queries a proposal based on proposal id. */ - proposal(request: QueryProposalRequest): Promise; - /** ProposalsByGroupPolicy queries proposals based on account address of group policy. */ - proposalsByGroupPolicy( - request: QueryProposalsByGroupPolicyRequest, - ): Promise; - /** VoteByProposalVoter queries a vote by proposal id and voter. */ - voteByProposalVoter( - request: QueryVoteByProposalVoterRequest, - ): Promise; - /** VotesByProposal queries a vote by proposal. */ - votesByProposal( - request: QueryVotesByProposalRequest, - ): Promise; - /** VotesByVoter queries a vote by voter. */ - votesByVoter( - request: QueryVotesByVoterRequest, - ): Promise; - /** GroupsByMember queries groups by member address. */ - groupsByMember( - request: QueryGroupsByMemberRequest, - ): Promise; - /** TallyResult queries the tally of a proposal votes. */ - tallyResult( - request: QueryTallyResultRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.groupInfo = this.groupInfo.bind(this); - this.groupPolicyInfo = this.groupPolicyInfo.bind(this); - this.groupMembers = this.groupMembers.bind(this); - this.groupsByAdmin = this.groupsByAdmin.bind(this); - this.groupPoliciesByGroup = this.groupPoliciesByGroup.bind(this); - this.groupPoliciesByAdmin = this.groupPoliciesByAdmin.bind(this); - this.proposal = this.proposal.bind(this); - this.proposalsByGroupPolicy = this.proposalsByGroupPolicy.bind(this); - this.voteByProposalVoter = this.voteByProposalVoter.bind(this); - this.votesByProposal = this.votesByProposal.bind(this); - this.votesByVoter = this.votesByVoter.bind(this); - this.groupsByMember = this.groupsByMember.bind(this); - this.tallyResult = this.tallyResult.bind(this); - } - groupInfo(request: QueryGroupInfoRequest): Promise { - const data = QueryGroupInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupInfo', - data, - ); - return promise.then(data => - QueryGroupInfoResponse.decode(new BinaryReader(data)), - ); - } - groupPolicyInfo( - request: QueryGroupPolicyInfoRequest, - ): Promise { - const data = QueryGroupPolicyInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupPolicyInfo', - data, - ); - return promise.then(data => - QueryGroupPolicyInfoResponse.decode(new BinaryReader(data)), - ); - } - groupMembers( - request: QueryGroupMembersRequest, - ): Promise { - const data = QueryGroupMembersRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupMembers', - data, - ); - return promise.then(data => - QueryGroupMembersResponse.decode(new BinaryReader(data)), - ); - } - groupsByAdmin( - request: QueryGroupsByAdminRequest, - ): Promise { - const data = QueryGroupsByAdminRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupsByAdmin', - data, - ); - return promise.then(data => - QueryGroupsByAdminResponse.decode(new BinaryReader(data)), - ); - } - groupPoliciesByGroup( - request: QueryGroupPoliciesByGroupRequest, - ): Promise { - const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupPoliciesByGroup', - data, - ); - return promise.then(data => - QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data)), - ); - } - groupPoliciesByAdmin( - request: QueryGroupPoliciesByAdminRequest, - ): Promise { - const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupPoliciesByAdmin', - data, - ); - return promise.then(data => - QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data)), - ); - } - proposal(request: QueryProposalRequest): Promise { - const data = QueryProposalRequest.encode(request).finish(); - const promise = this.rpc.request('cosmos.group.v1.Query', 'Proposal', data); - return promise.then(data => - QueryProposalResponse.decode(new BinaryReader(data)), - ); - } - proposalsByGroupPolicy( - request: QueryProposalsByGroupPolicyRequest, - ): Promise { - const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'ProposalsByGroupPolicy', - data, - ); - return promise.then(data => - QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data)), - ); - } - voteByProposalVoter( - request: QueryVoteByProposalVoterRequest, - ): Promise { - const data = QueryVoteByProposalVoterRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'VoteByProposalVoter', - data, - ); - return promise.then(data => - QueryVoteByProposalVoterResponse.decode(new BinaryReader(data)), - ); - } - votesByProposal( - request: QueryVotesByProposalRequest, - ): Promise { - const data = QueryVotesByProposalRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'VotesByProposal', - data, - ); - return promise.then(data => - QueryVotesByProposalResponse.decode(new BinaryReader(data)), - ); - } - votesByVoter( - request: QueryVotesByVoterRequest, - ): Promise { - const data = QueryVotesByVoterRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'VotesByVoter', - data, - ); - return promise.then(data => - QueryVotesByVoterResponse.decode(new BinaryReader(data)), - ); - } - groupsByMember( - request: QueryGroupsByMemberRequest, - ): Promise { - const data = QueryGroupsByMemberRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'GroupsByMember', - data, - ); - return promise.then(data => - QueryGroupsByMemberResponse.decode(new BinaryReader(data)), - ); - } - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - const data = QueryTallyResultRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Query', - 'TallyResult', - data, - ); - return promise.then(data => - QueryTallyResultResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - groupInfo(request: QueryGroupInfoRequest): Promise { - return queryService.groupInfo(request); - }, - groupPolicyInfo( - request: QueryGroupPolicyInfoRequest, - ): Promise { - return queryService.groupPolicyInfo(request); - }, - groupMembers( - request: QueryGroupMembersRequest, - ): Promise { - return queryService.groupMembers(request); - }, - groupsByAdmin( - request: QueryGroupsByAdminRequest, - ): Promise { - return queryService.groupsByAdmin(request); - }, - groupPoliciesByGroup( - request: QueryGroupPoliciesByGroupRequest, - ): Promise { - return queryService.groupPoliciesByGroup(request); - }, - groupPoliciesByAdmin( - request: QueryGroupPoliciesByAdminRequest, - ): Promise { - return queryService.groupPoliciesByAdmin(request); - }, - proposal(request: QueryProposalRequest): Promise { - return queryService.proposal(request); - }, - proposalsByGroupPolicy( - request: QueryProposalsByGroupPolicyRequest, - ): Promise { - return queryService.proposalsByGroupPolicy(request); - }, - voteByProposalVoter( - request: QueryVoteByProposalVoterRequest, - ): Promise { - return queryService.voteByProposalVoter(request); - }, - votesByProposal( - request: QueryVotesByProposalRequest, - ): Promise { - return queryService.votesByProposal(request); - }, - votesByVoter( - request: QueryVotesByVoterRequest, - ): Promise { - return queryService.votesByVoter(request); - }, - groupsByMember( - request: QueryGroupsByMemberRequest, - ): Promise { - return queryService.groupsByMember(request); - }, - tallyResult( - request: QueryTallyResultRequest, - ): Promise { - return queryService.tallyResult(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts index ccfe0339131..dd639469481 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts @@ -1,30 +1,22 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { GroupInfo, - GroupInfoAmino, GroupInfoSDKType, GroupPolicyInfo, - GroupPolicyInfoAmino, GroupPolicyInfoSDKType, GroupMember, - GroupMemberAmino, GroupMemberSDKType, Proposal, - ProposalAmino, ProposalSDKType, Vote, - VoteAmino, VoteSDKType, TallyResult, - TallyResultAmino, TallyResultSDKType, } from './types.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -39,15 +31,6 @@ export interface QueryGroupInfoRequestProtoMsg { value: Uint8Array; } /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ -export interface QueryGroupInfoRequestAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; -} -export interface QueryGroupInfoRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupInfoRequest'; - value: QueryGroupInfoRequestAmino; -} -/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequestSDKType { group_id: bigint; } @@ -61,15 +44,6 @@ export interface QueryGroupInfoResponseProtoMsg { value: Uint8Array; } /** QueryGroupInfoResponse is the Query/GroupInfo response type. */ -export interface QueryGroupInfoResponseAmino { - /** info is the GroupInfo for the group. */ - info?: GroupInfoAmino; -} -export interface QueryGroupInfoResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupInfoResponse'; - value: QueryGroupInfoResponseAmino; -} -/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ export interface QueryGroupInfoResponseSDKType { info?: GroupInfoSDKType; } @@ -83,15 +57,6 @@ export interface QueryGroupPolicyInfoRequestProtoMsg { value: Uint8Array; } /** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ -export interface QueryGroupPolicyInfoRequestAmino { - /** address is the account address of the group policy. */ - address?: string; -} -export interface QueryGroupPolicyInfoRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupPolicyInfoRequest'; - value: QueryGroupPolicyInfoRequestAmino; -} -/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ export interface QueryGroupPolicyInfoRequestSDKType { address: string; } @@ -105,15 +70,6 @@ export interface QueryGroupPolicyInfoResponseProtoMsg { value: Uint8Array; } /** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ -export interface QueryGroupPolicyInfoResponseAmino { - /** info is the GroupPolicyInfo for the group policy. */ - info?: GroupPolicyInfoAmino; -} -export interface QueryGroupPolicyInfoResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupPolicyInfoResponse'; - value: QueryGroupPolicyInfoResponseAmino; -} -/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ export interface QueryGroupPolicyInfoResponseSDKType { info?: GroupPolicyInfoSDKType; } @@ -129,17 +85,6 @@ export interface QueryGroupMembersRequestProtoMsg { value: Uint8Array; } /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ -export interface QueryGroupMembersRequestAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGroupMembersRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupMembersRequest'; - value: QueryGroupMembersRequestAmino; -} -/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequestSDKType { group_id: bigint; pagination?: PageRequestSDKType; @@ -156,17 +101,6 @@ export interface QueryGroupMembersResponseProtoMsg { value: Uint8Array; } /** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ -export interface QueryGroupMembersResponseAmino { - /** members are the members of the group with given group_id. */ - members?: GroupMemberAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGroupMembersResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupMembersResponse'; - value: QueryGroupMembersResponseAmino; -} -/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ export interface QueryGroupMembersResponseSDKType { members: GroupMemberSDKType[]; pagination?: PageResponseSDKType; @@ -183,17 +117,6 @@ export interface QueryGroupsByAdminRequestProtoMsg { value: Uint8Array; } /** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ -export interface QueryGroupsByAdminRequestAmino { - /** admin is the account address of a group's admin. */ - admin?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGroupsByAdminRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupsByAdminRequest'; - value: QueryGroupsByAdminRequestAmino; -} -/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ export interface QueryGroupsByAdminRequestSDKType { admin: string; pagination?: PageRequestSDKType; @@ -210,17 +133,6 @@ export interface QueryGroupsByAdminResponseProtoMsg { value: Uint8Array; } /** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ -export interface QueryGroupsByAdminResponseAmino { - /** groups are the groups info with the provided admin. */ - groups?: GroupInfoAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGroupsByAdminResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupsByAdminResponse'; - value: QueryGroupsByAdminResponseAmino; -} -/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ export interface QueryGroupsByAdminResponseSDKType { groups: GroupInfoSDKType[]; pagination?: PageResponseSDKType; @@ -237,17 +149,6 @@ export interface QueryGroupPoliciesByGroupRequestProtoMsg { value: Uint8Array; } /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ -export interface QueryGroupPoliciesByGroupRequestAmino { - /** group_id is the unique ID of the group policy's group. */ - group_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGroupPoliciesByGroupRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupPoliciesByGroupRequest'; - value: QueryGroupPoliciesByGroupRequestAmino; -} -/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequestSDKType { group_id: bigint; pagination?: PageRequestSDKType; @@ -264,17 +165,6 @@ export interface QueryGroupPoliciesByGroupResponseProtoMsg { value: Uint8Array; } /** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ -export interface QueryGroupPoliciesByGroupResponseAmino { - /** group_policies are the group policies info associated with the provided group. */ - group_policies?: GroupPolicyInfoAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGroupPoliciesByGroupResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupPoliciesByGroupResponse'; - value: QueryGroupPoliciesByGroupResponseAmino; -} -/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ export interface QueryGroupPoliciesByGroupResponseSDKType { group_policies: GroupPolicyInfoSDKType[]; pagination?: PageResponseSDKType; @@ -291,17 +181,6 @@ export interface QueryGroupPoliciesByAdminRequestProtoMsg { value: Uint8Array; } /** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ -export interface QueryGroupPoliciesByAdminRequestAmino { - /** admin is the admin address of the group policy. */ - admin?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGroupPoliciesByAdminRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupPoliciesByAdminRequest'; - value: QueryGroupPoliciesByAdminRequestAmino; -} -/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ export interface QueryGroupPoliciesByAdminRequestSDKType { admin: string; pagination?: PageRequestSDKType; @@ -318,17 +197,6 @@ export interface QueryGroupPoliciesByAdminResponseProtoMsg { value: Uint8Array; } /** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ -export interface QueryGroupPoliciesByAdminResponseAmino { - /** group_policies are the group policies info with provided admin. */ - group_policies?: GroupPolicyInfoAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGroupPoliciesByAdminResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupPoliciesByAdminResponse'; - value: QueryGroupPoliciesByAdminResponseAmino; -} -/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ export interface QueryGroupPoliciesByAdminResponseSDKType { group_policies: GroupPolicyInfoSDKType[]; pagination?: PageResponseSDKType; @@ -343,15 +211,6 @@ export interface QueryProposalRequestProtoMsg { value: Uint8Array; } /** QueryProposalRequest is the Query/Proposal request type. */ -export interface QueryProposalRequestAmino { - /** proposal_id is the unique ID of a proposal. */ - proposal_id?: string; -} -export interface QueryProposalRequestAminoMsg { - type: 'cosmos-sdk/QueryProposalRequest'; - value: QueryProposalRequestAmino; -} -/** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequestSDKType { proposal_id: bigint; } @@ -365,15 +224,6 @@ export interface QueryProposalResponseProtoMsg { value: Uint8Array; } /** QueryProposalResponse is the Query/Proposal response type. */ -export interface QueryProposalResponseAmino { - /** proposal is the proposal info. */ - proposal?: ProposalAmino; -} -export interface QueryProposalResponseAminoMsg { - type: 'cosmos-sdk/QueryProposalResponse'; - value: QueryProposalResponseAmino; -} -/** QueryProposalResponse is the Query/Proposal response type. */ export interface QueryProposalResponseSDKType { proposal?: ProposalSDKType; } @@ -389,17 +239,6 @@ export interface QueryProposalsByGroupPolicyRequestProtoMsg { value: Uint8Array; } /** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ -export interface QueryProposalsByGroupPolicyRequestAmino { - /** address is the account address of the group policy related to proposals. */ - address?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryProposalsByGroupPolicyRequestAminoMsg { - type: 'cosmos-sdk/QueryProposalsByGroupPolicyRequest'; - value: QueryProposalsByGroupPolicyRequestAmino; -} -/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ export interface QueryProposalsByGroupPolicyRequestSDKType { address: string; pagination?: PageRequestSDKType; @@ -416,17 +255,6 @@ export interface QueryProposalsByGroupPolicyResponseProtoMsg { value: Uint8Array; } /** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ -export interface QueryProposalsByGroupPolicyResponseAmino { - /** proposals are the proposals with given group policy. */ - proposals?: ProposalAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryProposalsByGroupPolicyResponseAminoMsg { - type: 'cosmos-sdk/QueryProposalsByGroupPolicyResponse'; - value: QueryProposalsByGroupPolicyResponseAmino; -} -/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ export interface QueryProposalsByGroupPolicyResponseSDKType { proposals: ProposalSDKType[]; pagination?: PageResponseSDKType; @@ -443,17 +271,6 @@ export interface QueryVoteByProposalVoterRequestProtoMsg { value: Uint8Array; } /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ -export interface QueryVoteByProposalVoterRequestAmino { - /** proposal_id is the unique ID of a proposal. */ - proposal_id?: string; - /** voter is a proposal voter account address. */ - voter?: string; -} -export interface QueryVoteByProposalVoterRequestAminoMsg { - type: 'cosmos-sdk/QueryVoteByProposalVoterRequest'; - value: QueryVoteByProposalVoterRequestAmino; -} -/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequestSDKType { proposal_id: bigint; voter: string; @@ -468,15 +285,6 @@ export interface QueryVoteByProposalVoterResponseProtoMsg { value: Uint8Array; } /** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ -export interface QueryVoteByProposalVoterResponseAmino { - /** vote is the vote with given proposal_id and voter. */ - vote?: VoteAmino; -} -export interface QueryVoteByProposalVoterResponseAminoMsg { - type: 'cosmos-sdk/QueryVoteByProposalVoterResponse'; - value: QueryVoteByProposalVoterResponseAmino; -} -/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ export interface QueryVoteByProposalVoterResponseSDKType { vote?: VoteSDKType; } @@ -492,17 +300,6 @@ export interface QueryVotesByProposalRequestProtoMsg { value: Uint8Array; } /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ -export interface QueryVotesByProposalRequestAmino { - /** proposal_id is the unique ID of a proposal. */ - proposal_id?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryVotesByProposalRequestAminoMsg { - type: 'cosmos-sdk/QueryVotesByProposalRequest'; - value: QueryVotesByProposalRequestAmino; -} -/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequestSDKType { proposal_id: bigint; pagination?: PageRequestSDKType; @@ -519,17 +316,6 @@ export interface QueryVotesByProposalResponseProtoMsg { value: Uint8Array; } /** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ -export interface QueryVotesByProposalResponseAmino { - /** votes are the list of votes for given proposal_id. */ - votes?: VoteAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryVotesByProposalResponseAminoMsg { - type: 'cosmos-sdk/QueryVotesByProposalResponse'; - value: QueryVotesByProposalResponseAmino; -} -/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ export interface QueryVotesByProposalResponseSDKType { votes: VoteSDKType[]; pagination?: PageResponseSDKType; @@ -546,17 +332,6 @@ export interface QueryVotesByVoterRequestProtoMsg { value: Uint8Array; } /** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ -export interface QueryVotesByVoterRequestAmino { - /** voter is a proposal voter account address. */ - voter?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryVotesByVoterRequestAminoMsg { - type: 'cosmos-sdk/QueryVotesByVoterRequest'; - value: QueryVotesByVoterRequestAmino; -} -/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ export interface QueryVotesByVoterRequestSDKType { voter: string; pagination?: PageRequestSDKType; @@ -573,17 +348,6 @@ export interface QueryVotesByVoterResponseProtoMsg { value: Uint8Array; } /** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ -export interface QueryVotesByVoterResponseAmino { - /** votes are the list of votes by given voter. */ - votes?: VoteAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryVotesByVoterResponseAminoMsg { - type: 'cosmos-sdk/QueryVotesByVoterResponse'; - value: QueryVotesByVoterResponseAmino; -} -/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ export interface QueryVotesByVoterResponseSDKType { votes: VoteSDKType[]; pagination?: PageResponseSDKType; @@ -600,17 +364,6 @@ export interface QueryGroupsByMemberRequestProtoMsg { value: Uint8Array; } /** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ -export interface QueryGroupsByMemberRequestAmino { - /** address is the group member address. */ - address?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryGroupsByMemberRequestAminoMsg { - type: 'cosmos-sdk/QueryGroupsByMemberRequest'; - value: QueryGroupsByMemberRequestAmino; -} -/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ export interface QueryGroupsByMemberRequestSDKType { address: string; pagination?: PageRequestSDKType; @@ -627,17 +380,6 @@ export interface QueryGroupsByMemberResponseProtoMsg { value: Uint8Array; } /** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ -export interface QueryGroupsByMemberResponseAmino { - /** groups are the groups info with the provided group member. */ - groups?: GroupInfoAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryGroupsByMemberResponseAminoMsg { - type: 'cosmos-sdk/QueryGroupsByMemberResponse'; - value: QueryGroupsByMemberResponseAmino; -} -/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ export interface QueryGroupsByMemberResponseSDKType { groups: GroupInfoSDKType[]; pagination?: PageResponseSDKType; @@ -652,15 +394,6 @@ export interface QueryTallyResultRequestProtoMsg { value: Uint8Array; } /** QueryTallyResultRequest is the Query/TallyResult request type. */ -export interface QueryTallyResultRequestAmino { - /** proposal_id is the unique id of a proposal. */ - proposal_id?: string; -} -export interface QueryTallyResultRequestAminoMsg { - type: 'cosmos-sdk/QueryTallyResultRequest'; - value: QueryTallyResultRequestAmino; -} -/** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequestSDKType { proposal_id: bigint; } @@ -674,15 +407,6 @@ export interface QueryTallyResultResponseProtoMsg { value: Uint8Array; } /** QueryTallyResultResponse is the Query/TallyResult response type. */ -export interface QueryTallyResultResponseAmino { - /** tally defines the requested tally. */ - tally?: TallyResultAmino; -} -export interface QueryTallyResultResponseAminoMsg { - type: 'cosmos-sdk/QueryTallyResultResponse'; - value: QueryTallyResultResponseAmino; -} -/** QueryTallyResultResponse is the Query/TallyResult response type. */ export interface QueryTallyResultResponseSDKType { tally: TallyResultSDKType; } @@ -744,28 +468,6 @@ export const QueryGroupInfoRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryGroupInfoRequestAmino): QueryGroupInfoRequest { - const message = createBaseQueryGroupInfoRequest(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - return message; - }, - toAmino(message: QueryGroupInfoRequest): QueryGroupInfoRequestAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: QueryGroupInfoRequestAminoMsg): QueryGroupInfoRequest { - return QueryGroupInfoRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryGroupInfoRequest): QueryGroupInfoRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupInfoRequest', - value: QueryGroupInfoRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryGroupInfoRequestProtoMsg): QueryGroupInfoRequest { return QueryGroupInfoRequest.decode(message.value); }, @@ -835,27 +537,6 @@ export const QueryGroupInfoResponse = { : undefined; return message; }, - fromAmino(object: QueryGroupInfoResponseAmino): QueryGroupInfoResponse { - const message = createBaseQueryGroupInfoResponse(); - if (object.info !== undefined && object.info !== null) { - message.info = GroupInfo.fromAmino(object.info); - } - return message; - }, - toAmino(message: QueryGroupInfoResponse): QueryGroupInfoResponseAmino { - const obj: any = {}; - obj.info = message.info ? GroupInfo.toAmino(message.info) : undefined; - return obj; - }, - fromAminoMsg(object: QueryGroupInfoResponseAminoMsg): QueryGroupInfoResponse { - return QueryGroupInfoResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryGroupInfoResponse): QueryGroupInfoResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupInfoResponse', - value: QueryGroupInfoResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupInfoResponseProtoMsg, ): QueryGroupInfoResponse { @@ -925,35 +606,6 @@ export const QueryGroupPolicyInfoRequest = { message.address = object.address ?? ''; return message; }, - fromAmino( - object: QueryGroupPolicyInfoRequestAmino, - ): QueryGroupPolicyInfoRequest { - const message = createBaseQueryGroupPolicyInfoRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino( - message: QueryGroupPolicyInfoRequest, - ): QueryGroupPolicyInfoRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg( - object: QueryGroupPolicyInfoRequestAminoMsg, - ): QueryGroupPolicyInfoRequest { - return QueryGroupPolicyInfoRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPolicyInfoRequest, - ): QueryGroupPolicyInfoRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPolicyInfoRequest', - value: QueryGroupPolicyInfoRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupPolicyInfoRequestProtoMsg, ): QueryGroupPolicyInfoRequest { @@ -1033,35 +685,6 @@ export const QueryGroupPolicyInfoResponse = { : undefined; return message; }, - fromAmino( - object: QueryGroupPolicyInfoResponseAmino, - ): QueryGroupPolicyInfoResponse { - const message = createBaseQueryGroupPolicyInfoResponse(); - if (object.info !== undefined && object.info !== null) { - message.info = GroupPolicyInfo.fromAmino(object.info); - } - return message; - }, - toAmino( - message: QueryGroupPolicyInfoResponse, - ): QueryGroupPolicyInfoResponseAmino { - const obj: any = {}; - obj.info = message.info ? GroupPolicyInfo.toAmino(message.info) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupPolicyInfoResponseAminoMsg, - ): QueryGroupPolicyInfoResponse { - return QueryGroupPolicyInfoResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPolicyInfoResponse, - ): QueryGroupPolicyInfoResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPolicyInfoResponse', - value: QueryGroupPolicyInfoResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupPolicyInfoResponseProtoMsg, ): QueryGroupPolicyInfoResponse { @@ -1157,38 +780,6 @@ export const QueryGroupMembersRequest = { : undefined; return message; }, - fromAmino(object: QueryGroupMembersRequestAmino): QueryGroupMembersRequest { - const message = createBaseQueryGroupMembersRequest(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGroupMembersRequest): QueryGroupMembersRequestAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupMembersRequestAminoMsg, - ): QueryGroupMembersRequest { - return QueryGroupMembersRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupMembersRequest, - ): QueryGroupMembersRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupMembersRequest', - value: QueryGroupMembersRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupMembersRequestProtoMsg, ): QueryGroupMembersRequest { @@ -1290,41 +881,6 @@ export const QueryGroupMembersResponse = { : undefined; return message; }, - fromAmino(object: QueryGroupMembersResponseAmino): QueryGroupMembersResponse { - const message = createBaseQueryGroupMembersResponse(); - message.members = object.members?.map(e => GroupMember.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGroupMembersResponse): QueryGroupMembersResponseAmino { - const obj: any = {}; - if (message.members) { - obj.members = message.members.map(e => - e ? GroupMember.toAmino(e) : undefined, - ); - } else { - obj.members = message.members; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupMembersResponseAminoMsg, - ): QueryGroupMembersResponse { - return QueryGroupMembersResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupMembersResponse, - ): QueryGroupMembersResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupMembersResponse', - value: QueryGroupMembersResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupMembersResponseProtoMsg, ): QueryGroupMembersResponse { @@ -1414,37 +970,6 @@ export const QueryGroupsByAdminRequest = { : undefined; return message; }, - fromAmino(object: QueryGroupsByAdminRequestAmino): QueryGroupsByAdminRequest { - const message = createBaseQueryGroupsByAdminRequest(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupsByAdminRequestAminoMsg, - ): QueryGroupsByAdminRequest { - return QueryGroupsByAdminRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupsByAdminRequest, - ): QueryGroupsByAdminRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupsByAdminRequest', - value: QueryGroupsByAdminRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupsByAdminRequestProtoMsg, ): QueryGroupsByAdminRequest { @@ -1545,45 +1070,6 @@ export const QueryGroupsByAdminResponse = { : undefined; return message; }, - fromAmino( - object: QueryGroupsByAdminResponseAmino, - ): QueryGroupsByAdminResponse { - const message = createBaseQueryGroupsByAdminResponse(); - message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupsByAdminResponse, - ): QueryGroupsByAdminResponseAmino { - const obj: any = {}; - if (message.groups) { - obj.groups = message.groups.map(e => - e ? GroupInfo.toAmino(e) : undefined, - ); - } else { - obj.groups = message.groups; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupsByAdminResponseAminoMsg, - ): QueryGroupsByAdminResponse { - return QueryGroupsByAdminResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupsByAdminResponse, - ): QueryGroupsByAdminResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupsByAdminResponse', - value: QueryGroupsByAdminResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupsByAdminResponseProtoMsg, ): QueryGroupsByAdminResponse { @@ -1679,42 +1165,6 @@ export const QueryGroupPoliciesByGroupRequest = { : undefined; return message; }, - fromAmino( - object: QueryGroupPoliciesByGroupRequestAmino, - ): QueryGroupPoliciesByGroupRequest { - const message = createBaseQueryGroupPoliciesByGroupRequest(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupPoliciesByGroupRequest, - ): QueryGroupPoliciesByGroupRequestAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupPoliciesByGroupRequestAminoMsg, - ): QueryGroupPoliciesByGroupRequest { - return QueryGroupPoliciesByGroupRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPoliciesByGroupRequest, - ): QueryGroupPoliciesByGroupRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPoliciesByGroupRequest', - value: QueryGroupPoliciesByGroupRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupPoliciesByGroupRequestProtoMsg, ): QueryGroupPoliciesByGroupRequest { @@ -1816,47 +1266,7 @@ export const QueryGroupPoliciesByGroupResponse = { object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - fromAmino( - object: QueryGroupPoliciesByGroupResponseAmino, - ): QueryGroupPoliciesByGroupResponse { - const message = createBaseQueryGroupPoliciesByGroupResponse(); - message.groupPolicies = - object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupPoliciesByGroupResponse, - ): QueryGroupPoliciesByGroupResponseAmino { - const obj: any = {}; - if (message.groupPolicies) { - obj.group_policies = message.groupPolicies.map(e => - e ? GroupPolicyInfo.toAmino(e) : undefined, - ); - } else { - obj.group_policies = message.groupPolicies; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupPoliciesByGroupResponseAminoMsg, - ): QueryGroupPoliciesByGroupResponse { - return QueryGroupPoliciesByGroupResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPoliciesByGroupResponse, - ): QueryGroupPoliciesByGroupResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPoliciesByGroupResponse', - value: QueryGroupPoliciesByGroupResponse.toAmino(message), - }; + return message; }, fromProtoMsg( message: QueryGroupPoliciesByGroupResponseProtoMsg, @@ -1947,41 +1357,6 @@ export const QueryGroupPoliciesByAdminRequest = { : undefined; return message; }, - fromAmino( - object: QueryGroupPoliciesByAdminRequestAmino, - ): QueryGroupPoliciesByAdminRequest { - const message = createBaseQueryGroupPoliciesByAdminRequest(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupPoliciesByAdminRequest, - ): QueryGroupPoliciesByAdminRequestAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupPoliciesByAdminRequestAminoMsg, - ): QueryGroupPoliciesByAdminRequest { - return QueryGroupPoliciesByAdminRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPoliciesByAdminRequest, - ): QueryGroupPoliciesByAdminRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPoliciesByAdminRequest', - value: QueryGroupPoliciesByAdminRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupPoliciesByAdminRequestProtoMsg, ): QueryGroupPoliciesByAdminRequest { @@ -2085,46 +1460,6 @@ export const QueryGroupPoliciesByAdminResponse = { : undefined; return message; }, - fromAmino( - object: QueryGroupPoliciesByAdminResponseAmino, - ): QueryGroupPoliciesByAdminResponse { - const message = createBaseQueryGroupPoliciesByAdminResponse(); - message.groupPolicies = - object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupPoliciesByAdminResponse, - ): QueryGroupPoliciesByAdminResponseAmino { - const obj: any = {}; - if (message.groupPolicies) { - obj.group_policies = message.groupPolicies.map(e => - e ? GroupPolicyInfo.toAmino(e) : undefined, - ); - } else { - obj.group_policies = message.groupPolicies; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupPoliciesByAdminResponseAminoMsg, - ): QueryGroupPoliciesByAdminResponse { - return QueryGroupPoliciesByAdminResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupPoliciesByAdminResponse, - ): QueryGroupPoliciesByAdminResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupPoliciesByAdminResponse', - value: QueryGroupPoliciesByAdminResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupPoliciesByAdminResponseProtoMsg, ): QueryGroupPoliciesByAdminResponse { @@ -2200,30 +1535,6 @@ export const QueryProposalRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - const message = createBaseQueryProposalRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { - return QueryProposalRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalRequest', - value: QueryProposalRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { return QueryProposalRequest.decode(message.value); }, @@ -2297,29 +1608,6 @@ export const QueryProposalResponse = { : undefined; return message; }, - fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - const message = createBaseQueryProposalResponse(); - if (object.proposal !== undefined && object.proposal !== null) { - message.proposal = Proposal.fromAmino(object.proposal); - } - return message; - }, - toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { - const obj: any = {}; - obj.proposal = message.proposal - ? Proposal.toAmino(message.proposal) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { - return QueryProposalResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalResponse', - value: QueryProposalResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { return QueryProposalResponse.decode(message.value); }, @@ -2405,41 +1693,6 @@ export const QueryProposalsByGroupPolicyRequest = { : undefined; return message; }, - fromAmino( - object: QueryProposalsByGroupPolicyRequestAmino, - ): QueryProposalsByGroupPolicyRequest { - const message = createBaseQueryProposalsByGroupPolicyRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryProposalsByGroupPolicyRequest, - ): QueryProposalsByGroupPolicyRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryProposalsByGroupPolicyRequestAminoMsg, - ): QueryProposalsByGroupPolicyRequest { - return QueryProposalsByGroupPolicyRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryProposalsByGroupPolicyRequest, - ): QueryProposalsByGroupPolicyRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalsByGroupPolicyRequest', - value: QueryProposalsByGroupPolicyRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryProposalsByGroupPolicyRequestProtoMsg, ): QueryProposalsByGroupPolicyRequest { @@ -2541,45 +1794,6 @@ export const QueryProposalsByGroupPolicyResponse = { : undefined; return message; }, - fromAmino( - object: QueryProposalsByGroupPolicyResponseAmino, - ): QueryProposalsByGroupPolicyResponse { - const message = createBaseQueryProposalsByGroupPolicyResponse(); - message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryProposalsByGroupPolicyResponse, - ): QueryProposalsByGroupPolicyResponseAmino { - const obj: any = {}; - if (message.proposals) { - obj.proposals = message.proposals.map(e => - e ? Proposal.toAmino(e) : undefined, - ); - } else { - obj.proposals = message.proposals; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryProposalsByGroupPolicyResponseAminoMsg, - ): QueryProposalsByGroupPolicyResponse { - return QueryProposalsByGroupPolicyResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryProposalsByGroupPolicyResponse, - ): QueryProposalsByGroupPolicyResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryProposalsByGroupPolicyResponse', - value: QueryProposalsByGroupPolicyResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryProposalsByGroupPolicyResponseProtoMsg, ): QueryProposalsByGroupPolicyResponse { @@ -2667,42 +1881,6 @@ export const QueryVoteByProposalVoterRequest = { message.voter = object.voter ?? ''; return message; }, - fromAmino( - object: QueryVoteByProposalVoterRequestAmino, - ): QueryVoteByProposalVoterRequest { - const message = createBaseQueryVoteByProposalVoterRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - return message; - }, - toAmino( - message: QueryVoteByProposalVoterRequest, - ): QueryVoteByProposalVoterRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - return obj; - }, - fromAminoMsg( - object: QueryVoteByProposalVoterRequestAminoMsg, - ): QueryVoteByProposalVoterRequest { - return QueryVoteByProposalVoterRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVoteByProposalVoterRequest, - ): QueryVoteByProposalVoterRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryVoteByProposalVoterRequest', - value: QueryVoteByProposalVoterRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryVoteByProposalVoterRequestProtoMsg, ): QueryVoteByProposalVoterRequest { @@ -2778,35 +1956,6 @@ export const QueryVoteByProposalVoterResponse = { : undefined; return message; }, - fromAmino( - object: QueryVoteByProposalVoterResponseAmino, - ): QueryVoteByProposalVoterResponse { - const message = createBaseQueryVoteByProposalVoterResponse(); - if (object.vote !== undefined && object.vote !== null) { - message.vote = Vote.fromAmino(object.vote); - } - return message; - }, - toAmino( - message: QueryVoteByProposalVoterResponse, - ): QueryVoteByProposalVoterResponseAmino { - const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryVoteByProposalVoterResponseAminoMsg, - ): QueryVoteByProposalVoterResponse { - return QueryVoteByProposalVoterResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVoteByProposalVoterResponse, - ): QueryVoteByProposalVoterResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryVoteByProposalVoterResponse', - value: QueryVoteByProposalVoterResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryVoteByProposalVoterResponseProtoMsg, ): QueryVoteByProposalVoterResponse { @@ -2902,44 +2051,6 @@ export const QueryVotesByProposalRequest = { : undefined; return message; }, - fromAmino( - object: QueryVotesByProposalRequestAmino, - ): QueryVotesByProposalRequest { - const message = createBaseQueryVotesByProposalRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryVotesByProposalRequest, - ): QueryVotesByProposalRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryVotesByProposalRequestAminoMsg, - ): QueryVotesByProposalRequest { - return QueryVotesByProposalRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVotesByProposalRequest, - ): QueryVotesByProposalRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesByProposalRequest', - value: QueryVotesByProposalRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryVotesByProposalRequestProtoMsg, ): QueryVotesByProposalRequest { @@ -3038,43 +2149,6 @@ export const QueryVotesByProposalResponse = { : undefined; return message; }, - fromAmino( - object: QueryVotesByProposalResponseAmino, - ): QueryVotesByProposalResponse { - const message = createBaseQueryVotesByProposalResponse(); - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryVotesByProposalResponse, - ): QueryVotesByProposalResponseAmino { - const obj: any = {}; - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryVotesByProposalResponseAminoMsg, - ): QueryVotesByProposalResponse { - return QueryVotesByProposalResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVotesByProposalResponse, - ): QueryVotesByProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesByProposalResponse', - value: QueryVotesByProposalResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryVotesByProposalResponseProtoMsg, ): QueryVotesByProposalResponse { @@ -3164,37 +2238,6 @@ export const QueryVotesByVoterRequest = { : undefined; return message; }, - fromAmino(object: QueryVotesByVoterRequestAmino): QueryVotesByVoterRequest { - const message = createBaseQueryVotesByVoterRequest(); - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAmino { - const obj: any = {}; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryVotesByVoterRequestAminoMsg, - ): QueryVotesByVoterRequest { - return QueryVotesByVoterRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVotesByVoterRequest, - ): QueryVotesByVoterRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesByVoterRequest', - value: QueryVotesByVoterRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryVotesByVoterRequestProtoMsg, ): QueryVotesByVoterRequest { @@ -3293,39 +2336,6 @@ export const QueryVotesByVoterResponse = { : undefined; return message; }, - fromAmino(object: QueryVotesByVoterResponseAmino): QueryVotesByVoterResponse { - const message = createBaseQueryVotesByVoterResponse(); - message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAmino { - const obj: any = {}; - if (message.votes) { - obj.votes = message.votes.map(e => (e ? Vote.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryVotesByVoterResponseAminoMsg, - ): QueryVotesByVoterResponse { - return QueryVotesByVoterResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryVotesByVoterResponse, - ): QueryVotesByVoterResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryVotesByVoterResponse', - value: QueryVotesByVoterResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryVotesByVoterResponseProtoMsg, ): QueryVotesByVoterResponse { @@ -3415,41 +2425,6 @@ export const QueryGroupsByMemberRequest = { : undefined; return message; }, - fromAmino( - object: QueryGroupsByMemberRequestAmino, - ): QueryGroupsByMemberRequest { - const message = createBaseQueryGroupsByMemberRequest(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupsByMemberRequest, - ): QueryGroupsByMemberRequestAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupsByMemberRequestAminoMsg, - ): QueryGroupsByMemberRequest { - return QueryGroupsByMemberRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupsByMemberRequest, - ): QueryGroupsByMemberRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupsByMemberRequest', - value: QueryGroupsByMemberRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupsByMemberRequestProtoMsg, ): QueryGroupsByMemberRequest { @@ -3550,45 +2525,6 @@ export const QueryGroupsByMemberResponse = { : undefined; return message; }, - fromAmino( - object: QueryGroupsByMemberResponseAmino, - ): QueryGroupsByMemberResponse { - const message = createBaseQueryGroupsByMemberResponse(); - message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryGroupsByMemberResponse, - ): QueryGroupsByMemberResponseAmino { - const obj: any = {}; - if (message.groups) { - obj.groups = message.groups.map(e => - e ? GroupInfo.toAmino(e) : undefined, - ); - } else { - obj.groups = message.groups; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryGroupsByMemberResponseAminoMsg, - ): QueryGroupsByMemberResponse { - return QueryGroupsByMemberResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryGroupsByMemberResponse, - ): QueryGroupsByMemberResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryGroupsByMemberResponse', - value: QueryGroupsByMemberResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryGroupsByMemberResponseProtoMsg, ): QueryGroupsByMemberResponse { @@ -3666,34 +2602,6 @@ export const QueryTallyResultRequest = { : BigInt(0); return message; }, - fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - const message = createBaseQueryTallyResultRequest(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultRequestAminoMsg, - ): QueryTallyResultRequest { - return QueryTallyResultRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultRequest, - ): QueryTallyResultRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryTallyResultRequest', - value: QueryTallyResultRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultRequestProtoMsg, ): QueryTallyResultRequest { @@ -3773,31 +2681,6 @@ export const QueryTallyResultResponse = { : undefined; return message; }, - fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - const message = createBaseQueryTallyResultResponse(); - if (object.tally !== undefined && object.tally !== null) { - message.tally = TallyResult.fromAmino(object.tally); - } - return message; - }, - toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { - const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryTallyResultResponseAminoMsg, - ): QueryTallyResultResponse { - return QueryTallyResultResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryTallyResultResponse, - ): QueryTallyResultResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryTallyResultResponse', - value: QueryTallyResultResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryTallyResultResponseProtoMsg, ): QueryTallyResultResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.amino.ts deleted file mode 100644 index 6d430774a70..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.amino.ts +++ /dev/null @@ -1,89 +0,0 @@ -//@ts-nocheck -import { - MsgCreateGroup, - MsgUpdateGroupMembers, - MsgUpdateGroupAdmin, - MsgUpdateGroupMetadata, - MsgCreateGroupPolicy, - MsgCreateGroupWithPolicy, - MsgUpdateGroupPolicyAdmin, - MsgUpdateGroupPolicyDecisionPolicy, - MsgUpdateGroupPolicyMetadata, - MsgSubmitProposal, - MsgWithdrawProposal, - MsgVote, - MsgExec, - MsgLeaveGroup, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.group.v1.MsgCreateGroup': { - aminoType: 'cosmos-sdk/MsgCreateGroup', - toAmino: MsgCreateGroup.toAmino, - fromAmino: MsgCreateGroup.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupMembers': { - aminoType: 'cosmos-sdk/MsgUpdateGroupMembers', - toAmino: MsgUpdateGroupMembers.toAmino, - fromAmino: MsgUpdateGroupMembers.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupAdmin': { - aminoType: 'cosmos-sdk/MsgUpdateGroupAdmin', - toAmino: MsgUpdateGroupAdmin.toAmino, - fromAmino: MsgUpdateGroupAdmin.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupMetadata': { - aminoType: 'cosmos-sdk/MsgUpdateGroupMetadata', - toAmino: MsgUpdateGroupMetadata.toAmino, - fromAmino: MsgUpdateGroupMetadata.fromAmino, - }, - '/cosmos.group.v1.MsgCreateGroupPolicy': { - aminoType: 'cosmos-sdk/MsgCreateGroupPolicy', - toAmino: MsgCreateGroupPolicy.toAmino, - fromAmino: MsgCreateGroupPolicy.fromAmino, - }, - '/cosmos.group.v1.MsgCreateGroupWithPolicy': { - aminoType: 'cosmos-sdk/MsgCreateGroupWithPolicy', - toAmino: MsgCreateGroupWithPolicy.toAmino, - fromAmino: MsgCreateGroupWithPolicy.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin': { - aminoType: 'cosmos-sdk/MsgUpdateGroupPolicyAdmin', - toAmino: MsgUpdateGroupPolicyAdmin.toAmino, - fromAmino: MsgUpdateGroupPolicyAdmin.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy': { - aminoType: 'cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy', - toAmino: MsgUpdateGroupPolicyDecisionPolicy.toAmino, - fromAmino: MsgUpdateGroupPolicyDecisionPolicy.fromAmino, - }, - '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata': { - aminoType: 'cosmos-sdk/MsgUpdateGroupPolicyMetadata', - toAmino: MsgUpdateGroupPolicyMetadata.toAmino, - fromAmino: MsgUpdateGroupPolicyMetadata.fromAmino, - }, - '/cosmos.group.v1.MsgSubmitProposal': { - aminoType: 'cosmos-sdk/group/MsgSubmitProposal', - toAmino: MsgSubmitProposal.toAmino, - fromAmino: MsgSubmitProposal.fromAmino, - }, - '/cosmos.group.v1.MsgWithdrawProposal': { - aminoType: 'cosmos-sdk/group/MsgWithdrawProposal', - toAmino: MsgWithdrawProposal.toAmino, - fromAmino: MsgWithdrawProposal.fromAmino, - }, - '/cosmos.group.v1.MsgVote': { - aminoType: 'cosmos-sdk/group/MsgVote', - toAmino: MsgVote.toAmino, - fromAmino: MsgVote.fromAmino, - }, - '/cosmos.group.v1.MsgExec': { - aminoType: 'cosmos-sdk/group/MsgExec', - toAmino: MsgExec.toAmino, - fromAmino: MsgExec.fromAmino, - }, - '/cosmos.group.v1.MsgLeaveGroup': { - aminoType: 'cosmos-sdk/group/MsgLeaveGroup', - toAmino: MsgLeaveGroup.toAmino, - fromAmino: MsgLeaveGroup.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.registry.ts deleted file mode 100644 index e429056519f..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.registry.ts +++ /dev/null @@ -1,477 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgCreateGroup, - MsgUpdateGroupMembers, - MsgUpdateGroupAdmin, - MsgUpdateGroupMetadata, - MsgCreateGroupPolicy, - MsgCreateGroupWithPolicy, - MsgUpdateGroupPolicyAdmin, - MsgUpdateGroupPolicyDecisionPolicy, - MsgUpdateGroupPolicyMetadata, - MsgSubmitProposal, - MsgWithdrawProposal, - MsgVote, - MsgExec, - MsgLeaveGroup, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.group.v1.MsgCreateGroup', MsgCreateGroup], - ['/cosmos.group.v1.MsgUpdateGroupMembers', MsgUpdateGroupMembers], - ['/cosmos.group.v1.MsgUpdateGroupAdmin', MsgUpdateGroupAdmin], - ['/cosmos.group.v1.MsgUpdateGroupMetadata', MsgUpdateGroupMetadata], - ['/cosmos.group.v1.MsgCreateGroupPolicy', MsgCreateGroupPolicy], - ['/cosmos.group.v1.MsgCreateGroupWithPolicy', MsgCreateGroupWithPolicy], - ['/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', MsgUpdateGroupPolicyAdmin], - [ - '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - MsgUpdateGroupPolicyDecisionPolicy, - ], - [ - '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - MsgUpdateGroupPolicyMetadata, - ], - ['/cosmos.group.v1.MsgSubmitProposal', MsgSubmitProposal], - ['/cosmos.group.v1.MsgWithdrawProposal', MsgWithdrawProposal], - ['/cosmos.group.v1.MsgVote', MsgVote], - ['/cosmos.group.v1.MsgExec', MsgExec], - ['/cosmos.group.v1.MsgLeaveGroup', MsgLeaveGroup], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - createGroup(value: MsgCreateGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroup', - value: MsgCreateGroup.encode(value).finish(), - }; - }, - updateGroupMembers(value: MsgUpdateGroupMembers) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers', - value: MsgUpdateGroupMembers.encode(value).finish(), - }; - }, - updateGroupAdmin(value: MsgUpdateGroupAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupAdmin', - value: MsgUpdateGroupAdmin.encode(value).finish(), - }; - }, - updateGroupMetadata(value: MsgUpdateGroupMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMetadata', - value: MsgUpdateGroupMetadata.encode(value).finish(), - }; - }, - createGroupPolicy(value: MsgCreateGroupPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy', - value: MsgCreateGroupPolicy.encode(value).finish(), - }; - }, - createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy', - value: MsgCreateGroupWithPolicy.encode(value).finish(), - }; - }, - updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', - value: MsgUpdateGroupPolicyAdmin.encode(value).finish(), - }; - }, - updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - value: MsgUpdateGroupPolicyDecisionPolicy.encode(value).finish(), - }; - }, - updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - value: MsgUpdateGroupPolicyMetadata.encode(value).finish(), - }; - }, - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgSubmitProposal', - value: MsgSubmitProposal.encode(value).finish(), - }; - }, - withdrawProposal(value: MsgWithdrawProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgWithdrawProposal', - value: MsgWithdrawProposal.encode(value).finish(), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.group.v1.MsgVote', - value: MsgVote.encode(value).finish(), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.group.v1.MsgExec', - value: MsgExec.encode(value).finish(), - }; - }, - leaveGroup(value: MsgLeaveGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgLeaveGroup', - value: MsgLeaveGroup.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - createGroup(value: MsgCreateGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroup', - value, - }; - }, - updateGroupMembers(value: MsgUpdateGroupMembers) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers', - value, - }; - }, - updateGroupAdmin(value: MsgUpdateGroupAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupAdmin', - value, - }; - }, - updateGroupMetadata(value: MsgUpdateGroupMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMetadata', - value, - }; - }, - createGroupPolicy(value: MsgCreateGroupPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy', - value, - }; - }, - createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy', - value, - }; - }, - updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', - value, - }; - }, - updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - value, - }; - }, - updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - value, - }; - }, - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgSubmitProposal', - value, - }; - }, - withdrawProposal(value: MsgWithdrawProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgWithdrawProposal', - value, - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.group.v1.MsgVote', - value, - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.group.v1.MsgExec', - value, - }; - }, - leaveGroup(value: MsgLeaveGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgLeaveGroup', - value, - }; - }, - }, - toJSON: { - createGroup(value: MsgCreateGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroup', - value: MsgCreateGroup.toJSON(value), - }; - }, - updateGroupMembers(value: MsgUpdateGroupMembers) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers', - value: MsgUpdateGroupMembers.toJSON(value), - }; - }, - updateGroupAdmin(value: MsgUpdateGroupAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupAdmin', - value: MsgUpdateGroupAdmin.toJSON(value), - }; - }, - updateGroupMetadata(value: MsgUpdateGroupMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMetadata', - value: MsgUpdateGroupMetadata.toJSON(value), - }; - }, - createGroupPolicy(value: MsgCreateGroupPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy', - value: MsgCreateGroupPolicy.toJSON(value), - }; - }, - createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy', - value: MsgCreateGroupWithPolicy.toJSON(value), - }; - }, - updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', - value: MsgUpdateGroupPolicyAdmin.toJSON(value), - }; - }, - updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - value: MsgUpdateGroupPolicyDecisionPolicy.toJSON(value), - }; - }, - updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - value: MsgUpdateGroupPolicyMetadata.toJSON(value), - }; - }, - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgSubmitProposal', - value: MsgSubmitProposal.toJSON(value), - }; - }, - withdrawProposal(value: MsgWithdrawProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgWithdrawProposal', - value: MsgWithdrawProposal.toJSON(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.group.v1.MsgVote', - value: MsgVote.toJSON(value), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.group.v1.MsgExec', - value: MsgExec.toJSON(value), - }; - }, - leaveGroup(value: MsgLeaveGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgLeaveGroup', - value: MsgLeaveGroup.toJSON(value), - }; - }, - }, - fromJSON: { - createGroup(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroup', - value: MsgCreateGroup.fromJSON(value), - }; - }, - updateGroupMembers(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers', - value: MsgUpdateGroupMembers.fromJSON(value), - }; - }, - updateGroupAdmin(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupAdmin', - value: MsgUpdateGroupAdmin.fromJSON(value), - }; - }, - updateGroupMetadata(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMetadata', - value: MsgUpdateGroupMetadata.fromJSON(value), - }; - }, - createGroupPolicy(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy', - value: MsgCreateGroupPolicy.fromJSON(value), - }; - }, - createGroupWithPolicy(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy', - value: MsgCreateGroupWithPolicy.fromJSON(value), - }; - }, - updateGroupPolicyAdmin(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', - value: MsgUpdateGroupPolicyAdmin.fromJSON(value), - }; - }, - updateGroupPolicyDecisionPolicy(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - value: MsgUpdateGroupPolicyDecisionPolicy.fromJSON(value), - }; - }, - updateGroupPolicyMetadata(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - value: MsgUpdateGroupPolicyMetadata.fromJSON(value), - }; - }, - submitProposal(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgSubmitProposal', - value: MsgSubmitProposal.fromJSON(value), - }; - }, - withdrawProposal(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgWithdrawProposal', - value: MsgWithdrawProposal.fromJSON(value), - }; - }, - vote(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgVote', - value: MsgVote.fromJSON(value), - }; - }, - exec(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgExec', - value: MsgExec.fromJSON(value), - }; - }, - leaveGroup(value: any) { - return { - typeUrl: '/cosmos.group.v1.MsgLeaveGroup', - value: MsgLeaveGroup.fromJSON(value), - }; - }, - }, - fromPartial: { - createGroup(value: MsgCreateGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroup', - value: MsgCreateGroup.fromPartial(value), - }; - }, - updateGroupMembers(value: MsgUpdateGroupMembers) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMembers', - value: MsgUpdateGroupMembers.fromPartial(value), - }; - }, - updateGroupAdmin(value: MsgUpdateGroupAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupAdmin', - value: MsgUpdateGroupAdmin.fromPartial(value), - }; - }, - updateGroupMetadata(value: MsgUpdateGroupMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupMetadata', - value: MsgUpdateGroupMetadata.fromPartial(value), - }; - }, - createGroupPolicy(value: MsgCreateGroupPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy', - value: MsgCreateGroupPolicy.fromPartial(value), - }; - }, - createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy', - value: MsgCreateGroupWithPolicy.fromPartial(value), - }; - }, - updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyAdmin', - value: MsgUpdateGroupPolicyAdmin.fromPartial(value), - }; - }, - updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy', - value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value), - }; - }, - updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { - return { - typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyMetadata', - value: MsgUpdateGroupPolicyMetadata.fromPartial(value), - }; - }, - submitProposal(value: MsgSubmitProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgSubmitProposal', - value: MsgSubmitProposal.fromPartial(value), - }; - }, - withdrawProposal(value: MsgWithdrawProposal) { - return { - typeUrl: '/cosmos.group.v1.MsgWithdrawProposal', - value: MsgWithdrawProposal.fromPartial(value), - }; - }, - vote(value: MsgVote) { - return { - typeUrl: '/cosmos.group.v1.MsgVote', - value: MsgVote.fromPartial(value), - }; - }, - exec(value: MsgExec) { - return { - typeUrl: '/cosmos.group.v1.MsgExec', - value: MsgExec.fromPartial(value), - }; - }, - leaveGroup(value: MsgLeaveGroup) { - return { - typeUrl: '/cosmos.group.v1.MsgLeaveGroup', - value: MsgLeaveGroup.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.rpc.msg.ts deleted file mode 100644 index 333bc5bfb68..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,263 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgCreateGroup, - MsgCreateGroupResponse, - MsgUpdateGroupMembers, - MsgUpdateGroupMembersResponse, - MsgUpdateGroupAdmin, - MsgUpdateGroupAdminResponse, - MsgUpdateGroupMetadata, - MsgUpdateGroupMetadataResponse, - MsgCreateGroupPolicy, - MsgCreateGroupPolicyResponse, - MsgCreateGroupWithPolicy, - MsgCreateGroupWithPolicyResponse, - MsgUpdateGroupPolicyAdmin, - MsgUpdateGroupPolicyAdminResponse, - MsgUpdateGroupPolicyDecisionPolicy, - MsgUpdateGroupPolicyDecisionPolicyResponse, - MsgUpdateGroupPolicyMetadata, - MsgUpdateGroupPolicyMetadataResponse, - MsgSubmitProposal, - MsgSubmitProposalResponse, - MsgWithdrawProposal, - MsgWithdrawProposalResponse, - MsgVote, - MsgVoteResponse, - MsgExec, - MsgExecResponse, - MsgLeaveGroup, - MsgLeaveGroupResponse, -} from './tx.js'; -/** Msg is the cosmos.group.v1 Msg service. */ -export interface Msg { - /** CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ - createGroup(request: MsgCreateGroup): Promise; - /** UpdateGroupMembers updates the group members with given group id and admin address. */ - updateGroupMembers( - request: MsgUpdateGroupMembers, - ): Promise; - /** UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ - updateGroupAdmin( - request: MsgUpdateGroupAdmin, - ): Promise; - /** UpdateGroupMetadata updates the group metadata with given group id and admin address. */ - updateGroupMetadata( - request: MsgUpdateGroupMetadata, - ): Promise; - /** CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ - createGroupPolicy( - request: MsgCreateGroupPolicy, - ): Promise; - /** CreateGroupWithPolicy creates a new group with policy. */ - createGroupWithPolicy( - request: MsgCreateGroupWithPolicy, - ): Promise; - /** UpdateGroupPolicyAdmin updates a group policy admin. */ - updateGroupPolicyAdmin( - request: MsgUpdateGroupPolicyAdmin, - ): Promise; - /** UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ - updateGroupPolicyDecisionPolicy( - request: MsgUpdateGroupPolicyDecisionPolicy, - ): Promise; - /** UpdateGroupPolicyMetadata updates a group policy metadata. */ - updateGroupPolicyMetadata( - request: MsgUpdateGroupPolicyMetadata, - ): Promise; - /** SubmitProposal submits a new proposal. */ - submitProposal( - request: MsgSubmitProposal, - ): Promise; - /** WithdrawProposal aborts a proposal. */ - withdrawProposal( - request: MsgWithdrawProposal, - ): Promise; - /** Vote allows a voter to vote on a proposal. */ - vote(request: MsgVote): Promise; - /** Exec executes a proposal. */ - exec(request: MsgExec): Promise; - /** LeaveGroup allows a group member to leave the group. */ - leaveGroup(request: MsgLeaveGroup): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createGroup = this.createGroup.bind(this); - this.updateGroupMembers = this.updateGroupMembers.bind(this); - this.updateGroupAdmin = this.updateGroupAdmin.bind(this); - this.updateGroupMetadata = this.updateGroupMetadata.bind(this); - this.createGroupPolicy = this.createGroupPolicy.bind(this); - this.createGroupWithPolicy = this.createGroupWithPolicy.bind(this); - this.updateGroupPolicyAdmin = this.updateGroupPolicyAdmin.bind(this); - this.updateGroupPolicyDecisionPolicy = - this.updateGroupPolicyDecisionPolicy.bind(this); - this.updateGroupPolicyMetadata = this.updateGroupPolicyMetadata.bind(this); - this.submitProposal = this.submitProposal.bind(this); - this.withdrawProposal = this.withdrawProposal.bind(this); - this.vote = this.vote.bind(this); - this.exec = this.exec.bind(this); - this.leaveGroup = this.leaveGroup.bind(this); - } - createGroup(request: MsgCreateGroup): Promise { - const data = MsgCreateGroup.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'CreateGroup', - data, - ); - return promise.then(data => - MsgCreateGroupResponse.decode(new BinaryReader(data)), - ); - } - updateGroupMembers( - request: MsgUpdateGroupMembers, - ): Promise { - const data = MsgUpdateGroupMembers.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupMembers', - data, - ); - return promise.then(data => - MsgUpdateGroupMembersResponse.decode(new BinaryReader(data)), - ); - } - updateGroupAdmin( - request: MsgUpdateGroupAdmin, - ): Promise { - const data = MsgUpdateGroupAdmin.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupAdmin', - data, - ); - return promise.then(data => - MsgUpdateGroupAdminResponse.decode(new BinaryReader(data)), - ); - } - updateGroupMetadata( - request: MsgUpdateGroupMetadata, - ): Promise { - const data = MsgUpdateGroupMetadata.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupMetadata', - data, - ); - return promise.then(data => - MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data)), - ); - } - createGroupPolicy( - request: MsgCreateGroupPolicy, - ): Promise { - const data = MsgCreateGroupPolicy.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'CreateGroupPolicy', - data, - ); - return promise.then(data => - MsgCreateGroupPolicyResponse.decode(new BinaryReader(data)), - ); - } - createGroupWithPolicy( - request: MsgCreateGroupWithPolicy, - ): Promise { - const data = MsgCreateGroupWithPolicy.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'CreateGroupWithPolicy', - data, - ); - return promise.then(data => - MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data)), - ); - } - updateGroupPolicyAdmin( - request: MsgUpdateGroupPolicyAdmin, - ): Promise { - const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupPolicyAdmin', - data, - ); - return promise.then(data => - MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data)), - ); - } - updateGroupPolicyDecisionPolicy( - request: MsgUpdateGroupPolicyDecisionPolicy, - ): Promise { - const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupPolicyDecisionPolicy', - data, - ); - return promise.then(data => - MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data)), - ); - } - updateGroupPolicyMetadata( - request: MsgUpdateGroupPolicyMetadata, - ): Promise { - const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'UpdateGroupPolicyMetadata', - data, - ); - return promise.then(data => - MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data)), - ); - } - submitProposal( - request: MsgSubmitProposal, - ): Promise { - const data = MsgSubmitProposal.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'SubmitProposal', - data, - ); - return promise.then(data => - MsgSubmitProposalResponse.decode(new BinaryReader(data)), - ); - } - withdrawProposal( - request: MsgWithdrawProposal, - ): Promise { - const data = MsgWithdrawProposal.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.group.v1.Msg', - 'WithdrawProposal', - data, - ); - return promise.then(data => - MsgWithdrawProposalResponse.decode(new BinaryReader(data)), - ); - } - vote(request: MsgVote): Promise { - const data = MsgVote.encode(request).finish(); - const promise = this.rpc.request('cosmos.group.v1.Msg', 'Vote', data); - return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); - } - exec(request: MsgExec): Promise { - const data = MsgExec.encode(request).finish(); - const promise = this.rpc.request('cosmos.group.v1.Msg', 'Exec', data); - return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); - } - leaveGroup(request: MsgLeaveGroup): Promise { - const data = MsgLeaveGroup.encode(request).finish(); - const promise = this.rpc.request('cosmos.group.v1.Msg', 'LeaveGroup', data); - return promise.then(data => - MsgLeaveGroupResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts index 4ba57f46389..b73c9db7622 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/tx.ts @@ -1,24 +1,16 @@ //@ts-nocheck import { Member, - MemberAmino, MemberSDKType, VoteOption, ThresholdDecisionPolicy, - ThresholdDecisionPolicyProtoMsg, ThresholdDecisionPolicySDKType, PercentageDecisionPolicy, - PercentageDecisionPolicyProtoMsg, PercentageDecisionPolicySDKType, voteOptionFromJSON, voteOptionToJSON, } from './types.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** Exec defines modes of execution of a proposal on creation or on new vote. */ @@ -38,7 +30,6 @@ export enum Exec { UNRECOGNIZED = -1, } export const ExecSDKType = Exec; -export const ExecAmino = Exec; export function execFromJSON(object: any): Exec { switch (object) { case 0: @@ -78,19 +69,6 @@ export interface MsgCreateGroupProtoMsg { value: Uint8Array; } /** MsgCreateGroup is the Msg/CreateGroup request type. */ -export interface MsgCreateGroupAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** members defines the group members. */ - members?: MemberAmino[]; - /** metadata is any arbitrary metadata to attached to the group. */ - metadata?: string; -} -export interface MsgCreateGroupAminoMsg { - type: 'cosmos-sdk/MsgCreateGroup'; - value: MsgCreateGroupAmino; -} -/** MsgCreateGroup is the Msg/CreateGroup request type. */ export interface MsgCreateGroupSDKType { admin: string; members: MemberSDKType[]; @@ -106,15 +84,6 @@ export interface MsgCreateGroupResponseProtoMsg { value: Uint8Array; } /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ -export interface MsgCreateGroupResponseAmino { - /** group_id is the unique ID of the newly created group. */ - group_id?: string; -} -export interface MsgCreateGroupResponseAminoMsg { - type: 'cosmos-sdk/MsgCreateGroupResponse'; - value: MsgCreateGroupResponseAmino; -} -/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponseSDKType { group_id: bigint; } @@ -135,22 +104,6 @@ export interface MsgUpdateGroupMembersProtoMsg { value: Uint8Array; } /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ -export interface MsgUpdateGroupMembersAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; - /** - * member_updates is the list of members to update, - * set weight to 0 to remove a member. - */ - member_updates?: MemberAmino[]; -} -export interface MsgUpdateGroupMembersAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupMembers'; - value: MsgUpdateGroupMembersAmino; -} -/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembersSDKType { admin: string; group_id: bigint; @@ -163,12 +116,6 @@ export interface MsgUpdateGroupMembersResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ -export interface MsgUpdateGroupMembersResponseAmino {} -export interface MsgUpdateGroupMembersResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupMembersResponse'; - value: MsgUpdateGroupMembersResponseAmino; -} -/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ export interface MsgUpdateGroupMembersResponseSDKType {} /** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ export interface MsgUpdateGroupAdmin { @@ -184,19 +131,6 @@ export interface MsgUpdateGroupAdminProtoMsg { value: Uint8Array; } /** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ -export interface MsgUpdateGroupAdminAmino { - /** admin is the current account address of the group admin. */ - admin?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; - /** new_admin is the group new admin account address. */ - new_admin?: string; -} -export interface MsgUpdateGroupAdminAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupAdmin'; - value: MsgUpdateGroupAdminAmino; -} -/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ export interface MsgUpdateGroupAdminSDKType { admin: string; group_id: bigint; @@ -209,12 +143,6 @@ export interface MsgUpdateGroupAdminResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ -export interface MsgUpdateGroupAdminResponseAmino {} -export interface MsgUpdateGroupAdminResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupAdminResponse'; - value: MsgUpdateGroupAdminResponseAmino; -} -/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ export interface MsgUpdateGroupAdminResponseSDKType {} /** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ export interface MsgUpdateGroupMetadata { @@ -230,19 +158,6 @@ export interface MsgUpdateGroupMetadataProtoMsg { value: Uint8Array; } /** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ -export interface MsgUpdateGroupMetadataAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; - /** metadata is the updated group's metadata. */ - metadata?: string; -} -export interface MsgUpdateGroupMetadataAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupMetadata'; - value: MsgUpdateGroupMetadataAmino; -} -/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ export interface MsgUpdateGroupMetadataSDKType { admin: string; group_id: bigint; @@ -255,12 +170,6 @@ export interface MsgUpdateGroupMetadataResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ -export interface MsgUpdateGroupMetadataResponseAmino {} -export interface MsgUpdateGroupMetadataResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupMetadataResponse'; - value: MsgUpdateGroupMetadataResponseAmino; -} -/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ export interface MsgUpdateGroupMetadataResponseSDKType {} /** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ export interface MsgCreateGroupPolicy { @@ -279,31 +188,6 @@ export interface MsgCreateGroupPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgCreateGroupPolicy'; value: Uint8Array; } -export type MsgCreateGroupPolicyEncoded = Omit< - MsgCreateGroupPolicy, - 'decisionPolicy' -> & { - /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: - | ThresholdDecisionPolicyProtoMsg - | PercentageDecisionPolicyProtoMsg - | AnyProtoMsg - | undefined; -}; -/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ -export interface MsgCreateGroupPolicyAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; - /** metadata is any arbitrary metadata attached to the group policy. */ - metadata?: string; - /** decision_policy specifies the group policy's decision policy. */ - decision_policy?: AnyAmino; -} -export interface MsgCreateGroupPolicyAminoMsg { - type: 'cosmos-sdk/MsgCreateGroupPolicy'; - value: MsgCreateGroupPolicyAmino; -} /** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ export interface MsgCreateGroupPolicySDKType { admin: string; @@ -325,15 +209,6 @@ export interface MsgCreateGroupPolicyResponseProtoMsg { value: Uint8Array; } /** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ -export interface MsgCreateGroupPolicyResponseAmino { - /** address is the account address of the newly created group policy. */ - address?: string; -} -export interface MsgCreateGroupPolicyResponseAminoMsg { - type: 'cosmos-sdk/MsgCreateGroupPolicyResponse'; - value: MsgCreateGroupPolicyResponseAmino; -} -/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ export interface MsgCreateGroupPolicyResponseSDKType { address: string; } @@ -351,19 +226,6 @@ export interface MsgUpdateGroupPolicyAdminProtoMsg { value: Uint8Array; } /** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ -export interface MsgUpdateGroupPolicyAdminAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** address is the account address of the group policy. */ - address?: string; - /** new_admin is the new group policy admin. */ - new_admin?: string; -} -export interface MsgUpdateGroupPolicyAdminAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyAdmin'; - value: MsgUpdateGroupPolicyAdminAmino; -} -/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ export interface MsgUpdateGroupPolicyAdminSDKType { admin: string; address: string; @@ -390,35 +252,6 @@ export interface MsgCreateGroupWithPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgCreateGroupWithPolicy'; value: Uint8Array; } -export type MsgCreateGroupWithPolicyEncoded = Omit< - MsgCreateGroupWithPolicy, - 'decisionPolicy' -> & { - /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: - | ThresholdDecisionPolicyProtoMsg - | PercentageDecisionPolicyProtoMsg - | AnyProtoMsg - | undefined; -}; -/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ -export interface MsgCreateGroupWithPolicyAmino { - /** admin is the account address of the group and group policy admin. */ - admin?: string; - /** members defines the group members. */ - members?: MemberAmino[]; - /** group_metadata is any arbitrary metadata attached to the group. */ - group_metadata?: string; - /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ - group_policy_metadata?: string; - /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ - group_policy_as_admin?: boolean; - /** decision_policy specifies the group policy's decision policy. */ - decision_policy?: AnyAmino; -} -export interface MsgCreateGroupWithPolicyAminoMsg { - type: 'cosmos-sdk/MsgCreateGroupWithPolicy'; - value: MsgCreateGroupWithPolicyAmino; -} /** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ export interface MsgCreateGroupWithPolicySDKType { admin: string; @@ -444,17 +277,6 @@ export interface MsgCreateGroupWithPolicyResponseProtoMsg { value: Uint8Array; } /** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ -export interface MsgCreateGroupWithPolicyResponseAmino { - /** group_id is the unique ID of the newly created group with policy. */ - group_id?: string; - /** group_policy_address is the account address of the newly created group policy. */ - group_policy_address?: string; -} -export interface MsgCreateGroupWithPolicyResponseAminoMsg { - type: 'cosmos-sdk/MsgCreateGroupWithPolicyResponse'; - value: MsgCreateGroupWithPolicyResponseAmino; -} -/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ export interface MsgCreateGroupWithPolicyResponseSDKType { group_id: bigint; group_policy_address: string; @@ -466,12 +288,6 @@ export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ -export interface MsgUpdateGroupPolicyAdminResponseAmino {} -export interface MsgUpdateGroupPolicyAdminResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyAdminResponse'; - value: MsgUpdateGroupPolicyAdminResponseAmino; -} -/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ export interface MsgUpdateGroupPolicyAdminResponseSDKType {} /** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ export interface MsgUpdateGroupPolicyDecisionPolicy { @@ -488,29 +304,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { typeUrl: '/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy'; value: Uint8Array; } -export type MsgUpdateGroupPolicyDecisionPolicyEncoded = Omit< - MsgUpdateGroupPolicyDecisionPolicy, - 'decisionPolicy' -> & { - /** decision_policy is the updated group policy's decision policy. */ decisionPolicy?: - | ThresholdDecisionPolicyProtoMsg - | PercentageDecisionPolicyProtoMsg - | AnyProtoMsg - | undefined; -}; -/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ -export interface MsgUpdateGroupPolicyDecisionPolicyAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** address is the account address of group policy. */ - address?: string; - /** decision_policy is the updated group policy's decision policy. */ - decision_policy?: AnyAmino; -} -export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy'; - value: MsgUpdateGroupPolicyDecisionPolicyAmino; -} /** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ export interface MsgUpdateGroupPolicyDecisionPolicySDKType { admin: string; @@ -528,12 +321,6 @@ export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ -export interface MsgUpdateGroupPolicyDecisionPolicyResponseAmino {} -export interface MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse'; - value: MsgUpdateGroupPolicyDecisionPolicyResponseAmino; -} -/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ export interface MsgUpdateGroupPolicyDecisionPolicyResponseSDKType {} /** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ export interface MsgUpdateGroupPolicyMetadata { @@ -549,19 +336,6 @@ export interface MsgUpdateGroupPolicyMetadataProtoMsg { value: Uint8Array; } /** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ -export interface MsgUpdateGroupPolicyMetadataAmino { - /** admin is the account address of the group admin. */ - admin?: string; - /** address is the account address of group policy. */ - address?: string; - /** metadata is the updated group policy metadata. */ - metadata?: string; -} -export interface MsgUpdateGroupPolicyMetadataAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyMetadata'; - value: MsgUpdateGroupPolicyMetadataAmino; -} -/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ export interface MsgUpdateGroupPolicyMetadataSDKType { admin: string; address: string; @@ -574,12 +348,6 @@ export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { value: Uint8Array; } /** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ -export interface MsgUpdateGroupPolicyMetadataResponseAmino {} -export interface MsgUpdateGroupPolicyMetadataResponseAminoMsg { - type: 'cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse'; - value: MsgUpdateGroupPolicyMetadataResponseAmino; -} -/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ export interface MsgUpdateGroupPolicyMetadataResponseSDKType {} /** MsgSubmitProposal is the Msg/SubmitProposal request type. */ export interface MsgSubmitProposal { @@ -606,30 +374,6 @@ export interface MsgSubmitProposalProtoMsg { value: Uint8Array; } /** MsgSubmitProposal is the Msg/SubmitProposal request type. */ -export interface MsgSubmitProposalAmino { - /** address is the account address of group policy. */ - address?: string; - /** - * proposers are the account addresses of the proposers. - * Proposers signatures will be counted as yes votes. - */ - proposers?: string[]; - /** metadata is any arbitrary metadata to attached to the proposal. */ - metadata?: string; - /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ - messages?: AnyAmino[]; - /** - * exec defines the mode of execution of the proposal, - * whether it should be executed immediately on creation or not. - * If so, proposers signatures are considered as Yes votes. - */ - exec?: Exec; -} -export interface MsgSubmitProposalAminoMsg { - type: 'cosmos-sdk/group/MsgSubmitProposal'; - value: MsgSubmitProposalAmino; -} -/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ export interface MsgSubmitProposalSDKType { address: string; proposers: string[]; @@ -647,15 +391,6 @@ export interface MsgSubmitProposalResponseProtoMsg { value: Uint8Array; } /** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponseAmino { - /** proposal is the unique ID of the proposal. */ - proposal_id?: string; -} -export interface MsgSubmitProposalResponseAminoMsg { - type: 'cosmos-sdk/MsgSubmitProposalResponse'; - value: MsgSubmitProposalResponseAmino; -} -/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { proposal_id: bigint; } @@ -671,17 +406,6 @@ export interface MsgWithdrawProposalProtoMsg { value: Uint8Array; } /** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ -export interface MsgWithdrawProposalAmino { - /** proposal is the unique ID of the proposal. */ - proposal_id?: string; - /** address is the admin of the group policy or one of the proposer of the proposal. */ - address?: string; -} -export interface MsgWithdrawProposalAminoMsg { - type: 'cosmos-sdk/group/MsgWithdrawProposal'; - value: MsgWithdrawProposalAmino; -} -/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ export interface MsgWithdrawProposalSDKType { proposal_id: bigint; address: string; @@ -693,12 +417,6 @@ export interface MsgWithdrawProposalResponseProtoMsg { value: Uint8Array; } /** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ -export interface MsgWithdrawProposalResponseAmino {} -export interface MsgWithdrawProposalResponseAminoMsg { - type: 'cosmos-sdk/MsgWithdrawProposalResponse'; - value: MsgWithdrawProposalResponseAmino; -} -/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ export interface MsgWithdrawProposalResponseSDKType {} /** MsgVote is the Msg/Vote request type. */ export interface MsgVote { @@ -721,26 +439,6 @@ export interface MsgVoteProtoMsg { value: Uint8Array; } /** MsgVote is the Msg/Vote request type. */ -export interface MsgVoteAmino { - /** proposal is the unique ID of the proposal. */ - proposal_id?: string; - /** voter is the voter account address. */ - voter?: string; - /** option is the voter's choice on the proposal. */ - option?: VoteOption; - /** metadata is any arbitrary metadata to attached to the vote. */ - metadata?: string; - /** - * exec defines whether the proposal should be executed - * immediately after voting or not. - */ - exec?: Exec; -} -export interface MsgVoteAminoMsg { - type: 'cosmos-sdk/group/MsgVote'; - value: MsgVoteAmino; -} -/** MsgVote is the Msg/Vote request type. */ export interface MsgVoteSDKType { proposal_id: bigint; voter: string; @@ -755,12 +453,6 @@ export interface MsgVoteResponseProtoMsg { value: Uint8Array; } /** MsgVoteResponse is the Msg/Vote response type. */ -export interface MsgVoteResponseAmino {} -export interface MsgVoteResponseAminoMsg { - type: 'cosmos-sdk/MsgVoteResponse'; - value: MsgVoteResponseAmino; -} -/** MsgVoteResponse is the Msg/Vote response type. */ export interface MsgVoteResponseSDKType {} /** MsgExec is the Msg/Exec request type. */ export interface MsgExec { @@ -774,17 +466,6 @@ export interface MsgExecProtoMsg { value: Uint8Array; } /** MsgExec is the Msg/Exec request type. */ -export interface MsgExecAmino { - /** proposal is the unique ID of the proposal. */ - proposal_id?: string; - /** signer is the account address used to execute the proposal. */ - signer?: string; -} -export interface MsgExecAminoMsg { - type: 'cosmos-sdk/group/MsgExec'; - value: MsgExecAmino; -} -/** MsgExec is the Msg/Exec request type. */ export interface MsgExecSDKType { proposal_id: bigint; signer: string; @@ -796,12 +477,6 @@ export interface MsgExecResponseProtoMsg { value: Uint8Array; } /** MsgExecResponse is the Msg/Exec request type. */ -export interface MsgExecResponseAmino {} -export interface MsgExecResponseAminoMsg { - type: 'cosmos-sdk/MsgExecResponse'; - value: MsgExecResponseAmino; -} -/** MsgExecResponse is the Msg/Exec request type. */ export interface MsgExecResponseSDKType {} /** MsgLeaveGroup is the Msg/LeaveGroup request type. */ export interface MsgLeaveGroup { @@ -815,17 +490,6 @@ export interface MsgLeaveGroupProtoMsg { value: Uint8Array; } /** MsgLeaveGroup is the Msg/LeaveGroup request type. */ -export interface MsgLeaveGroupAmino { - /** address is the account address of the group member. */ - address?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; -} -export interface MsgLeaveGroupAminoMsg { - type: 'cosmos-sdk/group/MsgLeaveGroup'; - value: MsgLeaveGroupAmino; -} -/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ export interface MsgLeaveGroupSDKType { address: string; group_id: bigint; @@ -837,12 +501,6 @@ export interface MsgLeaveGroupResponseProtoMsg { value: Uint8Array; } /** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ -export interface MsgLeaveGroupResponseAmino {} -export interface MsgLeaveGroupResponseAminoMsg { - type: 'cosmos-sdk/MsgLeaveGroupResponse'; - value: MsgLeaveGroupResponseAmino; -} -/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ export interface MsgLeaveGroupResponseSDKType {} function createBaseMsgCreateGroup(): MsgCreateGroup { return { @@ -921,39 +579,6 @@ export const MsgCreateGroup = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { - const message = createBaseMsgCreateGroup(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - message.members = object.members?.map(e => Member.fromAmino(e)) || []; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - if (message.members) { - obj.members = message.members.map(e => - e ? Member.toAmino(e) : undefined, - ); - } else { - obj.members = message.members; - } - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { - return MsgCreateGroup.fromAmino(object.value); - }, - toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroup', - value: MsgCreateGroup.toAmino(message), - }; - }, fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { return MsgCreateGroup.decode(message.value); }, @@ -1025,28 +650,6 @@ export const MsgCreateGroupResponse = { : BigInt(0); return message; }, - fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { - const message = createBaseMsgCreateGroupResponse(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - return message; - }, - toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { - return MsgCreateGroupResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroupResponse', - value: MsgCreateGroupResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateGroupResponseProtoMsg, ): MsgCreateGroupResponse { @@ -1149,41 +752,6 @@ export const MsgUpdateGroupMembers = { object.memberUpdates?.map(e => Member.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgUpdateGroupMembersAmino): MsgUpdateGroupMembers { - const message = createBaseMsgUpdateGroupMembers(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - message.memberUpdates = - object.member_updates?.map(e => Member.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - if (message.memberUpdates) { - obj.member_updates = message.memberUpdates.map(e => - e ? Member.toAmino(e) : undefined, - ); - } else { - obj.member_updates = message.memberUpdates; - } - return obj; - }, - fromAminoMsg(object: MsgUpdateGroupMembersAminoMsg): MsgUpdateGroupMembers { - return MsgUpdateGroupMembers.fromAmino(object.value); - }, - toAminoMsg(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupMembers', - value: MsgUpdateGroupMembers.toAmino(message), - }; - }, fromProtoMsg(message: MsgUpdateGroupMembersProtoMsg): MsgUpdateGroupMembers { return MsgUpdateGroupMembers.decode(message.value); }, @@ -1239,31 +807,6 @@ export const MsgUpdateGroupMembersResponse = { const message = createBaseMsgUpdateGroupMembersResponse(); return message; }, - fromAmino( - _: MsgUpdateGroupMembersResponseAmino, - ): MsgUpdateGroupMembersResponse { - const message = createBaseMsgUpdateGroupMembersResponse(); - return message; - }, - toAmino( - _: MsgUpdateGroupMembersResponse, - ): MsgUpdateGroupMembersResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupMembersResponseAminoMsg, - ): MsgUpdateGroupMembersResponse { - return MsgUpdateGroupMembersResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupMembersResponse, - ): MsgUpdateGroupMembersResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupMembersResponse', - value: MsgUpdateGroupMembersResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupMembersResponseProtoMsg, ): MsgUpdateGroupMembersResponse { @@ -1359,36 +902,6 @@ export const MsgUpdateGroupAdmin = { message.newAdmin = object.newAdmin ?? ''; return message; }, - fromAmino(object: MsgUpdateGroupAdminAmino): MsgUpdateGroupAdmin { - const message = createBaseMsgUpdateGroupAdmin(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.newAdmin = object.new_admin; - } - return message; - }, - toAmino(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin; - return obj; - }, - fromAminoMsg(object: MsgUpdateGroupAdminAminoMsg): MsgUpdateGroupAdmin { - return MsgUpdateGroupAdmin.fromAmino(object.value); - }, - toAminoMsg(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupAdmin', - value: MsgUpdateGroupAdmin.toAmino(message), - }; - }, fromProtoMsg(message: MsgUpdateGroupAdminProtoMsg): MsgUpdateGroupAdmin { return MsgUpdateGroupAdmin.decode(message.value); }, @@ -1444,27 +957,6 @@ export const MsgUpdateGroupAdminResponse = { const message = createBaseMsgUpdateGroupAdminResponse(); return message; }, - fromAmino(_: MsgUpdateGroupAdminResponseAmino): MsgUpdateGroupAdminResponse { - const message = createBaseMsgUpdateGroupAdminResponse(); - return message; - }, - toAmino(_: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupAdminResponseAminoMsg, - ): MsgUpdateGroupAdminResponse { - return MsgUpdateGroupAdminResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupAdminResponse, - ): MsgUpdateGroupAdminResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupAdminResponse', - value: MsgUpdateGroupAdminResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupAdminResponseProtoMsg, ): MsgUpdateGroupAdminResponse { @@ -1560,36 +1052,6 @@ export const MsgUpdateGroupMetadata = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino(object: MsgUpdateGroupMetadataAmino): MsgUpdateGroupMetadata { - const message = createBaseMsgUpdateGroupMetadata(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg(object: MsgUpdateGroupMetadataAminoMsg): MsgUpdateGroupMetadata { - return MsgUpdateGroupMetadata.fromAmino(object.value); - }, - toAminoMsg(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupMetadata', - value: MsgUpdateGroupMetadata.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupMetadataProtoMsg, ): MsgUpdateGroupMetadata { @@ -1647,31 +1109,6 @@ export const MsgUpdateGroupMetadataResponse = { const message = createBaseMsgUpdateGroupMetadataResponse(); return message; }, - fromAmino( - _: MsgUpdateGroupMetadataResponseAmino, - ): MsgUpdateGroupMetadataResponse { - const message = createBaseMsgUpdateGroupMetadataResponse(); - return message; - }, - toAmino( - _: MsgUpdateGroupMetadataResponse, - ): MsgUpdateGroupMetadataResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupMetadataResponseAminoMsg, - ): MsgUpdateGroupMetadataResponse { - return MsgUpdateGroupMetadataResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupMetadataResponse, - ): MsgUpdateGroupMetadataResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupMetadataResponse', - value: MsgUpdateGroupMetadataResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupMetadataResponseProtoMsg, ): MsgUpdateGroupMetadataResponse { @@ -1790,47 +1227,6 @@ export const MsgCreateGroupPolicy = { : undefined; return message; }, - fromAmino(object: MsgCreateGroupPolicyAmino): MsgCreateGroupPolicy { - const message = createBaseMsgCreateGroupPolicy(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if ( - object.decision_policy !== undefined && - object.decision_policy !== null - ) { - message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino( - object.decision_policy, - ); - } - return message; - }, - toAmino(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.decision_policy = message.decisionPolicy - ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) - : undefined; - return obj; - }, - fromAminoMsg(object: MsgCreateGroupPolicyAminoMsg): MsgCreateGroupPolicy { - return MsgCreateGroupPolicy.fromAmino(object.value); - }, - toAminoMsg(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroupPolicy', - value: MsgCreateGroupPolicy.toAmino(message), - }; - }, fromProtoMsg(message: MsgCreateGroupPolicyProtoMsg): MsgCreateGroupPolicy { return MsgCreateGroupPolicy.decode(message.value); }, @@ -1898,35 +1294,6 @@ export const MsgCreateGroupPolicyResponse = { message.address = object.address ?? ''; return message; }, - fromAmino( - object: MsgCreateGroupPolicyResponseAmino, - ): MsgCreateGroupPolicyResponse { - const message = createBaseMsgCreateGroupPolicyResponse(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino( - message: MsgCreateGroupPolicyResponse, - ): MsgCreateGroupPolicyResponseAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg( - object: MsgCreateGroupPolicyResponseAminoMsg, - ): MsgCreateGroupPolicyResponse { - return MsgCreateGroupPolicyResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateGroupPolicyResponse, - ): MsgCreateGroupPolicyResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroupPolicyResponse', - value: MsgCreateGroupPolicyResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateGroupPolicyResponseProtoMsg, ): MsgCreateGroupPolicyResponse { @@ -2010,46 +1377,13 @@ export const MsgUpdateGroupPolicyAdmin = { return obj; }, fromPartial( - object: Partial, - ): MsgUpdateGroupPolicyAdmin { - const message = createBaseMsgUpdateGroupPolicyAdmin(); - message.admin = object.admin ?? ''; - message.address = object.address ?? ''; - message.newAdmin = object.newAdmin ?? ''; - return message; - }, - fromAmino(object: MsgUpdateGroupPolicyAdminAmino): MsgUpdateGroupPolicyAdmin { - const message = createBaseMsgUpdateGroupPolicyAdmin(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.newAdmin = object.new_admin; - } - return message; - }, - toAmino(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.address = message.address === '' ? undefined : message.address; - obj.new_admin = message.newAdmin === '' ? undefined : message.newAdmin; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyAdminAminoMsg, - ): MsgUpdateGroupPolicyAdmin { - return MsgUpdateGroupPolicyAdmin.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyAdmin, - ): MsgUpdateGroupPolicyAdminAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyAdmin', - value: MsgUpdateGroupPolicyAdmin.toAmino(message), - }; + object: Partial, + ): MsgUpdateGroupPolicyAdmin { + const message = createBaseMsgUpdateGroupPolicyAdmin(); + message.admin = object.admin ?? ''; + message.address = object.address ?? ''; + message.newAdmin = object.newAdmin ?? ''; + return message; }, fromProtoMsg( message: MsgUpdateGroupPolicyAdminProtoMsg, @@ -2202,75 +1536,6 @@ export const MsgCreateGroupWithPolicy = { : undefined; return message; }, - fromAmino(object: MsgCreateGroupWithPolicyAmino): MsgCreateGroupWithPolicy { - const message = createBaseMsgCreateGroupWithPolicy(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - message.members = object.members?.map(e => Member.fromAmino(e)) || []; - if (object.group_metadata !== undefined && object.group_metadata !== null) { - message.groupMetadata = object.group_metadata; - } - if ( - object.group_policy_metadata !== undefined && - object.group_policy_metadata !== null - ) { - message.groupPolicyMetadata = object.group_policy_metadata; - } - if ( - object.group_policy_as_admin !== undefined && - object.group_policy_as_admin !== null - ) { - message.groupPolicyAsAdmin = object.group_policy_as_admin; - } - if ( - object.decision_policy !== undefined && - object.decision_policy !== null - ) { - message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino( - object.decision_policy, - ); - } - return message; - }, - toAmino(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - if (message.members) { - obj.members = message.members.map(e => - e ? Member.toAmino(e) : undefined, - ); - } else { - obj.members = message.members; - } - obj.group_metadata = - message.groupMetadata === '' ? undefined : message.groupMetadata; - obj.group_policy_metadata = - message.groupPolicyMetadata === '' - ? undefined - : message.groupPolicyMetadata; - obj.group_policy_as_admin = - message.groupPolicyAsAdmin === false - ? undefined - : message.groupPolicyAsAdmin; - obj.decision_policy = message.decisionPolicy - ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) - : undefined; - return obj; - }, - fromAminoMsg( - object: MsgCreateGroupWithPolicyAminoMsg, - ): MsgCreateGroupWithPolicy { - return MsgCreateGroupWithPolicy.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateGroupWithPolicy, - ): MsgCreateGroupWithPolicyAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroupWithPolicy', - value: MsgCreateGroupWithPolicy.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateGroupWithPolicyProtoMsg, ): MsgCreateGroupWithPolicy { @@ -2361,46 +1626,6 @@ export const MsgCreateGroupWithPolicyResponse = { message.groupPolicyAddress = object.groupPolicyAddress ?? ''; return message; }, - fromAmino( - object: MsgCreateGroupWithPolicyResponseAmino, - ): MsgCreateGroupWithPolicyResponse { - const message = createBaseMsgCreateGroupWithPolicyResponse(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if ( - object.group_policy_address !== undefined && - object.group_policy_address !== null - ) { - message.groupPolicyAddress = object.group_policy_address; - } - return message; - }, - toAmino( - message: MsgCreateGroupWithPolicyResponse, - ): MsgCreateGroupWithPolicyResponseAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.group_policy_address = - message.groupPolicyAddress === '' - ? undefined - : message.groupPolicyAddress; - return obj; - }, - fromAminoMsg( - object: MsgCreateGroupWithPolicyResponseAminoMsg, - ): MsgCreateGroupWithPolicyResponse { - return MsgCreateGroupWithPolicyResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateGroupWithPolicyResponse, - ): MsgCreateGroupWithPolicyResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateGroupWithPolicyResponse', - value: MsgCreateGroupWithPolicyResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateGroupWithPolicyResponseProtoMsg, ): MsgCreateGroupWithPolicyResponse { @@ -2460,31 +1685,6 @@ export const MsgUpdateGroupPolicyAdminResponse = { const message = createBaseMsgUpdateGroupPolicyAdminResponse(); return message; }, - fromAmino( - _: MsgUpdateGroupPolicyAdminResponseAmino, - ): MsgUpdateGroupPolicyAdminResponse { - const message = createBaseMsgUpdateGroupPolicyAdminResponse(); - return message; - }, - toAmino( - _: MsgUpdateGroupPolicyAdminResponse, - ): MsgUpdateGroupPolicyAdminResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyAdminResponseAminoMsg, - ): MsgUpdateGroupPolicyAdminResponse { - return MsgUpdateGroupPolicyAdminResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyAdminResponse, - ): MsgUpdateGroupPolicyAdminResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyAdminResponse', - value: MsgUpdateGroupPolicyAdminResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupPolicyAdminResponseProtoMsg, ): MsgUpdateGroupPolicyAdminResponse { @@ -2589,50 +1789,6 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { : undefined; return message; }, - fromAmino( - object: MsgUpdateGroupPolicyDecisionPolicyAmino, - ): MsgUpdateGroupPolicyDecisionPolicy { - const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if ( - object.decision_policy !== undefined && - object.decision_policy !== null - ) { - message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino( - object.decision_policy, - ); - } - return message; - }, - toAmino( - message: MsgUpdateGroupPolicyDecisionPolicy, - ): MsgUpdateGroupPolicyDecisionPolicyAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.address = message.address === '' ? undefined : message.address; - obj.decision_policy = message.decisionPolicy - ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) - : undefined; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyDecisionPolicyAminoMsg, - ): MsgUpdateGroupPolicyDecisionPolicy { - return MsgUpdateGroupPolicyDecisionPolicy.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyDecisionPolicy, - ): MsgUpdateGroupPolicyDecisionPolicyAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicy', - value: MsgUpdateGroupPolicyDecisionPolicy.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupPolicyDecisionPolicyProtoMsg, ): MsgUpdateGroupPolicyDecisionPolicy { @@ -2692,31 +1848,6 @@ export const MsgUpdateGroupPolicyDecisionPolicyResponse = { const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); return message; }, - fromAmino( - _: MsgUpdateGroupPolicyDecisionPolicyResponseAmino, - ): MsgUpdateGroupPolicyDecisionPolicyResponse { - const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); - return message; - }, - toAmino( - _: MsgUpdateGroupPolicyDecisionPolicyResponse, - ): MsgUpdateGroupPolicyDecisionPolicyResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg, - ): MsgUpdateGroupPolicyDecisionPolicyResponse { - return MsgUpdateGroupPolicyDecisionPolicyResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyDecisionPolicyResponse, - ): MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse', - value: MsgUpdateGroupPolicyDecisionPolicyResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg, ): MsgUpdateGroupPolicyDecisionPolicyResponse { @@ -2809,43 +1940,6 @@ export const MsgUpdateGroupPolicyMetadata = { message.metadata = object.metadata ?? ''; return message; }, - fromAmino( - object: MsgUpdateGroupPolicyMetadataAmino, - ): MsgUpdateGroupPolicyMetadata { - const message = createBaseMsgUpdateGroupPolicyMetadata(); - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino( - message: MsgUpdateGroupPolicyMetadata, - ): MsgUpdateGroupPolicyMetadataAmino { - const obj: any = {}; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.address = message.address === '' ? undefined : message.address; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyMetadataAminoMsg, - ): MsgUpdateGroupPolicyMetadata { - return MsgUpdateGroupPolicyMetadata.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyMetadata, - ): MsgUpdateGroupPolicyMetadataAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyMetadata', - value: MsgUpdateGroupPolicyMetadata.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupPolicyMetadataProtoMsg, ): MsgUpdateGroupPolicyMetadata { @@ -2905,31 +1999,6 @@ export const MsgUpdateGroupPolicyMetadataResponse = { const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); return message; }, - fromAmino( - _: MsgUpdateGroupPolicyMetadataResponseAmino, - ): MsgUpdateGroupPolicyMetadataResponse { - const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); - return message; - }, - toAmino( - _: MsgUpdateGroupPolicyMetadataResponse, - ): MsgUpdateGroupPolicyMetadataResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgUpdateGroupPolicyMetadataResponseAminoMsg, - ): MsgUpdateGroupPolicyMetadataResponse { - return MsgUpdateGroupPolicyMetadataResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgUpdateGroupPolicyMetadataResponse, - ): MsgUpdateGroupPolicyMetadataResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse', - value: MsgUpdateGroupPolicyMetadataResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgUpdateGroupPolicyMetadataResponseProtoMsg, ): MsgUpdateGroupPolicyMetadataResponse { @@ -3048,49 +2117,6 @@ export const MsgSubmitProposal = { message.exec = object.exec ?? 0; return message; }, - fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - message.proposers = object.proposers?.map(e => e) || []; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - if (object.exec !== undefined && object.exec !== null) { - message.exec = object.exec; - } - return message; - }, - toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - if (message.proposers) { - obj.proposers = message.proposers.map(e => e); - } else { - obj.proposers = message.proposers; - } - obj.metadata = message.metadata === '' ? undefined : message.metadata; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - obj.exec = message.exec === 0 ? undefined : message.exec; - return obj; - }, - fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { - return MsgSubmitProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { - return { - type: 'cosmos-sdk/group/MsgSubmitProposal', - value: MsgSubmitProposal.toAmino(message), - }; - }, fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { return MsgSubmitProposal.decode(message.value); }, @@ -3164,34 +2190,6 @@ export const MsgSubmitProposalResponse = { : BigInt(0); return message; }, - fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: MsgSubmitProposalResponseAminoMsg, - ): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgSubmitProposalResponse, - ): MsgSubmitProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgSubmitProposalResponse', - value: MsgSubmitProposalResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgSubmitProposalResponseProtoMsg, ): MsgSubmitProposalResponse { @@ -3277,34 +2275,6 @@ export const MsgWithdrawProposal = { message.address = object.address ?? ''; return message; }, - fromAmino(object: MsgWithdrawProposalAmino): MsgWithdrawProposal { - const message = createBaseMsgWithdrawProposal(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: MsgWithdrawProposal): MsgWithdrawProposalAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: MsgWithdrawProposalAminoMsg): MsgWithdrawProposal { - return MsgWithdrawProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgWithdrawProposal): MsgWithdrawProposalAminoMsg { - return { - type: 'cosmos-sdk/group/MsgWithdrawProposal', - value: MsgWithdrawProposal.toAmino(message), - }; - }, fromProtoMsg(message: MsgWithdrawProposalProtoMsg): MsgWithdrawProposal { return MsgWithdrawProposal.decode(message.value); }, @@ -3360,27 +2330,6 @@ export const MsgWithdrawProposalResponse = { const message = createBaseMsgWithdrawProposalResponse(); return message; }, - fromAmino(_: MsgWithdrawProposalResponseAmino): MsgWithdrawProposalResponse { - const message = createBaseMsgWithdrawProposalResponse(); - return message; - }, - toAmino(_: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgWithdrawProposalResponseAminoMsg, - ): MsgWithdrawProposalResponse { - return MsgWithdrawProposalResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgWithdrawProposalResponse, - ): MsgWithdrawProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgWithdrawProposalResponse', - value: MsgWithdrawProposalResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgWithdrawProposalResponseProtoMsg, ): MsgWithdrawProposalResponse { @@ -3494,46 +2443,6 @@ export const MsgVote = { message.exec = object.exec ?? 0; return message; }, - fromAmino(object: MsgVoteAmino): MsgVote { - const message = createBaseMsgVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.exec !== undefined && object.exec !== null) { - message.exec = object.exec; - } - return message; - }, - toAmino(message: MsgVote): MsgVoteAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.option = message.option === 0 ? undefined : message.option; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.exec = message.exec === 0 ? undefined : message.exec; - return obj; - }, - fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { - return MsgVote.fromAmino(object.value); - }, - toAminoMsg(message: MsgVote): MsgVoteAminoMsg { - return { - type: 'cosmos-sdk/group/MsgVote', - value: MsgVote.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { return MsgVote.decode(message.value); }, @@ -3584,23 +2493,6 @@ export const MsgVoteResponse = { const message = createBaseMsgVoteResponse(); return message; }, - fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; - }, - toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { - return MsgVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgVoteResponse', - value: MsgVoteResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { return MsgVoteResponse.decode(message.value); }, @@ -3679,34 +2571,6 @@ export const MsgExec = { message.signer = object.signer ?? ''; return message; }, - fromAmino(object: MsgExecAmino): MsgExec { - const message = createBaseMsgExec(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.signer !== undefined && object.signer !== null) { - message.signer = object.signer; - } - return message; - }, - toAmino(message: MsgExec): MsgExecAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.signer = message.signer === '' ? undefined : message.signer; - return obj; - }, - fromAminoMsg(object: MsgExecAminoMsg): MsgExec { - return MsgExec.fromAmino(object.value); - }, - toAminoMsg(message: MsgExec): MsgExecAminoMsg { - return { - type: 'cosmos-sdk/group/MsgExec', - value: MsgExec.toAmino(message), - }; - }, fromProtoMsg(message: MsgExecProtoMsg): MsgExec { return MsgExec.decode(message.value); }, @@ -3757,23 +2621,6 @@ export const MsgExecResponse = { const message = createBaseMsgExecResponse(); return message; }, - fromAmino(_: MsgExecResponseAmino): MsgExecResponse { - const message = createBaseMsgExecResponse(); - return message; - }, - toAmino(_: MsgExecResponse): MsgExecResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { - return MsgExecResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgExecResponse', - value: MsgExecResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { return MsgExecResponse.decode(message.value); }, @@ -3852,32 +2699,6 @@ export const MsgLeaveGroup = { : BigInt(0); return message; }, - fromAmino(object: MsgLeaveGroupAmino): MsgLeaveGroup { - const message = createBaseMsgLeaveGroup(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - return message; - }, - toAmino(message: MsgLeaveGroup): MsgLeaveGroupAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: MsgLeaveGroupAminoMsg): MsgLeaveGroup { - return MsgLeaveGroup.fromAmino(object.value); - }, - toAminoMsg(message: MsgLeaveGroup): MsgLeaveGroupAminoMsg { - return { - type: 'cosmos-sdk/group/MsgLeaveGroup', - value: MsgLeaveGroup.toAmino(message), - }; - }, fromProtoMsg(message: MsgLeaveGroupProtoMsg): MsgLeaveGroup { return MsgLeaveGroup.decode(message.value); }, @@ -3931,23 +2752,6 @@ export const MsgLeaveGroupResponse = { const message = createBaseMsgLeaveGroupResponse(); return message; }, - fromAmino(_: MsgLeaveGroupResponseAmino): MsgLeaveGroupResponse { - const message = createBaseMsgLeaveGroupResponse(); - return message; - }, - toAmino(_: MsgLeaveGroupResponse): MsgLeaveGroupResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgLeaveGroupResponseAminoMsg): MsgLeaveGroupResponse { - return MsgLeaveGroupResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgLeaveGroupResponse): MsgLeaveGroupResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgLeaveGroupResponse', - value: MsgLeaveGroupResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgLeaveGroupResponseProtoMsg): MsgLeaveGroupResponse { return MsgLeaveGroupResponse.decode(message.value); }, @@ -3976,49 +2780,3 @@ export const Cosmos_groupDecisionPolicy_InterfaceDecoder = ( return data; } }; -export const Cosmos_groupDecisionPolicy_FromAmino = ( - content: AnyAmino, -): Any => { - switch (content.type) { - case 'cosmos-sdk/ThresholdDecisionPolicy': - return Any.fromPartial({ - typeUrl: '/cosmos.group.v1.ThresholdDecisionPolicy', - value: ThresholdDecisionPolicy.encode( - ThresholdDecisionPolicy.fromPartial( - ThresholdDecisionPolicy.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/PercentageDecisionPolicy': - return Any.fromPartial({ - typeUrl: '/cosmos.group.v1.PercentageDecisionPolicy', - value: PercentageDecisionPolicy.encode( - PercentageDecisionPolicy.fromPartial( - PercentageDecisionPolicy.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_groupDecisionPolicy_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.group.v1.ThresholdDecisionPolicy': - return { - type: 'cosmos-sdk/ThresholdDecisionPolicy', - value: ThresholdDecisionPolicy.toAmino( - ThresholdDecisionPolicy.decode(content.value, undefined), - ), - }; - case '/cosmos.group.v1.PercentageDecisionPolicy': - return { - type: 'cosmos-sdk/PercentageDecisionPolicy', - value: PercentageDecisionPolicy.toAmino( - PercentageDecisionPolicy.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts b/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts index 2ccb06776ac..eb9b3d9720c 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts @@ -2,15 +2,9 @@ import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { Duration, - DurationAmino, DurationSDKType, } from '../../../google/protobuf/duration.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { toTimestamp, @@ -33,7 +27,6 @@ export enum VoteOption { UNRECOGNIZED = -1, } export const VoteOptionSDKType = VoteOption; -export const VoteOptionAmino = VoteOption; export function voteOptionFromJSON(object: any): VoteOption { switch (object) { case 0: @@ -92,7 +85,6 @@ export enum ProposalStatus { UNRECOGNIZED = -1, } export const ProposalStatusSDKType = ProposalStatus; -export const ProposalStatusAmino = ProposalStatus; export function proposalStatusFromJSON(object: any): ProposalStatus { switch (object) { case 0: @@ -146,7 +138,6 @@ export enum ProposalResult { UNRECOGNIZED = -1, } export const ProposalResultSDKType = ProposalResult; -export const ProposalResultAmino = ProposalResult; export function proposalResultFromJSON(object: any): ProposalResult { switch (object) { case 0: @@ -195,7 +186,6 @@ export enum ProposalExecutorResult { UNRECOGNIZED = -1, } export const ProposalExecutorResultSDKType = ProposalExecutorResult; -export const ProposalExecutorResultAmino = ProposalExecutorResult; export function proposalExecutorResultFromJSON( object: any, ): ProposalExecutorResult { @@ -253,24 +243,6 @@ export interface MemberProtoMsg { typeUrl: '/cosmos.group.v1.Member'; value: Uint8Array; } -/** - * Member represents a group member with an account address, - * non-zero weight and metadata. - */ -export interface MemberAmino { - /** address is the member's account address. */ - address?: string; - /** weight is the member's voting weight that should be greater than 0. */ - weight?: string; - /** metadata is any arbitrary metadata to attached to the member. */ - metadata?: string; - /** added_at is a timestamp specifying when a member was added. */ - added_at?: string; -} -export interface MemberAminoMsg { - type: 'cosmos-sdk/Member'; - value: MemberAmino; -} /** * Member represents a group member with an account address, * non-zero weight and metadata. @@ -291,15 +263,6 @@ export interface MembersProtoMsg { value: Uint8Array; } /** Members defines a repeated slice of Member objects. */ -export interface MembersAmino { - /** members is the list of members. */ - members?: MemberAmino[]; -} -export interface MembersAminoMsg { - type: 'cosmos-sdk/Members'; - value: MembersAmino; -} -/** Members defines a repeated slice of Member objects. */ export interface MembersSDKType { members: MemberSDKType[]; } @@ -316,17 +279,6 @@ export interface ThresholdDecisionPolicyProtoMsg { value: Uint8Array; } /** ThresholdDecisionPolicy implements the DecisionPolicy interface */ -export interface ThresholdDecisionPolicyAmino { - /** threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. */ - threshold?: string; - /** windows defines the different windows for voting and execution. */ - windows?: DecisionPolicyWindowsAmino; -} -export interface ThresholdDecisionPolicyAminoMsg { - type: 'cosmos-sdk/ThresholdDecisionPolicy'; - value: ThresholdDecisionPolicyAmino; -} -/** ThresholdDecisionPolicy implements the DecisionPolicy interface */ export interface ThresholdDecisionPolicySDKType { $typeUrl?: '/cosmos.group.v1.ThresholdDecisionPolicy'; threshold: string; @@ -345,17 +297,6 @@ export interface PercentageDecisionPolicyProtoMsg { value: Uint8Array; } /** PercentageDecisionPolicy implements the DecisionPolicy interface */ -export interface PercentageDecisionPolicyAmino { - /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ - percentage?: string; - /** windows defines the different windows for voting and execution. */ - windows?: DecisionPolicyWindowsAmino; -} -export interface PercentageDecisionPolicyAminoMsg { - type: 'cosmos-sdk/PercentageDecisionPolicy'; - value: PercentageDecisionPolicyAmino; -} -/** PercentageDecisionPolicy implements the DecisionPolicy interface */ export interface PercentageDecisionPolicySDKType { $typeUrl?: '/cosmos.group.v1.PercentageDecisionPolicy'; percentage: string; @@ -388,32 +329,6 @@ export interface DecisionPolicyWindowsProtoMsg { value: Uint8Array; } /** DecisionPolicyWindows defines the different windows for voting and execution. */ -export interface DecisionPolicyWindowsAmino { - /** - * voting_period is the duration from submission of a proposal to the end of voting period - * Within this times votes can be submitted with MsgVote. - */ - voting_period?: DurationAmino; - /** - * min_execution_period is the minimum duration after the proposal submission - * where members can start sending MsgExec. This means that the window for - * sending a MsgExec transaction is: - * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` - * where max_execution_period is a app-specific config, defined in the keeper. - * If not set, min_execution_period will default to 0. - * - * Please make sure to set a `min_execution_period` that is smaller than - * `voting_period + max_execution_period`, or else the above execution window - * is empty, meaning that all proposals created with this decision policy - * won't be able to be executed. - */ - min_execution_period?: DurationAmino; -} -export interface DecisionPolicyWindowsAminoMsg { - type: 'cosmos-sdk/DecisionPolicyWindows'; - value: DecisionPolicyWindowsAmino; -} -/** DecisionPolicyWindows defines the different windows for voting and execution. */ export interface DecisionPolicyWindowsSDKType { voting_period: DurationSDKType; min_execution_period: DurationSDKType; @@ -443,30 +358,6 @@ export interface GroupInfoProtoMsg { value: Uint8Array; } /** GroupInfo represents the high-level on-chain information for a group. */ -export interface GroupInfoAmino { - /** id is the unique ID of the group. */ - id?: string; - /** admin is the account address of the group's admin. */ - admin?: string; - /** metadata is any arbitrary metadata to attached to the group. */ - metadata?: string; - /** - * version is used to track changes to a group's membership structure that - * would break existing proposals. Whenever any members weight is changed, - * or any member is added or removed this version is incremented and will - * cause proposals based on older versions of this group to fail - */ - version?: string; - /** total_weight is the sum of the group members' weights. */ - total_weight?: string; - /** created_at is a timestamp specifying when a group was created. */ - created_at?: string; -} -export interface GroupInfoAminoMsg { - type: 'cosmos-sdk/GroupInfo'; - value: GroupInfoAmino; -} -/** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfoSDKType { id: bigint; admin: string; @@ -487,17 +378,6 @@ export interface GroupMemberProtoMsg { value: Uint8Array; } /** GroupMember represents the relationship between a group and a member. */ -export interface GroupMemberAmino { - /** group_id is the unique ID of the group. */ - group_id?: string; - /** member is the member data. */ - member?: MemberAmino; -} -export interface GroupMemberAminoMsg { - type: 'cosmos-sdk/GroupMember'; - value: GroupMemberAmino; -} -/** GroupMember represents the relationship between a group and a member. */ export interface GroupMemberSDKType { group_id: bigint; member?: MemberSDKType; @@ -528,37 +408,6 @@ export interface GroupPolicyInfoProtoMsg { typeUrl: '/cosmos.group.v1.GroupPolicyInfo'; value: Uint8Array; } -export type GroupPolicyInfoEncoded = Omit & { - /** decision_policy specifies the group policy's decision policy. */ decisionPolicy?: - | ThresholdDecisionPolicyProtoMsg - | PercentageDecisionPolicyProtoMsg - | AnyProtoMsg - | undefined; -}; -/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ -export interface GroupPolicyInfoAmino { - /** address is the account address of group policy. */ - address?: string; - /** group_id is the unique ID of the group. */ - group_id?: string; - /** admin is the account address of the group admin. */ - admin?: string; - /** metadata is any arbitrary metadata to attached to the group policy. */ - metadata?: string; - /** - * version is used to track changes to a group's GroupPolicyInfo structure that - * would create a different result on a running proposal. - */ - version?: string; - /** decision_policy specifies the group policy's decision policy. */ - decision_policy?: AnyAmino; - /** created_at is a timestamp specifying when a group policy was created. */ - created_at?: string; -} -export interface GroupPolicyInfoAminoMsg { - type: 'cosmos-sdk/GroupPolicyInfo'; - value: GroupPolicyInfoAmino; -} /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfoSDKType { address: string; @@ -631,64 +480,6 @@ export interface ProposalProtoMsg { typeUrl: '/cosmos.group.v1.Proposal'; value: Uint8Array; } -/** - * Proposal defines a group proposal. Any member of a group can submit a proposal - * for a group policy to decide upon. - * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal - * passes as well as some optional metadata associated with the proposal. - */ -export interface ProposalAmino { - /** id is the unique id of the proposal. */ - id?: string; - /** address is the account address of group policy. */ - address?: string; - /** metadata is any arbitrary metadata to attached to the proposal. */ - metadata?: string; - /** proposers are the account addresses of the proposers. */ - proposers?: string[]; - /** submit_time is a timestamp specifying when a proposal was submitted. */ - submit_time?: string; - /** - * group_version tracks the version of the group that this proposal corresponds to. - * When group membership is changed, existing proposals from previous group versions will become invalid. - */ - group_version?: string; - /** - * group_policy_version tracks the version of the group policy that this proposal corresponds to. - * When a decision policy is changed, existing proposals from previous policy versions will become invalid. - */ - group_policy_version?: string; - /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ - status?: ProposalStatus; - /** - * result is the final result based on the votes and election rule. Initial value is unfinalized. - * The result is persisted so that clients can always rely on this state and not have to replicate the logic. - */ - result?: ProposalResult; - /** - * final_tally_result contains the sums of all weighted votes for this - * proposal for each vote option, after tallying. When querying a proposal - * via gRPC, this field is not populated until the proposal's voting period - * has ended. - */ - final_tally_result?: TallyResultAmino; - /** - * voting_period_end is the timestamp before which voting must be done. - * Unless a successfull MsgExec is called before (to execute a proposal whose - * tally is successful before the voting period ends), tallying will be done - * at this point, and the `final_tally_result`, as well - * as `status` and `result` fields will be accordingly updated. - */ - voting_period_end?: string; - /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ - executor_result?: ProposalExecutorResult; - /** messages is a list of Msgs that will be executed if the proposal passes. */ - messages?: AnyAmino[]; -} -export interface ProposalAminoMsg { - type: 'cosmos-sdk/Proposal'; - value: ProposalAmino; -} /** * Proposal defines a group proposal. Any member of a group can submit a proposal * for a group policy to decide upon. @@ -726,21 +517,6 @@ export interface TallyResultProtoMsg { value: Uint8Array; } /** TallyResult represents the sum of weighted votes for each vote option. */ -export interface TallyResultAmino { - /** yes_count is the weighted sum of yes votes. */ - yes_count?: string; - /** abstain_count is the weighted sum of abstainers. */ - abstain_count?: string; - /** no is the weighted sum of no votes. */ - no_count?: string; - /** no_with_veto_count is the weighted sum of veto. */ - no_with_veto_count?: string; -} -export interface TallyResultAminoMsg { - type: 'cosmos-sdk/TallyResult'; - value: TallyResultAmino; -} -/** TallyResult represents the sum of weighted votes for each vote option. */ export interface TallyResultSDKType { yes_count: string; abstain_count: string; @@ -765,23 +541,6 @@ export interface VoteProtoMsg { value: Uint8Array; } /** Vote represents a vote for a proposal. */ -export interface VoteAmino { - /** proposal is the unique ID of the proposal. */ - proposal_id?: string; - /** voter is the account address of the voter. */ - voter?: string; - /** option is the voter's choice on the proposal. */ - option?: VoteOption; - /** metadata is any arbitrary metadata to attached to the vote. */ - metadata?: string; - /** submit_time is the timestamp when the vote was submitted. */ - submit_time?: string; -} -export interface VoteAminoMsg { - type: 'cosmos-sdk/Vote'; - value: VoteAmino; -} -/** Vote represents a vote for a proposal. */ export interface VoteSDKType { proposal_id: bigint; voter: string; @@ -876,41 +635,6 @@ export const Member = { message.addedAt = object.addedAt ?? undefined; return message; }, - fromAmino(object: MemberAmino): Member { - const message = createBaseMember(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.weight !== undefined && object.weight !== null) { - message.weight = object.weight; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.added_at !== undefined && object.added_at !== null) { - message.addedAt = fromTimestamp(Timestamp.fromAmino(object.added_at)); - } - return message; - }, - toAmino(message: Member): MemberAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.weight = message.weight === '' ? undefined : message.weight; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.added_at = message.addedAt - ? Timestamp.toAmino(toTimestamp(message.addedAt)) - : undefined; - return obj; - }, - fromAminoMsg(object: MemberAminoMsg): Member { - return Member.fromAmino(object.value); - }, - toAminoMsg(message: Member): MemberAminoMsg { - return { - type: 'cosmos-sdk/Member', - value: Member.toAmino(message), - }; - }, fromProtoMsg(message: MemberProtoMsg): Member { return Member.decode(message.value); }, @@ -981,31 +705,6 @@ export const Members = { message.members = object.members?.map(e => Member.fromPartial(e)) || []; return message; }, - fromAmino(object: MembersAmino): Members { - const message = createBaseMembers(); - message.members = object.members?.map(e => Member.fromAmino(e)) || []; - return message; - }, - toAmino(message: Members): MembersAmino { - const obj: any = {}; - if (message.members) { - obj.members = message.members.map(e => - e ? Member.toAmino(e) : undefined, - ); - } else { - obj.members = message.members; - } - return obj; - }, - fromAminoMsg(object: MembersAminoMsg): Members { - return Members.fromAmino(object.value); - }, - toAminoMsg(message: Members): MembersAminoMsg { - return { - type: 'cosmos-sdk/Members', - value: Members.toAmino(message), - }; - }, fromProtoMsg(message: MembersProtoMsg): Members { return Members.decode(message.value); }, @@ -1098,37 +797,6 @@ export const ThresholdDecisionPolicy = { : undefined; return message; }, - fromAmino(object: ThresholdDecisionPolicyAmino): ThresholdDecisionPolicy { - const message = createBaseThresholdDecisionPolicy(); - if (object.threshold !== undefined && object.threshold !== null) { - message.threshold = object.threshold; - } - if (object.windows !== undefined && object.windows !== null) { - message.windows = DecisionPolicyWindows.fromAmino(object.windows); - } - return message; - }, - toAmino(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAmino { - const obj: any = {}; - obj.threshold = message.threshold === '' ? undefined : message.threshold; - obj.windows = message.windows - ? DecisionPolicyWindows.toAmino(message.windows) - : undefined; - return obj; - }, - fromAminoMsg( - object: ThresholdDecisionPolicyAminoMsg, - ): ThresholdDecisionPolicy { - return ThresholdDecisionPolicy.fromAmino(object.value); - }, - toAminoMsg( - message: ThresholdDecisionPolicy, - ): ThresholdDecisionPolicyAminoMsg { - return { - type: 'cosmos-sdk/ThresholdDecisionPolicy', - value: ThresholdDecisionPolicy.toAmino(message), - }; - }, fromProtoMsg( message: ThresholdDecisionPolicyProtoMsg, ): ThresholdDecisionPolicy { @@ -1225,37 +893,6 @@ export const PercentageDecisionPolicy = { : undefined; return message; }, - fromAmino(object: PercentageDecisionPolicyAmino): PercentageDecisionPolicy { - const message = createBasePercentageDecisionPolicy(); - if (object.percentage !== undefined && object.percentage !== null) { - message.percentage = object.percentage; - } - if (object.windows !== undefined && object.windows !== null) { - message.windows = DecisionPolicyWindows.fromAmino(object.windows); - } - return message; - }, - toAmino(message: PercentageDecisionPolicy): PercentageDecisionPolicyAmino { - const obj: any = {}; - obj.percentage = message.percentage === '' ? undefined : message.percentage; - obj.windows = message.windows - ? DecisionPolicyWindows.toAmino(message.windows) - : undefined; - return obj; - }, - fromAminoMsg( - object: PercentageDecisionPolicyAminoMsg, - ): PercentageDecisionPolicy { - return PercentageDecisionPolicy.fromAmino(object.value); - }, - toAminoMsg( - message: PercentageDecisionPolicy, - ): PercentageDecisionPolicyAminoMsg { - return { - type: 'cosmos-sdk/PercentageDecisionPolicy', - value: PercentageDecisionPolicy.toAmino(message), - }; - }, fromProtoMsg( message: PercentageDecisionPolicyProtoMsg, ): PercentageDecisionPolicy { @@ -1355,40 +992,6 @@ export const DecisionPolicyWindows = { : undefined; return message; }, - fromAmino(object: DecisionPolicyWindowsAmino): DecisionPolicyWindows { - const message = createBaseDecisionPolicyWindows(); - if (object.voting_period !== undefined && object.voting_period !== null) { - message.votingPeriod = Duration.fromAmino(object.voting_period); - } - if ( - object.min_execution_period !== undefined && - object.min_execution_period !== null - ) { - message.minExecutionPeriod = Duration.fromAmino( - object.min_execution_period, - ); - } - return message; - }, - toAmino(message: DecisionPolicyWindows): DecisionPolicyWindowsAmino { - const obj: any = {}; - obj.voting_period = message.votingPeriod - ? Duration.toAmino(message.votingPeriod) - : undefined; - obj.min_execution_period = message.minExecutionPeriod - ? Duration.toAmino(message.minExecutionPeriod) - : undefined; - return obj; - }, - fromAminoMsg(object: DecisionPolicyWindowsAminoMsg): DecisionPolicyWindows { - return DecisionPolicyWindows.fromAmino(object.value); - }, - toAminoMsg(message: DecisionPolicyWindows): DecisionPolicyWindowsAminoMsg { - return { - type: 'cosmos-sdk/DecisionPolicyWindows', - value: DecisionPolicyWindows.toAmino(message), - }; - }, fromProtoMsg(message: DecisionPolicyWindowsProtoMsg): DecisionPolicyWindows { return DecisionPolicyWindows.decode(message.value); }, @@ -1519,51 +1122,6 @@ export const GroupInfo = { message.createdAt = object.createdAt ?? undefined; return message; }, - fromAmino(object: GroupInfoAmino): GroupInfo { - const message = createBaseGroupInfo(); - if (object.id !== undefined && object.id !== null) { - message.id = BigInt(object.id); - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.version !== undefined && object.version !== null) { - message.version = BigInt(object.version); - } - if (object.total_weight !== undefined && object.total_weight !== null) { - message.totalWeight = object.total_weight; - } - if (object.created_at !== undefined && object.created_at !== null) { - message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); - } - return message; - }, - toAmino(message: GroupInfo): GroupInfoAmino { - const obj: any = {}; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.version = - message.version !== BigInt(0) ? message.version.toString() : undefined; - obj.total_weight = - message.totalWeight === '' ? undefined : message.totalWeight; - obj.created_at = message.createdAt - ? Timestamp.toAmino(toTimestamp(message.createdAt)) - : undefined; - return obj; - }, - fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { - return GroupInfo.fromAmino(object.value); - }, - toAminoMsg(message: GroupInfo): GroupInfoAminoMsg { - return { - type: 'cosmos-sdk/GroupInfo', - value: GroupInfo.toAmino(message), - }; - }, fromProtoMsg(message: GroupInfoProtoMsg): GroupInfo { return GroupInfo.decode(message.value); }, @@ -1646,32 +1204,6 @@ export const GroupMember = { : undefined; return message; }, - fromAmino(object: GroupMemberAmino): GroupMember { - const message = createBaseGroupMember(); - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.member !== undefined && object.member !== null) { - message.member = Member.fromAmino(object.member); - } - return message; - }, - toAmino(message: GroupMember): GroupMemberAmino { - const obj: any = {}; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.member = message.member ? Member.toAmino(message.member) : undefined; - return obj; - }, - fromAminoMsg(object: GroupMemberAminoMsg): GroupMember { - return GroupMember.fromAmino(object.value); - }, - toAminoMsg(message: GroupMember): GroupMemberAminoMsg { - return { - type: 'cosmos-sdk/GroupMember', - value: GroupMember.toAmino(message), - }; - }, fromProtoMsg(message: GroupMemberProtoMsg): GroupMember { return GroupMember.decode(message.value); }, @@ -1827,62 +1359,6 @@ export const GroupPolicyInfo = { message.createdAt = object.createdAt ?? undefined; return message; }, - fromAmino(object: GroupPolicyInfoAmino): GroupPolicyInfo { - const message = createBaseGroupPolicyInfo(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.group_id !== undefined && object.group_id !== null) { - message.groupId = BigInt(object.group_id); - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.version !== undefined && object.version !== null) { - message.version = BigInt(object.version); - } - if ( - object.decision_policy !== undefined && - object.decision_policy !== null - ) { - message.decisionPolicy = Cosmos_groupDecisionPolicy_FromAmino( - object.decision_policy, - ); - } - if (object.created_at !== undefined && object.created_at !== null) { - message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); - } - return message; - }, - toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.group_id = - message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; - obj.admin = message.admin === '' ? undefined : message.admin; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.version = - message.version !== BigInt(0) ? message.version.toString() : undefined; - obj.decision_policy = message.decisionPolicy - ? Cosmos_groupDecisionPolicy_ToAmino(message.decisionPolicy as Any) - : undefined; - obj.created_at = message.createdAt - ? Timestamp.toAmino(toTimestamp(message.createdAt)) - : undefined; - return obj; - }, - fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { - return GroupPolicyInfo.fromAmino(object.value); - }, - toAminoMsg(message: GroupPolicyInfo): GroupPolicyInfoAminoMsg { - return { - type: 'cosmos-sdk/GroupPolicyInfo', - value: GroupPolicyInfo.toAmino(message), - }; - }, fromProtoMsg(message: GroupPolicyInfoProtoMsg): GroupPolicyInfo { return GroupPolicyInfo.decode(message.value); }, @@ -2132,112 +1608,6 @@ export const Proposal = { message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: ProposalAmino): Proposal { - const message = createBaseProposal(); - if (object.id !== undefined && object.id !== null) { - message.id = BigInt(object.id); - } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - message.proposers = object.proposers?.map(e => e) || []; - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submitTime = fromTimestamp( - Timestamp.fromAmino(object.submit_time), - ); - } - if (object.group_version !== undefined && object.group_version !== null) { - message.groupVersion = BigInt(object.group_version); - } - if ( - object.group_policy_version !== undefined && - object.group_policy_version !== null - ) { - message.groupPolicyVersion = BigInt(object.group_policy_version); - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } - if ( - object.final_tally_result !== undefined && - object.final_tally_result !== null - ) { - message.finalTallyResult = TallyResult.fromAmino( - object.final_tally_result, - ); - } - if ( - object.voting_period_end !== undefined && - object.voting_period_end !== null - ) { - message.votingPeriodEnd = fromTimestamp( - Timestamp.fromAmino(object.voting_period_end), - ); - } - if ( - object.executor_result !== undefined && - object.executor_result !== null - ) { - message.executorResult = object.executor_result; - } - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: Proposal): ProposalAmino { - const obj: any = {}; - obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; - obj.address = message.address === '' ? undefined : message.address; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - if (message.proposers) { - obj.proposers = message.proposers.map(e => e); - } else { - obj.proposers = message.proposers; - } - obj.submit_time = message.submitTime - ? Timestamp.toAmino(toTimestamp(message.submitTime)) - : undefined; - obj.group_version = - message.groupVersion !== BigInt(0) - ? message.groupVersion.toString() - : undefined; - obj.group_policy_version = - message.groupPolicyVersion !== BigInt(0) - ? message.groupPolicyVersion.toString() - : undefined; - obj.status = message.status === 0 ? undefined : message.status; - obj.result = message.result === 0 ? undefined : message.result; - obj.final_tally_result = message.finalTallyResult - ? TallyResult.toAmino(message.finalTallyResult) - : undefined; - obj.voting_period_end = message.votingPeriodEnd - ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) - : undefined; - obj.executor_result = - message.executorResult === 0 ? undefined : message.executorResult; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - return obj; - }, - fromAminoMsg(object: ProposalAminoMsg): Proposal { - return Proposal.fromAmino(object.value); - }, - toAminoMsg(message: Proposal): ProposalAminoMsg { - return { - type: 'cosmos-sdk/Proposal', - value: Proposal.toAmino(message), - }; - }, fromProtoMsg(message: ProposalProtoMsg): Proposal { return Proposal.decode(message.value); }, @@ -2336,44 +1706,6 @@ export const TallyResult = { message.noWithVetoCount = object.noWithVetoCount ?? ''; return message; }, - fromAmino(object: TallyResultAmino): TallyResult { - const message = createBaseTallyResult(); - if (object.yes_count !== undefined && object.yes_count !== null) { - message.yesCount = object.yes_count; - } - if (object.abstain_count !== undefined && object.abstain_count !== null) { - message.abstainCount = object.abstain_count; - } - if (object.no_count !== undefined && object.no_count !== null) { - message.noCount = object.no_count; - } - if ( - object.no_with_veto_count !== undefined && - object.no_with_veto_count !== null - ) { - message.noWithVetoCount = object.no_with_veto_count; - } - return message; - }, - toAmino(message: TallyResult): TallyResultAmino { - const obj: any = {}; - obj.yes_count = message.yesCount === '' ? undefined : message.yesCount; - obj.abstain_count = - message.abstainCount === '' ? undefined : message.abstainCount; - obj.no_count = message.noCount === '' ? undefined : message.noCount; - obj.no_with_veto_count = - message.noWithVetoCount === '' ? undefined : message.noWithVetoCount; - return obj; - }, - fromAminoMsg(object: TallyResultAminoMsg): TallyResult { - return TallyResult.fromAmino(object.value); - }, - toAminoMsg(message: TallyResult): TallyResultAminoMsg { - return { - type: 'cosmos-sdk/TallyResult', - value: TallyResult.toAmino(message), - }; - }, fromProtoMsg(message: TallyResultProtoMsg): TallyResult { return TallyResult.decode(message.value); }, @@ -2491,50 +1823,6 @@ export const Vote = { message.submitTime = object.submitTime ?? undefined; return message; }, - fromAmino(object: VoteAmino): Vote { - const message = createBaseVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.submit_time !== undefined && object.submit_time !== null) { - message.submitTime = fromTimestamp( - Timestamp.fromAmino(object.submit_time), - ); - } - return message; - }, - toAmino(message: Vote): VoteAmino { - const obj: any = {}; - obj.proposal_id = - message.proposalId !== BigInt(0) - ? message.proposalId.toString() - : undefined; - obj.voter = message.voter === '' ? undefined : message.voter; - obj.option = message.option === 0 ? undefined : message.option; - obj.metadata = message.metadata === '' ? undefined : message.metadata; - obj.submit_time = message.submitTime - ? Timestamp.toAmino(toTimestamp(message.submitTime)) - : undefined; - return obj; - }, - fromAminoMsg(object: VoteAminoMsg): Vote { - return Vote.fromAmino(object.value); - }, - toAminoMsg(message: Vote): VoteAminoMsg { - return { - type: 'cosmos-sdk/Vote', - value: Vote.toAmino(message), - }; - }, fromProtoMsg(message: VoteProtoMsg): Vote { return Vote.decode(message.value); }, @@ -2563,49 +1851,3 @@ export const Cosmos_groupDecisionPolicy_InterfaceDecoder = ( return data; } }; -export const Cosmos_groupDecisionPolicy_FromAmino = ( - content: AnyAmino, -): Any => { - switch (content.type) { - case 'cosmos-sdk/ThresholdDecisionPolicy': - return Any.fromPartial({ - typeUrl: '/cosmos.group.v1.ThresholdDecisionPolicy', - value: ThresholdDecisionPolicy.encode( - ThresholdDecisionPolicy.fromPartial( - ThresholdDecisionPolicy.fromAmino(content.value), - ), - ).finish(), - }); - case 'cosmos-sdk/PercentageDecisionPolicy': - return Any.fromPartial({ - typeUrl: '/cosmos.group.v1.PercentageDecisionPolicy', - value: PercentageDecisionPolicy.encode( - PercentageDecisionPolicy.fromPartial( - PercentageDecisionPolicy.fromAmino(content.value), - ), - ).finish(), - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_groupDecisionPolicy_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case '/cosmos.group.v1.ThresholdDecisionPolicy': - return { - type: 'cosmos-sdk/ThresholdDecisionPolicy', - value: ThresholdDecisionPolicy.toAmino( - ThresholdDecisionPolicy.decode(content.value, undefined), - ), - }; - case '/cosmos.group.v1.PercentageDecisionPolicy': - return { - type: 'cosmos-sdk/PercentageDecisionPolicy', - value: PercentageDecisionPolicy.toAmino( - PercentageDecisionPolicy.decode(content.value, undefined), - ), - }; - default: - return Any.toAmino(content); - } -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/genesis.ts index ba1d52c915f..8f5efd988d7 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/genesis.ts @@ -1,12 +1,5 @@ //@ts-nocheck -import { - Minter, - MinterAmino, - MinterSDKType, - Params, - ParamsAmino, - ParamsSDKType, -} from './mint.js'; +import { Minter, MinterSDKType, Params, ParamsSDKType } from './mint.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** GenesisState defines the mint module's genesis state. */ @@ -21,17 +14,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the mint module's genesis state. */ -export interface GenesisStateAmino { - /** minter is a space for holding current inflation information. */ - minter?: MinterAmino; - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the mint module's genesis state. */ export interface GenesisStateSDKType { minter: MinterSDKType; params: ParamsSDKType; @@ -103,31 +85,6 @@ export const GenesisState = { : undefined; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.minter !== undefined && object.minter !== null) { - message.minter = Minter.fromAmino(object.minter); - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.minter = message.minter ? Minter.toAmino(message.minter) : undefined; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/mint.ts b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/mint.ts index 28021928a09..1d981e5116b 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/mint.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/mint.ts @@ -14,17 +14,6 @@ export interface MinterProtoMsg { value: Uint8Array; } /** Minter represents the minting state. */ -export interface MinterAmino { - /** current annual inflation rate */ - inflation?: string; - /** current annual expected provisions */ - annual_provisions?: string; -} -export interface MinterAminoMsg { - type: 'cosmos-sdk/Minter'; - value: MinterAmino; -} -/** Minter represents the minting state. */ export interface MinterSDKType { inflation: string; annual_provisions: string; @@ -49,25 +38,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params holds parameters for the mint module. */ -export interface ParamsAmino { - /** type of coin to mint */ - mint_denom?: string; - /** maximum annual change in inflation rate */ - inflation_rate_change?: string; - /** maximum inflation rate */ - inflation_max?: string; - /** minimum inflation rate */ - inflation_min?: string; - /** goal of percent bonded atoms */ - goal_bonded?: string; - /** expected blocks per year */ - blocks_per_year?: string; -} -export interface ParamsAminoMsg { - type: 'cosmos-sdk/Params'; - value: ParamsAmino; -} -/** Params holds parameters for the mint module. */ export interface ParamsSDKType { mint_denom: string; inflation_rate_change: string; @@ -148,35 +118,6 @@ export const Minter = { message.annualProvisions = object.annualProvisions ?? ''; return message; }, - fromAmino(object: MinterAmino): Minter { - const message = createBaseMinter(); - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = object.inflation; - } - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annualProvisions = object.annual_provisions; - } - return message; - }, - toAmino(message: Minter): MinterAmino { - const obj: any = {}; - obj.inflation = message.inflation === '' ? undefined : message.inflation; - obj.annual_provisions = - message.annualProvisions === '' ? undefined : message.annualProvisions; - return obj; - }, - fromAminoMsg(object: MinterAminoMsg): Minter { - return Minter.fromAmino(object.value); - }, - toAminoMsg(message: Minter): MinterAminoMsg { - return { - type: 'cosmos-sdk/Minter', - value: Minter.toAmino(message), - }; - }, fromProtoMsg(message: MinterProtoMsg): Minter { return Minter.decode(message.value); }, @@ -324,62 +265,6 @@ export const Params = { : BigInt(0); return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - if (object.mint_denom !== undefined && object.mint_denom !== null) { - message.mintDenom = object.mint_denom; - } - if ( - object.inflation_rate_change !== undefined && - object.inflation_rate_change !== null - ) { - message.inflationRateChange = object.inflation_rate_change; - } - if (object.inflation_max !== undefined && object.inflation_max !== null) { - message.inflationMax = object.inflation_max; - } - if (object.inflation_min !== undefined && object.inflation_min !== null) { - message.inflationMin = object.inflation_min; - } - if (object.goal_bonded !== undefined && object.goal_bonded !== null) { - message.goalBonded = object.goal_bonded; - } - if ( - object.blocks_per_year !== undefined && - object.blocks_per_year !== null - ) { - message.blocksPerYear = BigInt(object.blocks_per_year); - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.mint_denom = message.mintDenom === '' ? undefined : message.mintDenom; - obj.inflation_rate_change = - message.inflationRateChange === '' - ? undefined - : message.inflationRateChange; - obj.inflation_max = - message.inflationMax === '' ? undefined : message.inflationMax; - obj.inflation_min = - message.inflationMin === '' ? undefined : message.inflationMin; - obj.goal_bonded = - message.goalBonded === '' ? undefined : message.goalBonded; - obj.blocks_per_year = - message.blocksPerYear !== BigInt(0) - ? message.blocksPerYear.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: 'cosmos-sdk/Params', - value: Params.toAmino(message), - }; - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 1f2658fcf66..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,88 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryParamsRequest, - QueryParamsResponse, - QueryInflationRequest, - QueryInflationResponse, - QueryAnnualProvisionsRequest, - QueryAnnualProvisionsResponse, -} from './query.js'; -/** Query provides defines the gRPC querier service. */ -export interface Query { - /** Params returns the total set of minting parameters. */ - params(request?: QueryParamsRequest): Promise; - /** Inflation returns the current minting inflation value. */ - inflation(request?: QueryInflationRequest): Promise; - /** AnnualProvisions current minting annual provisions value. */ - annualProvisions( - request?: QueryAnnualProvisionsRequest, - ): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.params = this.params.bind(this); - this.inflation = this.inflation.bind(this); - this.annualProvisions = this.annualProvisions.bind(this); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.mint.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - inflation( - request: QueryInflationRequest = {}, - ): Promise { - const data = QueryInflationRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.mint.v1beta1.Query', - 'Inflation', - data, - ); - return promise.then(data => - QueryInflationResponse.decode(new BinaryReader(data)), - ); - } - annualProvisions( - request: QueryAnnualProvisionsRequest = {}, - ): Promise { - const data = QueryAnnualProvisionsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.mint.v1beta1.Query', - 'AnnualProvisions', - data, - ); - return promise.then(data => - QueryAnnualProvisionsResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - inflation( - request?: QueryInflationRequest, - ): Promise { - return queryService.inflation(request); - }, - annualProvisions( - request?: QueryAnnualProvisionsRequest, - ): Promise { - return queryService.annualProvisions(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.ts index 314e9f8c94a..8dc55fba3de 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Params, ParamsAmino, ParamsSDKType } from './mint.js'; +import { Params, ParamsSDKType } from './mint.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../../helpers.js'; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ @@ -9,12 +9,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -26,15 +20,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params defines the parameters of the module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -45,12 +30,6 @@ export interface QueryInflationRequestProtoMsg { value: Uint8Array; } /** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ -export interface QueryInflationRequestAmino {} -export interface QueryInflationRequestAminoMsg { - type: 'cosmos-sdk/QueryInflationRequest'; - value: QueryInflationRequestAmino; -} -/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ export interface QueryInflationRequestSDKType {} /** * QueryInflationResponse is the response type for the Query/Inflation RPC @@ -64,18 +43,6 @@ export interface QueryInflationResponseProtoMsg { typeUrl: '/cosmos.mint.v1beta1.QueryInflationResponse'; value: Uint8Array; } -/** - * QueryInflationResponse is the response type for the Query/Inflation RPC - * method. - */ -export interface QueryInflationResponseAmino { - /** inflation is the current minting inflation value. */ - inflation?: string; -} -export interface QueryInflationResponseAminoMsg { - type: 'cosmos-sdk/QueryInflationResponse'; - value: QueryInflationResponseAmino; -} /** * QueryInflationResponse is the response type for the Query/Inflation RPC * method. @@ -92,15 +59,6 @@ export interface QueryAnnualProvisionsRequestProtoMsg { typeUrl: '/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest'; value: Uint8Array; } -/** - * QueryAnnualProvisionsRequest is the request type for the - * Query/AnnualProvisions RPC method. - */ -export interface QueryAnnualProvisionsRequestAmino {} -export interface QueryAnnualProvisionsRequestAminoMsg { - type: 'cosmos-sdk/QueryAnnualProvisionsRequest'; - value: QueryAnnualProvisionsRequestAmino; -} /** * QueryAnnualProvisionsRequest is the request type for the * Query/AnnualProvisions RPC method. @@ -118,18 +76,6 @@ export interface QueryAnnualProvisionsResponseProtoMsg { typeUrl: '/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse'; value: Uint8Array; } -/** - * QueryAnnualProvisionsResponse is the response type for the - * Query/AnnualProvisions RPC method. - */ -export interface QueryAnnualProvisionsResponseAmino { - /** annual_provisions is the current minting annual provisions value. */ - annual_provisions?: string; -} -export interface QueryAnnualProvisionsResponseAminoMsg { - type: 'cosmos-sdk/QueryAnnualProvisionsResponse'; - value: QueryAnnualProvisionsResponseAmino; -} /** * QueryAnnualProvisionsResponse is the response type for the * Query/AnnualProvisions RPC method. @@ -177,23 +123,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -263,27 +192,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -337,23 +245,6 @@ export const QueryInflationRequest = { const message = createBaseQueryInflationRequest(); return message; }, - fromAmino(_: QueryInflationRequestAmino): QueryInflationRequest { - const message = createBaseQueryInflationRequest(); - return message; - }, - toAmino(_: QueryInflationRequest): QueryInflationRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryInflationRequestAminoMsg): QueryInflationRequest { - return QueryInflationRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryInflationRequest): QueryInflationRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryInflationRequest', - value: QueryInflationRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryInflationRequestProtoMsg): QueryInflationRequest { return QueryInflationRequest.decode(message.value); }, @@ -424,29 +315,6 @@ export const QueryInflationResponse = { message.inflation = object.inflation ?? new Uint8Array(); return message; }, - fromAmino(object: QueryInflationResponseAmino): QueryInflationResponse { - const message = createBaseQueryInflationResponse(); - if (object.inflation !== undefined && object.inflation !== null) { - message.inflation = bytesFromBase64(object.inflation); - } - return message; - }, - toAmino(message: QueryInflationResponse): QueryInflationResponseAmino { - const obj: any = {}; - obj.inflation = message.inflation - ? base64FromBytes(message.inflation) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryInflationResponseAminoMsg): QueryInflationResponse { - return QueryInflationResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryInflationResponse): QueryInflationResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryInflationResponse', - value: QueryInflationResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryInflationResponseProtoMsg, ): QueryInflationResponse { @@ -504,29 +372,6 @@ export const QueryAnnualProvisionsRequest = { const message = createBaseQueryAnnualProvisionsRequest(); return message; }, - fromAmino( - _: QueryAnnualProvisionsRequestAmino, - ): QueryAnnualProvisionsRequest { - const message = createBaseQueryAnnualProvisionsRequest(); - return message; - }, - toAmino(_: QueryAnnualProvisionsRequest): QueryAnnualProvisionsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: QueryAnnualProvisionsRequestAminoMsg, - ): QueryAnnualProvisionsRequest { - return QueryAnnualProvisionsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAnnualProvisionsRequest, - ): QueryAnnualProvisionsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAnnualProvisionsRequest', - value: QueryAnnualProvisionsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryAnnualProvisionsRequestProtoMsg, ): QueryAnnualProvisionsRequest { @@ -605,40 +450,6 @@ export const QueryAnnualProvisionsResponse = { message.annualProvisions = object.annualProvisions ?? new Uint8Array(); return message; }, - fromAmino( - object: QueryAnnualProvisionsResponseAmino, - ): QueryAnnualProvisionsResponse { - const message = createBaseQueryAnnualProvisionsResponse(); - if ( - object.annual_provisions !== undefined && - object.annual_provisions !== null - ) { - message.annualProvisions = bytesFromBase64(object.annual_provisions); - } - return message; - }, - toAmino( - message: QueryAnnualProvisionsResponse, - ): QueryAnnualProvisionsResponseAmino { - const obj: any = {}; - obj.annual_provisions = message.annualProvisions - ? base64FromBytes(message.annualProvisions) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAnnualProvisionsResponseAminoMsg, - ): QueryAnnualProvisionsResponse { - return QueryAnnualProvisionsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAnnualProvisionsResponse, - ): QueryAnnualProvisionsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAnnualProvisionsResponse', - value: QueryAnnualProvisionsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAnnualProvisionsResponseProtoMsg, ): QueryAnnualProvisionsResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/params.ts b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/params.ts index 32c0eb6d99f..78c42a5b0d7 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/params.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/params.ts @@ -13,16 +13,6 @@ export interface ParameterChangeProposalProtoMsg { value: Uint8Array; } /** ParameterChangeProposal defines a proposal to change one or more parameters. */ -export interface ParameterChangeProposalAmino { - title?: string; - description?: string; - changes?: ParamChangeAmino[]; -} -export interface ParameterChangeProposalAminoMsg { - type: 'cosmos-sdk/ParameterChangeProposal'; - value: ParameterChangeProposalAmino; -} -/** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposalSDKType { $typeUrl?: '/cosmos.params.v1beta1.ParameterChangeProposal'; title: string; @@ -42,19 +32,6 @@ export interface ParamChangeProtoMsg { typeUrl: '/cosmos.params.v1beta1.ParamChange'; value: Uint8Array; } -/** - * ParamChange defines an individual parameter change, for use in - * ParameterChangeProposal. - */ -export interface ParamChangeAmino { - subspace?: string; - key?: string; - value?: string; -} -export interface ParamChangeAminoMsg { - type: 'cosmos-sdk/ParamChange'; - value: ParamChangeAmino; -} /** * ParamChange defines an individual parameter change, for use in * ParameterChangeProposal. @@ -149,44 +126,6 @@ export const ParameterChangeProposal = { object.changes?.map(e => ParamChange.fromPartial(e)) || []; return message; }, - fromAmino(object: ParameterChangeProposalAmino): ParameterChangeProposal { - const message = createBaseParameterChangeProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - message.changes = object.changes?.map(e => ParamChange.fromAmino(e)) || []; - return message; - }, - toAmino(message: ParameterChangeProposal): ParameterChangeProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - if (message.changes) { - obj.changes = message.changes.map(e => - e ? ParamChange.toAmino(e) : undefined, - ); - } else { - obj.changes = message.changes; - } - return obj; - }, - fromAminoMsg( - object: ParameterChangeProposalAminoMsg, - ): ParameterChangeProposal { - return ParameterChangeProposal.fromAmino(object.value); - }, - toAminoMsg( - message: ParameterChangeProposal, - ): ParameterChangeProposalAminoMsg { - return { - type: 'cosmos-sdk/ParameterChangeProposal', - value: ParameterChangeProposal.toAmino(message), - }; - }, fromProtoMsg( message: ParameterChangeProposalProtoMsg, ): ParameterChangeProposal { @@ -273,35 +212,6 @@ export const ParamChange = { message.value = object.value ?? ''; return message; }, - fromAmino(object: ParamChangeAmino): ParamChange { - const message = createBaseParamChange(); - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: ParamChange): ParamChangeAmino { - const obj: any = {}; - obj.subspace = message.subspace === '' ? undefined : message.subspace; - obj.key = message.key === '' ? undefined : message.key; - obj.value = message.value === '' ? undefined : message.value; - return obj; - }, - fromAminoMsg(object: ParamChangeAminoMsg): ParamChange { - return ParamChange.fromAmino(object.value); - }, - toAminoMsg(message: ParamChange): ParamChangeAminoMsg { - return { - type: 'cosmos-sdk/ParamChange', - value: ParamChange.toAmino(message), - }; - }, fromProtoMsg(message: ParamChangeProtoMsg): ParamChange { return ParamChange.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts deleted file mode 100644 index 3e746eb16bd..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,66 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryParamsRequest, - QueryParamsResponse, - QuerySubspacesRequest, - QuerySubspacesResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** - * Params queries a specific parameter of a module, given its subspace and - * key. - */ - params(request: QueryParamsRequest): Promise; - /** Subspaces queries for all registered subspaces and all keys for a subspace. */ - subspaces(request?: QuerySubspacesRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.params = this.params.bind(this); - this.subspaces = this.subspaces.bind(this); - } - params(request: QueryParamsRequest): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.params.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } - subspaces( - request: QuerySubspacesRequest = {}, - ): Promise { - const data = QuerySubspacesRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.params.v1beta1.Query', - 'Subspaces', - data, - ); - return promise.then(data => - QuerySubspacesResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request: QueryParamsRequest): Promise { - return queryService.params(request); - }, - subspaces( - request?: QuerySubspacesRequest, - ): Promise { - return queryService.subspaces(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts index f7a7468e3a0..2dd6c5737b7 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { ParamChange, ParamChangeAmino, ParamChangeSDKType } from './params.js'; +import { ParamChange, ParamChangeSDKType } from './params.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** QueryParamsRequest is request type for the Query/Params RPC method. */ @@ -14,17 +14,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino { - /** subspace defines the module to query the parameter for. */ - subspace?: string; - /** key defines the key of the parameter in the subspace. */ - key?: string; -} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { subspace: string; key: string; @@ -39,15 +28,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** param defines the queried parameter. */ - param?: ParamChangeAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { param: ParamChangeSDKType; } @@ -60,15 +40,6 @@ export interface QuerySubspacesRequestProtoMsg { typeUrl: '/cosmos.params.v1beta1.QuerySubspacesRequest'; value: Uint8Array; } -/** - * QuerySubspacesRequest defines a request type for querying for all registered - * subspaces and all keys for a subspace. - */ -export interface QuerySubspacesRequestAmino {} -export interface QuerySubspacesRequestAminoMsg { - type: 'cosmos-sdk/QuerySubspacesRequest'; - value: QuerySubspacesRequestAmino; -} /** * QuerySubspacesRequest defines a request type for querying for all registered * subspaces and all keys for a subspace. @@ -85,17 +56,6 @@ export interface QuerySubspacesResponseProtoMsg { typeUrl: '/cosmos.params.v1beta1.QuerySubspacesResponse'; value: Uint8Array; } -/** - * QuerySubspacesResponse defines the response types for querying for all - * registered subspaces and all keys for a subspace. - */ -export interface QuerySubspacesResponseAmino { - subspaces?: SubspaceAmino[]; -} -export interface QuerySubspacesResponseAminoMsg { - type: 'cosmos-sdk/QuerySubspacesResponse'; - value: QuerySubspacesResponseAmino; -} /** * QuerySubspacesResponse defines the response types for querying for all * registered subspaces and all keys for a subspace. @@ -115,18 +75,6 @@ export interface SubspaceProtoMsg { typeUrl: '/cosmos.params.v1beta1.Subspace'; value: Uint8Array; } -/** - * Subspace defines a parameter subspace name and all the keys that exist for - * the subspace. - */ -export interface SubspaceAmino { - subspace?: string; - keys?: string[]; -} -export interface SubspaceAminoMsg { - type: 'cosmos-sdk/Subspace'; - value: SubspaceAmino; -} /** * Subspace defines a parameter subspace name and all the keys that exist for * the subspace. @@ -197,31 +145,6 @@ export const QueryParamsRequest = { message.key = object.key ?? ''; return message; }, - fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - return message; - }, - toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - obj.subspace = message.subspace === '' ? undefined : message.subspace; - obj.key = message.key === '' ? undefined : message.key; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -295,27 +218,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.param !== undefined && object.param !== null) { - message.param = ParamChange.fromAmino(object.param); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.param = message.param ? ParamChange.toAmino(message.param) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, @@ -369,23 +271,6 @@ export const QuerySubspacesRequest = { const message = createBaseQuerySubspacesRequest(); return message; }, - fromAmino(_: QuerySubspacesRequestAmino): QuerySubspacesRequest { - const message = createBaseQuerySubspacesRequest(); - return message; - }, - toAmino(_: QuerySubspacesRequest): QuerySubspacesRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QuerySubspacesRequestAminoMsg): QuerySubspacesRequest { - return QuerySubspacesRequest.fromAmino(object.value); - }, - toAminoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestAminoMsg { - return { - type: 'cosmos-sdk/QuerySubspacesRequest', - value: QuerySubspacesRequest.toAmino(message), - }; - }, fromProtoMsg(message: QuerySubspacesRequestProtoMsg): QuerySubspacesRequest { return QuerySubspacesRequest.decode(message.value); }, @@ -460,31 +345,6 @@ export const QuerySubspacesResponse = { object.subspaces?.map(e => Subspace.fromPartial(e)) || []; return message; }, - fromAmino(object: QuerySubspacesResponseAmino): QuerySubspacesResponse { - const message = createBaseQuerySubspacesResponse(); - message.subspaces = object.subspaces?.map(e => Subspace.fromAmino(e)) || []; - return message; - }, - toAmino(message: QuerySubspacesResponse): QuerySubspacesResponseAmino { - const obj: any = {}; - if (message.subspaces) { - obj.subspaces = message.subspaces.map(e => - e ? Subspace.toAmino(e) : undefined, - ); - } else { - obj.subspaces = message.subspaces; - } - return obj; - }, - fromAminoMsg(object: QuerySubspacesResponseAminoMsg): QuerySubspacesResponse { - return QuerySubspacesResponse.fromAmino(object.value); - }, - toAminoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseAminoMsg { - return { - type: 'cosmos-sdk/QuerySubspacesResponse', - value: QuerySubspacesResponse.toAmino(message), - }; - }, fromProtoMsg( message: QuerySubspacesResponseProtoMsg, ): QuerySubspacesResponse { @@ -565,33 +425,6 @@ export const Subspace = { message.keys = object.keys?.map(e => e) || []; return message; }, - fromAmino(object: SubspaceAmino): Subspace { - const message = createBaseSubspace(); - if (object.subspace !== undefined && object.subspace !== null) { - message.subspace = object.subspace; - } - message.keys = object.keys?.map(e => e) || []; - return message; - }, - toAmino(message: Subspace): SubspaceAmino { - const obj: any = {}; - obj.subspace = message.subspace === '' ? undefined : message.subspace; - if (message.keys) { - obj.keys = message.keys.map(e => e); - } else { - obj.keys = message.keys; - } - return obj; - }, - fromAminoMsg(object: SubspaceAminoMsg): Subspace { - return Subspace.fromAmino(object.value); - }, - toAminoMsg(message: Subspace): SubspaceAminoMsg { - return { - type: 'cosmos-sdk/Subspace', - value: Subspace.toAmino(message), - }; - }, fromProtoMsg(message: SubspaceProtoMsg): Subspace { return Subspace.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/rpc.query.ts b/packages/cosmic-proto/src/codegen/cosmos/rpc.query.ts deleted file mode 100644 index 6d66ad83f4f..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/rpc.query.ts +++ /dev/null @@ -1,78 +0,0 @@ -//@ts-nocheck -import { Tendermint34Client, HttpEndpoint } from '@cosmjs/tendermint-rpc'; -import { QueryClient } from '@cosmjs/stargate'; -export const createRPCQueryClient = async ({ - rpcEndpoint, -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await Tendermint34Client.connect(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - auth: { - v1beta1: ( - await import('./auth/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - authz: { - v1beta1: ( - await import('./authz/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - bank: { - v1beta1: ( - await import('./bank/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - distribution: { - v1beta1: ( - await import('./distribution/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - feegrant: { - v1beta1: ( - await import('./feegrant/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - gov: { - v1: ( - await import('./gov/v1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - v1beta1: ( - await import('./gov/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - group: { - v1: ( - await import('./group/v1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - mint: { - v1beta1: ( - await import('./mint/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - params: { - v1beta1: ( - await import('./params/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - staking: { - v1beta1: ( - await import('./staking/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - tx: { - v1beta1: ( - await import('./tx/v1beta1/service.rpc.Service.js') - ).createRpcQueryExtension(client), - }, - upgrade: { - v1beta1: ( - await import('./upgrade/v1beta1/query.rpc.Query.js') - ).createRpcQueryExtension(client), - }, - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/rpc.tx.ts b/packages/cosmic-proto/src/codegen/cosmos/rpc.tx.ts deleted file mode 100644 index c3ea741222f..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/rpc.tx.ts +++ /dev/null @@ -1,50 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../helpers.js'; -export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ - cosmos: { - authz: { - v1beta1: new ( - await import('./authz/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - bank: { - v1beta1: new (await import('./bank/v1beta1/tx.rpc.msg.js')).MsgClientImpl( - rpc, - ), - }, - distribution: { - v1beta1: new ( - await import('./distribution/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - feegrant: { - v1beta1: new ( - await import('./feegrant/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - gov: { - v1: new (await import('./gov/v1/tx.rpc.msg.js')).MsgClientImpl(rpc), - v1beta1: new (await import('./gov/v1beta1/tx.rpc.msg.js')).MsgClientImpl( - rpc, - ), - }, - group: { - v1: new (await import('./group/v1/tx.rpc.msg.js')).MsgClientImpl(rpc), - }, - staking: { - v1beta1: new ( - await import('./staking/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - upgrade: { - v1beta1: new ( - await import('./upgrade/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - vesting: { - v1beta1: new ( - await import('./vesting/v1beta1/tx.rpc.msg.js') - ).MsgClientImpl(rpc), - }, - }, -}); diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/authz.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/authz.ts index a894b4eccf7..7a90f13b6d5 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -19,7 +19,6 @@ export enum AuthorizationType { UNRECOGNIZED = -1, } export const AuthorizationTypeSDKType = AuthorizationType; -export const AuthorizationTypeAmino = AuthorizationType; export function authorizationTypeFromJSON(object: any): AuthorizationType { switch (object) { case 0: @@ -81,31 +80,6 @@ export interface StakeAuthorizationProtoMsg { typeUrl: '/cosmos.staking.v1beta1.StakeAuthorization'; value: Uint8Array; } -/** - * StakeAuthorization defines authorization for delegate/undelegate/redelegate. - * - * Since: cosmos-sdk 0.43 - */ -export interface StakeAuthorizationAmino { - /** - * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - * empty, there is no spend limit and any amount of coins can be delegated. - */ - max_tokens?: CoinAmino; - /** - * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - * account. - */ - allow_list?: StakeAuthorization_ValidatorsAmino; - /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ - deny_list?: StakeAuthorization_ValidatorsAmino; - /** authorization_type defines one of AuthorizationType. */ - authorization_type?: AuthorizationType; -} -export interface StakeAuthorizationAminoMsg { - type: 'cosmos-sdk/StakeAuthorization'; - value: StakeAuthorizationAmino; -} /** * StakeAuthorization defines authorization for delegate/undelegate/redelegate. * @@ -127,14 +101,6 @@ export interface StakeAuthorization_ValidatorsProtoMsg { value: Uint8Array; } /** Validators defines list of validator addresses. */ -export interface StakeAuthorization_ValidatorsAmino { - address?: string[]; -} -export interface StakeAuthorization_ValidatorsAminoMsg { - type: 'cosmos-sdk/Validators'; - value: StakeAuthorization_ValidatorsAmino; -} -/** Validators defines list of validator addresses. */ export interface StakeAuthorization_ValidatorsSDKType { address: string[]; } @@ -262,53 +228,6 @@ export const StakeAuthorization = { message.authorizationType = object.authorizationType ?? 0; return message; }, - fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { - const message = createBaseStakeAuthorization(); - if (object.max_tokens !== undefined && object.max_tokens !== null) { - message.maxTokens = Coin.fromAmino(object.max_tokens); - } - if (object.allow_list !== undefined && object.allow_list !== null) { - message.allowList = StakeAuthorization_Validators.fromAmino( - object.allow_list, - ); - } - if (object.deny_list !== undefined && object.deny_list !== null) { - message.denyList = StakeAuthorization_Validators.fromAmino( - object.deny_list, - ); - } - if ( - object.authorization_type !== undefined && - object.authorization_type !== null - ) { - message.authorizationType = object.authorization_type; - } - return message; - }, - toAmino(message: StakeAuthorization): StakeAuthorizationAmino { - const obj: any = {}; - obj.max_tokens = message.maxTokens - ? Coin.toAmino(message.maxTokens) - : undefined; - obj.allow_list = message.allowList - ? StakeAuthorization_Validators.toAmino(message.allowList) - : undefined; - obj.deny_list = message.denyList - ? StakeAuthorization_Validators.toAmino(message.denyList) - : undefined; - obj.authorization_type = - message.authorizationType === 0 ? undefined : message.authorizationType; - return obj; - }, - fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { - return StakeAuthorization.fromAmino(object.value); - }, - toAminoMsg(message: StakeAuthorization): StakeAuthorizationAminoMsg { - return { - type: 'cosmos-sdk/StakeAuthorization', - value: StakeAuthorization.toAmino(message), - }; - }, fromProtoMsg(message: StakeAuthorizationProtoMsg): StakeAuthorization { return StakeAuthorization.decode(message.value); }, @@ -382,37 +301,6 @@ export const StakeAuthorization_Validators = { message.address = object.address?.map(e => e) || []; return message; }, - fromAmino( - object: StakeAuthorization_ValidatorsAmino, - ): StakeAuthorization_Validators { - const message = createBaseStakeAuthorization_Validators(); - message.address = object.address?.map(e => e) || []; - return message; - }, - toAmino( - message: StakeAuthorization_Validators, - ): StakeAuthorization_ValidatorsAmino { - const obj: any = {}; - if (message.address) { - obj.address = message.address.map(e => e); - } else { - obj.address = message.address; - } - return obj; - }, - fromAminoMsg( - object: StakeAuthorization_ValidatorsAminoMsg, - ): StakeAuthorization_Validators { - return StakeAuthorization_Validators.fromAmino(object.value); - }, - toAminoMsg( - message: StakeAuthorization_Validators, - ): StakeAuthorization_ValidatorsAminoMsg { - return { - type: 'cosmos-sdk/Validators', - value: StakeAuthorization_Validators.toAmino(message), - }; - }, fromProtoMsg( message: StakeAuthorization_ValidatorsProtoMsg, ): StakeAuthorization_Validators { diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/genesis.ts index 03d34d7287d..f578dc0c129 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -1,19 +1,14 @@ //@ts-nocheck import { Params, - ParamsAmino, ParamsSDKType, Validator, - ValidatorAmino, ValidatorSDKType, Delegation, - DelegationAmino, DelegationSDKType, UnbondingDelegation, - UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, - RedelegationAmino, RedelegationSDKType, } from './staking.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -47,34 +42,6 @@ export interface GenesisStateProtoMsg { value: Uint8Array; } /** GenesisState defines the staking module's genesis state. */ -export interface GenesisStateAmino { - /** params defines all the paramaters of related to deposit. */ - params?: ParamsAmino; - /** - * last_total_power tracks the total amounts of bonded tokens recorded during - * the previous end block. - */ - last_total_power?: string; - /** - * last_validator_powers is a special index that provides a historical list - * of the last-block's bonded validators. - */ - last_validator_powers?: LastValidatorPowerAmino[]; - /** delegations defines the validator set at genesis. */ - validators?: ValidatorAmino[]; - /** delegations defines the delegations active at genesis. */ - delegations?: DelegationAmino[]; - /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbonding_delegations?: UnbondingDelegationAmino[]; - /** redelegations defines the redelegations active at genesis. */ - redelegations?: RedelegationAmino[]; - exported?: boolean; -} -export interface GenesisStateAminoMsg { - type: 'cosmos-sdk/GenesisState'; - value: GenesisStateAmino; -} -/** GenesisState defines the staking module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; last_total_power: Uint8Array; @@ -97,17 +64,6 @@ export interface LastValidatorPowerProtoMsg { value: Uint8Array; } /** LastValidatorPower required for validator set update logic. */ -export interface LastValidatorPowerAmino { - /** address is the address of the validator. */ - address?: string; - /** power defines the power of the validator. */ - power?: string; -} -export interface LastValidatorPowerAminoMsg { - type: 'cosmos-sdk/LastValidatorPower'; - value: LastValidatorPowerAmino; -} -/** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerSDKType { address: string; power: bigint; @@ -300,88 +256,6 @@ export const GenesisState = { message.exported = object.exported ?? false; return message; }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - if ( - object.last_total_power !== undefined && - object.last_total_power !== null - ) { - message.lastTotalPower = bytesFromBase64(object.last_total_power); - } - message.lastValidatorPowers = - object.last_validator_powers?.map(e => LastValidatorPower.fromAmino(e)) || - []; - message.validators = - object.validators?.map(e => Validator.fromAmino(e)) || []; - message.delegations = - object.delegations?.map(e => Delegation.fromAmino(e)) || []; - message.unbondingDelegations = - object.unbonding_delegations?.map(e => - UnbondingDelegation.fromAmino(e), - ) || []; - message.redelegations = - object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; - if (object.exported !== undefined && object.exported !== null) { - message.exported = object.exported; - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.last_total_power = message.lastTotalPower - ? base64FromBytes(message.lastTotalPower) - : undefined; - if (message.lastValidatorPowers) { - obj.last_validator_powers = message.lastValidatorPowers.map(e => - e ? LastValidatorPower.toAmino(e) : undefined, - ); - } else { - obj.last_validator_powers = message.lastValidatorPowers; - } - if (message.validators) { - obj.validators = message.validators.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - if (message.delegations) { - obj.delegations = message.delegations.map(e => - e ? Delegation.toAmino(e) : undefined, - ); - } else { - obj.delegations = message.delegations; - } - if (message.unbondingDelegations) { - obj.unbonding_delegations = message.unbondingDelegations.map(e => - e ? UnbondingDelegation.toAmino(e) : undefined, - ); - } else { - obj.unbonding_delegations = message.unbondingDelegations; - } - if (message.redelegations) { - obj.redelegations = message.redelegations.map(e => - e ? Redelegation.toAmino(e) : undefined, - ); - } else { - obj.redelegations = message.redelegations; - } - obj.exported = message.exported === false ? undefined : message.exported; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: 'cosmos-sdk/GenesisState', - value: GenesisState.toAmino(message), - }; - }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, @@ -461,32 +335,6 @@ export const LastValidatorPower = { : BigInt(0); return message; }, - fromAmino(object: LastValidatorPowerAmino): LastValidatorPower { - const message = createBaseLastValidatorPower(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.power !== undefined && object.power !== null) { - message.power = BigInt(object.power); - } - return message; - }, - toAmino(message: LastValidatorPower): LastValidatorPowerAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.power = - message.power !== BigInt(0) ? message.power.toString() : undefined; - return obj; - }, - fromAminoMsg(object: LastValidatorPowerAminoMsg): LastValidatorPower { - return LastValidatorPower.fromAmino(object.value); - }, - toAminoMsg(message: LastValidatorPower): LastValidatorPowerAminoMsg { - return { - type: 'cosmos-sdk/LastValidatorPower', - value: LastValidatorPower.toAmino(message), - }; - }, fromProtoMsg(message: LastValidatorPowerProtoMsg): LastValidatorPower { return LastValidatorPower.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts deleted file mode 100644 index cca73b7ad7a..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,365 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryValidatorsRequest, - QueryValidatorsResponse, - QueryValidatorRequest, - QueryValidatorResponse, - QueryValidatorDelegationsRequest, - QueryValidatorDelegationsResponse, - QueryValidatorUnbondingDelegationsRequest, - QueryValidatorUnbondingDelegationsResponse, - QueryDelegationRequest, - QueryDelegationResponse, - QueryUnbondingDelegationRequest, - QueryUnbondingDelegationResponse, - QueryDelegatorDelegationsRequest, - QueryDelegatorDelegationsResponse, - QueryDelegatorUnbondingDelegationsRequest, - QueryDelegatorUnbondingDelegationsResponse, - QueryRedelegationsRequest, - QueryRedelegationsResponse, - QueryDelegatorValidatorsRequest, - QueryDelegatorValidatorsResponse, - QueryDelegatorValidatorRequest, - QueryDelegatorValidatorResponse, - QueryHistoricalInfoRequest, - QueryHistoricalInfoResponse, - QueryPoolRequest, - QueryPoolResponse, - QueryParamsRequest, - QueryParamsResponse, -} from './query.js'; -/** Query defines the gRPC querier service. */ -export interface Query { - /** Validators queries all validators that match the given status. */ - validators(request: QueryValidatorsRequest): Promise; - /** Validator queries validator info for given validator address. */ - validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ - validatorDelegations( - request: QueryValidatorDelegationsRequest, - ): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ - validatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest, - ): Promise; - /** Delegation queries delegate info for given validator delegator pair. */ - delegation(request: QueryDelegationRequest): Promise; - /** - * UnbondingDelegation queries unbonding info for given validator delegator - * pair. - */ - unbondingDelegation( - request: QueryUnbondingDelegationRequest, - ): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ - delegatorDelegations( - request: QueryDelegatorDelegationsRequest, - ): Promise; - /** - * DelegatorUnbondingDelegations queries all unbonding delegations of a given - * delegator address. - */ - delegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest, - ): Promise; - /** Redelegations queries redelegations of given address. */ - redelegations( - request: QueryRedelegationsRequest, - ): Promise; - /** - * DelegatorValidators queries all validators info for given delegator - * address. - */ - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise; - /** - * DelegatorValidator queries validator info for given delegator validator - * pair. - */ - delegatorValidator( - request: QueryDelegatorValidatorRequest, - ): Promise; - /** HistoricalInfo queries the historical info for given height. */ - historicalInfo( - request: QueryHistoricalInfoRequest, - ): Promise; - /** Pool queries the pool info. */ - pool(request?: QueryPoolRequest): Promise; - /** Parameters queries the staking parameters. */ - params(request?: QueryParamsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.validators = this.validators.bind(this); - this.validator = this.validator.bind(this); - this.validatorDelegations = this.validatorDelegations.bind(this); - this.validatorUnbondingDelegations = - this.validatorUnbondingDelegations.bind(this); - this.delegation = this.delegation.bind(this); - this.unbondingDelegation = this.unbondingDelegation.bind(this); - this.delegatorDelegations = this.delegatorDelegations.bind(this); - this.delegatorUnbondingDelegations = - this.delegatorUnbondingDelegations.bind(this); - this.redelegations = this.redelegations.bind(this); - this.delegatorValidators = this.delegatorValidators.bind(this); - this.delegatorValidator = this.delegatorValidator.bind(this); - this.historicalInfo = this.historicalInfo.bind(this); - this.pool = this.pool.bind(this); - this.params = this.params.bind(this); - } - validators( - request: QueryValidatorsRequest, - ): Promise { - const data = QueryValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Validators', - data, - ); - return promise.then(data => - QueryValidatorsResponse.decode(new BinaryReader(data)), - ); - } - validator(request: QueryValidatorRequest): Promise { - const data = QueryValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Validator', - data, - ); - return promise.then(data => - QueryValidatorResponse.decode(new BinaryReader(data)), - ); - } - validatorDelegations( - request: QueryValidatorDelegationsRequest, - ): Promise { - const data = QueryValidatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'ValidatorDelegations', - data, - ); - return promise.then(data => - QueryValidatorDelegationsResponse.decode(new BinaryReader(data)), - ); - } - validatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest, - ): Promise { - const data = - QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'ValidatorUnbondingDelegations', - data, - ); - return promise.then(data => - QueryValidatorUnbondingDelegationsResponse.decode(new BinaryReader(data)), - ); - } - delegation( - request: QueryDelegationRequest, - ): Promise { - const data = QueryDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Delegation', - data, - ); - return promise.then(data => - QueryDelegationResponse.decode(new BinaryReader(data)), - ); - } - unbondingDelegation( - request: QueryUnbondingDelegationRequest, - ): Promise { - const data = QueryUnbondingDelegationRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'UnbondingDelegation', - data, - ); - return promise.then(data => - QueryUnbondingDelegationResponse.decode(new BinaryReader(data)), - ); - } - delegatorDelegations( - request: QueryDelegatorDelegationsRequest, - ): Promise { - const data = QueryDelegatorDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'DelegatorDelegations', - data, - ); - return promise.then(data => - QueryDelegatorDelegationsResponse.decode(new BinaryReader(data)), - ); - } - delegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest, - ): Promise { - const data = - QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'DelegatorUnbondingDelegations', - data, - ); - return promise.then(data => - QueryDelegatorUnbondingDelegationsResponse.decode(new BinaryReader(data)), - ); - } - redelegations( - request: QueryRedelegationsRequest, - ): Promise { - const data = QueryRedelegationsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Redelegations', - data, - ); - return promise.then(data => - QueryRedelegationsResponse.decode(new BinaryReader(data)), - ); - } - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise { - const data = QueryDelegatorValidatorsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'DelegatorValidators', - data, - ); - return promise.then(data => - QueryDelegatorValidatorsResponse.decode(new BinaryReader(data)), - ); - } - delegatorValidator( - request: QueryDelegatorValidatorRequest, - ): Promise { - const data = QueryDelegatorValidatorRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'DelegatorValidator', - data, - ); - return promise.then(data => - QueryDelegatorValidatorResponse.decode(new BinaryReader(data)), - ); - } - historicalInfo( - request: QueryHistoricalInfoRequest, - ): Promise { - const data = QueryHistoricalInfoRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'HistoricalInfo', - data, - ); - return promise.then(data => - QueryHistoricalInfoResponse.decode(new BinaryReader(data)), - ); - } - pool(request: QueryPoolRequest = {}): Promise { - const data = QueryPoolRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Pool', - data, - ); - return promise.then(data => - QueryPoolResponse.decode(new BinaryReader(data)), - ); - } - params(request: QueryParamsRequest = {}): Promise { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Query', - 'Params', - data, - ); - return promise.then(data => - QueryParamsResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - validators( - request: QueryValidatorsRequest, - ): Promise { - return queryService.validators(request); - }, - validator(request: QueryValidatorRequest): Promise { - return queryService.validator(request); - }, - validatorDelegations( - request: QueryValidatorDelegationsRequest, - ): Promise { - return queryService.validatorDelegations(request); - }, - validatorUnbondingDelegations( - request: QueryValidatorUnbondingDelegationsRequest, - ): Promise { - return queryService.validatorUnbondingDelegations(request); - }, - delegation( - request: QueryDelegationRequest, - ): Promise { - return queryService.delegation(request); - }, - unbondingDelegation( - request: QueryUnbondingDelegationRequest, - ): Promise { - return queryService.unbondingDelegation(request); - }, - delegatorDelegations( - request: QueryDelegatorDelegationsRequest, - ): Promise { - return queryService.delegatorDelegations(request); - }, - delegatorUnbondingDelegations( - request: QueryDelegatorUnbondingDelegationsRequest, - ): Promise { - return queryService.delegatorUnbondingDelegations(request); - }, - redelegations( - request: QueryRedelegationsRequest, - ): Promise { - return queryService.redelegations(request); - }, - delegatorValidators( - request: QueryDelegatorValidatorsRequest, - ): Promise { - return queryService.delegatorValidators(request); - }, - delegatorValidator( - request: QueryDelegatorValidatorRequest, - ): Promise { - return queryService.delegatorValidator(request); - }, - historicalInfo( - request: QueryHistoricalInfoRequest, - ): Promise { - return queryService.historicalInfo(request); - }, - pool(request?: QueryPoolRequest): Promise { - return queryService.pool(request); - }, - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts index fd97dfe63a2..09a595c46bd 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts @@ -1,33 +1,24 @@ //@ts-nocheck import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { Validator, - ValidatorAmino, ValidatorSDKType, DelegationResponse, - DelegationResponseAmino, DelegationResponseSDKType, UnbondingDelegation, - UnbondingDelegationAmino, UnbondingDelegationSDKType, RedelegationResponse, - RedelegationResponseAmino, RedelegationResponseSDKType, HistoricalInfo, - HistoricalInfoAmino, HistoricalInfoSDKType, Pool, - PoolAmino, PoolSDKType, Params, - ParamsAmino, ParamsSDKType, } from './staking.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -44,17 +35,6 @@ export interface QueryValidatorsRequestProtoMsg { value: Uint8Array; } /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ -export interface QueryValidatorsRequestAmino { - /** status enables to query for validators matching a given status. */ - status?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryValidatorsRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorsRequest'; - value: QueryValidatorsRequestAmino; -} -/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestSDKType { status: string; pagination?: PageRequestSDKType; @@ -71,17 +51,6 @@ export interface QueryValidatorsResponseProtoMsg { value: Uint8Array; } /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ -export interface QueryValidatorsResponseAmino { - /** validators contains all the queried validators. */ - validators?: ValidatorAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryValidatorsResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorsResponse'; - value: QueryValidatorsResponseAmino; -} -/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseSDKType { validators: ValidatorSDKType[]; pagination?: PageResponseSDKType; @@ -96,15 +65,6 @@ export interface QueryValidatorRequestProtoMsg { value: Uint8Array; } /** QueryValidatorRequest is response type for the Query/Validator RPC method */ -export interface QueryValidatorRequestAmino { - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; -} -export interface QueryValidatorRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorRequest'; - value: QueryValidatorRequestAmino; -} -/** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequestSDKType { validator_addr: string; } @@ -118,15 +78,6 @@ export interface QueryValidatorResponseProtoMsg { value: Uint8Array; } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ -export interface QueryValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; -} -export interface QueryValidatorResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorResponse'; - value: QueryValidatorResponseAmino; -} -/** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponseSDKType { validator: ValidatorSDKType; } @@ -144,20 +95,6 @@ export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest'; value: Uint8Array; } -/** - * QueryValidatorDelegationsRequest is request type for the - * Query/ValidatorDelegations RPC method - */ -export interface QueryValidatorDelegationsRequestAmino { - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryValidatorDelegationsRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorDelegationsRequest'; - value: QueryValidatorDelegationsRequestAmino; -} /** * QueryValidatorDelegationsRequest is request type for the * Query/ValidatorDelegations RPC method @@ -179,19 +116,6 @@ export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse'; value: Uint8Array; } -/** - * QueryValidatorDelegationsResponse is response type for the - * Query/ValidatorDelegations RPC method - */ -export interface QueryValidatorDelegationsResponseAmino { - delegation_responses?: DelegationResponseAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryValidatorDelegationsResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorDelegationsResponse'; - value: QueryValidatorDelegationsResponseAmino; -} /** * QueryValidatorDelegationsResponse is response type for the * Query/ValidatorDelegations RPC method @@ -214,20 +138,6 @@ export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest'; value: Uint8Array; } -/** - * QueryValidatorUnbondingDelegationsRequest is required type for the - * Query/ValidatorUnbondingDelegations RPC method - */ -export interface QueryValidatorUnbondingDelegationsRequestAmino { - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { - type: 'cosmos-sdk/QueryValidatorUnbondingDelegationsRequest'; - value: QueryValidatorUnbondingDelegationsRequestAmino; -} /** * QueryValidatorUnbondingDelegationsRequest is required type for the * Query/ValidatorUnbondingDelegations RPC method @@ -249,19 +159,6 @@ export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse'; value: Uint8Array; } -/** - * QueryValidatorUnbondingDelegationsResponse is response type for the - * Query/ValidatorUnbondingDelegations RPC method. - */ -export interface QueryValidatorUnbondingDelegationsResponseAmino { - unbonding_responses?: UnbondingDelegationAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { - type: 'cosmos-sdk/QueryValidatorUnbondingDelegationsResponse'; - value: QueryValidatorUnbondingDelegationsResponseAmino; -} /** * QueryValidatorUnbondingDelegationsResponse is response type for the * Query/ValidatorUnbondingDelegations RPC method. @@ -282,17 +179,6 @@ export interface QueryDelegationRequestProtoMsg { value: Uint8Array; } /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ -export interface QueryDelegationRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; -} -export interface QueryDelegationRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegationRequest'; - value: QueryDelegationRequestAmino; -} -/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequestSDKType { delegator_addr: string; validator_addr: string; @@ -307,15 +193,6 @@ export interface QueryDelegationResponseProtoMsg { value: Uint8Array; } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ -export interface QueryDelegationResponseAmino { - /** delegation_responses defines the delegation info of a delegation. */ - delegation_response?: DelegationResponseAmino; -} -export interface QueryDelegationResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegationResponse'; - value: QueryDelegationResponseAmino; -} -/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponseSDKType { delegation_response?: DelegationResponseSDKType; } @@ -333,20 +210,6 @@ export interface QueryUnbondingDelegationRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest'; value: Uint8Array; } -/** - * QueryUnbondingDelegationRequest is request type for the - * Query/UnbondingDelegation RPC method. - */ -export interface QueryUnbondingDelegationRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; -} -export interface QueryUnbondingDelegationRequestAminoMsg { - type: 'cosmos-sdk/QueryUnbondingDelegationRequest'; - value: QueryUnbondingDelegationRequestAmino; -} /** * QueryUnbondingDelegationRequest is request type for the * Query/UnbondingDelegation RPC method. @@ -367,18 +230,6 @@ export interface QueryUnbondingDelegationResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse'; value: Uint8Array; } -/** - * QueryDelegationResponse is response type for the Query/UnbondingDelegation - * RPC method. - */ -export interface QueryUnbondingDelegationResponseAmino { - /** unbond defines the unbonding information of a delegation. */ - unbond?: UnbondingDelegationAmino; -} -export interface QueryUnbondingDelegationResponseAminoMsg { - type: 'cosmos-sdk/QueryUnbondingDelegationResponse'; - value: QueryUnbondingDelegationResponseAmino; -} /** * QueryDelegationResponse is response type for the Query/UnbondingDelegation * RPC method. @@ -400,20 +251,6 @@ export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest'; value: Uint8Array; } -/** - * QueryDelegatorDelegationsRequest is request type for the - * Query/DelegatorDelegations RPC method. - */ -export interface QueryDelegatorDelegationsRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDelegatorDelegationsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorDelegationsRequest'; - value: QueryDelegatorDelegationsRequestAmino; -} /** * QueryDelegatorDelegationsRequest is request type for the * Query/DelegatorDelegations RPC method. @@ -436,20 +273,6 @@ export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse'; value: Uint8Array; } -/** - * QueryDelegatorDelegationsResponse is response type for the - * Query/DelegatorDelegations RPC method. - */ -export interface QueryDelegatorDelegationsResponseAmino { - /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses?: DelegationResponseAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDelegatorDelegationsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorDelegationsResponse'; - value: QueryDelegatorDelegationsResponseAmino; -} /** * QueryDelegatorDelegationsResponse is response type for the * Query/DelegatorDelegations RPC method. @@ -472,20 +295,6 @@ export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest'; value: Uint8Array; } -/** - * QueryDelegatorUnbondingDelegationsRequest is request type for the - * Query/DelegatorUnbondingDelegations RPC method. - */ -export interface QueryDelegatorUnbondingDelegationsRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest'; - value: QueryDelegatorUnbondingDelegationsRequestAmino; -} /** * QueryDelegatorUnbondingDelegationsRequest is request type for the * Query/DelegatorUnbondingDelegations RPC method. @@ -507,19 +316,6 @@ export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse'; value: Uint8Array; } -/** - * QueryUnbondingDelegatorDelegationsResponse is response type for the - * Query/UnbondingDelegatorDelegations RPC method. - */ -export interface QueryDelegatorUnbondingDelegationsResponseAmino { - unbonding_responses?: UnbondingDelegationAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse'; - value: QueryDelegatorUnbondingDelegationsResponseAmino; -} /** * QueryUnbondingDelegatorDelegationsResponse is response type for the * Query/UnbondingDelegatorDelegations RPC method. @@ -546,24 +342,6 @@ export interface QueryRedelegationsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryRedelegationsRequest'; value: Uint8Array; } -/** - * QueryRedelegationsRequest is request type for the Query/Redelegations RPC - * method. - */ -export interface QueryRedelegationsRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr?: string; - /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryRedelegationsRequestAminoMsg { - type: 'cosmos-sdk/QueryRedelegationsRequest'; - value: QueryRedelegationsRequestAmino; -} /** * QueryRedelegationsRequest is request type for the Query/Redelegations RPC * method. @@ -587,19 +365,6 @@ export interface QueryRedelegationsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryRedelegationsResponse'; value: Uint8Array; } -/** - * QueryRedelegationsResponse is response type for the Query/Redelegations RPC - * method. - */ -export interface QueryRedelegationsResponseAmino { - redelegation_responses?: RedelegationResponseAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryRedelegationsResponseAminoMsg { - type: 'cosmos-sdk/QueryRedelegationsResponse'; - value: QueryRedelegationsResponseAmino; -} /** * QueryRedelegationsResponse is response type for the Query/Redelegations RPC * method. @@ -622,20 +387,6 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest'; value: Uint8Array; } -/** - * QueryDelegatorValidatorsRequest is request type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** pagination defines an optional pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface QueryDelegatorValidatorsRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorsRequest'; - value: QueryDelegatorValidatorsRequestAmino; -} /** * QueryDelegatorValidatorsRequest is request type for the * Query/DelegatorValidators RPC method. @@ -658,20 +409,6 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse'; value: Uint8Array; } -/** - * QueryDelegatorValidatorsResponse is response type for the - * Query/DelegatorValidators RPC method. - */ -export interface QueryDelegatorValidatorsResponseAmino { - /** validators defines the the validators' info of a delegator. */ - validators?: ValidatorAmino[]; - /** pagination defines the pagination in the response. */ - pagination?: PageResponseAmino; -} -export interface QueryDelegatorValidatorsResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorsResponse'; - value: QueryDelegatorValidatorsResponseAmino; -} /** * QueryDelegatorValidatorsResponse is response type for the * Query/DelegatorValidators RPC method. @@ -694,20 +431,6 @@ export interface QueryDelegatorValidatorRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest'; value: Uint8Array; } -/** - * QueryDelegatorValidatorRequest is request type for the - * Query/DelegatorValidator RPC method. - */ -export interface QueryDelegatorValidatorRequestAmino { - /** delegator_addr defines the delegator address to query for. */ - delegator_addr?: string; - /** validator_addr defines the validator address to query for. */ - validator_addr?: string; -} -export interface QueryDelegatorValidatorRequestAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorRequest'; - value: QueryDelegatorValidatorRequestAmino; -} /** * QueryDelegatorValidatorRequest is request type for the * Query/DelegatorValidator RPC method. @@ -728,18 +451,6 @@ export interface QueryDelegatorValidatorResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse'; value: Uint8Array; } -/** - * QueryDelegatorValidatorResponse response type for the - * Query/DelegatorValidator RPC method. - */ -export interface QueryDelegatorValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; -} -export interface QueryDelegatorValidatorResponseAminoMsg { - type: 'cosmos-sdk/QueryDelegatorValidatorResponse'; - value: QueryDelegatorValidatorResponseAmino; -} /** * QueryDelegatorValidatorResponse response type for the * Query/DelegatorValidator RPC method. @@ -759,18 +470,6 @@ export interface QueryHistoricalInfoRequestProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryHistoricalInfoRequest'; value: Uint8Array; } -/** - * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC - * method. - */ -export interface QueryHistoricalInfoRequestAmino { - /** height defines at which height to query the historical info. */ - height?: string; -} -export interface QueryHistoricalInfoRequestAminoMsg { - type: 'cosmos-sdk/QueryHistoricalInfoRequest'; - value: QueryHistoricalInfoRequestAmino; -} /** * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC * method. @@ -790,18 +489,6 @@ export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.QueryHistoricalInfoResponse'; value: Uint8Array; } -/** - * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC - * method. - */ -export interface QueryHistoricalInfoResponseAmino { - /** hist defines the historical info at the given height. */ - hist?: HistoricalInfoAmino; -} -export interface QueryHistoricalInfoResponseAminoMsg { - type: 'cosmos-sdk/QueryHistoricalInfoResponse'; - value: QueryHistoricalInfoResponseAmino; -} /** * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC * method. @@ -816,12 +503,6 @@ export interface QueryPoolRequestProtoMsg { value: Uint8Array; } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ -export interface QueryPoolRequestAmino {} -export interface QueryPoolRequestAminoMsg { - type: 'cosmos-sdk/QueryPoolRequest'; - value: QueryPoolRequestAmino; -} -/** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequestSDKType {} /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponse { @@ -833,15 +514,6 @@ export interface QueryPoolResponseProtoMsg { value: Uint8Array; } /** QueryPoolResponse is response type for the Query/Pool RPC method. */ -export interface QueryPoolResponseAmino { - /** pool defines the pool info. */ - pool?: PoolAmino; -} -export interface QueryPoolResponseAminoMsg { - type: 'cosmos-sdk/QueryPoolResponse'; - value: QueryPoolResponseAmino; -} -/** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponseSDKType { pool: PoolSDKType; } @@ -852,12 +524,6 @@ export interface QueryParamsRequestProtoMsg { value: Uint8Array; } /** QueryParamsRequest is request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: 'cosmos-sdk/QueryParamsRequest'; - value: QueryParamsRequestAmino; -} -/** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType {} /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponse { @@ -869,15 +535,6 @@ export interface QueryParamsResponseProtoMsg { value: Uint8Array; } /** QueryParamsResponse is response type for the Query/Params RPC method. */ -export interface QueryParamsResponseAmino { - /** params holds all the parameters of this module. */ - params?: ParamsAmino; -} -export interface QueryParamsResponseAminoMsg { - type: 'cosmos-sdk/QueryParamsResponse'; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { params: ParamsSDKType; } @@ -951,33 +608,6 @@ export const QueryValidatorsRequest = { : undefined; return message; }, - fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { - const message = createBaseQueryValidatorsRequest(); - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { - const obj: any = {}; - obj.status = message.status === '' ? undefined : message.status; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryValidatorsRequestAminoMsg): QueryValidatorsRequest { - return QueryValidatorsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryValidatorsRequest): QueryValidatorsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorsRequest', - value: QueryValidatorsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorsRequestProtoMsg, ): QueryValidatorsRequest { @@ -1077,42 +707,6 @@ export const QueryValidatorsResponse = { : undefined; return message; }, - fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { - const message = createBaseQueryValidatorsResponse(); - message.validators = - object.validators?.map(e => Validator.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorsResponseAminoMsg, - ): QueryValidatorsResponse { - return QueryValidatorsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorsResponse, - ): QueryValidatorsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorsResponse', - value: QueryValidatorsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorsResponseProtoMsg, ): QueryValidatorsResponse { @@ -1185,28 +779,6 @@ export const QueryValidatorRequest = { message.validatorAddr = object.validatorAddr ?? ''; return message; }, - fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { - const message = createBaseQueryValidatorRequest(); - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - return message; - }, - toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { - const obj: any = {}; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - return obj; - }, - fromAminoMsg(object: QueryValidatorRequestAminoMsg): QueryValidatorRequest { - return QueryValidatorRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryValidatorRequest): QueryValidatorRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorRequest', - value: QueryValidatorRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryValidatorRequestProtoMsg): QueryValidatorRequest { return QueryValidatorRequest.decode(message.value); }, @@ -1280,29 +852,6 @@ export const QueryValidatorResponse = { : undefined; return message; }, - fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { - const message = createBaseQueryValidatorResponse(); - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromAmino(object.validator); - } - return message; - }, - toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { - const obj: any = {}; - obj.validator = message.validator - ? Validator.toAmino(message.validator) - : undefined; - return obj; - }, - fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { - return QueryValidatorResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryValidatorResponse): QueryValidatorResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorResponse', - value: QueryValidatorResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorResponseProtoMsg, ): QueryValidatorResponse { @@ -1393,42 +942,6 @@ export const QueryValidatorDelegationsRequest = { : undefined; return message; }, - fromAmino( - object: QueryValidatorDelegationsRequestAmino, - ): QueryValidatorDelegationsRequest { - const message = createBaseQueryValidatorDelegationsRequest(); - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorDelegationsRequest, - ): QueryValidatorDelegationsRequestAmino { - const obj: any = {}; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorDelegationsRequestAminoMsg, - ): QueryValidatorDelegationsRequest { - return QueryValidatorDelegationsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorDelegationsRequest, - ): QueryValidatorDelegationsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorDelegationsRequest', - value: QueryValidatorDelegationsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorDelegationsRequestProtoMsg, ): QueryValidatorDelegationsRequest { @@ -1535,47 +1048,6 @@ export const QueryValidatorDelegationsResponse = { : undefined; return message; }, - fromAmino( - object: QueryValidatorDelegationsResponseAmino, - ): QueryValidatorDelegationsResponse { - const message = createBaseQueryValidatorDelegationsResponse(); - message.delegationResponses = - object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || - []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorDelegationsResponse, - ): QueryValidatorDelegationsResponseAmino { - const obj: any = {}; - if (message.delegationResponses) { - obj.delegation_responses = message.delegationResponses.map(e => - e ? DelegationResponse.toAmino(e) : undefined, - ); - } else { - obj.delegation_responses = message.delegationResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorDelegationsResponseAminoMsg, - ): QueryValidatorDelegationsResponse { - return QueryValidatorDelegationsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorDelegationsResponse, - ): QueryValidatorDelegationsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorDelegationsResponse', - value: QueryValidatorDelegationsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorDelegationsResponseProtoMsg, ): QueryValidatorDelegationsResponse { @@ -1668,42 +1140,6 @@ export const QueryValidatorUnbondingDelegationsRequest = { : undefined; return message; }, - fromAmino( - object: QueryValidatorUnbondingDelegationsRequestAmino, - ): QueryValidatorUnbondingDelegationsRequest { - const message = createBaseQueryValidatorUnbondingDelegationsRequest(); - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorUnbondingDelegationsRequest, - ): QueryValidatorUnbondingDelegationsRequestAmino { - const obj: any = {}; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorUnbondingDelegationsRequestAminoMsg, - ): QueryValidatorUnbondingDelegationsRequest { - return QueryValidatorUnbondingDelegationsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorUnbondingDelegationsRequest, - ): QueryValidatorUnbondingDelegationsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorUnbondingDelegationsRequest', - value: QueryValidatorUnbondingDelegationsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorUnbondingDelegationsRequestProtoMsg, ): QueryValidatorUnbondingDelegationsRequest { @@ -1811,47 +1247,6 @@ export const QueryValidatorUnbondingDelegationsResponse = { : undefined; return message; }, - fromAmino( - object: QueryValidatorUnbondingDelegationsResponseAmino, - ): QueryValidatorUnbondingDelegationsResponse { - const message = createBaseQueryValidatorUnbondingDelegationsResponse(); - message.unbondingResponses = - object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || - []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryValidatorUnbondingDelegationsResponse, - ): QueryValidatorUnbondingDelegationsResponseAmino { - const obj: any = {}; - if (message.unbondingResponses) { - obj.unbonding_responses = message.unbondingResponses.map(e => - e ? UnbondingDelegation.toAmino(e) : undefined, - ); - } else { - obj.unbonding_responses = message.unbondingResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryValidatorUnbondingDelegationsResponseAminoMsg, - ): QueryValidatorUnbondingDelegationsResponse { - return QueryValidatorUnbondingDelegationsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryValidatorUnbondingDelegationsResponse, - ): QueryValidatorUnbondingDelegationsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryValidatorUnbondingDelegationsResponse', - value: QueryValidatorUnbondingDelegationsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryValidatorUnbondingDelegationsResponseProtoMsg, ): QueryValidatorUnbondingDelegationsResponse { @@ -1939,33 +1334,6 @@ export const QueryDelegationRequest = { message.validatorAddr = object.validatorAddr ?? ''; return message; }, - fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { - const message = createBaseQueryDelegationRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - return message; - }, - toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - return obj; - }, - fromAminoMsg(object: QueryDelegationRequestAminoMsg): QueryDelegationRequest { - return QueryDelegationRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryDelegationRequest): QueryDelegationRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationRequest', - value: QueryDelegationRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationRequestProtoMsg, ): QueryDelegationRequest { @@ -2050,38 +1418,6 @@ export const QueryDelegationResponse = { : undefined; return message; }, - fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { - const message = createBaseQueryDelegationResponse(); - if ( - object.delegation_response !== undefined && - object.delegation_response !== null - ) { - message.delegationResponse = DelegationResponse.fromAmino( - object.delegation_response, - ); - } - return message; - }, - toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { - const obj: any = {}; - obj.delegation_response = message.delegationResponse - ? DelegationResponse.toAmino(message.delegationResponse) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegationResponseAminoMsg, - ): QueryDelegationResponse { - return QueryDelegationResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegationResponse, - ): QueryDelegationResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegationResponse', - value: QueryDelegationResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegationResponseProtoMsg, ): QueryDelegationResponse { @@ -2169,41 +1505,6 @@ export const QueryUnbondingDelegationRequest = { message.validatorAddr = object.validatorAddr ?? ''; return message; }, - fromAmino( - object: QueryUnbondingDelegationRequestAmino, - ): QueryUnbondingDelegationRequest { - const message = createBaseQueryUnbondingDelegationRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - return message; - }, - toAmino( - message: QueryUnbondingDelegationRequest, - ): QueryUnbondingDelegationRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - return obj; - }, - fromAminoMsg( - object: QueryUnbondingDelegationRequestAminoMsg, - ): QueryUnbondingDelegationRequest { - return QueryUnbondingDelegationRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryUnbondingDelegationRequest, - ): QueryUnbondingDelegationRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryUnbondingDelegationRequest', - value: QueryUnbondingDelegationRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryUnbondingDelegationRequestProtoMsg, ): QueryUnbondingDelegationRequest { @@ -2280,42 +1581,11 @@ export const QueryUnbondingDelegationResponse = { object: Partial, ): QueryUnbondingDelegationResponse { const message = createBaseQueryUnbondingDelegationResponse(); - message.unbond = - object.unbond !== undefined && object.unbond !== null - ? UnbondingDelegation.fromPartial(object.unbond) - : undefined; - return message; - }, - fromAmino( - object: QueryUnbondingDelegationResponseAmino, - ): QueryUnbondingDelegationResponse { - const message = createBaseQueryUnbondingDelegationResponse(); - if (object.unbond !== undefined && object.unbond !== null) { - message.unbond = UnbondingDelegation.fromAmino(object.unbond); - } - return message; - }, - toAmino( - message: QueryUnbondingDelegationResponse, - ): QueryUnbondingDelegationResponseAmino { - const obj: any = {}; - obj.unbond = message.unbond - ? UnbondingDelegation.toAmino(message.unbond) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryUnbondingDelegationResponseAminoMsg, - ): QueryUnbondingDelegationResponse { - return QueryUnbondingDelegationResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryUnbondingDelegationResponse, - ): QueryUnbondingDelegationResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryUnbondingDelegationResponse', - value: QueryUnbondingDelegationResponse.toAmino(message), - }; + message.unbond = + object.unbond !== undefined && object.unbond !== null + ? UnbondingDelegation.fromPartial(object.unbond) + : undefined; + return message; }, fromProtoMsg( message: QueryUnbondingDelegationResponseProtoMsg, @@ -2409,42 +1679,6 @@ export const QueryDelegatorDelegationsRequest = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorDelegationsRequestAmino, - ): QueryDelegatorDelegationsRequest { - const message = createBaseQueryDelegatorDelegationsRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorDelegationsRequest, - ): QueryDelegatorDelegationsRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorDelegationsRequestAminoMsg, - ): QueryDelegatorDelegationsRequest { - return QueryDelegatorDelegationsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorDelegationsRequest, - ): QueryDelegatorDelegationsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorDelegationsRequest', - value: QueryDelegatorDelegationsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorDelegationsRequestProtoMsg, ): QueryDelegatorDelegationsRequest { @@ -2551,47 +1785,6 @@ export const QueryDelegatorDelegationsResponse = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorDelegationsResponseAmino, - ): QueryDelegatorDelegationsResponse { - const message = createBaseQueryDelegatorDelegationsResponse(); - message.delegationResponses = - object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || - []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorDelegationsResponse, - ): QueryDelegatorDelegationsResponseAmino { - const obj: any = {}; - if (message.delegationResponses) { - obj.delegation_responses = message.delegationResponses.map(e => - e ? DelegationResponse.toAmino(e) : undefined, - ); - } else { - obj.delegation_responses = message.delegationResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorDelegationsResponseAminoMsg, - ): QueryDelegatorDelegationsResponse { - return QueryDelegatorDelegationsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorDelegationsResponse, - ): QueryDelegatorDelegationsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorDelegationsResponse', - value: QueryDelegatorDelegationsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorDelegationsResponseProtoMsg, ): QueryDelegatorDelegationsResponse { @@ -2684,42 +1877,6 @@ export const QueryDelegatorUnbondingDelegationsRequest = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorUnbondingDelegationsRequestAmino, - ): QueryDelegatorUnbondingDelegationsRequest { - const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorUnbondingDelegationsRequest, - ): QueryDelegatorUnbondingDelegationsRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorUnbondingDelegationsRequestAminoMsg, - ): QueryDelegatorUnbondingDelegationsRequest { - return QueryDelegatorUnbondingDelegationsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorUnbondingDelegationsRequest, - ): QueryDelegatorUnbondingDelegationsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest', - value: QueryDelegatorUnbondingDelegationsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorUnbondingDelegationsRequestProtoMsg, ): QueryDelegatorUnbondingDelegationsRequest { @@ -2827,47 +1984,6 @@ export const QueryDelegatorUnbondingDelegationsResponse = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorUnbondingDelegationsResponseAmino, - ): QueryDelegatorUnbondingDelegationsResponse { - const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); - message.unbondingResponses = - object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || - []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorUnbondingDelegationsResponse, - ): QueryDelegatorUnbondingDelegationsResponseAmino { - const obj: any = {}; - if (message.unbondingResponses) { - obj.unbonding_responses = message.unbondingResponses.map(e => - e ? UnbondingDelegation.toAmino(e) : undefined, - ); - } else { - obj.unbonding_responses = message.unbondingResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorUnbondingDelegationsResponseAminoMsg, - ): QueryDelegatorUnbondingDelegationsResponse { - return QueryDelegatorUnbondingDelegationsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorUnbondingDelegationsResponse, - ): QueryDelegatorUnbondingDelegationsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse', - value: QueryDelegatorUnbondingDelegationsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorUnbondingDelegationsResponseProtoMsg, ): QueryDelegatorUnbondingDelegationsResponse { @@ -2988,54 +2104,6 @@ export const QueryRedelegationsRequest = { : undefined; return message; }, - fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { - const message = createBaseQueryRedelegationsRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if ( - object.src_validator_addr !== undefined && - object.src_validator_addr !== null - ) { - message.srcValidatorAddr = object.src_validator_addr; - } - if ( - object.dst_validator_addr !== undefined && - object.dst_validator_addr !== null - ) { - message.dstValidatorAddr = object.dst_validator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.src_validator_addr = - message.srcValidatorAddr === '' ? undefined : message.srcValidatorAddr; - obj.dst_validator_addr = - message.dstValidatorAddr === '' ? undefined : message.dstValidatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryRedelegationsRequestAminoMsg, - ): QueryRedelegationsRequest { - return QueryRedelegationsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryRedelegationsRequest, - ): QueryRedelegationsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryRedelegationsRequest', - value: QueryRedelegationsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryRedelegationsRequestProtoMsg, ): QueryRedelegationsRequest { @@ -3143,48 +2211,6 @@ export const QueryRedelegationsResponse = { : undefined; return message; }, - fromAmino( - object: QueryRedelegationsResponseAmino, - ): QueryRedelegationsResponse { - const message = createBaseQueryRedelegationsResponse(); - message.redelegationResponses = - object.redelegation_responses?.map(e => - RedelegationResponse.fromAmino(e), - ) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryRedelegationsResponse, - ): QueryRedelegationsResponseAmino { - const obj: any = {}; - if (message.redelegationResponses) { - obj.redelegation_responses = message.redelegationResponses.map(e => - e ? RedelegationResponse.toAmino(e) : undefined, - ); - } else { - obj.redelegation_responses = message.redelegationResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryRedelegationsResponseAminoMsg, - ): QueryRedelegationsResponse { - return QueryRedelegationsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryRedelegationsResponse, - ): QueryRedelegationsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryRedelegationsResponse', - value: QueryRedelegationsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryRedelegationsResponseProtoMsg, ): QueryRedelegationsResponse { @@ -3277,42 +2303,6 @@ export const QueryDelegatorValidatorsRequest = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorValidatorsRequestAmino, - ): QueryDelegatorValidatorsRequest { - const message = createBaseQueryDelegatorValidatorsRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorValidatorsRequest, - ): QueryDelegatorValidatorsRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorsRequestAminoMsg, - ): QueryDelegatorValidatorsRequest { - return QueryDelegatorValidatorsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorsRequest, - ): QueryDelegatorValidatorsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorsRequest', - value: QueryDelegatorValidatorsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorsRequestProtoMsg, ): QueryDelegatorValidatorsRequest { @@ -3414,46 +2404,6 @@ export const QueryDelegatorValidatorsResponse = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorValidatorsResponseAmino, - ): QueryDelegatorValidatorsResponse { - const message = createBaseQueryDelegatorValidatorsResponse(); - message.validators = - object.validators?.map(e => Validator.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino( - message: QueryDelegatorValidatorsResponse, - ): QueryDelegatorValidatorsResponseAmino { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorsResponseAminoMsg, - ): QueryDelegatorValidatorsResponse { - return QueryDelegatorValidatorsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorsResponse, - ): QueryDelegatorValidatorsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorsResponse', - value: QueryDelegatorValidatorsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorsResponseProtoMsg, ): QueryDelegatorValidatorsResponse { @@ -3541,41 +2491,6 @@ export const QueryDelegatorValidatorRequest = { message.validatorAddr = object.validatorAddr ?? ''; return message; }, - fromAmino( - object: QueryDelegatorValidatorRequestAmino, - ): QueryDelegatorValidatorRequest { - const message = createBaseQueryDelegatorValidatorRequest(); - if (object.delegator_addr !== undefined && object.delegator_addr !== null) { - message.delegatorAddr = object.delegator_addr; - } - if (object.validator_addr !== undefined && object.validator_addr !== null) { - message.validatorAddr = object.validator_addr; - } - return message; - }, - toAmino( - message: QueryDelegatorValidatorRequest, - ): QueryDelegatorValidatorRequestAmino { - const obj: any = {}; - obj.delegator_addr = - message.delegatorAddr === '' ? undefined : message.delegatorAddr; - obj.validator_addr = - message.validatorAddr === '' ? undefined : message.validatorAddr; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorRequestAminoMsg, - ): QueryDelegatorValidatorRequest { - return QueryDelegatorValidatorRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorRequest, - ): QueryDelegatorValidatorRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorRequest', - value: QueryDelegatorValidatorRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorRequestProtoMsg, ): QueryDelegatorValidatorRequest { @@ -3655,37 +2570,6 @@ export const QueryDelegatorValidatorResponse = { : undefined; return message; }, - fromAmino( - object: QueryDelegatorValidatorResponseAmino, - ): QueryDelegatorValidatorResponse { - const message = createBaseQueryDelegatorValidatorResponse(); - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromAmino(object.validator); - } - return message; - }, - toAmino( - message: QueryDelegatorValidatorResponse, - ): QueryDelegatorValidatorResponseAmino { - const obj: any = {}; - obj.validator = message.validator - ? Validator.toAmino(message.validator) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryDelegatorValidatorResponseAminoMsg, - ): QueryDelegatorValidatorResponse { - return QueryDelegatorValidatorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryDelegatorValidatorResponse, - ): QueryDelegatorValidatorResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryDelegatorValidatorResponse', - value: QueryDelegatorValidatorResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryDelegatorValidatorResponseProtoMsg, ): QueryDelegatorValidatorResponse { @@ -3763,36 +2647,6 @@ export const QueryHistoricalInfoRequest = { : BigInt(0); return message; }, - fromAmino( - object: QueryHistoricalInfoRequestAmino, - ): QueryHistoricalInfoRequest { - const message = createBaseQueryHistoricalInfoRequest(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - return message; - }, - toAmino( - message: QueryHistoricalInfoRequest, - ): QueryHistoricalInfoRequestAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - return obj; - }, - fromAminoMsg( - object: QueryHistoricalInfoRequestAminoMsg, - ): QueryHistoricalInfoRequest { - return QueryHistoricalInfoRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryHistoricalInfoRequest, - ): QueryHistoricalInfoRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryHistoricalInfoRequest', - value: QueryHistoricalInfoRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryHistoricalInfoRequestProtoMsg, ): QueryHistoricalInfoRequest { @@ -3872,35 +2726,6 @@ export const QueryHistoricalInfoResponse = { : undefined; return message; }, - fromAmino( - object: QueryHistoricalInfoResponseAmino, - ): QueryHistoricalInfoResponse { - const message = createBaseQueryHistoricalInfoResponse(); - if (object.hist !== undefined && object.hist !== null) { - message.hist = HistoricalInfo.fromAmino(object.hist); - } - return message; - }, - toAmino( - message: QueryHistoricalInfoResponse, - ): QueryHistoricalInfoResponseAmino { - const obj: any = {}; - obj.hist = message.hist ? HistoricalInfo.toAmino(message.hist) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryHistoricalInfoResponseAminoMsg, - ): QueryHistoricalInfoResponse { - return QueryHistoricalInfoResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryHistoricalInfoResponse, - ): QueryHistoricalInfoResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryHistoricalInfoResponse', - value: QueryHistoricalInfoResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryHistoricalInfoResponseProtoMsg, ): QueryHistoricalInfoResponse { @@ -3955,23 +2780,6 @@ export const QueryPoolRequest = { const message = createBaseQueryPoolRequest(); return message; }, - fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { - const message = createBaseQueryPoolRequest(); - return message; - }, - toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryPoolRequestAminoMsg): QueryPoolRequest { - return QueryPoolRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryPoolRequest): QueryPoolRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryPoolRequest', - value: QueryPoolRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryPoolRequestProtoMsg): QueryPoolRequest { return QueryPoolRequest.decode(message.value); }, @@ -4038,27 +2846,6 @@ export const QueryPoolResponse = { : undefined; return message; }, - fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { - const message = createBaseQueryPoolResponse(); - if (object.pool !== undefined && object.pool !== null) { - message.pool = Pool.fromAmino(object.pool); - } - return message; - }, - toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { - const obj: any = {}; - obj.pool = message.pool ? Pool.toAmino(message.pool) : undefined; - return obj; - }, - fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { - return QueryPoolResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryPoolResponse): QueryPoolResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryPoolResponse', - value: QueryPoolResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryPoolResponseProtoMsg): QueryPoolResponse { return QueryPoolResponse.decode(message.value); }, @@ -4112,23 +2899,6 @@ export const QueryParamsRequest = { const message = createBaseQueryParamsRequest(); return message; }, - fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - const message = createBaseQueryParamsRequest(); - return message; - }, - toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { - return QueryParamsRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsRequest', - value: QueryParamsRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { return QueryParamsRequest.decode(message.value); }, @@ -4198,27 +2968,6 @@ export const QueryParamsResponse = { : undefined; return message; }, - fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { - return QueryParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryParamsResponse', - value: QueryParamsResponse.toAmino(message), - }; - }, fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { return QueryParamsResponse.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts index b534e2b451c..5a8f4b630b9 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -1,22 +1,12 @@ //@ts-nocheck -import { - Header, - HeaderAmino, - HeaderSDKType, -} from '../../../tendermint/types/types.js'; +import { Header, HeaderSDKType } from '../../../tendermint/types/types.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { Duration, - DurationAmino, DurationSDKType, } from '../../../google/protobuf/duration.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet, @@ -25,8 +15,6 @@ import { fromJsonTimestamp, } from '../../../helpers.js'; import { Decimal } from '@cosmjs/math'; -import { encodePubkey, decodePubkey } from '@cosmjs/proto-signing'; -import { Pubkey } from '@cosmjs/amino'; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -40,7 +28,6 @@ export enum BondStatus { UNRECOGNIZED = -1, } export const BondStatusSDKType = BondStatus; -export const BondStatusAmino = BondStatus; export function bondStatusFromJSON(object: any): BondStatus { switch (object) { case 0: @@ -90,20 +77,6 @@ export interface HistoricalInfoProtoMsg { typeUrl: '/cosmos.staking.v1beta1.HistoricalInfo'; value: Uint8Array; } -/** - * HistoricalInfo contains header and validator information for a given block. - * It is stored as part of staking module's state, which persists the `n` most - * recent HistoricalInfo - * (`n` is set by the staking module's `historical_entries` parameter). - */ -export interface HistoricalInfoAmino { - header?: HeaderAmino; - valset?: ValidatorAmino[]; -} -export interface HistoricalInfoAminoMsg { - type: 'cosmos-sdk/HistoricalInfo'; - value: HistoricalInfoAmino; -} /** * HistoricalInfo contains header and validator information for a given block. * It is stored as part of staking module's state, which persists the `n` most @@ -130,22 +103,6 @@ export interface CommissionRatesProtoMsg { typeUrl: '/cosmos.staking.v1beta1.CommissionRates'; value: Uint8Array; } -/** - * CommissionRates defines the initial commission rates to be used for creating - * a validator. - */ -export interface CommissionRatesAmino { - /** rate is the commission rate charged to delegators, as a fraction. */ - rate?: string; - /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate?: string; - /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate?: string; -} -export interface CommissionRatesAminoMsg { - type: 'cosmos-sdk/CommissionRates'; - value: CommissionRatesAmino; -} /** * CommissionRates defines the initial commission rates to be used for creating * a validator. @@ -167,17 +124,6 @@ export interface CommissionProtoMsg { value: Uint8Array; } /** Commission defines commission parameters for a given validator. */ -export interface CommissionAmino { - /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates?: CommissionRatesAmino; - /** update_time is the last time the commission rate was changed. */ - update_time?: string; -} -export interface CommissionAminoMsg { - type: 'cosmos-sdk/Commission'; - value: CommissionAmino; -} -/** Commission defines commission parameters for a given validator. */ export interface CommissionSDKType { commission_rates: CommissionRatesSDKType; update_time: Date; @@ -200,23 +146,6 @@ export interface DescriptionProtoMsg { value: Uint8Array; } /** Description defines a validator description. */ -export interface DescriptionAmino { - /** moniker defines a human-readable name for the validator. */ - moniker?: string; - /** identity defines an optional identity signature (ex. UPort or Keybase). */ - identity?: string; - /** website defines an optional website link. */ - website?: string; - /** security_contact defines an optional email for security contact. */ - security_contact?: string; - /** details define other optional details. */ - details?: string; -} -export interface DescriptionAminoMsg { - type: 'cosmos-sdk/Description'; - value: DescriptionAmino; -} -/** Description defines a validator description. */ export interface DescriptionSDKType { moniker: string; identity: string; @@ -262,49 +191,6 @@ export interface ValidatorProtoMsg { typeUrl: '/cosmos.staking.v1beta1.Validator'; value: Uint8Array; } -export type ValidatorEncoded = Omit & { - /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensusPubkey?: - | AnyProtoMsg - | undefined; -}; -/** - * Validator defines a validator, together with the total amount of the - * Validator's bond shares and their exchange rate to coins. Slashing results in - * a decrease in the exchange rate, allowing correct calculation of future - * undelegations without iterating over delegators. When coins are delegated to - * this validator, the validator is credited with a delegation whose number of - * bond shares is based on the amount of coins delegated divided by the current - * exchange rate. Voting power can be calculated as total bonded shares - * multiplied by exchange rate. - */ -export interface ValidatorAmino { - /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address?: string; - /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensus_pubkey?: AnyAmino; - /** jailed defined whether the validator has been jailed from bonded status or not. */ - jailed?: boolean; - /** status is the validator status (bonded/unbonding/unbonded). */ - status?: BondStatus; - /** tokens define the delegated tokens (incl. self-delegation). */ - tokens?: string; - /** delegator_shares defines total shares issued to a validator's delegators. */ - delegator_shares?: string; - /** description defines the description terms for the validator. */ - description?: DescriptionAmino; - /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height?: string; - /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: string; - /** commission defines the commission parameters. */ - commission?: CommissionAmino; - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation?: string; -} -export interface ValidatorAminoMsg { - type: 'cosmos-sdk/Validator'; - value: ValidatorAmino; -} /** * Validator defines a validator, together with the total amount of the * Validator's bond shares and their exchange rate to coins. Slashing results in @@ -337,14 +223,6 @@ export interface ValAddressesProtoMsg { value: Uint8Array; } /** ValAddresses defines a repeated set of validator addresses. */ -export interface ValAddressesAmino { - addresses?: string[]; -} -export interface ValAddressesAminoMsg { - type: 'cosmos-sdk/ValAddresses'; - value: ValAddressesAmino; -} -/** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddressesSDKType { addresses: string[]; } @@ -361,19 +239,6 @@ export interface DVPairProtoMsg { typeUrl: '/cosmos.staking.v1beta1.DVPair'; value: Uint8Array; } -/** - * DVPair is struct that just has a delegator-validator pair with no other data. - * It is intended to be used as a marshalable pointer. For example, a DVPair can - * be used to construct the key to getting an UnbondingDelegation from state. - */ -export interface DVPairAmino { - delegator_address?: string; - validator_address?: string; -} -export interface DVPairAminoMsg { - type: 'cosmos-sdk/DVPair'; - value: DVPairAmino; -} /** * DVPair is struct that just has a delegator-validator pair with no other data. * It is intended to be used as a marshalable pointer. For example, a DVPair can @@ -392,14 +257,6 @@ export interface DVPairsProtoMsg { value: Uint8Array; } /** DVPairs defines an array of DVPair objects. */ -export interface DVPairsAmino { - pairs?: DVPairAmino[]; -} -export interface DVPairsAminoMsg { - type: 'cosmos-sdk/DVPairs'; - value: DVPairsAmino; -} -/** DVPairs defines an array of DVPair objects. */ export interface DVPairsSDKType { pairs: DVPairSDKType[]; } @@ -418,21 +275,6 @@ export interface DVVTripletProtoMsg { typeUrl: '/cosmos.staking.v1beta1.DVVTriplet'; value: Uint8Array; } -/** - * DVVTriplet is struct that just has a delegator-validator-validator triplet - * with no other data. It is intended to be used as a marshalable pointer. For - * example, a DVVTriplet can be used to construct the key to getting a - * Redelegation from state. - */ -export interface DVVTripletAmino { - delegator_address?: string; - validator_src_address?: string; - validator_dst_address?: string; -} -export interface DVVTripletAminoMsg { - type: 'cosmos-sdk/DVVTriplet'; - value: DVVTripletAmino; -} /** * DVVTriplet is struct that just has a delegator-validator-validator triplet * with no other data. It is intended to be used as a marshalable pointer. For @@ -453,14 +295,6 @@ export interface DVVTripletsProtoMsg { value: Uint8Array; } /** DVVTriplets defines an array of DVVTriplet objects. */ -export interface DVVTripletsAmino { - triplets?: DVVTripletAmino[]; -} -export interface DVVTripletsAminoMsg { - type: 'cosmos-sdk/DVVTriplets'; - value: DVVTripletsAmino; -} -/** DVVTriplets defines an array of DVVTriplet objects. */ export interface DVVTripletsSDKType { triplets: DVVTripletSDKType[]; } @@ -481,23 +315,6 @@ export interface DelegationProtoMsg { typeUrl: '/cosmos.staking.v1beta1.Delegation'; value: Uint8Array; } -/** - * Delegation represents the bond with tokens held by an account. It is - * owned by one delegator, and is associated with the voting power of one - * validator. - */ -export interface DelegationAmino { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - /** shares define the delegation shares received. */ - shares?: string; -} -export interface DelegationAminoMsg { - type: 'cosmos-sdk/Delegation'; - value: DelegationAmino; -} /** * Delegation represents the bond with tokens held by an account. It is * owned by one delegator, and is associated with the voting power of one @@ -524,22 +341,6 @@ export interface UnbondingDelegationProtoMsg { typeUrl: '/cosmos.staking.v1beta1.UnbondingDelegation'; value: Uint8Array; } -/** - * UnbondingDelegation stores all of a single delegator's unbonding bonds - * for a single validator in an time-ordered list. - */ -export interface UnbondingDelegationAmino { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - /** entries are the unbonding delegation entries. */ - entries?: UnbondingDelegationEntryAmino[]; -} -export interface UnbondingDelegationAminoMsg { - type: 'cosmos-sdk/UnbondingDelegation'; - value: UnbondingDelegationAmino; -} /** * UnbondingDelegation stores all of a single delegator's unbonding bonds * for a single validator in an time-ordered list. @@ -565,21 +366,6 @@ export interface UnbondingDelegationEntryProtoMsg { value: Uint8Array; } /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ -export interface UnbondingDelegationEntryAmino { - /** creation_height is the height which the unbonding took place. */ - creation_height?: string; - /** completion_time is the unix time for unbonding completion. */ - completion_time?: string; - /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance?: string; - /** balance defines the tokens to receive at completion. */ - balance?: string; -} -export interface UnbondingDelegationEntryAminoMsg { - type: 'cosmos-sdk/UnbondingDelegationEntry'; - value: UnbondingDelegationEntryAmino; -} -/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntrySDKType { creation_height: bigint; completion_time: Date; @@ -602,21 +388,6 @@ export interface RedelegationEntryProtoMsg { value: Uint8Array; } /** RedelegationEntry defines a redelegation object with relevant metadata. */ -export interface RedelegationEntryAmino { - /** creation_height defines the height which the redelegation took place. */ - creation_height?: string; - /** completion_time defines the unix time for redelegation completion. */ - completion_time?: string; - /** initial_balance defines the initial balance when redelegation started. */ - initial_balance?: string; - /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst?: string; -} -export interface RedelegationEntryAminoMsg { - type: 'cosmos-sdk/RedelegationEntry'; - value: RedelegationEntryAmino; -} -/** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntrySDKType { creation_height: bigint; completion_time: Date; @@ -641,24 +412,6 @@ export interface RedelegationProtoMsg { typeUrl: '/cosmos.staking.v1beta1.Redelegation'; value: Uint8Array; } -/** - * Redelegation contains the list of a particular delegator's redelegating bonds - * from a particular source validator to a particular destination validator. - */ -export interface RedelegationAmino { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address?: string; - /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address?: string; - /** entries are the redelegation entries. */ - entries?: RedelegationEntryAmino[]; -} -export interface RedelegationAminoMsg { - type: 'cosmos-sdk/Redelegation'; - value: RedelegationAmino; -} /** * Redelegation contains the list of a particular delegator's redelegating bonds * from a particular source validator to a particular destination validator. @@ -689,25 +442,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params defines the parameters for the staking module. */ -export interface ParamsAmino { - /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: DurationAmino; - /** max_validators is the maximum number of validators. */ - max_validators?: number; - /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries?: number; - /** historical_entries is the number of historical entries to persist. */ - historical_entries?: number; - /** bond_denom defines the bondable coin denomination. */ - bond_denom?: string; - /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ - min_commission_rate?: string; -} -export interface ParamsAminoMsg { - type: 'cosmos-sdk/Params'; - value: ParamsAmino; -} -/** Params defines the parameters for the staking module. */ export interface ParamsSDKType { unbonding_time: DurationSDKType; max_validators: number; @@ -728,18 +462,6 @@ export interface DelegationResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.DelegationResponse'; value: Uint8Array; } -/** - * DelegationResponse is equivalent to Delegation except that it contains a - * balance in addition to shares which is more suitable for client responses. - */ -export interface DelegationResponseAmino { - delegation?: DelegationAmino; - balance?: CoinAmino; -} -export interface DelegationResponseAminoMsg { - type: 'cosmos-sdk/DelegationResponse'; - value: DelegationResponseAmino; -} /** * DelegationResponse is equivalent to Delegation except that it contains a * balance in addition to shares which is more suitable for client responses. @@ -761,19 +483,6 @@ export interface RedelegationEntryResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.RedelegationEntryResponse'; value: Uint8Array; } -/** - * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it - * contains a balance in addition to shares which is more suitable for client - * responses. - */ -export interface RedelegationEntryResponseAmino { - redelegation_entry?: RedelegationEntryAmino; - balance?: string; -} -export interface RedelegationEntryResponseAminoMsg { - type: 'cosmos-sdk/RedelegationEntryResponse'; - value: RedelegationEntryResponseAmino; -} /** * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it * contains a balance in addition to shares which is more suitable for client @@ -796,19 +505,6 @@ export interface RedelegationResponseProtoMsg { typeUrl: '/cosmos.staking.v1beta1.RedelegationResponse'; value: Uint8Array; } -/** - * RedelegationResponse is equivalent to a Redelegation except that its entries - * contain a balance in addition to shares which is more suitable for client - * responses. - */ -export interface RedelegationResponseAmino { - redelegation?: RedelegationAmino; - entries?: RedelegationEntryResponseAmino[]; -} -export interface RedelegationResponseAminoMsg { - type: 'cosmos-sdk/RedelegationResponse'; - value: RedelegationResponseAmino; -} /** * RedelegationResponse is equivalent to a Redelegation except that its entries * contain a balance in addition to shares which is more suitable for client @@ -830,18 +526,6 @@ export interface PoolProtoMsg { typeUrl: '/cosmos.staking.v1beta1.Pool'; value: Uint8Array; } -/** - * Pool is used for tracking bonded and not-bonded token supply of the bond - * denomination. - */ -export interface PoolAmino { - not_bonded_tokens: string; - bonded_tokens: string; -} -export interface PoolAminoMsg { - type: 'cosmos-sdk/Pool'; - value: PoolAmino; -} /** * Pool is used for tracking bonded and not-bonded token supply of the bond * denomination. @@ -921,35 +605,6 @@ export const HistoricalInfo = { message.valset = object.valset?.map(e => Validator.fromPartial(e)) || []; return message; }, - fromAmino(object: HistoricalInfoAmino): HistoricalInfo { - const message = createBaseHistoricalInfo(); - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); - } - message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; - return message; - }, - toAmino(message: HistoricalInfo): HistoricalInfoAmino { - const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - if (message.valset) { - obj.valset = message.valset.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.valset = message.valset; - } - return obj; - }, - fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo { - return HistoricalInfo.fromAmino(object.value); - }, - toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg { - return { - type: 'cosmos-sdk/HistoricalInfo', - value: HistoricalInfo.toAmino(message), - }; - }, fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo { return HistoricalInfo.decode(message.value); }, @@ -1042,39 +697,6 @@ export const CommissionRates = { message.maxChangeRate = object.maxChangeRate ?? ''; return message; }, - fromAmino(object: CommissionRatesAmino): CommissionRates { - const message = createBaseCommissionRates(); - if (object.rate !== undefined && object.rate !== null) { - message.rate = object.rate; - } - if (object.max_rate !== undefined && object.max_rate !== null) { - message.maxRate = object.max_rate; - } - if ( - object.max_change_rate !== undefined && - object.max_change_rate !== null - ) { - message.maxChangeRate = object.max_change_rate; - } - return message; - }, - toAmino(message: CommissionRates): CommissionRatesAmino { - const obj: any = {}; - obj.rate = message.rate === '' ? undefined : message.rate; - obj.max_rate = message.maxRate === '' ? undefined : message.maxRate; - obj.max_change_rate = - message.maxChangeRate === '' ? undefined : message.maxChangeRate; - return obj; - }, - fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { - return CommissionRates.fromAmino(object.value); - }, - toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg { - return { - type: 'cosmos-sdk/CommissionRates', - value: CommissionRates.toAmino(message), - }; - }, fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates { return CommissionRates.decode(message.value); }, @@ -1169,42 +791,6 @@ export const Commission = { message.updateTime = object.updateTime ?? undefined; return message; }, - fromAmino(object: CommissionAmino): Commission { - const message = createBaseCommission(); - if ( - object.commission_rates !== undefined && - object.commission_rates !== null - ) { - message.commissionRates = CommissionRates.fromAmino( - object.commission_rates, - ); - } - if (object.update_time !== undefined && object.update_time !== null) { - message.updateTime = fromTimestamp( - Timestamp.fromAmino(object.update_time), - ); - } - return message; - }, - toAmino(message: Commission): CommissionAmino { - const obj: any = {}; - obj.commission_rates = message.commissionRates - ? CommissionRates.toAmino(message.commissionRates) - : undefined; - obj.update_time = message.updateTime - ? Timestamp.toAmino(toTimestamp(message.updateTime)) - : undefined; - return obj; - }, - fromAminoMsg(object: CommissionAminoMsg): Commission { - return Commission.fromAmino(object.value); - }, - toAminoMsg(message: Commission): CommissionAminoMsg { - return { - type: 'cosmos-sdk/Commission', - value: Commission.toAmino(message), - }; - }, fromProtoMsg(message: CommissionProtoMsg): Commission { return Commission.decode(message.value); }, @@ -1310,47 +896,6 @@ export const Description = { message.details = object.details ?? ''; return message; }, - fromAmino(object: DescriptionAmino): Description { - const message = createBaseDescription(); - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } - if (object.identity !== undefined && object.identity !== null) { - message.identity = object.identity; - } - if (object.website !== undefined && object.website !== null) { - message.website = object.website; - } - if ( - object.security_contact !== undefined && - object.security_contact !== null - ) { - message.securityContact = object.security_contact; - } - if (object.details !== undefined && object.details !== null) { - message.details = object.details; - } - return message; - }, - toAmino(message: Description): DescriptionAmino { - const obj: any = {}; - obj.moniker = message.moniker === '' ? undefined : message.moniker; - obj.identity = message.identity === '' ? undefined : message.identity; - obj.website = message.website === '' ? undefined : message.website; - obj.security_contact = - message.securityContact === '' ? undefined : message.securityContact; - obj.details = message.details === '' ? undefined : message.details; - return obj; - }, - fromAminoMsg(object: DescriptionAminoMsg): Description { - return Description.fromAmino(object.value); - }, - toAminoMsg(message: Description): DescriptionAminoMsg { - return { - type: 'cosmos-sdk/Description', - value: Description.toAmino(message), - }; - }, fromProtoMsg(message: DescriptionProtoMsg): Description { return Description.decode(message.value); }, @@ -1574,98 +1119,6 @@ export const Validator = { message.minSelfDelegation = object.minSelfDelegation ?? ''; return message; }, - fromAmino(object: ValidatorAmino): Validator { - const message = createBaseValidator(); - if ( - object.operator_address !== undefined && - object.operator_address !== null - ) { - message.operatorAddress = object.operator_address; - } - if ( - object.consensus_pubkey !== undefined && - object.consensus_pubkey !== null - ) { - message.consensusPubkey = encodePubkey(object.consensus_pubkey); - } - if (object.jailed !== undefined && object.jailed !== null) { - message.jailed = object.jailed; - } - if (object.status !== undefined && object.status !== null) { - message.status = object.status; - } - if (object.tokens !== undefined && object.tokens !== null) { - message.tokens = object.tokens; - } - if ( - object.delegator_shares !== undefined && - object.delegator_shares !== null - ) { - message.delegatorShares = object.delegator_shares; - } - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromAmino(object.description); - } - if ( - object.unbonding_height !== undefined && - object.unbonding_height !== null - ) { - message.unbondingHeight = BigInt(object.unbonding_height); - } - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbondingTime = fromTimestamp( - Timestamp.fromAmino(object.unbonding_time), - ); - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = Commission.fromAmino(object.commission); - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.minSelfDelegation = object.min_self_delegation; - } - return message; - }, - toAmino(message: Validator): ValidatorAmino { - const obj: any = {}; - obj.operator_address = - message.operatorAddress === '' ? undefined : message.operatorAddress; - obj.consensus_pubkey = message.consensusPubkey - ? decodePubkey(message.consensusPubkey) - : undefined; - obj.jailed = message.jailed === false ? undefined : message.jailed; - obj.status = message.status === 0 ? undefined : message.status; - obj.tokens = message.tokens === '' ? undefined : message.tokens; - obj.delegator_shares = - message.delegatorShares === '' ? undefined : message.delegatorShares; - obj.description = message.description - ? Description.toAmino(message.description) - : undefined; - obj.unbonding_height = - message.unbondingHeight !== BigInt(0) - ? message.unbondingHeight.toString() - : undefined; - obj.unbonding_time = message.unbondingTime - ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) - : undefined; - obj.commission = message.commission - ? Commission.toAmino(message.commission) - : undefined; - obj.min_self_delegation = - message.minSelfDelegation === '' ? undefined : message.minSelfDelegation; - return obj; - }, - fromAminoMsg(object: ValidatorAminoMsg): Validator { - return Validator.fromAmino(object.value); - }, - toAminoMsg(message: Validator): ValidatorAminoMsg { - return { - type: 'cosmos-sdk/Validator', - value: Validator.toAmino(message), - }; - }, fromProtoMsg(message: ValidatorProtoMsg): Validator { return Validator.decode(message.value); }, @@ -1734,29 +1187,6 @@ export const ValAddresses = { message.addresses = object.addresses?.map(e => e) || []; return message; }, - fromAmino(object: ValAddressesAmino): ValAddresses { - const message = createBaseValAddresses(); - message.addresses = object.addresses?.map(e => e) || []; - return message; - }, - toAmino(message: ValAddresses): ValAddressesAmino { - const obj: any = {}; - if (message.addresses) { - obj.addresses = message.addresses.map(e => e); - } else { - obj.addresses = message.addresses; - } - return obj; - }, - fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses { - return ValAddresses.fromAmino(object.value); - }, - toAminoMsg(message: ValAddresses): ValAddressesAminoMsg { - return { - type: 'cosmos-sdk/ValAddresses', - value: ValAddresses.toAmino(message), - }; - }, fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses { return ValAddresses.decode(message.value); }, @@ -1835,39 +1265,6 @@ export const DVPair = { message.validatorAddress = object.validatorAddress ?? ''; return message; }, - fromAmino(object: DVPairAmino): DVPair { - const message = createBaseDVPair(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - return message; - }, - toAmino(message: DVPair): DVPairAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - return obj; - }, - fromAminoMsg(object: DVPairAminoMsg): DVPair { - return DVPair.fromAmino(object.value); - }, - toAminoMsg(message: DVPair): DVPairAminoMsg { - return { - type: 'cosmos-sdk/DVPair', - value: DVPair.toAmino(message), - }; - }, fromProtoMsg(message: DVPairProtoMsg): DVPair { return DVPair.decode(message.value); }, @@ -1936,29 +1333,6 @@ export const DVPairs = { message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || []; return message; }, - fromAmino(object: DVPairsAmino): DVPairs { - const message = createBaseDVPairs(); - message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; - return message; - }, - toAmino(message: DVPairs): DVPairsAmino { - const obj: any = {}; - if (message.pairs) { - obj.pairs = message.pairs.map(e => (e ? DVPair.toAmino(e) : undefined)); - } else { - obj.pairs = message.pairs; - } - return obj; - }, - fromAminoMsg(object: DVPairsAminoMsg): DVPairs { - return DVPairs.fromAmino(object.value); - }, - toAminoMsg(message: DVPairs): DVPairsAminoMsg { - return { - type: 'cosmos-sdk/DVPairs', - value: DVPairs.toAmino(message), - }; - }, fromProtoMsg(message: DVPairsProtoMsg): DVPairs { return DVPairs.decode(message.value); }, @@ -2050,51 +1424,6 @@ export const DVVTriplet = { message.validatorDstAddress = object.validatorDstAddress ?? ''; return message; }, - fromAmino(object: DVVTripletAmino): DVVTriplet { - const message = createBaseDVVTriplet(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validatorSrcAddress = object.validator_src_address; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validatorDstAddress = object.validator_dst_address; - } - return message; - }, - toAmino(message: DVVTriplet): DVVTripletAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_src_address = - message.validatorSrcAddress === '' - ? undefined - : message.validatorSrcAddress; - obj.validator_dst_address = - message.validatorDstAddress === '' - ? undefined - : message.validatorDstAddress; - return obj; - }, - fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet { - return DVVTriplet.fromAmino(object.value); - }, - toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg { - return { - type: 'cosmos-sdk/DVVTriplet', - value: DVVTriplet.toAmino(message), - }; - }, fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet { return DVVTriplet.decode(message.value); }, @@ -2166,31 +1495,6 @@ export const DVVTriplets = { object.triplets?.map(e => DVVTriplet.fromPartial(e)) || []; return message; }, - fromAmino(object: DVVTripletsAmino): DVVTriplets { - const message = createBaseDVVTriplets(); - message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; - return message; - }, - toAmino(message: DVVTriplets): DVVTripletsAmino { - const obj: any = {}; - if (message.triplets) { - obj.triplets = message.triplets.map(e => - e ? DVVTriplet.toAmino(e) : undefined, - ); - } else { - obj.triplets = message.triplets; - } - return obj; - }, - fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets { - return DVVTriplets.fromAmino(object.value); - }, - toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg { - return { - type: 'cosmos-sdk/DVVTriplets', - value: DVVTriplets.toAmino(message), - }; - }, fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets { return DVVTriplets.decode(message.value); }, @@ -2281,43 +1585,6 @@ export const Delegation = { message.shares = object.shares ?? ''; return message; }, - fromAmino(object: DelegationAmino): Delegation { - const message = createBaseDelegation(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.shares !== undefined && object.shares !== null) { - message.shares = object.shares; - } - return message; - }, - toAmino(message: Delegation): DelegationAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.shares = message.shares === '' ? undefined : message.shares; - return obj; - }, - fromAminoMsg(object: DelegationAminoMsg): Delegation { - return Delegation.fromAmino(object.value); - }, - toAminoMsg(message: Delegation): DelegationAminoMsg { - return { - type: 'cosmos-sdk/Delegation', - value: Delegation.toAmino(message), - }; - }, fromProtoMsg(message: DelegationProtoMsg): Delegation { return Delegation.decode(message.value); }, @@ -2420,48 +1687,6 @@ export const UnbondingDelegation = { object.entries?.map(e => UnbondingDelegationEntry.fromPartial(e)) || []; return message; }, - fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { - const message = createBaseUnbondingDelegation(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - message.entries = - object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; - return message; - }, - toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - if (message.entries) { - obj.entries = message.entries.map(e => - e ? UnbondingDelegationEntry.toAmino(e) : undefined, - ); - } else { - obj.entries = message.entries; - } - return obj; - }, - fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation { - return UnbondingDelegation.fromAmino(object.value); - }, - toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg { - return { - type: 'cosmos-sdk/UnbondingDelegation', - value: UnbondingDelegation.toAmino(message), - }; - }, fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation { return UnbondingDelegation.decode(message.value); }, @@ -2576,60 +1801,6 @@ export const UnbondingDelegationEntry = { message.balance = object.balance ?? ''; return message; }, - fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { - const message = createBaseUnbondingDelegationEntry(); - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creationHeight = BigInt(object.creation_height); - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completionTime = fromTimestamp( - Timestamp.fromAmino(object.completion_time), - ); - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initialBalance = object.initial_balance; - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } - return message; - }, - toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { - const obj: any = {}; - obj.creation_height = - message.creationHeight !== BigInt(0) - ? message.creationHeight.toString() - : undefined; - obj.completion_time = message.completionTime - ? Timestamp.toAmino(toTimestamp(message.completionTime)) - : undefined; - obj.initial_balance = - message.initialBalance === '' ? undefined : message.initialBalance; - obj.balance = message.balance === '' ? undefined : message.balance; - return obj; - }, - fromAminoMsg( - object: UnbondingDelegationEntryAminoMsg, - ): UnbondingDelegationEntry { - return UnbondingDelegationEntry.fromAmino(object.value); - }, - toAminoMsg( - message: UnbondingDelegationEntry, - ): UnbondingDelegationEntryAminoMsg { - return { - type: 'cosmos-sdk/UnbondingDelegationEntry', - value: UnbondingDelegationEntry.toAmino(message), - }; - }, fromProtoMsg( message: UnbondingDelegationEntryProtoMsg, ): UnbondingDelegationEntry { @@ -2748,56 +1919,6 @@ export const RedelegationEntry = { message.sharesDst = object.sharesDst ?? ''; return message; }, - fromAmino(object: RedelegationEntryAmino): RedelegationEntry { - const message = createBaseRedelegationEntry(); - if ( - object.creation_height !== undefined && - object.creation_height !== null - ) { - message.creationHeight = BigInt(object.creation_height); - } - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completionTime = fromTimestamp( - Timestamp.fromAmino(object.completion_time), - ); - } - if ( - object.initial_balance !== undefined && - object.initial_balance !== null - ) { - message.initialBalance = object.initial_balance; - } - if (object.shares_dst !== undefined && object.shares_dst !== null) { - message.sharesDst = object.shares_dst; - } - return message; - }, - toAmino(message: RedelegationEntry): RedelegationEntryAmino { - const obj: any = {}; - obj.creation_height = - message.creationHeight !== BigInt(0) - ? message.creationHeight.toString() - : undefined; - obj.completion_time = message.completionTime - ? Timestamp.toAmino(toTimestamp(message.completionTime)) - : undefined; - obj.initial_balance = - message.initialBalance === '' ? undefined : message.initialBalance; - obj.shares_dst = message.sharesDst === '' ? undefined : message.sharesDst; - return obj; - }, - fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { - return RedelegationEntry.fromAmino(object.value); - }, - toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg { - return { - type: 'cosmos-sdk/RedelegationEntry', - value: RedelegationEntry.toAmino(message), - }; - }, fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry { return RedelegationEntry.decode(message.value); }, @@ -2910,60 +2031,6 @@ export const Redelegation = { object.entries?.map(e => RedelegationEntry.fromPartial(e)) || []; return message; }, - fromAmino(object: RedelegationAmino): Redelegation { - const message = createBaseRedelegation(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validatorSrcAddress = object.validator_src_address; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validatorDstAddress = object.validator_dst_address; - } - message.entries = - object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; - return message; - }, - toAmino(message: Redelegation): RedelegationAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_src_address = - message.validatorSrcAddress === '' - ? undefined - : message.validatorSrcAddress; - obj.validator_dst_address = - message.validatorDstAddress === '' - ? undefined - : message.validatorDstAddress; - if (message.entries) { - obj.entries = message.entries.map(e => - e ? RedelegationEntry.toAmino(e) : undefined, - ); - } else { - obj.entries = message.entries; - } - return obj; - }, - fromAminoMsg(object: RedelegationAminoMsg): Redelegation { - return Redelegation.fromAmino(object.value); - }, - toAminoMsg(message: Redelegation): RedelegationAminoMsg { - return { - type: 'cosmos-sdk/Redelegation', - value: Redelegation.toAmino(message), - }; - }, fromProtoMsg(message: RedelegationProtoMsg): Redelegation { return Redelegation.decode(message.value); }, @@ -3099,58 +2166,6 @@ export const Params = { message.minCommissionRate = object.minCommissionRate ?? ''; return message; }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - if (object.unbonding_time !== undefined && object.unbonding_time !== null) { - message.unbondingTime = Duration.fromAmino(object.unbonding_time); - } - if (object.max_validators !== undefined && object.max_validators !== null) { - message.maxValidators = object.max_validators; - } - if (object.max_entries !== undefined && object.max_entries !== null) { - message.maxEntries = object.max_entries; - } - if ( - object.historical_entries !== undefined && - object.historical_entries !== null - ) { - message.historicalEntries = object.historical_entries; - } - if (object.bond_denom !== undefined && object.bond_denom !== null) { - message.bondDenom = object.bond_denom; - } - if ( - object.min_commission_rate !== undefined && - object.min_commission_rate !== null - ) { - message.minCommissionRate = object.min_commission_rate; - } - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.unbonding_time = message.unbondingTime - ? Duration.toAmino(message.unbondingTime) - : undefined; - obj.max_validators = - message.maxValidators === 0 ? undefined : message.maxValidators; - obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries; - obj.historical_entries = - message.historicalEntries === 0 ? undefined : message.historicalEntries; - obj.bond_denom = message.bondDenom === '' ? undefined : message.bondDenom; - obj.min_commission_rate = - message.minCommissionRate === '' ? undefined : message.minCommissionRate; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: 'cosmos-sdk/Params', - value: Params.toAmino(message), - }; - }, fromProtoMsg(message: ParamsProtoMsg): Params { return Params.decode(message.value); }, @@ -3242,33 +2257,6 @@ export const DelegationResponse = { : undefined; return message; }, - fromAmino(object: DelegationResponseAmino): DelegationResponse { - const message = createBaseDelegationResponse(); - if (object.delegation !== undefined && object.delegation !== null) { - message.delegation = Delegation.fromAmino(object.delegation); - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = Coin.fromAmino(object.balance); - } - return message; - }, - toAmino(message: DelegationResponse): DelegationResponseAmino { - const obj: any = {}; - obj.delegation = message.delegation - ? Delegation.toAmino(message.delegation) - : undefined; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; - return obj; - }, - fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { - return DelegationResponse.fromAmino(object.value); - }, - toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg { - return { - type: 'cosmos-sdk/DelegationResponse', - value: DelegationResponse.toAmino(message), - }; - }, fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse { return DelegationResponse.decode(message.value); }, @@ -3361,42 +2349,6 @@ export const RedelegationEntryResponse = { message.balance = object.balance ?? ''; return message; }, - fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { - const message = createBaseRedelegationEntryResponse(); - if ( - object.redelegation_entry !== undefined && - object.redelegation_entry !== null - ) { - message.redelegationEntry = RedelegationEntry.fromAmino( - object.redelegation_entry, - ); - } - if (object.balance !== undefined && object.balance !== null) { - message.balance = object.balance; - } - return message; - }, - toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { - const obj: any = {}; - obj.redelegation_entry = message.redelegationEntry - ? RedelegationEntry.toAmino(message.redelegationEntry) - : undefined; - obj.balance = message.balance === '' ? undefined : message.balance; - return obj; - }, - fromAminoMsg( - object: RedelegationEntryResponseAminoMsg, - ): RedelegationEntryResponse { - return RedelegationEntryResponse.fromAmino(object.value); - }, - toAminoMsg( - message: RedelegationEntryResponse, - ): RedelegationEntryResponseAminoMsg { - return { - type: 'cosmos-sdk/RedelegationEntryResponse', - value: RedelegationEntryResponse.toAmino(message), - }; - }, fromProtoMsg( message: RedelegationEntryResponseProtoMsg, ): RedelegationEntryResponse { @@ -3498,38 +2450,6 @@ export const RedelegationResponse = { object.entries?.map(e => RedelegationEntryResponse.fromPartial(e)) || []; return message; }, - fromAmino(object: RedelegationResponseAmino): RedelegationResponse { - const message = createBaseRedelegationResponse(); - if (object.redelegation !== undefined && object.redelegation !== null) { - message.redelegation = Redelegation.fromAmino(object.redelegation); - } - message.entries = - object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; - return message; - }, - toAmino(message: RedelegationResponse): RedelegationResponseAmino { - const obj: any = {}; - obj.redelegation = message.redelegation - ? Redelegation.toAmino(message.redelegation) - : undefined; - if (message.entries) { - obj.entries = message.entries.map(e => - e ? RedelegationEntryResponse.toAmino(e) : undefined, - ); - } else { - obj.entries = message.entries; - } - return obj; - }, - fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse { - return RedelegationResponse.fromAmino(object.value); - }, - toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg { - return { - type: 'cosmos-sdk/RedelegationResponse', - value: RedelegationResponse.toAmino(message), - }; - }, fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse { return RedelegationResponse.decode(message.value); }, @@ -3608,34 +2528,6 @@ export const Pool = { message.bondedTokens = object.bondedTokens ?? ''; return message; }, - fromAmino(object: PoolAmino): Pool { - const message = createBasePool(); - if ( - object.not_bonded_tokens !== undefined && - object.not_bonded_tokens !== null - ) { - message.notBondedTokens = object.not_bonded_tokens; - } - if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { - message.bondedTokens = object.bonded_tokens; - } - return message; - }, - toAmino(message: Pool): PoolAmino { - const obj: any = {}; - obj.not_bonded_tokens = message.notBondedTokens ?? ''; - obj.bonded_tokens = message.bondedTokens ?? ''; - return obj; - }, - fromAminoMsg(object: PoolAminoMsg): Pool { - return Pool.fromAmino(object.value); - }, - toAminoMsg(message: Pool): PoolAminoMsg { - return { - type: 'cosmos-sdk/Pool', - value: Pool.toAmino(message), - }; - }, fromProtoMsg(message: PoolProtoMsg): Pool { return Pool.decode(message.value); }, @@ -3660,9 +2552,3 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = ( return data; } }; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { - return encodePubkey(content); -}; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { - return decodePubkey(content); -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.amino.ts deleted file mode 100644 index b1357f5de74..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.amino.ts +++ /dev/null @@ -1,35 +0,0 @@ -//@ts-nocheck -import { - MsgCreateValidator, - MsgEditValidator, - MsgDelegate, - MsgBeginRedelegate, - MsgUndelegate, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.staking.v1beta1.MsgCreateValidator': { - aminoType: 'cosmos-sdk/MsgCreateValidator', - toAmino: MsgCreateValidator.toAmino, - fromAmino: MsgCreateValidator.fromAmino, - }, - '/cosmos.staking.v1beta1.MsgEditValidator': { - aminoType: 'cosmos-sdk/MsgEditValidator', - toAmino: MsgEditValidator.toAmino, - fromAmino: MsgEditValidator.fromAmino, - }, - '/cosmos.staking.v1beta1.MsgDelegate': { - aminoType: 'cosmos-sdk/MsgDelegate', - toAmino: MsgDelegate.toAmino, - fromAmino: MsgDelegate.fromAmino, - }, - '/cosmos.staking.v1beta1.MsgBeginRedelegate': { - aminoType: 'cosmos-sdk/MsgBeginRedelegate', - toAmino: MsgBeginRedelegate.toAmino, - fromAmino: MsgBeginRedelegate.fromAmino, - }, - '/cosmos.staking.v1beta1.MsgUndelegate': { - aminoType: 'cosmos-sdk/MsgUndelegate', - toAmino: MsgUndelegate.toAmino, - fromAmino: MsgUndelegate.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.registry.ts deleted file mode 100644 index f9ffc980273..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.registry.ts +++ /dev/null @@ -1,183 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgCreateValidator, - MsgEditValidator, - MsgDelegate, - MsgBeginRedelegate, - MsgUndelegate, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.staking.v1beta1.MsgCreateValidator', MsgCreateValidator], - ['/cosmos.staking.v1beta1.MsgEditValidator', MsgEditValidator], - ['/cosmos.staking.v1beta1.MsgDelegate', MsgDelegate], - ['/cosmos.staking.v1beta1.MsgBeginRedelegate', MsgBeginRedelegate], - ['/cosmos.staking.v1beta1.MsgUndelegate', MsgUndelegate], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - createValidator(value: MsgCreateValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', - value: MsgCreateValidator.encode(value).finish(), - }; - }, - editValidator(value: MsgEditValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', - value: MsgEditValidator.encode(value).finish(), - }; - }, - delegate(value: MsgDelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', - value: MsgDelegate.encode(value).finish(), - }; - }, - beginRedelegate(value: MsgBeginRedelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', - value: MsgBeginRedelegate.encode(value).finish(), - }; - }, - undelegate(value: MsgUndelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', - value: MsgUndelegate.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - createValidator(value: MsgCreateValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', - value, - }; - }, - editValidator(value: MsgEditValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', - value, - }; - }, - delegate(value: MsgDelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', - value, - }; - }, - beginRedelegate(value: MsgBeginRedelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', - value, - }; - }, - undelegate(value: MsgUndelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', - value, - }; - }, - }, - toJSON: { - createValidator(value: MsgCreateValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', - value: MsgCreateValidator.toJSON(value), - }; - }, - editValidator(value: MsgEditValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', - value: MsgEditValidator.toJSON(value), - }; - }, - delegate(value: MsgDelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', - value: MsgDelegate.toJSON(value), - }; - }, - beginRedelegate(value: MsgBeginRedelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', - value: MsgBeginRedelegate.toJSON(value), - }; - }, - undelegate(value: MsgUndelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', - value: MsgUndelegate.toJSON(value), - }; - }, - }, - fromJSON: { - createValidator(value: any) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', - value: MsgCreateValidator.fromJSON(value), - }; - }, - editValidator(value: any) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', - value: MsgEditValidator.fromJSON(value), - }; - }, - delegate(value: any) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', - value: MsgDelegate.fromJSON(value), - }; - }, - beginRedelegate(value: any) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', - value: MsgBeginRedelegate.fromJSON(value), - }; - }, - undelegate(value: any) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', - value: MsgUndelegate.fromJSON(value), - }; - }, - }, - fromPartial: { - createValidator(value: MsgCreateValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator', - value: MsgCreateValidator.fromPartial(value), - }; - }, - editValidator(value: MsgEditValidator) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgEditValidator', - value: MsgEditValidator.fromPartial(value), - }; - }, - delegate(value: MsgDelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', - value: MsgDelegate.fromPartial(value), - }; - }, - beginRedelegate(value: MsgBeginRedelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate', - value: MsgBeginRedelegate.fromPartial(value), - }; - }, - undelegate(value: MsgUndelegate) { - return { - typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate', - value: MsgUndelegate.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index ccd25f8513d..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,111 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgCreateValidator, - MsgCreateValidatorResponse, - MsgEditValidator, - MsgEditValidatorResponse, - MsgDelegate, - MsgDelegateResponse, - MsgBeginRedelegate, - MsgBeginRedelegateResponse, - MsgUndelegate, - MsgUndelegateResponse, -} from './tx.js'; -/** Msg defines the staking Msg service. */ -export interface Msg { - /** CreateValidator defines a method for creating a new validator. */ - createValidator( - request: MsgCreateValidator, - ): Promise; - /** EditValidator defines a method for editing an existing validator. */ - editValidator(request: MsgEditValidator): Promise; - /** - * Delegate defines a method for performing a delegation of coins - * from a delegator to a validator. - */ - delegate(request: MsgDelegate): Promise; - /** - * BeginRedelegate defines a method for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ - beginRedelegate( - request: MsgBeginRedelegate, - ): Promise; - /** - * Undelegate defines a method for performing an undelegation from a - * delegate and a validator. - */ - undelegate(request: MsgUndelegate): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createValidator = this.createValidator.bind(this); - this.editValidator = this.editValidator.bind(this); - this.delegate = this.delegate.bind(this); - this.beginRedelegate = this.beginRedelegate.bind(this); - this.undelegate = this.undelegate.bind(this); - } - createValidator( - request: MsgCreateValidator, - ): Promise { - const data = MsgCreateValidator.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Msg', - 'CreateValidator', - data, - ); - return promise.then(data => - MsgCreateValidatorResponse.decode(new BinaryReader(data)), - ); - } - editValidator(request: MsgEditValidator): Promise { - const data = MsgEditValidator.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Msg', - 'EditValidator', - data, - ); - return promise.then(data => - MsgEditValidatorResponse.decode(new BinaryReader(data)), - ); - } - delegate(request: MsgDelegate): Promise { - const data = MsgDelegate.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Msg', - 'Delegate', - data, - ); - return promise.then(data => - MsgDelegateResponse.decode(new BinaryReader(data)), - ); - } - beginRedelegate( - request: MsgBeginRedelegate, - ): Promise { - const data = MsgBeginRedelegate.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Msg', - 'BeginRedelegate', - data, - ); - return promise.then(data => - MsgBeginRedelegateResponse.decode(new BinaryReader(data)), - ); - } - undelegate(request: MsgUndelegate): Promise { - const data = MsgUndelegate.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.staking.v1beta1.Msg', - 'Undelegate', - data, - ); - return promise.then(data => - MsgUndelegateResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts index e24860efac8..0834df3ff60 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -1,19 +1,12 @@ //@ts-nocheck import { Description, - DescriptionAmino, DescriptionSDKType, CommissionRates, - CommissionRatesAmino, CommissionRatesSDKType, } from './staking.js'; -import { - Any, - AnyProtoMsg, - AnyAmino, - AnySDKType, -} from '../../../google/protobuf/any.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { Timestamp } from '../../../google/protobuf/timestamp.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { @@ -22,9 +15,7 @@ import { fromTimestamp, fromJsonTimestamp, } from '../../../helpers.js'; -import { encodePubkey, decodePubkey } from '@cosmjs/proto-signing'; import { Decimal } from '@cosmjs/math'; -import { Pubkey } from '@cosmjs/amino'; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -39,23 +30,6 @@ export interface MsgCreateValidatorProtoMsg { typeUrl: '/cosmos.staking.v1beta1.MsgCreateValidator'; value: Uint8Array; } -export type MsgCreateValidatorEncoded = Omit & { - pubkey?: AnyProtoMsg | undefined; -}; -/** MsgCreateValidator defines a SDK message for creating a new validator. */ -export interface MsgCreateValidatorAmino { - description?: DescriptionAmino; - commission?: CommissionRatesAmino; - min_self_delegation?: string; - delegator_address?: string; - validator_address?: string; - pubkey?: AnyAmino; - value?: CoinAmino; -} -export interface MsgCreateValidatorAminoMsg { - type: 'cosmos-sdk/MsgCreateValidator'; - value: MsgCreateValidatorAmino; -} /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidatorSDKType { description: DescriptionSDKType; @@ -73,12 +47,6 @@ export interface MsgCreateValidatorResponseProtoMsg { value: Uint8Array; } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ -export interface MsgCreateValidatorResponseAmino {} -export interface MsgCreateValidatorResponseAminoMsg { - type: 'cosmos-sdk/MsgCreateValidatorResponse'; - value: MsgCreateValidatorResponseAmino; -} -/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ export interface MsgCreateValidatorResponseSDKType {} /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidator { @@ -98,23 +66,6 @@ export interface MsgEditValidatorProtoMsg { value: Uint8Array; } /** MsgEditValidator defines a SDK message for editing an existing validator. */ -export interface MsgEditValidatorAmino { - description?: DescriptionAmino; - validator_address?: string; - /** - * We pass a reference to the new commission rate and min self delegation as - * it's not mandatory to update. If not updated, the deserialized rate will be - * zero with no way to distinguish if an update was intended. - * REF: #2373 - */ - commission_rate?: string; - min_self_delegation?: string; -} -export interface MsgEditValidatorAminoMsg { - type: 'cosmos-sdk/MsgEditValidator'; - value: MsgEditValidatorAmino; -} -/** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidatorSDKType { description: DescriptionSDKType; validator_address: string; @@ -128,12 +79,6 @@ export interface MsgEditValidatorResponseProtoMsg { value: Uint8Array; } /** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ -export interface MsgEditValidatorResponseAmino {} -export interface MsgEditValidatorResponseAminoMsg { - type: 'cosmos-sdk/MsgEditValidatorResponse'; - value: MsgEditValidatorResponseAmino; -} -/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ export interface MsgEditValidatorResponseSDKType {} /** * MsgDelegate defines a SDK message for performing a delegation of coins @@ -148,19 +93,6 @@ export interface MsgDelegateProtoMsg { typeUrl: '/cosmos.staking.v1beta1.MsgDelegate'; value: Uint8Array; } -/** - * MsgDelegate defines a SDK message for performing a delegation of coins - * from a delegator to a validator. - */ -export interface MsgDelegateAmino { - delegator_address?: string; - validator_address?: string; - amount?: CoinAmino; -} -export interface MsgDelegateAminoMsg { - type: 'cosmos-sdk/MsgDelegate'; - value: MsgDelegateAmino; -} /** * MsgDelegate defines a SDK message for performing a delegation of coins * from a delegator to a validator. @@ -177,12 +109,6 @@ export interface MsgDelegateResponseProtoMsg { value: Uint8Array; } /** MsgDelegateResponse defines the Msg/Delegate response type. */ -export interface MsgDelegateResponseAmino {} -export interface MsgDelegateResponseAminoMsg { - type: 'cosmos-sdk/MsgDelegateResponse'; - value: MsgDelegateResponseAmino; -} -/** MsgDelegateResponse defines the Msg/Delegate response type. */ export interface MsgDelegateResponseSDKType {} /** * MsgBeginRedelegate defines a SDK message for performing a redelegation @@ -198,20 +124,6 @@ export interface MsgBeginRedelegateProtoMsg { typeUrl: '/cosmos.staking.v1beta1.MsgBeginRedelegate'; value: Uint8Array; } -/** - * MsgBeginRedelegate defines a SDK message for performing a redelegation - * of coins from a delegator and source validator to a destination validator. - */ -export interface MsgBeginRedelegateAmino { - delegator_address?: string; - validator_src_address?: string; - validator_dst_address?: string; - amount?: CoinAmino; -} -export interface MsgBeginRedelegateAminoMsg { - type: 'cosmos-sdk/MsgBeginRedelegate'; - value: MsgBeginRedelegateAmino; -} /** * MsgBeginRedelegate defines a SDK message for performing a redelegation * of coins from a delegator and source validator to a destination validator. @@ -231,14 +143,6 @@ export interface MsgBeginRedelegateResponseProtoMsg { value: Uint8Array; } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ -export interface MsgBeginRedelegateResponseAmino { - completion_time?: string; -} -export interface MsgBeginRedelegateResponseAminoMsg { - type: 'cosmos-sdk/MsgBeginRedelegateResponse'; - value: MsgBeginRedelegateResponseAmino; -} -/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseSDKType { completion_time: Date; } @@ -255,19 +159,6 @@ export interface MsgUndelegateProtoMsg { typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate'; value: Uint8Array; } -/** - * MsgUndelegate defines a SDK message for performing an undelegation from a - * delegate and a validator. - */ -export interface MsgUndelegateAmino { - delegator_address?: string; - validator_address?: string; - amount?: CoinAmino; -} -export interface MsgUndelegateAminoMsg { - type: 'cosmos-sdk/MsgUndelegate'; - value: MsgUndelegateAmino; -} /** * MsgUndelegate defines a SDK message for performing an undelegation from a * delegate and a validator. @@ -286,14 +177,6 @@ export interface MsgUndelegateResponseProtoMsg { value: Uint8Array; } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ -export interface MsgUndelegateResponseAmino { - completion_time?: string; -} -export interface MsgUndelegateResponseAminoMsg { - type: 'cosmos-sdk/MsgUndelegateResponse'; - value: MsgUndelegateResponseAmino; -} -/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseSDKType { completion_time: Date; } @@ -448,67 +331,6 @@ export const MsgCreateValidator = { : undefined; return message; }, - fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { - const message = createBaseMsgCreateValidator(); - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromAmino(object.description); - } - if (object.commission !== undefined && object.commission !== null) { - message.commission = CommissionRates.fromAmino(object.commission); - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.minSelfDelegation = object.min_self_delegation; - } - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.pubkey !== undefined && object.pubkey !== null) { - message.pubkey = encodePubkey(object.pubkey); - } - if (object.value !== undefined && object.value !== null) { - message.value = Coin.fromAmino(object.value); - } - return message; - }, - toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { - const obj: any = {}; - obj.description = message.description - ? Description.toAmino(message.description) - : undefined; - obj.commission = message.commission - ? CommissionRates.toAmino(message.commission) - : undefined; - obj.min_self_delegation = - message.minSelfDelegation === '' ? undefined : message.minSelfDelegation; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; - obj.value = message.value ? Coin.toAmino(message.value) : undefined; - return obj; - }, - fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { - return MsgCreateValidator.fromAmino(object.value); - }, - toAminoMsg(message: MsgCreateValidator): MsgCreateValidatorAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateValidator', - value: MsgCreateValidator.toAmino(message), - }; - }, fromProtoMsg(message: MsgCreateValidatorProtoMsg): MsgCreateValidator { return MsgCreateValidator.decode(message.value); }, @@ -564,27 +386,6 @@ export const MsgCreateValidatorResponse = { const message = createBaseMsgCreateValidatorResponse(); return message; }, - fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { - const message = createBaseMsgCreateValidatorResponse(); - return message; - }, - toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgCreateValidatorResponseAminoMsg, - ): MsgCreateValidatorResponse { - return MsgCreateValidatorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateValidatorResponse, - ): MsgCreateValidatorResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateValidatorResponse', - value: MsgCreateValidatorResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateValidatorResponseProtoMsg, ): MsgCreateValidatorResponse { @@ -706,53 +507,6 @@ export const MsgEditValidator = { message.minSelfDelegation = object.minSelfDelegation ?? ''; return message; }, - fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { - const message = createBaseMsgEditValidator(); - if (object.description !== undefined && object.description !== null) { - message.description = Description.fromAmino(object.description); - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if ( - object.commission_rate !== undefined && - object.commission_rate !== null - ) { - message.commissionRate = object.commission_rate; - } - if ( - object.min_self_delegation !== undefined && - object.min_self_delegation !== null - ) { - message.minSelfDelegation = object.min_self_delegation; - } - return message; - }, - toAmino(message: MsgEditValidator): MsgEditValidatorAmino { - const obj: any = {}; - obj.description = message.description - ? Description.toAmino(message.description) - : undefined; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.commission_rate = - message.commissionRate === '' ? undefined : message.commissionRate; - obj.min_self_delegation = - message.minSelfDelegation === '' ? undefined : message.minSelfDelegation; - return obj; - }, - fromAminoMsg(object: MsgEditValidatorAminoMsg): MsgEditValidator { - return MsgEditValidator.fromAmino(object.value); - }, - toAminoMsg(message: MsgEditValidator): MsgEditValidatorAminoMsg { - return { - type: 'cosmos-sdk/MsgEditValidator', - value: MsgEditValidator.toAmino(message), - }; - }, fromProtoMsg(message: MsgEditValidatorProtoMsg): MsgEditValidator { return MsgEditValidator.decode(message.value); }, @@ -806,27 +560,6 @@ export const MsgEditValidatorResponse = { const message = createBaseMsgEditValidatorResponse(); return message; }, - fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { - const message = createBaseMsgEditValidatorResponse(); - return message; - }, - toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgEditValidatorResponseAminoMsg, - ): MsgEditValidatorResponse { - return MsgEditValidatorResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgEditValidatorResponse, - ): MsgEditValidatorResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgEditValidatorResponse', - value: MsgEditValidatorResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgEditValidatorResponseProtoMsg, ): MsgEditValidatorResponse { @@ -923,43 +656,6 @@ export const MsgDelegate = { : undefined; return message; }, - fromAmino(object: MsgDelegateAmino): MsgDelegate { - const message = createBaseMsgDelegate(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromAmino(object.amount); - } - return message; - }, - toAmino(message: MsgDelegate): MsgDelegateAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - return obj; - }, - fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { - return MsgDelegate.fromAmino(object.value); - }, - toAminoMsg(message: MsgDelegate): MsgDelegateAminoMsg { - return { - type: 'cosmos-sdk/MsgDelegate', - value: MsgDelegate.toAmino(message), - }; - }, fromProtoMsg(message: MsgDelegateProtoMsg): MsgDelegate { return MsgDelegate.decode(message.value); }, @@ -1013,23 +709,6 @@ export const MsgDelegateResponse = { const message = createBaseMsgDelegateResponse(); return message; }, - fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { - const message = createBaseMsgDelegateResponse(); - return message; - }, - toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgDelegateResponseAminoMsg): MsgDelegateResponse { - return MsgDelegateResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgDelegateResponse): MsgDelegateResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgDelegateResponse', - value: MsgDelegateResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgDelegateResponseProtoMsg): MsgDelegateResponse { return MsgDelegateResponse.decode(message.value); }, @@ -1138,55 +817,6 @@ export const MsgBeginRedelegate = { : undefined; return message; }, - fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { - const message = createBaseMsgBeginRedelegate(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_src_address !== undefined && - object.validator_src_address !== null - ) { - message.validatorSrcAddress = object.validator_src_address; - } - if ( - object.validator_dst_address !== undefined && - object.validator_dst_address !== null - ) { - message.validatorDstAddress = object.validator_dst_address; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromAmino(object.amount); - } - return message; - }, - toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_src_address = - message.validatorSrcAddress === '' - ? undefined - : message.validatorSrcAddress; - obj.validator_dst_address = - message.validatorDstAddress === '' - ? undefined - : message.validatorDstAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - return obj; - }, - fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { - return MsgBeginRedelegate.fromAmino(object.value); - }, - toAminoMsg(message: MsgBeginRedelegate): MsgBeginRedelegateAminoMsg { - return { - type: 'cosmos-sdk/MsgBeginRedelegate', - value: MsgBeginRedelegate.toAmino(message), - }; - }, fromProtoMsg(message: MsgBeginRedelegateProtoMsg): MsgBeginRedelegate { return MsgBeginRedelegate.decode(message.value); }, @@ -1262,42 +892,6 @@ export const MsgBeginRedelegateResponse = { message.completionTime = object.completionTime ?? undefined; return message; }, - fromAmino( - object: MsgBeginRedelegateResponseAmino, - ): MsgBeginRedelegateResponse { - const message = createBaseMsgBeginRedelegateResponse(); - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completionTime = fromTimestamp( - Timestamp.fromAmino(object.completion_time), - ); - } - return message; - }, - toAmino( - message: MsgBeginRedelegateResponse, - ): MsgBeginRedelegateResponseAmino { - const obj: any = {}; - obj.completion_time = message.completionTime - ? Timestamp.toAmino(toTimestamp(message.completionTime)) - : undefined; - return obj; - }, - fromAminoMsg( - object: MsgBeginRedelegateResponseAminoMsg, - ): MsgBeginRedelegateResponse { - return MsgBeginRedelegateResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgBeginRedelegateResponse, - ): MsgBeginRedelegateResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgBeginRedelegateResponse', - value: MsgBeginRedelegateResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgBeginRedelegateResponseProtoMsg, ): MsgBeginRedelegateResponse { @@ -1394,43 +988,6 @@ export const MsgUndelegate = { : undefined; return message; }, - fromAmino(object: MsgUndelegateAmino): MsgUndelegate { - const message = createBaseMsgUndelegate(); - if ( - object.delegator_address !== undefined && - object.delegator_address !== null - ) { - message.delegatorAddress = object.delegator_address; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = object.validator_address; - } - if (object.amount !== undefined && object.amount !== null) { - message.amount = Coin.fromAmino(object.amount); - } - return message; - }, - toAmino(message: MsgUndelegate): MsgUndelegateAmino { - const obj: any = {}; - obj.delegator_address = - message.delegatorAddress === '' ? undefined : message.delegatorAddress; - obj.validator_address = - message.validatorAddress === '' ? undefined : message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - return obj; - }, - fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { - return MsgUndelegate.fromAmino(object.value); - }, - toAminoMsg(message: MsgUndelegate): MsgUndelegateAminoMsg { - return { - type: 'cosmos-sdk/MsgUndelegate', - value: MsgUndelegate.toAmino(message), - }; - }, fromProtoMsg(message: MsgUndelegateProtoMsg): MsgUndelegate { return MsgUndelegate.decode(message.value); }, @@ -1504,34 +1061,6 @@ export const MsgUndelegateResponse = { message.completionTime = object.completionTime ?? undefined; return message; }, - fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { - const message = createBaseMsgUndelegateResponse(); - if ( - object.completion_time !== undefined && - object.completion_time !== null - ) { - message.completionTime = fromTimestamp( - Timestamp.fromAmino(object.completion_time), - ); - } - return message; - }, - toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { - const obj: any = {}; - obj.completion_time = message.completionTime - ? Timestamp.toAmino(toTimestamp(message.completionTime)) - : undefined; - return obj; - }, - fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { - return MsgUndelegateResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgUndelegateResponse): MsgUndelegateResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgUndelegateResponse', - value: MsgUndelegateResponse.toAmino(message), - }; - }, fromProtoMsg(message: MsgUndelegateResponseProtoMsg): MsgUndelegateResponse { return MsgUndelegateResponse.decode(message.value); }, @@ -1556,9 +1085,3 @@ export const Cosmos_cryptoPubKey_InterfaceDecoder = ( return data; } }; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino): Any => { - return encodePubkey(content); -}; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { - return decodePubkey(content); -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 4ee22068acf..0ed1c5ed7bf 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -1,10 +1,9 @@ //@ts-nocheck import { CompactBitArray, - CompactBitArrayAmino, CompactBitArraySDKType, } from '../../../crypto/multisig/v1beta1/multisig.js'; -import { Any, AnyAmino, AnySDKType } from '../../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../../binary.js'; import { isSet, @@ -55,7 +54,6 @@ export enum SignMode { UNRECOGNIZED = -1, } export const SignModeSDKType = SignMode; -export const SignModeAmino = SignMode; export function signModeFromJSON(object: any): SignMode { switch (object) { case 0: @@ -106,15 +104,6 @@ export interface SignatureDescriptorsProtoMsg { value: Uint8Array; } /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ -export interface SignatureDescriptorsAmino { - /** signatures are the signature descriptors */ - signatures?: SignatureDescriptorAmino[]; -} -export interface SignatureDescriptorsAminoMsg { - type: 'cosmos-sdk/SignatureDescriptors'; - value: SignatureDescriptorsAmino; -} -/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptorsSDKType { signatures: SignatureDescriptorSDKType[]; } @@ -139,27 +128,6 @@ export interface SignatureDescriptorProtoMsg { typeUrl: '/cosmos.tx.signing.v1beta1.SignatureDescriptor'; value: Uint8Array; } -/** - * SignatureDescriptor is a convenience type which represents the full data for - * a signature including the public key of the signer, signing modes and the - * signature itself. It is primarily used for coordinating signatures between - * clients. - */ -export interface SignatureDescriptorAmino { - /** public_key is the public key of the signer */ - public_key?: AnyAmino; - data?: SignatureDescriptor_DataAmino; - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to prevent - * replay attacks. - */ - sequence?: string; -} -export interface SignatureDescriptorAminoMsg { - type: 'cosmos-sdk/SignatureDescriptor'; - value: SignatureDescriptorAmino; -} /** * SignatureDescriptor is a convenience type which represents the full data for * a signature including the public key of the signer, signing modes and the @@ -183,17 +151,6 @@ export interface SignatureDescriptor_DataProtoMsg { value: Uint8Array; } /** Data represents signature data */ -export interface SignatureDescriptor_DataAmino { - /** single represents a single signer */ - single?: SignatureDescriptor_Data_SingleAmino; - /** multi represents a multisig signer */ - multi?: SignatureDescriptor_Data_MultiAmino; -} -export interface SignatureDescriptor_DataAminoMsg { - type: 'cosmos-sdk/Data'; - value: SignatureDescriptor_DataAmino; -} -/** Data represents signature data */ export interface SignatureDescriptor_DataSDKType { single?: SignatureDescriptor_Data_SingleSDKType; multi?: SignatureDescriptor_Data_MultiSDKType; @@ -210,17 +167,6 @@ export interface SignatureDescriptor_Data_SingleProtoMsg { value: Uint8Array; } /** Single is the signature data for a single signer */ -export interface SignatureDescriptor_Data_SingleAmino { - /** mode is the signing mode of the single signer */ - mode?: SignMode; - /** signature is the raw signature bytes */ - signature?: string; -} -export interface SignatureDescriptor_Data_SingleAminoMsg { - type: 'cosmos-sdk/Single'; - value: SignatureDescriptor_Data_SingleAmino; -} -/** Single is the signature data for a single signer */ export interface SignatureDescriptor_Data_SingleSDKType { mode: SignMode; signature: Uint8Array; @@ -237,17 +183,6 @@ export interface SignatureDescriptor_Data_MultiProtoMsg { value: Uint8Array; } /** Multi is the signature data for a multisig public key */ -export interface SignatureDescriptor_Data_MultiAmino { - /** bitarray specifies which keys within the multisig are signing */ - bitarray?: CompactBitArrayAmino; - /** signatures is the signatures of the multi-signature */ - signatures?: SignatureDescriptor_DataAmino[]; -} -export interface SignatureDescriptor_Data_MultiAminoMsg { - type: 'cosmos-sdk/Multi'; - value: SignatureDescriptor_Data_MultiAmino; -} -/** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_MultiSDKType { bitarray?: CompactBitArraySDKType; signatures: SignatureDescriptor_DataSDKType[]; @@ -315,32 +250,6 @@ export const SignatureDescriptors = { object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || []; return message; }, - fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { - const message = createBaseSignatureDescriptors(); - message.signatures = - object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; - return message; - }, - toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { - const obj: any = {}; - if (message.signatures) { - obj.signatures = message.signatures.map(e => - e ? SignatureDescriptor.toAmino(e) : undefined, - ); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg(object: SignatureDescriptorsAminoMsg): SignatureDescriptors { - return SignatureDescriptors.fromAmino(object.value); - }, - toAminoMsg(message: SignatureDescriptors): SignatureDescriptorsAminoMsg { - return { - type: 'cosmos-sdk/SignatureDescriptors', - value: SignatureDescriptors.toAmino(message), - }; - }, fromProtoMsg(message: SignatureDescriptorsProtoMsg): SignatureDescriptors { return SignatureDescriptors.decode(message.value); }, @@ -454,40 +363,6 @@ export const SignatureDescriptor = { : BigInt(0); return message; }, - fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { - const message = createBaseSignatureDescriptor(); - if (object.public_key !== undefined && object.public_key !== null) { - message.publicKey = Any.fromAmino(object.public_key); - } - if (object.data !== undefined && object.data !== null) { - message.data = SignatureDescriptor_Data.fromAmino(object.data); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - return message; - }, - toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { - const obj: any = {}; - obj.public_key = message.publicKey - ? Any.toAmino(message.publicKey) - : undefined; - obj.data = message.data - ? SignatureDescriptor_Data.toAmino(message.data) - : undefined; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - return obj; - }, - fromAminoMsg(object: SignatureDescriptorAminoMsg): SignatureDescriptor { - return SignatureDescriptor.fromAmino(object.value); - }, - toAminoMsg(message: SignatureDescriptor): SignatureDescriptorAminoMsg { - return { - type: 'cosmos-sdk/SignatureDescriptor', - value: SignatureDescriptor.toAmino(message), - }; - }, fromProtoMsg(message: SignatureDescriptorProtoMsg): SignatureDescriptor { return SignatureDescriptor.decode(message.value); }, @@ -593,39 +468,6 @@ export const SignatureDescriptor_Data = { : undefined; return message; }, - fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { - const message = createBaseSignatureDescriptor_Data(); - if (object.single !== undefined && object.single !== null) { - message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); - } - return message; - }, - toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { - const obj: any = {}; - obj.single = message.single - ? SignatureDescriptor_Data_Single.toAmino(message.single) - : undefined; - obj.multi = message.multi - ? SignatureDescriptor_Data_Multi.toAmino(message.multi) - : undefined; - return obj; - }, - fromAminoMsg( - object: SignatureDescriptor_DataAminoMsg, - ): SignatureDescriptor_Data { - return SignatureDescriptor_Data.fromAmino(object.value); - }, - toAminoMsg( - message: SignatureDescriptor_Data, - ): SignatureDescriptor_DataAminoMsg { - return { - type: 'cosmos-sdk/Data', - value: SignatureDescriptor_Data.toAmino(message), - }; - }, fromProtoMsg( message: SignatureDescriptor_DataProtoMsg, ): SignatureDescriptor_Data { @@ -712,41 +554,6 @@ export const SignatureDescriptor_Data_Single = { message.signature = object.signature ?? new Uint8Array(); return message; }, - fromAmino( - object: SignatureDescriptor_Data_SingleAmino, - ): SignatureDescriptor_Data_Single { - const message = createBaseSignatureDescriptor_Data_Single(); - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - toAmino( - message: SignatureDescriptor_Data_Single, - ): SignatureDescriptor_Data_SingleAmino { - const obj: any = {}; - obj.mode = message.mode === 0 ? undefined : message.mode; - obj.signature = message.signature - ? base64FromBytes(message.signature) - : undefined; - return obj; - }, - fromAminoMsg( - object: SignatureDescriptor_Data_SingleAminoMsg, - ): SignatureDescriptor_Data_Single { - return SignatureDescriptor_Data_Single.fromAmino(object.value); - }, - toAminoMsg( - message: SignatureDescriptor_Data_Single, - ): SignatureDescriptor_Data_SingleAminoMsg { - return { - type: 'cosmos-sdk/Single', - value: SignatureDescriptor_Data_Single.toAmino(message), - }; - }, fromProtoMsg( message: SignatureDescriptor_Data_SingleProtoMsg, ): SignatureDescriptor_Data_Single { @@ -853,46 +660,6 @@ export const SignatureDescriptor_Data_Multi = { []; return message; }, - fromAmino( - object: SignatureDescriptor_Data_MultiAmino, - ): SignatureDescriptor_Data_Multi { - const message = createBaseSignatureDescriptor_Data_Multi(); - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromAmino(object.bitarray); - } - message.signatures = - object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; - return message; - }, - toAmino( - message: SignatureDescriptor_Data_Multi, - ): SignatureDescriptor_Data_MultiAmino { - const obj: any = {}; - obj.bitarray = message.bitarray - ? CompactBitArray.toAmino(message.bitarray) - : undefined; - if (message.signatures) { - obj.signatures = message.signatures.map(e => - e ? SignatureDescriptor_Data.toAmino(e) : undefined, - ); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg( - object: SignatureDescriptor_Data_MultiAminoMsg, - ): SignatureDescriptor_Data_Multi { - return SignatureDescriptor_Data_Multi.fromAmino(object.value); - }, - toAminoMsg( - message: SignatureDescriptor_Data_Multi, - ): SignatureDescriptor_Data_MultiAminoMsg { - return { - type: 'cosmos-sdk/Multi', - value: SignatureDescriptor_Data_Multi.toAmino(message), - }; - }, fromProtoMsg( message: SignatureDescriptor_Data_MultiProtoMsg, ): SignatureDescriptor_Data_Multi { diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts deleted file mode 100644 index b4fa269f0b1..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts +++ /dev/null @@ -1,124 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - SimulateRequest, - SimulateResponse, - GetTxRequest, - GetTxResponse, - BroadcastTxRequest, - BroadcastTxResponse, - GetTxsEventRequest, - GetTxsEventResponse, - GetBlockWithTxsRequest, - GetBlockWithTxsResponse, -} from './service.js'; -/** Service defines a gRPC service for interacting with transactions. */ -export interface Service { - /** Simulate simulates executing a transaction for estimating gas usage. */ - simulate(request: SimulateRequest): Promise; - /** GetTx fetches a tx by hash. */ - getTx(request: GetTxRequest): Promise; - /** BroadcastTx broadcast transaction. */ - broadcastTx(request: BroadcastTxRequest): Promise; - /** GetTxsEvent fetches txs by event. */ - getTxsEvent(request: GetTxsEventRequest): Promise; - /** - * GetBlockWithTxs fetches a block with decoded txs. - * - * Since: cosmos-sdk 0.45.2 - */ - getBlockWithTxs( - request: GetBlockWithTxsRequest, - ): Promise; -} -export class ServiceClientImpl implements Service { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.simulate = this.simulate.bind(this); - this.getTx = this.getTx.bind(this); - this.broadcastTx = this.broadcastTx.bind(this); - this.getTxsEvent = this.getTxsEvent.bind(this); - this.getBlockWithTxs = this.getBlockWithTxs.bind(this); - } - simulate(request: SimulateRequest): Promise { - const data = SimulateRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.tx.v1beta1.Service', - 'Simulate', - data, - ); - return promise.then(data => - SimulateResponse.decode(new BinaryReader(data)), - ); - } - getTx(request: GetTxRequest): Promise { - const data = GetTxRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.tx.v1beta1.Service', - 'GetTx', - data, - ); - return promise.then(data => GetTxResponse.decode(new BinaryReader(data))); - } - broadcastTx(request: BroadcastTxRequest): Promise { - const data = BroadcastTxRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.tx.v1beta1.Service', - 'BroadcastTx', - data, - ); - return promise.then(data => - BroadcastTxResponse.decode(new BinaryReader(data)), - ); - } - getTxsEvent(request: GetTxsEventRequest): Promise { - const data = GetTxsEventRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.tx.v1beta1.Service', - 'GetTxsEvent', - data, - ); - return promise.then(data => - GetTxsEventResponse.decode(new BinaryReader(data)), - ); - } - getBlockWithTxs( - request: GetBlockWithTxsRequest, - ): Promise { - const data = GetBlockWithTxsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.tx.v1beta1.Service', - 'GetBlockWithTxs', - data, - ); - return promise.then(data => - GetBlockWithTxsResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new ServiceClientImpl(rpc); - return { - simulate(request: SimulateRequest): Promise { - return queryService.simulate(request); - }, - getTx(request: GetTxRequest): Promise { - return queryService.getTx(request); - }, - broadcastTx(request: BroadcastTxRequest): Promise { - return queryService.broadcastTx(request); - }, - getTxsEvent(request: GetTxsEventRequest): Promise { - return queryService.getTxsEvent(request); - }, - getBlockWithTxs( - request: GetBlockWithTxsRequest, - ): Promise { - return queryService.getBlockWithTxs(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts index 16cc8b3abc3..412285699d6 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/service.ts @@ -1,34 +1,21 @@ //@ts-nocheck -import { Tx, TxAmino, TxSDKType } from './tx.js'; +import { Tx, TxSDKType } from './tx.js'; import { PageRequest, - PageRequestAmino, PageRequestSDKType, PageResponse, - PageResponseAmino, PageResponseSDKType, } from '../../base/query/v1beta1/pagination.js'; import { TxResponse, - TxResponseAmino, TxResponseSDKType, GasInfo, - GasInfoAmino, GasInfoSDKType, Result, - ResultAmino, ResultSDKType, } from '../../base/abci/v1beta1/abci.js'; -import { - BlockID, - BlockIDAmino, - BlockIDSDKType, -} from '../../../tendermint/types/types.js'; -import { - Block, - BlockAmino, - BlockSDKType, -} from '../../../tendermint/types/block.js'; +import { BlockID, BlockIDSDKType } from '../../../tendermint/types/types.js'; +import { Block, BlockSDKType } from '../../../tendermint/types/block.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../../helpers.js'; /** OrderBy defines the sorting order */ @@ -42,7 +29,6 @@ export enum OrderBy { UNRECOGNIZED = -1, } export const OrderBySDKType = OrderBy; -export const OrderByAmino = OrderBy; export function orderByFromJSON(object: any): OrderBy { switch (object) { case 0: @@ -95,7 +81,6 @@ export enum BroadcastMode { UNRECOGNIZED = -1, } export const BroadcastModeSDKType = BroadcastMode; -export const BroadcastModeAmino = BroadcastMode; export function broadcastModeFromJSON(object: any): BroadcastMode { switch (object) { case 0: @@ -146,21 +131,6 @@ export interface GetTxsEventRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetTxsEventRequest'; value: Uint8Array; } -/** - * GetTxsEventRequest is the request type for the Service.TxsByEvents - * RPC method. - */ -export interface GetTxsEventRequestAmino { - /** events is the list of transaction event type. */ - events?: string[]; - /** pagination defines a pagination for the request. */ - pagination?: PageRequestAmino; - order_by?: OrderBy; -} -export interface GetTxsEventRequestAminoMsg { - type: 'cosmos-sdk/GetTxsEventRequest'; - value: GetTxsEventRequestAmino; -} /** * GetTxsEventRequest is the request type for the Service.TxsByEvents * RPC method. @@ -186,22 +156,6 @@ export interface GetTxsEventResponseProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetTxsEventResponse'; value: Uint8Array; } -/** - * GetTxsEventResponse is the response type for the Service.TxsByEvents - * RPC method. - */ -export interface GetTxsEventResponseAmino { - /** txs is the list of queried transactions. */ - txs?: TxAmino[]; - /** tx_responses is the list of queried TxResponses. */ - tx_responses?: TxResponseAmino[]; - /** pagination defines a pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface GetTxsEventResponseAminoMsg { - type: 'cosmos-sdk/GetTxsEventResponse'; - value: GetTxsEventResponseAmino; -} /** * GetTxsEventResponse is the response type for the Service.TxsByEvents * RPC method. @@ -224,19 +178,6 @@ export interface BroadcastTxRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.BroadcastTxRequest'; value: Uint8Array; } -/** - * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest - * RPC method. - */ -export interface BroadcastTxRequestAmino { - /** tx_bytes is the raw transaction. */ - tx_bytes?: string; - mode?: BroadcastMode; -} -export interface BroadcastTxRequestAminoMsg { - type: 'cosmos-sdk/BroadcastTxRequest'; - value: BroadcastTxRequestAmino; -} /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest * RPC method. @@ -257,18 +198,6 @@ export interface BroadcastTxResponseProtoMsg { typeUrl: '/cosmos.tx.v1beta1.BroadcastTxResponse'; value: Uint8Array; } -/** - * BroadcastTxResponse is the response type for the - * Service.BroadcastTx method. - */ -export interface BroadcastTxResponseAmino { - /** tx_response is the queried TxResponses. */ - tx_response?: TxResponseAmino; -} -export interface BroadcastTxResponseAminoMsg { - type: 'cosmos-sdk/BroadcastTxResponse'; - value: BroadcastTxResponseAmino; -} /** * BroadcastTxResponse is the response type for the * Service.BroadcastTx method. @@ -298,28 +227,6 @@ export interface SimulateRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.SimulateRequest'; value: Uint8Array; } -/** - * SimulateRequest is the request type for the Service.Simulate - * RPC method. - */ -export interface SimulateRequestAmino { - /** - * tx is the transaction to simulate. - * Deprecated. Send raw tx bytes instead. - */ - /** @deprecated */ - tx?: TxAmino; - /** - * tx_bytes is the raw transaction. - * - * Since: cosmos-sdk 0.43 - */ - tx_bytes?: string; -} -export interface SimulateRequestAminoMsg { - type: 'cosmos-sdk/SimulateRequest'; - value: SimulateRequestAmino; -} /** * SimulateRequest is the request type for the Service.Simulate * RPC method. @@ -343,20 +250,6 @@ export interface SimulateResponseProtoMsg { typeUrl: '/cosmos.tx.v1beta1.SimulateResponse'; value: Uint8Array; } -/** - * SimulateResponse is the response type for the - * Service.SimulateRPC method. - */ -export interface SimulateResponseAmino { - /** gas_info is the information about gas used in the simulation. */ - gas_info?: GasInfoAmino; - /** result is the result of the simulation. */ - result?: ResultAmino; -} -export interface SimulateResponseAminoMsg { - type: 'cosmos-sdk/SimulateResponse'; - value: SimulateResponseAmino; -} /** * SimulateResponse is the response type for the * Service.SimulateRPC method. @@ -377,18 +270,6 @@ export interface GetTxRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetTxRequest'; value: Uint8Array; } -/** - * GetTxRequest is the request type for the Service.GetTx - * RPC method. - */ -export interface GetTxRequestAmino { - /** hash is the tx hash to query, encoded as a hex string. */ - hash?: string; -} -export interface GetTxRequestAminoMsg { - type: 'cosmos-sdk/GetTxRequest'; - value: GetTxRequestAmino; -} /** * GetTxRequest is the request type for the Service.GetTx * RPC method. @@ -408,17 +289,6 @@ export interface GetTxResponseProtoMsg { value: Uint8Array; } /** GetTxResponse is the response type for the Service.GetTx method. */ -export interface GetTxResponseAmino { - /** tx is the queried transaction. */ - tx?: TxAmino; - /** tx_response is the queried TxResponses. */ - tx_response?: TxResponseAmino; -} -export interface GetTxResponseAminoMsg { - type: 'cosmos-sdk/GetTxResponse'; - value: GetTxResponseAmino; -} -/** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponseSDKType { tx?: TxSDKType; tx_response?: TxResponseSDKType; @@ -439,22 +309,6 @@ export interface GetBlockWithTxsRequestProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetBlockWithTxsRequest'; value: Uint8Array; } -/** - * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs - * RPC method. - * - * Since: cosmos-sdk 0.45.2 - */ -export interface GetBlockWithTxsRequestAmino { - /** height is the height of the block to query. */ - height?: string; - /** pagination defines a pagination for the request. */ - pagination?: PageRequestAmino; -} -export interface GetBlockWithTxsRequestAminoMsg { - type: 'cosmos-sdk/GetBlockWithTxsRequest'; - value: GetBlockWithTxsRequestAmino; -} /** * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs * RPC method. @@ -482,23 +336,6 @@ export interface GetBlockWithTxsResponseProtoMsg { typeUrl: '/cosmos.tx.v1beta1.GetBlockWithTxsResponse'; value: Uint8Array; } -/** - * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. - * - * Since: cosmos-sdk 0.45.2 - */ -export interface GetBlockWithTxsResponseAmino { - /** txs are the transactions in the block. */ - txs?: TxAmino[]; - block_id?: BlockIDAmino; - block?: BlockAmino; - /** pagination defines a pagination for the response. */ - pagination?: PageResponseAmino; -} -export interface GetBlockWithTxsResponseAminoMsg { - type: 'cosmos-sdk/GetBlockWithTxsResponse'; - value: GetBlockWithTxsResponseAmino; -} /** * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. * @@ -597,39 +434,6 @@ export const GetTxsEventRequest = { message.orderBy = object.orderBy ?? 0; return message; }, - fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { - const message = createBaseGetTxsEventRequest(); - message.events = object.events?.map(e => e) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - if (object.order_by !== undefined && object.order_by !== null) { - message.orderBy = object.order_by; - } - return message; - }, - toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { - const obj: any = {}; - if (message.events) { - obj.events = message.events.map(e => e); - } else { - obj.events = message.events; - } - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - obj.order_by = message.orderBy === 0 ? undefined : message.orderBy; - return obj; - }, - fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { - return GetTxsEventRequest.fromAmino(object.value); - }, - toAminoMsg(message: GetTxsEventRequest): GetTxsEventRequestAminoMsg { - return { - type: 'cosmos-sdk/GetTxsEventRequest', - value: GetTxsEventRequest.toAmino(message), - }; - }, fromProtoMsg(message: GetTxsEventRequestProtoMsg): GetTxsEventRequest { return GetTxsEventRequest.decode(message.value); }, @@ -741,44 +545,6 @@ export const GetTxsEventResponse = { : undefined; return message; }, - fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { - const message = createBaseGetTxsEventResponse(); - message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; - message.txResponses = - object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map(e => (e ? Tx.toAmino(e) : undefined)); - } else { - obj.txs = message.txs; - } - if (message.txResponses) { - obj.tx_responses = message.txResponses.map(e => - e ? TxResponse.toAmino(e) : undefined, - ); - } else { - obj.tx_responses = message.txResponses; - } - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { - return GetTxsEventResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetTxsEventResponse): GetTxsEventResponseAminoMsg { - return { - type: 'cosmos-sdk/GetTxsEventResponse', - value: GetTxsEventResponse.toAmino(message), - }; - }, fromProtoMsg(message: GetTxsEventResponseProtoMsg): GetTxsEventResponse { return GetTxsEventResponse.decode(message.value); }, @@ -860,33 +626,6 @@ export const BroadcastTxRequest = { message.mode = object.mode ?? 0; return message; }, - fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { - const message = createBaseBroadcastTxRequest(); - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.txBytes = bytesFromBase64(object.tx_bytes); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } - return message; - }, - toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { - const obj: any = {}; - obj.tx_bytes = message.txBytes - ? base64FromBytes(message.txBytes) - : undefined; - obj.mode = message.mode === 0 ? undefined : message.mode; - return obj; - }, - fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { - return BroadcastTxRequest.fromAmino(object.value); - }, - toAminoMsg(message: BroadcastTxRequest): BroadcastTxRequestAminoMsg { - return { - type: 'cosmos-sdk/BroadcastTxRequest', - value: BroadcastTxRequest.toAmino(message), - }; - }, fromProtoMsg(message: BroadcastTxRequestProtoMsg): BroadcastTxRequest { return BroadcastTxRequest.decode(message.value); }, @@ -960,29 +699,6 @@ export const BroadcastTxResponse = { : undefined; return message; }, - fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { - const message = createBaseBroadcastTxResponse(); - if (object.tx_response !== undefined && object.tx_response !== null) { - message.txResponse = TxResponse.fromAmino(object.tx_response); - } - return message; - }, - toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { - const obj: any = {}; - obj.tx_response = message.txResponse - ? TxResponse.toAmino(message.txResponse) - : undefined; - return obj; - }, - fromAminoMsg(object: BroadcastTxResponseAminoMsg): BroadcastTxResponse { - return BroadcastTxResponse.fromAmino(object.value); - }, - toAminoMsg(message: BroadcastTxResponse): BroadcastTxResponseAminoMsg { - return { - type: 'cosmos-sdk/BroadcastTxResponse', - value: BroadcastTxResponse.toAmino(message), - }; - }, fromProtoMsg(message: BroadcastTxResponseProtoMsg): BroadcastTxResponse { return BroadcastTxResponse.decode(message.value); }, @@ -1064,33 +780,6 @@ export const SimulateRequest = { message.txBytes = object.txBytes ?? new Uint8Array(); return message; }, - fromAmino(object: SimulateRequestAmino): SimulateRequest { - const message = createBaseSimulateRequest(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromAmino(object.tx); - } - if (object.tx_bytes !== undefined && object.tx_bytes !== null) { - message.txBytes = bytesFromBase64(object.tx_bytes); - } - return message; - }, - toAmino(message: SimulateRequest): SimulateRequestAmino { - const obj: any = {}; - obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; - obj.tx_bytes = message.txBytes - ? base64FromBytes(message.txBytes) - : undefined; - return obj; - }, - fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { - return SimulateRequest.fromAmino(object.value); - }, - toAminoMsg(message: SimulateRequest): SimulateRequestAminoMsg { - return { - type: 'cosmos-sdk/SimulateRequest', - value: SimulateRequest.toAmino(message), - }; - }, fromProtoMsg(message: SimulateRequestProtoMsg): SimulateRequest { return SimulateRequest.decode(message.value); }, @@ -1175,33 +864,6 @@ export const SimulateResponse = { : undefined; return message; }, - fromAmino(object: SimulateResponseAmino): SimulateResponse { - const message = createBaseSimulateResponse(); - if (object.gas_info !== undefined && object.gas_info !== null) { - message.gasInfo = GasInfo.fromAmino(object.gas_info); - } - if (object.result !== undefined && object.result !== null) { - message.result = Result.fromAmino(object.result); - } - return message; - }, - toAmino(message: SimulateResponse): SimulateResponseAmino { - const obj: any = {}; - obj.gas_info = message.gasInfo - ? GasInfo.toAmino(message.gasInfo) - : undefined; - obj.result = message.result ? Result.toAmino(message.result) : undefined; - return obj; - }, - fromAminoMsg(object: SimulateResponseAminoMsg): SimulateResponse { - return SimulateResponse.fromAmino(object.value); - }, - toAminoMsg(message: SimulateResponse): SimulateResponseAminoMsg { - return { - type: 'cosmos-sdk/SimulateResponse', - value: SimulateResponse.toAmino(message), - }; - }, fromProtoMsg(message: SimulateResponseProtoMsg): SimulateResponse { return SimulateResponse.decode(message.value); }, @@ -1264,27 +926,6 @@ export const GetTxRequest = { message.hash = object.hash ?? ''; return message; }, - fromAmino(object: GetTxRequestAmino): GetTxRequest { - const message = createBaseGetTxRequest(); - if (object.hash !== undefined && object.hash !== null) { - message.hash = object.hash; - } - return message; - }, - toAmino(message: GetTxRequest): GetTxRequestAmino { - const obj: any = {}; - obj.hash = message.hash === '' ? undefined : message.hash; - return obj; - }, - fromAminoMsg(object: GetTxRequestAminoMsg): GetTxRequest { - return GetTxRequest.fromAmino(object.value); - }, - toAminoMsg(message: GetTxRequest): GetTxRequestAminoMsg { - return { - type: 'cosmos-sdk/GetTxRequest', - value: GetTxRequest.toAmino(message), - }; - }, fromProtoMsg(message: GetTxRequestProtoMsg): GetTxRequest { return GetTxRequest.decode(message.value); }, @@ -1369,33 +1010,6 @@ export const GetTxResponse = { : undefined; return message; }, - fromAmino(object: GetTxResponseAmino): GetTxResponse { - const message = createBaseGetTxResponse(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = Tx.fromAmino(object.tx); - } - if (object.tx_response !== undefined && object.tx_response !== null) { - message.txResponse = TxResponse.fromAmino(object.tx_response); - } - return message; - }, - toAmino(message: GetTxResponse): GetTxResponseAmino { - const obj: any = {}; - obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; - obj.tx_response = message.txResponse - ? TxResponse.toAmino(message.txResponse) - : undefined; - return obj; - }, - fromAminoMsg(object: GetTxResponseAminoMsg): GetTxResponse { - return GetTxResponse.fromAmino(object.value); - }, - toAminoMsg(message: GetTxResponse): GetTxResponseAminoMsg { - return { - type: 'cosmos-sdk/GetTxResponse', - value: GetTxResponse.toAmino(message), - }; - }, fromProtoMsg(message: GetTxResponseProtoMsg): GetTxResponse { return GetTxResponse.decode(message.value); }, @@ -1485,34 +1099,6 @@ export const GetBlockWithTxsRequest = { : undefined; return message; }, - fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { - const message = createBaseGetBlockWithTxsRequest(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.pagination = message.pagination - ? PageRequest.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { - return GetBlockWithTxsRequest.fromAmino(object.value); - }, - toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { - return { - type: 'cosmos-sdk/GetBlockWithTxsRequest', - value: GetBlockWithTxsRequest.toAmino(message), - }; - }, fromProtoMsg( message: GetBlockWithTxsRequestProtoMsg, ): GetBlockWithTxsRequest { @@ -1641,49 +1227,6 @@ export const GetBlockWithTxsResponse = { : undefined; return message; }, - fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { - const message = createBaseGetBlockWithTxsResponse(); - message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; - if (object.block_id !== undefined && object.block_id !== null) { - message.blockId = BlockID.fromAmino(object.block_id); - } - if (object.block !== undefined && object.block !== null) { - message.block = Block.fromAmino(object.block); - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromAmino(object.pagination); - } - return message; - }, - toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map(e => (e ? Tx.toAmino(e) : undefined)); - } else { - obj.txs = message.txs; - } - obj.block_id = message.blockId - ? BlockID.toAmino(message.blockId) - : undefined; - obj.block = message.block ? Block.toAmino(message.block) : undefined; - obj.pagination = message.pagination - ? PageResponse.toAmino(message.pagination) - : undefined; - return obj; - }, - fromAminoMsg( - object: GetBlockWithTxsResponseAminoMsg, - ): GetBlockWithTxsResponse { - return GetBlockWithTxsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: GetBlockWithTxsResponse, - ): GetBlockWithTxsResponseAminoMsg { - return { - type: 'cosmos-sdk/GetBlockWithTxsResponse', - value: GetBlockWithTxsResponse.toAmino(message), - }; - }, fromProtoMsg( message: GetBlockWithTxsResponseProtoMsg, ): GetBlockWithTxsResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts index e335fc6edb8..ed5efe3c98b 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { SignMode, signModeFromJSON, @@ -7,10 +7,9 @@ import { } from '../signing/v1beta1/signing.js'; import { CompactBitArray, - CompactBitArrayAmino, CompactBitArraySDKType, } from '../../crypto/multisig/v1beta1/multisig.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../../helpers.js'; /** Tx is the standard type used for broadcasting transactions. */ @@ -34,26 +33,6 @@ export interface TxProtoMsg { value: Uint8Array; } /** Tx is the standard type used for broadcasting transactions. */ -export interface TxAmino { - /** body is the processable content of the transaction */ - body?: TxBodyAmino; - /** - * auth_info is the authorization related content of the transaction, - * specifically signers, signer modes and fee - */ - auth_info?: AuthInfoAmino; - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ - signatures?: string[]; -} -export interface TxAminoMsg { - type: 'cosmos-sdk/Tx'; - value: TxAmino; -} -/** Tx is the standard type used for broadcasting transactions. */ export interface TxSDKType { body?: TxBodySDKType; auth_info?: AuthInfoSDKType; @@ -88,35 +67,6 @@ export interface TxRawProtoMsg { typeUrl: '/cosmos.tx.v1beta1.TxRaw'; value: Uint8Array; } -/** - * TxRaw is a variant of Tx that pins the signer's exact binary representation - * of body and auth_info. This is used for signing, broadcasting and - * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and - * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used - * as the transaction ID. - */ -export interface TxRawAmino { - /** - * body_bytes is a protobuf serialization of a TxBody that matches the - * representation in SignDoc. - */ - body_bytes?: string; - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in SignDoc. - */ - auth_info_bytes?: string; - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ - signatures?: string[]; -} -export interface TxRawAminoMsg { - type: 'cosmos-sdk/TxRaw'; - value: TxRawAmino; -} /** * TxRaw is a variant of Tx that pins the signer's exact binary representation * of body and auth_info. This is used for signing, broadcasting and @@ -155,31 +105,6 @@ export interface SignDocProtoMsg { value: Uint8Array; } /** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ -export interface SignDocAmino { - /** - * body_bytes is protobuf serialization of a TxBody that matches the - * representation in TxRaw. - */ - body_bytes?: string; - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in TxRaw. - */ - auth_info_bytes?: string; - /** - * chain_id is the unique identifier of the chain this transaction targets. - * It prevents signed transactions from being used on another chain by an - * attacker - */ - chain_id?: string; - /** account_number is the account number of the account in state */ - account_number?: string; -} -export interface SignDocAminoMsg { - type: 'cosmos-sdk/SignDoc'; - value: SignDocAmino; -} -/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ export interface SignDocSDKType { body_bytes: Uint8Array; auth_info_bytes: Uint8Array; @@ -220,40 +145,6 @@ export interface SignDocDirectAuxProtoMsg { typeUrl: '/cosmos.tx.v1beta1.SignDocDirectAux'; value: Uint8Array; } -/** - * SignDocDirectAux is the type used for generating sign bytes for - * SIGN_MODE_DIRECT_AUX. - * - * Since: cosmos-sdk 0.46 - */ -export interface SignDocDirectAuxAmino { - /** - * body_bytes is protobuf serialization of a TxBody that matches the - * representation in TxRaw. - */ - body_bytes?: string; - /** public_key is the public key of the signing account. */ - public_key?: AnyAmino; - /** - * chain_id is the identifier of the chain this transaction targets. - * It prevents signed transactions from being used on another chain by an - * attacker. - */ - chain_id?: string; - /** account_number is the account number of the account in state. */ - account_number?: string; - /** sequence is the sequence number of the signing account. */ - sequence?: string; - /** - * Tip is the optional tip used for meta-transactions. It should be left - * empty if the signer is not the tipper for this transaction. - */ - tip?: TipAmino; -} -export interface SignDocDirectAuxAminoMsg { - type: 'cosmos-sdk/SignDocDirectAux'; - value: SignDocDirectAuxAmino; -} /** * SignDocDirectAux is the type used for generating sign bytes for * SIGN_MODE_DIRECT_AUX. @@ -309,46 +200,6 @@ export interface TxBodyProtoMsg { value: Uint8Array; } /** TxBody is the body of a transaction that all signers sign over. */ -export interface TxBodyAmino { - /** - * messages is a list of messages to be executed. The required signers of - * those messages define the number and order of elements in AuthInfo's - * signer_infos and Tx's signatures. Each required signer address is added to - * the list only the first time it occurs. - * By convention, the first required signer (usually from the first message) - * is referred to as the primary signer and pays the fee for the whole - * transaction. - */ - messages?: AnyAmino[]; - /** - * memo is any arbitrary note/comment to be added to the transaction. - * WARNING: in clients, any publicly exposed text should not be called memo, - * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - */ - memo?: string; - /** - * timeout is the block height after which this transaction will not - * be processed by the chain - */ - timeout_height?: string; - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, the transaction will be rejected - */ - extension_options?: AnyAmino[]; - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, they will be ignored - */ - non_critical_extension_options?: AnyAmino[]; -} -export interface TxBodyAminoMsg { - type: 'cosmos-sdk/TxBody'; - value: TxBodyAmino; -} -/** TxBody is the body of a transaction that all signers sign over. */ export interface TxBodySDKType { messages: AnySDKType[]; memo: string; @@ -386,36 +237,6 @@ export interface AuthInfoProtoMsg { typeUrl: '/cosmos.tx.v1beta1.AuthInfo'; value: Uint8Array; } -/** - * AuthInfo describes the fee and signer modes that are used to sign a - * transaction. - */ -export interface AuthInfoAmino { - /** - * signer_infos defines the signing modes for the required signers. The number - * and order of elements must match the required signers from TxBody's - * messages. The first element is the primary signer and the one which pays - * the fee. - */ - signer_infos?: SignerInfoAmino[]; - /** - * Fee is the fee and gas limit for the transaction. The first signer is the - * primary signer and the one which pays the fee. The fee can be calculated - * based on the cost of evaluating the body and doing signature verification - * of the signers. This can be estimated via simulation. - */ - fee?: FeeAmino; - /** - * Tip is the optional tip used for meta-transactions. - * - * Since: cosmos-sdk 0.46 - */ - tip?: TipAmino; -} -export interface AuthInfoAminoMsg { - type: 'cosmos-sdk/AuthInfo'; - value: AuthInfoAmino; -} /** * AuthInfo describes the fee and signer modes that are used to sign a * transaction. @@ -452,33 +273,6 @@ export interface SignerInfoProtoMsg { typeUrl: '/cosmos.tx.v1beta1.SignerInfo'; value: Uint8Array; } -/** - * SignerInfo describes the public key and signing mode of a single top-level - * signer. - */ -export interface SignerInfoAmino { - /** - * public_key is the public key of the signer. It is optional for accounts - * that already exist in state. If unset, the verifier can use the required \ - * signer address for this position and lookup the public key. - */ - public_key?: AnyAmino; - /** - * mode_info describes the signing mode of the signer and is a nested - * structure to support nested multisig pubkey's - */ - mode_info?: ModeInfoAmino; - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to - * prevent replay attacks. - */ - sequence?: string; -} -export interface SignerInfoAminoMsg { - type: 'cosmos-sdk/SignerInfo'; - value: SignerInfoAmino; -} /** * SignerInfo describes the public key and signing mode of a single top-level * signer. @@ -500,17 +294,6 @@ export interface ModeInfoProtoMsg { value: Uint8Array; } /** ModeInfo describes the signing mode of a single or nested multisig signer. */ -export interface ModeInfoAmino { - /** single represents a single signer */ - single?: ModeInfo_SingleAmino; - /** multi represents a nested multisig signer */ - multi?: ModeInfo_MultiAmino; -} -export interface ModeInfoAminoMsg { - type: 'cosmos-sdk/ModeInfo'; - value: ModeInfoAmino; -} -/** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfoSDKType { single?: ModeInfo_SingleSDKType; multi?: ModeInfo_MultiSDKType; @@ -528,19 +311,6 @@ export interface ModeInfo_SingleProtoMsg { typeUrl: '/cosmos.tx.v1beta1.Single'; value: Uint8Array; } -/** - * Single is the mode info for a single signer. It is structured as a message - * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - * future - */ -export interface ModeInfo_SingleAmino { - /** mode is the signing mode of the single signer */ - mode?: SignMode; -} -export interface ModeInfo_SingleAminoMsg { - type: 'cosmos-sdk/Single'; - value: ModeInfo_SingleAmino; -} /** * Single is the mode info for a single signer. It is structured as a message * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the @@ -564,20 +334,6 @@ export interface ModeInfo_MultiProtoMsg { value: Uint8Array; } /** Multi is the mode info for a multisig public key */ -export interface ModeInfo_MultiAmino { - /** bitarray specifies which keys within the multisig are signing */ - bitarray?: CompactBitArrayAmino; - /** - * mode_infos is the corresponding modes of the signers of the multisig - * which could include nested multisig public keys - */ - mode_infos?: ModeInfoAmino[]; -} -export interface ModeInfo_MultiAminoMsg { - type: 'cosmos-sdk/Multi'; - value: ModeInfo_MultiAmino; -} -/** Multi is the mode info for a multisig public key */ export interface ModeInfo_MultiSDKType { bitarray?: CompactBitArraySDKType; mode_infos: ModeInfoSDKType[]; @@ -612,36 +368,6 @@ export interface FeeProtoMsg { typeUrl: '/cosmos.tx.v1beta1.Fee'; value: Uint8Array; } -/** - * Fee includes the amount of coins paid in fees and the maximum - * gas to be used by the transaction. The ratio yields an effective "gasprice", - * which must be above some miminum to be accepted into the mempool. - */ -export interface FeeAmino { - /** amount is the amount of coins to be paid as a fee */ - amount?: CoinAmino[]; - /** - * gas_limit is the maximum gas that can be used in transaction processing - * before an out of gas error occurs - */ - gas_limit?: string; - /** - * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - * the payer must be a tx signer (and thus have signed this field in AuthInfo). - * setting this field does *not* change the ordering of required signers for the transaction. - */ - payer?: string; - /** - * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - * not support fee grants, this will fail - */ - granter?: string; -} -export interface FeeAminoMsg { - type: 'cosmos-sdk/Fee'; - value: FeeAmino; -} /** * Fee includes the amount of coins paid in fees and the maximum * gas to be used by the transaction. The ratio yields an effective "gasprice", @@ -668,21 +394,6 @@ export interface TipProtoMsg { typeUrl: '/cosmos.tx.v1beta1.Tip'; value: Uint8Array; } -/** - * Tip is the tip used for meta-transactions. - * - * Since: cosmos-sdk 0.46 - */ -export interface TipAmino { - /** amount is the amount of the tip */ - amount?: CoinAmino[]; - /** tipper is the address of the account paying for the tip */ - tipper?: string; -} -export interface TipAminoMsg { - type: 'cosmos-sdk/Tip'; - value: TipAmino; -} /** * Tip is the tip used for meta-transactions. * @@ -722,36 +433,6 @@ export interface AuxSignerDataProtoMsg { typeUrl: '/cosmos.tx.v1beta1.AuxSignerData'; value: Uint8Array; } -/** - * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a - * tipper) builds and sends to the fee payer (who will build and broadcast the - * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected - * by the node if sent directly as-is. - * - * Since: cosmos-sdk 0.46 - */ -export interface AuxSignerDataAmino { - /** - * address is the bech32-encoded address of the auxiliary signer. If using - * AuxSignerData across different chains, the bech32 prefix of the target - * chain (where the final transaction is broadcasted) should be used. - */ - address?: string; - /** - * sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer - * signs. Note: we use the same sign doc even if we're signing with - * LEGACY_AMINO_JSON. - */ - sign_doc?: SignDocDirectAuxAmino; - /** mode is the signing mode of the single signer */ - mode?: SignMode; - /** sig is the signature of the sign doc. */ - sig?: string; -} -export interface AuxSignerDataAminoMsg { - type: 'cosmos-sdk/AuxSignerData'; - value: AuxSignerDataAmino; -} /** * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a * tipper) builds and sends to the fee payer (who will build and broadcast the @@ -855,39 +536,6 @@ export const Tx = { message.signatures = object.signatures?.map(e => e) || []; return message; }, - fromAmino(object: TxAmino): Tx { - const message = createBaseTx(); - if (object.body !== undefined && object.body !== null) { - message.body = TxBody.fromAmino(object.body); - } - if (object.auth_info !== undefined && object.auth_info !== null) { - message.authInfo = AuthInfo.fromAmino(object.auth_info); - } - message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: Tx): TxAmino { - const obj: any = {}; - obj.body = message.body ? TxBody.toAmino(message.body) : undefined; - obj.auth_info = message.authInfo - ? AuthInfo.toAmino(message.authInfo) - : undefined; - if (message.signatures) { - obj.signatures = message.signatures.map(e => base64FromBytes(e)); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg(object: TxAminoMsg): Tx { - return Tx.fromAmino(object.value); - }, - toAminoMsg(message: Tx): TxAminoMsg { - return { - type: 'cosmos-sdk/Tx', - value: Tx.toAmino(message), - }; - }, fromProtoMsg(message: TxProtoMsg): Tx { return Tx.decode(message.value); }, @@ -990,44 +638,6 @@ export const TxRaw = { message.signatures = object.signatures?.map(e => e) || []; return message; }, - fromAmino(object: TxRawAmino): TxRaw { - const message = createBaseTxRaw(); - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.bodyBytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); - } - message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: TxRaw): TxRawAmino { - const obj: any = {}; - obj.body_bytes = message.bodyBytes - ? base64FromBytes(message.bodyBytes) - : undefined; - obj.auth_info_bytes = message.authInfoBytes - ? base64FromBytes(message.authInfoBytes) - : undefined; - if (message.signatures) { - obj.signatures = message.signatures.map(e => base64FromBytes(e)); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg(object: TxRawAminoMsg): TxRaw { - return TxRaw.fromAmino(object.value); - }, - toAminoMsg(message: TxRaw): TxRawAminoMsg { - return { - type: 'cosmos-sdk/TxRaw', - value: TxRaw.toAmino(message), - }; - }, fromProtoMsg(message: TxRawProtoMsg): TxRaw { return TxRaw.decode(message.value); }, @@ -1138,49 +748,6 @@ export const SignDoc = { : BigInt(0); return message; }, - fromAmino(object: SignDocAmino): SignDoc { - const message = createBaseSignDoc(); - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.bodyBytes = bytesFromBase64(object.body_bytes); - } - if ( - object.auth_info_bytes !== undefined && - object.auth_info_bytes !== null - ) { - message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chainId = object.chain_id; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.accountNumber = BigInt(object.account_number); - } - return message; - }, - toAmino(message: SignDoc): SignDocAmino { - const obj: any = {}; - obj.body_bytes = message.bodyBytes - ? base64FromBytes(message.bodyBytes) - : undefined; - obj.auth_info_bytes = message.authInfoBytes - ? base64FromBytes(message.authInfoBytes) - : undefined; - obj.chain_id = message.chainId === '' ? undefined : message.chainId; - obj.account_number = - message.accountNumber !== BigInt(0) - ? message.accountNumber.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: SignDocAminoMsg): SignDoc { - return SignDoc.fromAmino(object.value); - }, - toAminoMsg(message: SignDoc): SignDocAminoMsg { - return { - type: 'cosmos-sdk/SignDoc', - value: SignDoc.toAmino(message), - }; - }, fromProtoMsg(message: SignDocProtoMsg): SignDoc { return SignDoc.decode(message.value); }, @@ -1322,55 +889,6 @@ export const SignDocDirectAux = { : undefined; return message; }, - fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { - const message = createBaseSignDocDirectAux(); - if (object.body_bytes !== undefined && object.body_bytes !== null) { - message.bodyBytes = bytesFromBase64(object.body_bytes); - } - if (object.public_key !== undefined && object.public_key !== null) { - message.publicKey = Any.fromAmino(object.public_key); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chainId = object.chain_id; - } - if (object.account_number !== undefined && object.account_number !== null) { - message.accountNumber = BigInt(object.account_number); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - if (object.tip !== undefined && object.tip !== null) { - message.tip = Tip.fromAmino(object.tip); - } - return message; - }, - toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { - const obj: any = {}; - obj.body_bytes = message.bodyBytes - ? base64FromBytes(message.bodyBytes) - : undefined; - obj.public_key = message.publicKey - ? Any.toAmino(message.publicKey) - : undefined; - obj.chain_id = message.chainId === '' ? undefined : message.chainId; - obj.account_number = - message.accountNumber !== BigInt(0) - ? message.accountNumber.toString() - : undefined; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; - return obj; - }, - fromAminoMsg(object: SignDocDirectAuxAminoMsg): SignDocDirectAux { - return SignDocDirectAux.fromAmino(object.value); - }, - toAminoMsg(message: SignDocDirectAux): SignDocDirectAuxAminoMsg { - return { - type: 'cosmos-sdk/SignDocDirectAux', - value: SignDocDirectAux.toAmino(message), - }; - }, fromProtoMsg(message: SignDocDirectAuxProtoMsg): SignDocDirectAux { return SignDocDirectAux.decode(message.value); }, @@ -1507,61 +1025,6 @@ export const TxBody = { object.nonCriticalExtensionOptions?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: TxBodyAmino): TxBody { - const message = createBaseTxBody(); - message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; - if (object.memo !== undefined && object.memo !== null) { - message.memo = object.memo; - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeoutHeight = BigInt(object.timeout_height); - } - message.extensionOptions = - object.extension_options?.map(e => Any.fromAmino(e)) || []; - message.nonCriticalExtensionOptions = - object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; - return message; - }, - toAmino(message: TxBody): TxBodyAmino { - const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.messages = message.messages; - } - obj.memo = message.memo === '' ? undefined : message.memo; - obj.timeout_height = - message.timeoutHeight !== BigInt(0) - ? message.timeoutHeight.toString() - : undefined; - if (message.extensionOptions) { - obj.extension_options = message.extensionOptions.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.extension_options = message.extensionOptions; - } - if (message.nonCriticalExtensionOptions) { - obj.non_critical_extension_options = - message.nonCriticalExtensionOptions.map(e => - e ? Any.toAmino(e) : undefined, - ); - } else { - obj.non_critical_extension_options = message.nonCriticalExtensionOptions; - } - return obj; - }, - fromAminoMsg(object: TxBodyAminoMsg): TxBody { - return TxBody.fromAmino(object.value); - }, - toAminoMsg(message: TxBody): TxBodyAminoMsg { - return { - type: 'cosmos-sdk/TxBody', - value: TxBody.toAmino(message), - }; - }, fromProtoMsg(message: TxBodyProtoMsg): TxBody { return TxBody.decode(message.value); }, @@ -1661,40 +1124,6 @@ export const AuthInfo = { : undefined; return message; }, - fromAmino(object: AuthInfoAmino): AuthInfo { - const message = createBaseAuthInfo(); - message.signerInfos = - object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; - if (object.fee !== undefined && object.fee !== null) { - message.fee = Fee.fromAmino(object.fee); - } - if (object.tip !== undefined && object.tip !== null) { - message.tip = Tip.fromAmino(object.tip); - } - return message; - }, - toAmino(message: AuthInfo): AuthInfoAmino { - const obj: any = {}; - if (message.signerInfos) { - obj.signer_infos = message.signerInfos.map(e => - e ? SignerInfo.toAmino(e) : undefined, - ); - } else { - obj.signer_infos = message.signerInfos; - } - obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; - obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; - return obj; - }, - fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { - return AuthInfo.fromAmino(object.value); - }, - toAminoMsg(message: AuthInfo): AuthInfoAminoMsg { - return { - type: 'cosmos-sdk/AuthInfo', - value: AuthInfo.toAmino(message), - }; - }, fromProtoMsg(message: AuthInfoProtoMsg): AuthInfo { return AuthInfo.decode(message.value); }, @@ -1799,40 +1228,6 @@ export const SignerInfo = { : BigInt(0); return message; }, - fromAmino(object: SignerInfoAmino): SignerInfo { - const message = createBaseSignerInfo(); - if (object.public_key !== undefined && object.public_key !== null) { - message.publicKey = Any.fromAmino(object.public_key); - } - if (object.mode_info !== undefined && object.mode_info !== null) { - message.modeInfo = ModeInfo.fromAmino(object.mode_info); - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - return message; - }, - toAmino(message: SignerInfo): SignerInfoAmino { - const obj: any = {}; - obj.public_key = message.publicKey - ? Any.toAmino(message.publicKey) - : undefined; - obj.mode_info = message.modeInfo - ? ModeInfo.toAmino(message.modeInfo) - : undefined; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - return obj; - }, - fromAminoMsg(object: SignerInfoAminoMsg): SignerInfo { - return SignerInfo.fromAmino(object.value); - }, - toAminoMsg(message: SignerInfo): SignerInfoAminoMsg { - return { - type: 'cosmos-sdk/SignerInfo', - value: SignerInfo.toAmino(message), - }; - }, fromProtoMsg(message: SignerInfoProtoMsg): SignerInfo { return SignerInfo.decode(message.value); }, @@ -1921,35 +1316,6 @@ export const ModeInfo = { : undefined; return message; }, - fromAmino(object: ModeInfoAmino): ModeInfo { - const message = createBaseModeInfo(); - if (object.single !== undefined && object.single !== null) { - message.single = ModeInfo_Single.fromAmino(object.single); - } - if (object.multi !== undefined && object.multi !== null) { - message.multi = ModeInfo_Multi.fromAmino(object.multi); - } - return message; - }, - toAmino(message: ModeInfo): ModeInfoAmino { - const obj: any = {}; - obj.single = message.single - ? ModeInfo_Single.toAmino(message.single) - : undefined; - obj.multi = message.multi - ? ModeInfo_Multi.toAmino(message.multi) - : undefined; - return obj; - }, - fromAminoMsg(object: ModeInfoAminoMsg): ModeInfo { - return ModeInfo.fromAmino(object.value); - }, - toAminoMsg(message: ModeInfo): ModeInfoAminoMsg { - return { - type: 'cosmos-sdk/ModeInfo', - value: ModeInfo.toAmino(message), - }; - }, fromProtoMsg(message: ModeInfoProtoMsg): ModeInfo { return ModeInfo.decode(message.value); }, @@ -2012,27 +1378,6 @@ export const ModeInfo_Single = { message.mode = object.mode ?? 0; return message; }, - fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { - const message = createBaseModeInfo_Single(); - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } - return message; - }, - toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { - const obj: any = {}; - obj.mode = message.mode === 0 ? undefined : message.mode; - return obj; - }, - fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { - return ModeInfo_Single.fromAmino(object.value); - }, - toAminoMsg(message: ModeInfo_Single): ModeInfo_SingleAminoMsg { - return { - type: 'cosmos-sdk/Single', - value: ModeInfo_Single.toAmino(message), - }; - }, fromProtoMsg(message: ModeInfo_SingleProtoMsg): ModeInfo_Single { return ModeInfo_Single.decode(message.value); }, @@ -2125,38 +1470,6 @@ export const ModeInfo_Multi = { object.modeInfos?.map(e => ModeInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { - const message = createBaseModeInfo_Multi(); - if (object.bitarray !== undefined && object.bitarray !== null) { - message.bitarray = CompactBitArray.fromAmino(object.bitarray); - } - message.modeInfos = - object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; - return message; - }, - toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { - const obj: any = {}; - obj.bitarray = message.bitarray - ? CompactBitArray.toAmino(message.bitarray) - : undefined; - if (message.modeInfos) { - obj.mode_infos = message.modeInfos.map(e => - e ? ModeInfo.toAmino(e) : undefined, - ); - } else { - obj.mode_infos = message.modeInfos; - } - return obj; - }, - fromAminoMsg(object: ModeInfo_MultiAminoMsg): ModeInfo_Multi { - return ModeInfo_Multi.fromAmino(object.value); - }, - toAminoMsg(message: ModeInfo_Multi): ModeInfo_MultiAminoMsg { - return { - type: 'cosmos-sdk/Multi', - value: ModeInfo_Multi.toAmino(message), - }; - }, fromProtoMsg(message: ModeInfo_MultiProtoMsg): ModeInfo_Multi { return ModeInfo_Multi.decode(message.value); }, @@ -2261,42 +1574,6 @@ export const Fee = { message.granter = object.granter ?? ''; return message; }, - fromAmino(object: FeeAmino): Fee { - const message = createBaseFee(); - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - if (object.gas_limit !== undefined && object.gas_limit !== null) { - message.gasLimit = BigInt(object.gas_limit); - } - if (object.payer !== undefined && object.payer !== null) { - message.payer = object.payer; - } - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - return message; - }, - toAmino(message: Fee): FeeAmino { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - obj.gas_limit = - message.gasLimit !== BigInt(0) ? message.gasLimit.toString() : undefined; - obj.payer = message.payer === '' ? undefined : message.payer; - obj.granter = message.granter === '' ? undefined : message.granter; - return obj; - }, - fromAminoMsg(object: FeeAminoMsg): Fee { - return Fee.fromAmino(object.value); - }, - toAminoMsg(message: Fee): FeeAminoMsg { - return { - type: 'cosmos-sdk/Fee', - value: Fee.toAmino(message), - }; - }, fromProtoMsg(message: FeeProtoMsg): Fee { return Fee.decode(message.value); }, @@ -2375,33 +1652,6 @@ export const Tip = { message.tipper = object.tipper ?? ''; return message; }, - fromAmino(object: TipAmino): Tip { - const message = createBaseTip(); - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - if (object.tipper !== undefined && object.tipper !== null) { - message.tipper = object.tipper; - } - return message; - }, - toAmino(message: Tip): TipAmino { - const obj: any = {}; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - obj.tipper = message.tipper === '' ? undefined : message.tipper; - return obj; - }, - fromAminoMsg(object: TipAminoMsg): Tip { - return Tip.fromAmino(object.value); - }, - toAminoMsg(message: Tip): TipAminoMsg { - return { - type: 'cosmos-sdk/Tip', - value: Tip.toAmino(message), - }; - }, fromProtoMsg(message: TipProtoMsg): Tip { return Tip.decode(message.value); }, @@ -2508,41 +1758,6 @@ export const AuxSignerData = { message.sig = object.sig ?? new Uint8Array(); return message; }, - fromAmino(object: AuxSignerDataAmino): AuxSignerData { - const message = createBaseAuxSignerData(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.sign_doc !== undefined && object.sign_doc !== null) { - message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); - } - if (object.mode !== undefined && object.mode !== null) { - message.mode = object.mode; - } - if (object.sig !== undefined && object.sig !== null) { - message.sig = bytesFromBase64(object.sig); - } - return message; - }, - toAmino(message: AuxSignerData): AuxSignerDataAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.sign_doc = message.signDoc - ? SignDocDirectAux.toAmino(message.signDoc) - : undefined; - obj.mode = message.mode === 0 ? undefined : message.mode; - obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; - return obj; - }, - fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { - return AuxSignerData.fromAmino(object.value); - }, - toAminoMsg(message: AuxSignerData): AuxSignerDataAminoMsg { - return { - type: 'cosmos-sdk/AuxSignerData', - value: AuxSignerData.toAmino(message), - }; - }, fromProtoMsg(message: AuxSignerDataProtoMsg): AuxSignerData { return AuxSignerData.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts deleted file mode 100644 index b232df1072e..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ /dev/null @@ -1,155 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate'; -import { - QueryCurrentPlanRequest, - QueryCurrentPlanResponse, - QueryAppliedPlanRequest, - QueryAppliedPlanResponse, - QueryUpgradedConsensusStateRequest, - QueryUpgradedConsensusStateResponse, - QueryModuleVersionsRequest, - QueryModuleVersionsResponse, - QueryAuthorityRequest, - QueryAuthorityResponse, -} from './query.js'; -/** Query defines the gRPC upgrade querier service. */ -export interface Query { - /** CurrentPlan queries the current upgrade plan. */ - currentPlan( - request?: QueryCurrentPlanRequest, - ): Promise; - /** AppliedPlan queries a previously applied upgrade plan by its name. */ - appliedPlan( - request: QueryAppliedPlanRequest, - ): Promise; - /** - * UpgradedConsensusState queries the consensus state that will serve - * as a trusted kernel for the next version of this chain. It will only be - * stored at the last height of this chain. - * UpgradedConsensusState RPC not supported with legacy querier - * This rpc is deprecated now that IBC has its own replacement - * (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - */ - upgradedConsensusState( - request: QueryUpgradedConsensusStateRequest, - ): Promise; - /** - * ModuleVersions queries the list of module versions from state. - * - * Since: cosmos-sdk 0.43 - */ - moduleVersions( - request: QueryModuleVersionsRequest, - ): Promise; - /** Returns the account with authority to conduct upgrades */ - authority(request?: QueryAuthorityRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.currentPlan = this.currentPlan.bind(this); - this.appliedPlan = this.appliedPlan.bind(this); - this.upgradedConsensusState = this.upgradedConsensusState.bind(this); - this.moduleVersions = this.moduleVersions.bind(this); - this.authority = this.authority.bind(this); - } - currentPlan( - request: QueryCurrentPlanRequest = {}, - ): Promise { - const data = QueryCurrentPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Query', - 'CurrentPlan', - data, - ); - return promise.then(data => - QueryCurrentPlanResponse.decode(new BinaryReader(data)), - ); - } - appliedPlan( - request: QueryAppliedPlanRequest, - ): Promise { - const data = QueryAppliedPlanRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Query', - 'AppliedPlan', - data, - ); - return promise.then(data => - QueryAppliedPlanResponse.decode(new BinaryReader(data)), - ); - } - upgradedConsensusState( - request: QueryUpgradedConsensusStateRequest, - ): Promise { - const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Query', - 'UpgradedConsensusState', - data, - ); - return promise.then(data => - QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data)), - ); - } - moduleVersions( - request: QueryModuleVersionsRequest, - ): Promise { - const data = QueryModuleVersionsRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Query', - 'ModuleVersions', - data, - ); - return promise.then(data => - QueryModuleVersionsResponse.decode(new BinaryReader(data)), - ); - } - authority( - request: QueryAuthorityRequest = {}, - ): Promise { - const data = QueryAuthorityRequest.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Query', - 'Authority', - data, - ); - return promise.then(data => - QueryAuthorityResponse.decode(new BinaryReader(data)), - ); - } -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - currentPlan( - request?: QueryCurrentPlanRequest, - ): Promise { - return queryService.currentPlan(request); - }, - appliedPlan( - request: QueryAppliedPlanRequest, - ): Promise { - return queryService.appliedPlan(request); - }, - upgradedConsensusState( - request: QueryUpgradedConsensusStateRequest, - ): Promise { - return queryService.upgradedConsensusState(request); - }, - moduleVersions( - request: QueryModuleVersionsRequest, - ): Promise { - return queryService.moduleVersions(request); - }, - authority( - request?: QueryAuthorityRequest, - ): Promise { - return queryService.authority(request); - }, - }; -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.ts index 1f2c967129e..974c4d9fa71 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/query.ts @@ -1,10 +1,8 @@ //@ts-nocheck import { Plan, - PlanAmino, PlanSDKType, ModuleVersion, - ModuleVersionAmino, ModuleVersionSDKType, } from './upgrade.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; @@ -18,15 +16,6 @@ export interface QueryCurrentPlanRequestProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest'; value: Uint8Array; } -/** - * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC - * method. - */ -export interface QueryCurrentPlanRequestAmino {} -export interface QueryCurrentPlanRequestAminoMsg { - type: 'cosmos-sdk/QueryCurrentPlanRequest'; - value: QueryCurrentPlanRequestAmino; -} /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. @@ -44,18 +33,6 @@ export interface QueryCurrentPlanResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse'; value: Uint8Array; } -/** - * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC - * method. - */ -export interface QueryCurrentPlanResponseAmino { - /** plan is the current upgrade plan. */ - plan?: PlanAmino; -} -export interface QueryCurrentPlanResponseAminoMsg { - type: 'cosmos-sdk/QueryCurrentPlanResponse'; - value: QueryCurrentPlanResponseAmino; -} /** * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC * method. @@ -75,18 +52,6 @@ export interface QueryAppliedPlanRequestProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest'; value: Uint8Array; } -/** - * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC - * method. - */ -export interface QueryAppliedPlanRequestAmino { - /** name is the name of the applied plan to query for. */ - name?: string; -} -export interface QueryAppliedPlanRequestAminoMsg { - type: 'cosmos-sdk/QueryAppliedPlanRequest'; - value: QueryAppliedPlanRequestAmino; -} /** * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC * method. @@ -106,18 +71,6 @@ export interface QueryAppliedPlanResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse'; value: Uint8Array; } -/** - * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC - * method. - */ -export interface QueryAppliedPlanResponseAmino { - /** height is the block height at which the plan was applied. */ - height?: string; -} -export interface QueryAppliedPlanResponseAminoMsg { - type: 'cosmos-sdk/QueryAppliedPlanResponse'; - value: QueryAppliedPlanResponseAmino; -} /** * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC * method. @@ -146,22 +99,6 @@ export interface QueryUpgradedConsensusStateRequestProtoMsg { * RPC method. */ /** @deprecated */ -export interface QueryUpgradedConsensusStateRequestAmino { - /** - * last height of the current chain must be sent in request - * as this is the height under which next consensus state is stored - */ - last_height?: string; -} -export interface QueryUpgradedConsensusStateRequestAminoMsg { - type: 'cosmos-sdk/QueryUpgradedConsensusStateRequest'; - value: QueryUpgradedConsensusStateRequestAmino; -} -/** - * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState - * RPC method. - */ -/** @deprecated */ export interface QueryUpgradedConsensusStateRequestSDKType { last_height: bigint; } @@ -183,19 +120,6 @@ export interface QueryUpgradedConsensusStateResponseProtoMsg { * RPC method. */ /** @deprecated */ -export interface QueryUpgradedConsensusStateResponseAmino { - /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state?: string; -} -export interface QueryUpgradedConsensusStateResponseAminoMsg { - type: 'cosmos-sdk/QueryUpgradedConsensusStateResponse'; - value: QueryUpgradedConsensusStateResponseAmino; -} -/** - * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState - * RPC method. - */ -/** @deprecated */ export interface QueryUpgradedConsensusStateResponseSDKType { upgraded_consensus_state: Uint8Array; } @@ -217,24 +141,6 @@ export interface QueryModuleVersionsRequestProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest'; value: Uint8Array; } -/** - * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions - * RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryModuleVersionsRequestAmino { - /** - * module_name is a field to query a specific module - * consensus version from state. Leaving this empty will - * fetch the full list of module versions from state - */ - module_name?: string; -} -export interface QueryModuleVersionsRequestAminoMsg { - type: 'cosmos-sdk/QueryModuleVersionsRequest'; - value: QueryModuleVersionsRequestAmino; -} /** * QueryModuleVersionsRequest is the request type for the Query/ModuleVersions * RPC method. @@ -258,20 +164,6 @@ export interface QueryModuleVersionsResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse'; value: Uint8Array; } -/** - * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions - * RPC method. - * - * Since: cosmos-sdk 0.43 - */ -export interface QueryModuleVersionsResponseAmino { - /** module_versions is a list of module names with their consensus versions. */ - module_versions?: ModuleVersionAmino[]; -} -export interface QueryModuleVersionsResponseAminoMsg { - type: 'cosmos-sdk/QueryModuleVersionsResponse'; - value: QueryModuleVersionsResponseAmino; -} /** * QueryModuleVersionsResponse is the response type for the Query/ModuleVersions * RPC method. @@ -291,16 +183,6 @@ export interface QueryAuthorityRequestProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryAuthorityRequest'; value: Uint8Array; } -/** - * QueryAuthorityRequest is the request type for Query/Authority - * - * Since: cosmos-sdk 0.46 - */ -export interface QueryAuthorityRequestAmino {} -export interface QueryAuthorityRequestAminoMsg { - type: 'cosmos-sdk/QueryAuthorityRequest'; - value: QueryAuthorityRequestAmino; -} /** * QueryAuthorityRequest is the request type for Query/Authority * @@ -319,18 +201,6 @@ export interface QueryAuthorityResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.QueryAuthorityResponse'; value: Uint8Array; } -/** - * QueryAuthorityResponse is the response type for Query/Authority - * - * Since: cosmos-sdk 0.46 - */ -export interface QueryAuthorityResponseAmino { - address?: string; -} -export interface QueryAuthorityResponseAminoMsg { - type: 'cosmos-sdk/QueryAuthorityResponse'; - value: QueryAuthorityResponseAmino; -} /** * QueryAuthorityResponse is the response type for Query/Authority * @@ -379,27 +249,6 @@ export const QueryCurrentPlanRequest = { const message = createBaseQueryCurrentPlanRequest(); return message; }, - fromAmino(_: QueryCurrentPlanRequestAmino): QueryCurrentPlanRequest { - const message = createBaseQueryCurrentPlanRequest(); - return message; - }, - toAmino(_: QueryCurrentPlanRequest): QueryCurrentPlanRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: QueryCurrentPlanRequestAminoMsg, - ): QueryCurrentPlanRequest { - return QueryCurrentPlanRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryCurrentPlanRequest, - ): QueryCurrentPlanRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryCurrentPlanRequest', - value: QueryCurrentPlanRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryCurrentPlanRequestProtoMsg, ): QueryCurrentPlanRequest { @@ -475,31 +324,6 @@ export const QueryCurrentPlanResponse = { : undefined; return message; }, - fromAmino(object: QueryCurrentPlanResponseAmino): QueryCurrentPlanResponse { - const message = createBaseQueryCurrentPlanResponse(); - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromAmino(object.plan); - } - return message; - }, - toAmino(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAmino { - const obj: any = {}; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; - return obj; - }, - fromAminoMsg( - object: QueryCurrentPlanResponseAminoMsg, - ): QueryCurrentPlanResponse { - return QueryCurrentPlanResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryCurrentPlanResponse, - ): QueryCurrentPlanResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryCurrentPlanResponse', - value: QueryCurrentPlanResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryCurrentPlanResponseProtoMsg, ): QueryCurrentPlanResponse { @@ -571,31 +395,6 @@ export const QueryAppliedPlanRequest = { message.name = object.name ?? ''; return message; }, - fromAmino(object: QueryAppliedPlanRequestAmino): QueryAppliedPlanRequest { - const message = createBaseQueryAppliedPlanRequest(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - return message; - }, - toAmino(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - return obj; - }, - fromAminoMsg( - object: QueryAppliedPlanRequestAminoMsg, - ): QueryAppliedPlanRequest { - return QueryAppliedPlanRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAppliedPlanRequest, - ): QueryAppliedPlanRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAppliedPlanRequest', - value: QueryAppliedPlanRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryAppliedPlanRequestProtoMsg, ): QueryAppliedPlanRequest { @@ -673,32 +472,6 @@ export const QueryAppliedPlanResponse = { : BigInt(0); return message; }, - fromAmino(object: QueryAppliedPlanResponseAmino): QueryAppliedPlanResponse { - const message = createBaseQueryAppliedPlanResponse(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - return message; - }, - toAmino(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - return obj; - }, - fromAminoMsg( - object: QueryAppliedPlanResponseAminoMsg, - ): QueryAppliedPlanResponse { - return QueryAppliedPlanResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryAppliedPlanResponse, - ): QueryAppliedPlanResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAppliedPlanResponse', - value: QueryAppliedPlanResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAppliedPlanResponseProtoMsg, ): QueryAppliedPlanResponse { @@ -776,38 +549,6 @@ export const QueryUpgradedConsensusStateRequest = { : BigInt(0); return message; }, - fromAmino( - object: QueryUpgradedConsensusStateRequestAmino, - ): QueryUpgradedConsensusStateRequest { - const message = createBaseQueryUpgradedConsensusStateRequest(); - if (object.last_height !== undefined && object.last_height !== null) { - message.lastHeight = BigInt(object.last_height); - } - return message; - }, - toAmino( - message: QueryUpgradedConsensusStateRequest, - ): QueryUpgradedConsensusStateRequestAmino { - const obj: any = {}; - obj.last_height = - message.lastHeight !== BigInt(0) - ? message.lastHeight.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryUpgradedConsensusStateRequestAminoMsg, - ): QueryUpgradedConsensusStateRequest { - return QueryUpgradedConsensusStateRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryUpgradedConsensusStateRequest, - ): QueryUpgradedConsensusStateRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryUpgradedConsensusStateRequest', - value: QueryUpgradedConsensusStateRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryUpgradedConsensusStateRequestProtoMsg, ): QueryUpgradedConsensusStateRequest { @@ -887,42 +628,6 @@ export const QueryUpgradedConsensusStateResponse = { object.upgradedConsensusState ?? new Uint8Array(); return message; }, - fromAmino( - object: QueryUpgradedConsensusStateResponseAmino, - ): QueryUpgradedConsensusStateResponse { - const message = createBaseQueryUpgradedConsensusStateResponse(); - if ( - object.upgraded_consensus_state !== undefined && - object.upgraded_consensus_state !== null - ) { - message.upgradedConsensusState = bytesFromBase64( - object.upgraded_consensus_state, - ); - } - return message; - }, - toAmino( - message: QueryUpgradedConsensusStateResponse, - ): QueryUpgradedConsensusStateResponseAmino { - const obj: any = {}; - obj.upgraded_consensus_state = message.upgradedConsensusState - ? base64FromBytes(message.upgradedConsensusState) - : undefined; - return obj; - }, - fromAminoMsg( - object: QueryUpgradedConsensusStateResponseAminoMsg, - ): QueryUpgradedConsensusStateResponse { - return QueryUpgradedConsensusStateResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryUpgradedConsensusStateResponse, - ): QueryUpgradedConsensusStateResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryUpgradedConsensusStateResponse', - value: QueryUpgradedConsensusStateResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryUpgradedConsensusStateResponseProtoMsg, ): QueryUpgradedConsensusStateResponse { @@ -994,36 +699,6 @@ export const QueryModuleVersionsRequest = { message.moduleName = object.moduleName ?? ''; return message; }, - fromAmino( - object: QueryModuleVersionsRequestAmino, - ): QueryModuleVersionsRequest { - const message = createBaseQueryModuleVersionsRequest(); - if (object.module_name !== undefined && object.module_name !== null) { - message.moduleName = object.module_name; - } - return message; - }, - toAmino( - message: QueryModuleVersionsRequest, - ): QueryModuleVersionsRequestAmino { - const obj: any = {}; - obj.module_name = - message.moduleName === '' ? undefined : message.moduleName; - return obj; - }, - fromAminoMsg( - object: QueryModuleVersionsRequestAminoMsg, - ): QueryModuleVersionsRequest { - return QueryModuleVersionsRequest.fromAmino(object.value); - }, - toAminoMsg( - message: QueryModuleVersionsRequest, - ): QueryModuleVersionsRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryModuleVersionsRequest', - value: QueryModuleVersionsRequest.toAmino(message), - }; - }, fromProtoMsg( message: QueryModuleVersionsRequestProtoMsg, ): QueryModuleVersionsRequest { @@ -1106,40 +781,6 @@ export const QueryModuleVersionsResponse = { object.moduleVersions?.map(e => ModuleVersion.fromPartial(e)) || []; return message; }, - fromAmino( - object: QueryModuleVersionsResponseAmino, - ): QueryModuleVersionsResponse { - const message = createBaseQueryModuleVersionsResponse(); - message.moduleVersions = - object.module_versions?.map(e => ModuleVersion.fromAmino(e)) || []; - return message; - }, - toAmino( - message: QueryModuleVersionsResponse, - ): QueryModuleVersionsResponseAmino { - const obj: any = {}; - if (message.moduleVersions) { - obj.module_versions = message.moduleVersions.map(e => - e ? ModuleVersion.toAmino(e) : undefined, - ); - } else { - obj.module_versions = message.moduleVersions; - } - return obj; - }, - fromAminoMsg( - object: QueryModuleVersionsResponseAminoMsg, - ): QueryModuleVersionsResponse { - return QueryModuleVersionsResponse.fromAmino(object.value); - }, - toAminoMsg( - message: QueryModuleVersionsResponse, - ): QueryModuleVersionsResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryModuleVersionsResponse', - value: QueryModuleVersionsResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryModuleVersionsResponseProtoMsg, ): QueryModuleVersionsResponse { @@ -1197,23 +838,6 @@ export const QueryAuthorityRequest = { const message = createBaseQueryAuthorityRequest(); return message; }, - fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { - const message = createBaseQueryAuthorityRequest(); - return message; - }, - toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: QueryAuthorityRequestAminoMsg): QueryAuthorityRequest { - return QueryAuthorityRequest.fromAmino(object.value); - }, - toAminoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestAminoMsg { - return { - type: 'cosmos-sdk/QueryAuthorityRequest', - value: QueryAuthorityRequest.toAmino(message), - }; - }, fromProtoMsg(message: QueryAuthorityRequestProtoMsg): QueryAuthorityRequest { return QueryAuthorityRequest.decode(message.value); }, @@ -1279,27 +903,6 @@ export const QueryAuthorityResponse = { message.address = object.address ?? ''; return message; }, - fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { - const message = createBaseQueryAuthorityResponse(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - return message; - }, - toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - return obj; - }, - fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { - return QueryAuthorityResponse.fromAmino(object.value); - }, - toAminoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseAminoMsg { - return { - type: 'cosmos-sdk/QueryAuthorityResponse', - value: QueryAuthorityResponse.toAmino(message), - }; - }, fromProtoMsg( message: QueryAuthorityResponseProtoMsg, ): QueryAuthorityResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts deleted file mode 100644 index 7f151d8f475..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts +++ /dev/null @@ -1,14 +0,0 @@ -//@ts-nocheck -import { MsgSoftwareUpgrade, MsgCancelUpgrade } from './tx.js'; -export const AminoConverter = { - '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade': { - aminoType: 'cosmos-sdk/MsgSoftwareUpgrade', - toAmino: MsgSoftwareUpgrade.toAmino, - fromAmino: MsgSoftwareUpgrade.fromAmino, - }, - '/cosmos.upgrade.v1beta1.MsgCancelUpgrade': { - aminoType: 'cosmos-sdk/MsgCancelUpgrade', - toAmino: MsgCancelUpgrade.toAmino, - fromAmino: MsgCancelUpgrade.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts deleted file mode 100644 index e55ead4e0b5..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts +++ /dev/null @@ -1,84 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { MsgSoftwareUpgrade, MsgCancelUpgrade } from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', MsgSoftwareUpgrade], - ['/cosmos.upgrade.v1beta1.MsgCancelUpgrade', MsgCancelUpgrade], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - softwareUpgrade(value: MsgSoftwareUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', - value: MsgSoftwareUpgrade.encode(value).finish(), - }; - }, - cancelUpgrade(value: MsgCancelUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', - value: MsgCancelUpgrade.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - softwareUpgrade(value: MsgSoftwareUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', - value, - }; - }, - cancelUpgrade(value: MsgCancelUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', - value, - }; - }, - }, - toJSON: { - softwareUpgrade(value: MsgSoftwareUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', - value: MsgSoftwareUpgrade.toJSON(value), - }; - }, - cancelUpgrade(value: MsgCancelUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', - value: MsgCancelUpgrade.toJSON(value), - }; - }, - }, - fromJSON: { - softwareUpgrade(value: any) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', - value: MsgSoftwareUpgrade.fromJSON(value), - }; - }, - cancelUpgrade(value: any) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', - value: MsgCancelUpgrade.fromJSON(value), - }; - }, - }, - fromPartial: { - softwareUpgrade(value: MsgSoftwareUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade', - value: MsgSoftwareUpgrade.fromPartial(value), - }; - }, - cancelUpgrade(value: MsgCancelUpgrade) { - return { - typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade', - value: MsgCancelUpgrade.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 6a151eb7467..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,59 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgSoftwareUpgrade, - MsgSoftwareUpgradeResponse, - MsgCancelUpgrade, - MsgCancelUpgradeResponse, -} from './tx.js'; -/** Msg defines the upgrade Msg service. */ -export interface Msg { - /** - * SoftwareUpgrade is a governance operation for initiating a software upgrade. - * - * Since: cosmos-sdk 0.46 - */ - softwareUpgrade( - request: MsgSoftwareUpgrade, - ): Promise; - /** - * CancelUpgrade is a governance operation for cancelling a previously - * approvid software upgrade. - * - * Since: cosmos-sdk 0.46 - */ - cancelUpgrade(request: MsgCancelUpgrade): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.softwareUpgrade = this.softwareUpgrade.bind(this); - this.cancelUpgrade = this.cancelUpgrade.bind(this); - } - softwareUpgrade( - request: MsgSoftwareUpgrade, - ): Promise { - const data = MsgSoftwareUpgrade.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Msg', - 'SoftwareUpgrade', - data, - ); - return promise.then(data => - MsgSoftwareUpgradeResponse.decode(new BinaryReader(data)), - ); - } - cancelUpgrade(request: MsgCancelUpgrade): Promise { - const data = MsgCancelUpgrade.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.upgrade.v1beta1.Msg', - 'CancelUpgrade', - data, - ); - return promise.then(data => - MsgCancelUpgradeResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.ts index 14b9379e688..de82fe96575 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Plan, PlanAmino, PlanSDKType } from './upgrade.js'; +import { Plan, PlanSDKType } from './upgrade.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -17,21 +17,6 @@ export interface MsgSoftwareUpgradeProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade'; value: Uint8Array; } -/** - * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. - * - * Since: cosmos-sdk 0.46 - */ -export interface MsgSoftwareUpgradeAmino { - /** authority is the address of the governance account. */ - authority?: string; - /** plan is the upgrade plan. */ - plan?: PlanAmino; -} -export interface MsgSoftwareUpgradeAminoMsg { - type: 'cosmos-sdk/MsgSoftwareUpgrade'; - value: MsgSoftwareUpgradeAmino; -} /** * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. * @@ -51,16 +36,6 @@ export interface MsgSoftwareUpgradeResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse'; value: Uint8Array; } -/** - * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. - * - * Since: cosmos-sdk 0.46 - */ -export interface MsgSoftwareUpgradeResponseAmino {} -export interface MsgSoftwareUpgradeResponseAminoMsg { - type: 'cosmos-sdk/MsgSoftwareUpgradeResponse'; - value: MsgSoftwareUpgradeResponseAmino; -} /** * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. * @@ -80,19 +55,6 @@ export interface MsgCancelUpgradeProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgrade'; value: Uint8Array; } -/** - * MsgCancelUpgrade is the Msg/CancelUpgrade request type. - * - * Since: cosmos-sdk 0.46 - */ -export interface MsgCancelUpgradeAmino { - /** authority is the address of the governance account. */ - authority?: string; -} -export interface MsgCancelUpgradeAminoMsg { - type: 'cosmos-sdk/MsgCancelUpgrade'; - value: MsgCancelUpgradeAmino; -} /** * MsgCancelUpgrade is the Msg/CancelUpgrade request type. * @@ -111,16 +73,6 @@ export interface MsgCancelUpgradeResponseProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse'; value: Uint8Array; } -/** - * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. - * - * Since: cosmos-sdk 0.46 - */ -export interface MsgCancelUpgradeResponseAmino {} -export interface MsgCancelUpgradeResponseAminoMsg { - type: 'cosmos-sdk/MsgCancelUpgradeResponse'; - value: MsgCancelUpgradeResponseAmino; -} /** * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. * @@ -193,31 +145,6 @@ export const MsgSoftwareUpgrade = { : undefined; return message; }, - fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { - const message = createBaseMsgSoftwareUpgrade(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromAmino(object.plan); - } - return message; - }, - toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { - const obj: any = {}; - obj.authority = message.authority === '' ? undefined : message.authority; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; - return obj; - }, - fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { - return MsgSoftwareUpgrade.fromAmino(object.value); - }, - toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { - return { - type: 'cosmos-sdk/MsgSoftwareUpgrade', - value: MsgSoftwareUpgrade.toAmino(message), - }; - }, fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { return MsgSoftwareUpgrade.decode(message.value); }, @@ -273,27 +200,6 @@ export const MsgSoftwareUpgradeResponse = { const message = createBaseMsgSoftwareUpgradeResponse(); return message; }, - fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { - const message = createBaseMsgSoftwareUpgradeResponse(); - return message; - }, - toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgSoftwareUpgradeResponseAminoMsg, - ): MsgSoftwareUpgradeResponse { - return MsgSoftwareUpgradeResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgSoftwareUpgradeResponse, - ): MsgSoftwareUpgradeResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgSoftwareUpgradeResponse', - value: MsgSoftwareUpgradeResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgSoftwareUpgradeResponseProtoMsg, ): MsgSoftwareUpgradeResponse { @@ -360,27 +266,6 @@ export const MsgCancelUpgrade = { message.authority = object.authority ?? ''; return message; }, - fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { - const message = createBaseMsgCancelUpgrade(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - return message; - }, - toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { - const obj: any = {}; - obj.authority = message.authority === '' ? undefined : message.authority; - return obj; - }, - fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { - return MsgCancelUpgrade.fromAmino(object.value); - }, - toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { - return { - type: 'cosmos-sdk/MsgCancelUpgrade', - value: MsgCancelUpgrade.toAmino(message), - }; - }, fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { return MsgCancelUpgrade.decode(message.value); }, @@ -434,27 +319,6 @@ export const MsgCancelUpgradeResponse = { const message = createBaseMsgCancelUpgradeResponse(); return message; }, - fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { - const message = createBaseMsgCancelUpgradeResponse(); - return message; - }, - toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgCancelUpgradeResponseAminoMsg, - ): MsgCancelUpgradeResponse { - return MsgCancelUpgradeResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCancelUpgradeResponse, - ): MsgCancelUpgradeResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCancelUpgradeResponse', - value: MsgCancelUpgradeResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCancelUpgradeResponseProtoMsg, ): MsgCancelUpgradeResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index dc8088e0171..5dd005870e6 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,6 +1,6 @@ //@ts-nocheck import { Timestamp } from '../../../google/protobuf/timestamp.js'; -import { Any, AnyAmino, AnySDKType } from '../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../google/protobuf/any.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { toTimestamp, @@ -50,47 +50,6 @@ export interface PlanProtoMsg { value: Uint8Array; } /** Plan specifies information about a planned upgrade and when it should occur. */ -export interface PlanAmino { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ - name?: string; - /** - * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - * has been removed from the SDK. - * If this field is not empty, an error will be thrown. - */ - /** @deprecated */ - time?: string; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height?: string; - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ - info?: string; - /** - * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - * moved to the IBC module in the sub module 02-client. - * If this field is not empty, an error will be thrown. - */ - /** @deprecated */ - upgraded_client_state?: AnyAmino; -} -export interface PlanAminoMsg { - type: 'cosmos-sdk/Plan'; - value: PlanAmino; -} -/** Plan specifies information about a planned upgrade and when it should occur. */ export interface PlanSDKType { name: string; /** @deprecated */ @@ -124,22 +83,6 @@ export interface SoftwareUpgradeProposalProtoMsg { * proposals, see MsgSoftwareUpgrade. */ /** @deprecated */ -export interface SoftwareUpgradeProposalAmino { - title?: string; - description?: string; - plan?: PlanAmino; -} -export interface SoftwareUpgradeProposalAminoMsg { - type: 'cosmos-sdk/SoftwareUpgradeProposal'; - value: SoftwareUpgradeProposalAmino; -} -/** - * SoftwareUpgradeProposal is a gov Content type for initiating a software - * upgrade. - * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov - * proposals, see MsgSoftwareUpgrade. - */ -/** @deprecated */ export interface SoftwareUpgradeProposalSDKType { $typeUrl?: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal'; title: string; @@ -169,21 +112,6 @@ export interface CancelSoftwareUpgradeProposalProtoMsg { * proposals, see MsgCancelUpgrade. */ /** @deprecated */ -export interface CancelSoftwareUpgradeProposalAmino { - title?: string; - description?: string; -} -export interface CancelSoftwareUpgradeProposalAminoMsg { - type: 'cosmos-sdk/CancelSoftwareUpgradeProposal'; - value: CancelSoftwareUpgradeProposalAmino; -} -/** - * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software - * upgrade. - * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov - * proposals, see MsgCancelUpgrade. - */ -/** @deprecated */ export interface CancelSoftwareUpgradeProposalSDKType { $typeUrl?: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal'; title: string; @@ -204,21 +132,6 @@ export interface ModuleVersionProtoMsg { typeUrl: '/cosmos.upgrade.v1beta1.ModuleVersion'; value: Uint8Array; } -/** - * ModuleVersion specifies a module and its consensus version. - * - * Since: cosmos-sdk 0.43 - */ -export interface ModuleVersionAmino { - /** name of the app module */ - name?: string; - /** consensus version of the app module */ - version?: string; -} -export interface ModuleVersionAminoMsg { - type: 'cosmos-sdk/ModuleVersion'; - value: ModuleVersionAmino; -} /** * ModuleVersion specifies a module and its consensus version. * @@ -340,51 +253,6 @@ export const Plan = { : undefined; return message; }, - fromAmino(object: PlanAmino): Plan { - const message = createBasePlan(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.time !== undefined && object.time !== null) { - message.time = fromTimestamp(Timestamp.fromAmino(object.time)); - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); - } - return message; - }, - toAmino(message: Plan): PlanAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.time = message.time - ? Timestamp.toAmino(toTimestamp(message.time)) - : undefined; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.info = message.info === '' ? undefined : message.info; - obj.upgraded_client_state = message.upgradedClientState - ? Any.toAmino(message.upgradedClientState) - : undefined; - return obj; - }, - fromAminoMsg(object: PlanAminoMsg): Plan { - return Plan.fromAmino(object.value); - }, - toAminoMsg(message: Plan): PlanAminoMsg { - return { - type: 'cosmos-sdk/Plan', - value: Plan.toAmino(message), - }; - }, fromProtoMsg(message: PlanProtoMsg): Plan { return Plan.decode(message.value); }, @@ -478,40 +346,6 @@ export const SoftwareUpgradeProposal = { : undefined; return message; }, - fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { - const message = createBaseSoftwareUpgradeProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromAmino(object.plan); - } - return message; - }, - toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; - return obj; - }, - fromAminoMsg( - object: SoftwareUpgradeProposalAminoMsg, - ): SoftwareUpgradeProposal { - return SoftwareUpgradeProposal.fromAmino(object.value); - }, - toAminoMsg( - message: SoftwareUpgradeProposal, - ): SoftwareUpgradeProposalAminoMsg { - return { - type: 'cosmos-sdk/SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.toAmino(message), - }; - }, fromProtoMsg( message: SoftwareUpgradeProposalProtoMsg, ): SoftwareUpgradeProposal { @@ -595,40 +429,6 @@ export const CancelSoftwareUpgradeProposal = { message.description = object.description ?? ''; return message; }, - fromAmino( - object: CancelSoftwareUpgradeProposalAmino, - ): CancelSoftwareUpgradeProposal { - const message = createBaseCancelSoftwareUpgradeProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - return message; - }, - toAmino( - message: CancelSoftwareUpgradeProposal, - ): CancelSoftwareUpgradeProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - return obj; - }, - fromAminoMsg( - object: CancelSoftwareUpgradeProposalAminoMsg, - ): CancelSoftwareUpgradeProposal { - return CancelSoftwareUpgradeProposal.fromAmino(object.value); - }, - toAminoMsg( - message: CancelSoftwareUpgradeProposal, - ): CancelSoftwareUpgradeProposalAminoMsg { - return { - type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.toAmino(message), - }; - }, fromProtoMsg( message: CancelSoftwareUpgradeProposalProtoMsg, ): CancelSoftwareUpgradeProposal { @@ -711,32 +511,6 @@ export const ModuleVersion = { : BigInt(0); return message; }, - fromAmino(object: ModuleVersionAmino): ModuleVersion { - const message = createBaseModuleVersion(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.version !== undefined && object.version !== null) { - message.version = BigInt(object.version); - } - return message; - }, - toAmino(message: ModuleVersion): ModuleVersionAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.version = - message.version !== BigInt(0) ? message.version.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { - return ModuleVersion.fromAmino(object.value); - }, - toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { - return { - type: 'cosmos-sdk/ModuleVersion', - value: ModuleVersion.toAmino(message), - }; - }, fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { return ModuleVersion.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts deleted file mode 100644 index 5b8d6dc34ea..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts +++ /dev/null @@ -1,23 +0,0 @@ -//@ts-nocheck -import { - MsgCreateVestingAccount, - MsgCreatePermanentLockedAccount, - MsgCreatePeriodicVestingAccount, -} from './tx.js'; -export const AminoConverter = { - '/cosmos.vesting.v1beta1.MsgCreateVestingAccount': { - aminoType: 'cosmos-sdk/MsgCreateVestingAccount', - toAmino: MsgCreateVestingAccount.toAmino, - fromAmino: MsgCreateVestingAccount.fromAmino, - }, - '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount': { - aminoType: 'cosmos-sdk/MsgCreatePermanentLockedAccount', - toAmino: MsgCreatePermanentLockedAccount.toAmino, - fromAmino: MsgCreatePermanentLockedAccount.fromAmino, - }, - '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount': { - aminoType: 'cosmos-sdk/MsgCreatePeriodicVestingAccount', - toAmino: MsgCreatePeriodicVestingAccount.toAmino, - fromAmino: MsgCreatePeriodicVestingAccount.fromAmino, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts deleted file mode 100644 index 6eb3281bb41..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts +++ /dev/null @@ -1,125 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from '@cosmjs/proto-signing'; -import { - MsgCreateVestingAccount, - MsgCreatePermanentLockedAccount, - MsgCreatePeriodicVestingAccount, -} from './tx.js'; -export const registry: ReadonlyArray<[string, GeneratedType]> = [ - ['/cosmos.vesting.v1beta1.MsgCreateVestingAccount', MsgCreateVestingAccount], - [ - '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - MsgCreatePermanentLockedAccount, - ], - [ - '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - MsgCreatePeriodicVestingAccount, - ], -]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - createVestingAccount(value: MsgCreateVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount', - value: MsgCreateVestingAccount.encode(value).finish(), - }; - }, - createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - value: MsgCreatePermanentLockedAccount.encode(value).finish(), - }; - }, - createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - value: MsgCreatePeriodicVestingAccount.encode(value).finish(), - }; - }, - }, - withTypeUrl: { - createVestingAccount(value: MsgCreateVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount', - value, - }; - }, - createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - value, - }; - }, - createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - value, - }; - }, - }, - toJSON: { - createVestingAccount(value: MsgCreateVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount', - value: MsgCreateVestingAccount.toJSON(value), - }; - }, - createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - value: MsgCreatePermanentLockedAccount.toJSON(value), - }; - }, - createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - value: MsgCreatePeriodicVestingAccount.toJSON(value), - }; - }, - }, - fromJSON: { - createVestingAccount(value: any) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount', - value: MsgCreateVestingAccount.fromJSON(value), - }; - }, - createPermanentLockedAccount(value: any) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - value: MsgCreatePermanentLockedAccount.fromJSON(value), - }; - }, - createPeriodicVestingAccount(value: any) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - value: MsgCreatePeriodicVestingAccount.fromJSON(value), - }; - }, - }, - fromPartial: { - createVestingAccount(value: MsgCreateVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount', - value: MsgCreateVestingAccount.fromPartial(value), - }; - }, - createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount', - value: MsgCreatePermanentLockedAccount.fromPartial(value), - }; - }, - createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { - return { - typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount', - value: MsgCreatePeriodicVestingAccount.fromPartial(value), - }; - }, - }, -}; diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts deleted file mode 100644 index 9e0f9c0878d..00000000000 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts +++ /dev/null @@ -1,85 +0,0 @@ -//@ts-nocheck -import { Rpc } from '../../../helpers.js'; -import { BinaryReader } from '../../../binary.js'; -import { - MsgCreateVestingAccount, - MsgCreateVestingAccountResponse, - MsgCreatePermanentLockedAccount, - MsgCreatePermanentLockedAccountResponse, - MsgCreatePeriodicVestingAccount, - MsgCreatePeriodicVestingAccountResponse, -} from './tx.js'; -/** Msg defines the bank Msg service. */ -export interface Msg { - /** - * CreateVestingAccount defines a method that enables creating a vesting - * account. - */ - createVestingAccount( - request: MsgCreateVestingAccount, - ): Promise; - /** - * CreatePermanentLockedAccount defines a method that enables creating a permanent - * locked account. - */ - createPermanentLockedAccount( - request: MsgCreatePermanentLockedAccount, - ): Promise; - /** - * CreatePeriodicVestingAccount defines a method that enables creating a - * periodic vesting account. - */ - createPeriodicVestingAccount( - request: MsgCreatePeriodicVestingAccount, - ): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createVestingAccount = this.createVestingAccount.bind(this); - this.createPermanentLockedAccount = - this.createPermanentLockedAccount.bind(this); - this.createPeriodicVestingAccount = - this.createPeriodicVestingAccount.bind(this); - } - createVestingAccount( - request: MsgCreateVestingAccount, - ): Promise { - const data = MsgCreateVestingAccount.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.vesting.v1beta1.Msg', - 'CreateVestingAccount', - data, - ); - return promise.then(data => - MsgCreateVestingAccountResponse.decode(new BinaryReader(data)), - ); - } - createPermanentLockedAccount( - request: MsgCreatePermanentLockedAccount, - ): Promise { - const data = MsgCreatePermanentLockedAccount.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.vesting.v1beta1.Msg', - 'CreatePermanentLockedAccount', - data, - ); - return promise.then(data => - MsgCreatePermanentLockedAccountResponse.decode(new BinaryReader(data)), - ); - } - createPeriodicVestingAccount( - request: MsgCreatePeriodicVestingAccount, - ): Promise { - const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); - const promise = this.rpc.request( - 'cosmos.vesting.v1beta1.Msg', - 'CreatePeriodicVestingAccount', - data, - ); - return promise.then(data => - MsgCreatePeriodicVestingAccountResponse.decode(new BinaryReader(data)), - ); - } -} diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts index aa1d0d08d92..fb263a84747 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/tx.ts @@ -1,6 +1,6 @@ //@ts-nocheck -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; -import { Period, PeriodAmino, PeriodSDKType } from './vesting.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { Period, PeriodSDKType } from './vesting.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -18,21 +18,6 @@ export interface MsgCreateVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreateVestingAccount'; value: Uint8Array; } -/** - * MsgCreateVestingAccount defines a message that enables creating a vesting - * account. - */ -export interface MsgCreateVestingAccountAmino { - from_address?: string; - to_address?: string; - amount?: CoinAmino[]; - end_time?: string; - delayed?: boolean; -} -export interface MsgCreateVestingAccountAminoMsg { - type: 'cosmos-sdk/MsgCreateVestingAccount'; - value: MsgCreateVestingAccountAmino; -} /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. @@ -51,12 +36,6 @@ export interface MsgCreateVestingAccountResponseProtoMsg { value: Uint8Array; } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ -export interface MsgCreateVestingAccountResponseAmino {} -export interface MsgCreateVestingAccountResponseAminoMsg { - type: 'cosmos-sdk/MsgCreateVestingAccountResponse'; - value: MsgCreateVestingAccountResponseAmino; -} -/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ export interface MsgCreateVestingAccountResponseSDKType {} /** * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent @@ -71,19 +50,6 @@ export interface MsgCreatePermanentLockedAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount'; value: Uint8Array; } -/** - * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent - * locked account. - */ -export interface MsgCreatePermanentLockedAccountAmino { - from_address?: string; - to_address?: string; - amount?: CoinAmino[]; -} -export interface MsgCreatePermanentLockedAccountAminoMsg { - type: 'cosmos-sdk/MsgCreatePermanentLockedAccount'; - value: MsgCreatePermanentLockedAccountAmino; -} /** * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent * locked account. @@ -100,12 +66,6 @@ export interface MsgCreatePermanentLockedAccountResponseProtoMsg { value: Uint8Array; } /** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ -export interface MsgCreatePermanentLockedAccountResponseAmino {} -export interface MsgCreatePermanentLockedAccountResponseAminoMsg { - type: 'cosmos-sdk/MsgCreatePermanentLockedAccountResponse'; - value: MsgCreatePermanentLockedAccountResponseAmino; -} -/** MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. */ export interface MsgCreatePermanentLockedAccountResponseSDKType {} /** * MsgCreateVestingAccount defines a message that enables creating a vesting @@ -121,20 +81,6 @@ export interface MsgCreatePeriodicVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount'; value: Uint8Array; } -/** - * MsgCreateVestingAccount defines a message that enables creating a vesting - * account. - */ -export interface MsgCreatePeriodicVestingAccountAmino { - from_address?: string; - to_address?: string; - start_time?: string; - vesting_periods?: PeriodAmino[]; -} -export interface MsgCreatePeriodicVestingAccountAminoMsg { - type: 'cosmos-sdk/MsgCreatePeriodicVestingAccount'; - value: MsgCreatePeriodicVestingAccountAmino; -} /** * MsgCreateVestingAccount defines a message that enables creating a vesting * account. @@ -154,15 +100,6 @@ export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse'; value: Uint8Array; } -/** - * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount - * response type. - */ -export interface MsgCreatePeriodicVestingAccountResponseAmino {} -export interface MsgCreatePeriodicVestingAccountResponseAminoMsg { - type: 'cosmos-sdk/MsgCreatePeriodicVestingAccountResponse'; - value: MsgCreatePeriodicVestingAccountResponseAmino; -} /** * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount * response type. @@ -275,51 +212,6 @@ export const MsgCreateVestingAccount = { message.delayed = object.delayed ?? false; return message; }, - fromAmino(object: MsgCreateVestingAccountAmino): MsgCreateVestingAccount { - const message = createBaseMsgCreateVestingAccount(); - if (object.from_address !== undefined && object.from_address !== null) { - message.fromAddress = object.from_address; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.toAddress = object.to_address; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - if (object.end_time !== undefined && object.end_time !== null) { - message.endTime = BigInt(object.end_time); - } - if (object.delayed !== undefined && object.delayed !== null) { - message.delayed = object.delayed; - } - return message; - }, - toAmino(message: MsgCreateVestingAccount): MsgCreateVestingAccountAmino { - const obj: any = {}; - obj.from_address = - message.fromAddress === '' ? undefined : message.fromAddress; - obj.to_address = message.toAddress === '' ? undefined : message.toAddress; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - obj.end_time = - message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; - obj.delayed = message.delayed === false ? undefined : message.delayed; - return obj; - }, - fromAminoMsg( - object: MsgCreateVestingAccountAminoMsg, - ): MsgCreateVestingAccount { - return MsgCreateVestingAccount.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateVestingAccount, - ): MsgCreateVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateVestingAccount', - value: MsgCreateVestingAccount.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateVestingAccountProtoMsg, ): MsgCreateVestingAccount { @@ -379,31 +271,6 @@ export const MsgCreateVestingAccountResponse = { const message = createBaseMsgCreateVestingAccountResponse(); return message; }, - fromAmino( - _: MsgCreateVestingAccountResponseAmino, - ): MsgCreateVestingAccountResponse { - const message = createBaseMsgCreateVestingAccountResponse(); - return message; - }, - toAmino( - _: MsgCreateVestingAccountResponse, - ): MsgCreateVestingAccountResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgCreateVestingAccountResponseAminoMsg, - ): MsgCreateVestingAccountResponse { - return MsgCreateVestingAccountResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreateVestingAccountResponse, - ): MsgCreateVestingAccountResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreateVestingAccountResponse', - value: MsgCreateVestingAccountResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreateVestingAccountResponseProtoMsg, ): MsgCreateVestingAccountResponse { @@ -502,46 +369,6 @@ export const MsgCreatePermanentLockedAccount = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino( - object: MsgCreatePermanentLockedAccountAmino, - ): MsgCreatePermanentLockedAccount { - const message = createBaseMsgCreatePermanentLockedAccount(); - if (object.from_address !== undefined && object.from_address !== null) { - message.fromAddress = object.from_address; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.toAddress = object.to_address; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino( - message: MsgCreatePermanentLockedAccount, - ): MsgCreatePermanentLockedAccountAmino { - const obj: any = {}; - obj.from_address = - message.fromAddress === '' ? undefined : message.fromAddress; - obj.to_address = message.toAddress === '' ? undefined : message.toAddress; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg( - object: MsgCreatePermanentLockedAccountAminoMsg, - ): MsgCreatePermanentLockedAccount { - return MsgCreatePermanentLockedAccount.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreatePermanentLockedAccount, - ): MsgCreatePermanentLockedAccountAminoMsg { - return { - type: 'cosmos-sdk/MsgCreatePermanentLockedAccount', - value: MsgCreatePermanentLockedAccount.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreatePermanentLockedAccountProtoMsg, ): MsgCreatePermanentLockedAccount { @@ -601,31 +428,6 @@ export const MsgCreatePermanentLockedAccountResponse = { const message = createBaseMsgCreatePermanentLockedAccountResponse(); return message; }, - fromAmino( - _: MsgCreatePermanentLockedAccountResponseAmino, - ): MsgCreatePermanentLockedAccountResponse { - const message = createBaseMsgCreatePermanentLockedAccountResponse(); - return message; - }, - toAmino( - _: MsgCreatePermanentLockedAccountResponse, - ): MsgCreatePermanentLockedAccountResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgCreatePermanentLockedAccountResponseAminoMsg, - ): MsgCreatePermanentLockedAccountResponse { - return MsgCreatePermanentLockedAccountResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreatePermanentLockedAccountResponse, - ): MsgCreatePermanentLockedAccountResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreatePermanentLockedAccountResponse', - value: MsgCreatePermanentLockedAccountResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreatePermanentLockedAccountResponseProtoMsg, ): MsgCreatePermanentLockedAccountResponse { @@ -744,56 +546,6 @@ export const MsgCreatePeriodicVestingAccount = { object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; return message; }, - fromAmino( - object: MsgCreatePeriodicVestingAccountAmino, - ): MsgCreatePeriodicVestingAccount { - const message = createBaseMsgCreatePeriodicVestingAccount(); - if (object.from_address !== undefined && object.from_address !== null) { - message.fromAddress = object.from_address; - } - if (object.to_address !== undefined && object.to_address !== null) { - message.toAddress = object.to_address; - } - if (object.start_time !== undefined && object.start_time !== null) { - message.startTime = BigInt(object.start_time); - } - message.vestingPeriods = - object.vesting_periods?.map(e => Period.fromAmino(e)) || []; - return message; - }, - toAmino( - message: MsgCreatePeriodicVestingAccount, - ): MsgCreatePeriodicVestingAccountAmino { - const obj: any = {}; - obj.from_address = - message.fromAddress === '' ? undefined : message.fromAddress; - obj.to_address = message.toAddress === '' ? undefined : message.toAddress; - obj.start_time = - message.startTime !== BigInt(0) - ? message.startTime.toString() - : undefined; - if (message.vestingPeriods) { - obj.vesting_periods = message.vestingPeriods.map(e => - e ? Period.toAmino(e) : undefined, - ); - } else { - obj.vesting_periods = message.vestingPeriods; - } - return obj; - }, - fromAminoMsg( - object: MsgCreatePeriodicVestingAccountAminoMsg, - ): MsgCreatePeriodicVestingAccount { - return MsgCreatePeriodicVestingAccount.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreatePeriodicVestingAccount, - ): MsgCreatePeriodicVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/MsgCreatePeriodicVestingAccount', - value: MsgCreatePeriodicVestingAccount.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreatePeriodicVestingAccountProtoMsg, ): MsgCreatePeriodicVestingAccount { @@ -853,31 +605,6 @@ export const MsgCreatePeriodicVestingAccountResponse = { const message = createBaseMsgCreatePeriodicVestingAccountResponse(); return message; }, - fromAmino( - _: MsgCreatePeriodicVestingAccountResponseAmino, - ): MsgCreatePeriodicVestingAccountResponse { - const message = createBaseMsgCreatePeriodicVestingAccountResponse(); - return message; - }, - toAmino( - _: MsgCreatePeriodicVestingAccountResponse, - ): MsgCreatePeriodicVestingAccountResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg( - object: MsgCreatePeriodicVestingAccountResponseAminoMsg, - ): MsgCreatePeriodicVestingAccountResponse { - return MsgCreatePeriodicVestingAccountResponse.fromAmino(object.value); - }, - toAminoMsg( - message: MsgCreatePeriodicVestingAccountResponse, - ): MsgCreatePeriodicVestingAccountResponseAminoMsg { - return { - type: 'cosmos-sdk/MsgCreatePeriodicVestingAccountResponse', - value: MsgCreatePeriodicVestingAccountResponse.toAmino(message), - }; - }, fromProtoMsg( message: MsgCreatePeriodicVestingAccountResponseProtoMsg, ): MsgCreatePeriodicVestingAccountResponse { diff --git a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts index 03f2df8df14..e8d40a269a3 100644 --- a/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts +++ b/packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts @@ -1,10 +1,6 @@ //@ts-nocheck -import { - BaseAccount, - BaseAccountAmino, - BaseAccountSDKType, -} from '../../auth/v1beta1/auth.js'; -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin.js'; +import { BaseAccount, BaseAccountSDKType } from '../../auth/v1beta1/auth.js'; +import { Coin, CoinSDKType } from '../../base/v1beta1/coin.js'; import { BinaryReader, BinaryWriter } from '../../../binary.js'; import { isSet } from '../../../helpers.js'; /** @@ -22,21 +18,6 @@ export interface BaseVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.BaseVestingAccount'; value: Uint8Array; } -/** - * BaseVestingAccount implements the VestingAccount interface. It contains all - * the necessary fields needed for any vesting account implementation. - */ -export interface BaseVestingAccountAmino { - base_account?: BaseAccountAmino; - original_vesting?: CoinAmino[]; - delegated_free?: CoinAmino[]; - delegated_vesting?: CoinAmino[]; - end_time?: string; -} -export interface BaseVestingAccountAminoMsg { - type: 'cosmos-sdk/BaseVestingAccount'; - value: BaseVestingAccountAmino; -} /** * BaseVestingAccount implements the VestingAccount interface. It contains all * the necessary fields needed for any vesting account implementation. @@ -60,18 +41,6 @@ export interface ContinuousVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.ContinuousVestingAccount'; value: Uint8Array; } -/** - * ContinuousVestingAccount implements the VestingAccount interface. It - * continuously vests by unlocking coins linearly with respect to time. - */ -export interface ContinuousVestingAccountAmino { - base_vesting_account?: BaseVestingAccountAmino; - start_time?: string; -} -export interface ContinuousVestingAccountAminoMsg { - type: 'cosmos-sdk/ContinuousVestingAccount'; - value: ContinuousVestingAccountAmino; -} /** * ContinuousVestingAccount implements the VestingAccount interface. It * continuously vests by unlocking coins linearly with respect to time. @@ -92,18 +61,6 @@ export interface DelayedVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.DelayedVestingAccount'; value: Uint8Array; } -/** - * DelayedVestingAccount implements the VestingAccount interface. It vests all - * coins after a specific time, but non prior. In other words, it keeps them - * locked until a specified time. - */ -export interface DelayedVestingAccountAmino { - base_vesting_account?: BaseVestingAccountAmino; -} -export interface DelayedVestingAccountAminoMsg { - type: 'cosmos-sdk/DelayedVestingAccount'; - value: DelayedVestingAccountAmino; -} /** * DelayedVestingAccount implements the VestingAccount interface. It vests all * coins after a specific time, but non prior. In other words, it keeps them @@ -122,15 +79,6 @@ export interface PeriodProtoMsg { value: Uint8Array; } /** Period defines a length of time and amount of coins that will vest. */ -export interface PeriodAmino { - length?: string; - amount?: CoinAmino[]; -} -export interface PeriodAminoMsg { - type: 'cosmos-sdk/Period'; - value: PeriodAmino; -} -/** Period defines a length of time and amount of coins that will vest. */ export interface PeriodSDKType { length: bigint; amount: CoinSDKType[]; @@ -148,19 +96,6 @@ export interface PeriodicVestingAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.PeriodicVestingAccount'; value: Uint8Array; } -/** - * PeriodicVestingAccount implements the VestingAccount interface. It - * periodically vests by unlocking coins during each specified period. - */ -export interface PeriodicVestingAccountAmino { - base_vesting_account?: BaseVestingAccountAmino; - start_time?: string; - vesting_periods?: PeriodAmino[]; -} -export interface PeriodicVestingAccountAminoMsg { - type: 'cosmos-sdk/PeriodicVestingAccount'; - value: PeriodicVestingAccountAmino; -} /** * PeriodicVestingAccount implements the VestingAccount interface. It * periodically vests by unlocking coins during each specified period. @@ -184,20 +119,6 @@ export interface PermanentLockedAccountProtoMsg { typeUrl: '/cosmos.vesting.v1beta1.PermanentLockedAccount'; value: Uint8Array; } -/** - * PermanentLockedAccount implements the VestingAccount interface. It does - * not ever release coins, locking them indefinitely. Coins in this account can - * still be used for delegating and for governance votes even while locked. - * - * Since: cosmos-sdk 0.43 - */ -export interface PermanentLockedAccountAmino { - base_vesting_account?: BaseVestingAccountAmino; -} -export interface PermanentLockedAccountAminoMsg { - type: 'cosmos-sdk/PermanentLockedAccount'; - value: PermanentLockedAccountAmino; -} /** * PermanentLockedAccount implements the VestingAccount interface. It does * not ever release coins, locking them indefinitely. Coins in this account can @@ -344,61 +265,6 @@ export const BaseVestingAccount = { : BigInt(0); return message; }, - fromAmino(object: BaseVestingAccountAmino): BaseVestingAccount { - const message = createBaseBaseVestingAccount(); - if (object.base_account !== undefined && object.base_account !== null) { - message.baseAccount = BaseAccount.fromAmino(object.base_account); - } - message.originalVesting = - object.original_vesting?.map(e => Coin.fromAmino(e)) || []; - message.delegatedFree = - object.delegated_free?.map(e => Coin.fromAmino(e)) || []; - message.delegatedVesting = - object.delegated_vesting?.map(e => Coin.fromAmino(e)) || []; - if (object.end_time !== undefined && object.end_time !== null) { - message.endTime = BigInt(object.end_time); - } - return message; - }, - toAmino(message: BaseVestingAccount): BaseVestingAccountAmino { - const obj: any = {}; - obj.base_account = message.baseAccount - ? BaseAccount.toAmino(message.baseAccount) - : undefined; - if (message.originalVesting) { - obj.original_vesting = message.originalVesting.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.original_vesting = message.originalVesting; - } - if (message.delegatedFree) { - obj.delegated_free = message.delegatedFree.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.delegated_free = message.delegatedFree; - } - if (message.delegatedVesting) { - obj.delegated_vesting = message.delegatedVesting.map(e => - e ? Coin.toAmino(e) : undefined, - ); - } else { - obj.delegated_vesting = message.delegatedVesting; - } - obj.end_time = - message.endTime !== BigInt(0) ? message.endTime.toString() : undefined; - return obj; - }, - fromAminoMsg(object: BaseVestingAccountAminoMsg): BaseVestingAccount { - return BaseVestingAccount.fromAmino(object.value); - }, - toAminoMsg(message: BaseVestingAccount): BaseVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/BaseVestingAccount', - value: BaseVestingAccount.toAmino(message), - }; - }, fromProtoMsg(message: BaseVestingAccountProtoMsg): BaseVestingAccount { return BaseVestingAccount.decode(message.value); }, @@ -497,45 +363,6 @@ export const ContinuousVestingAccount = { : BigInt(0); return message; }, - fromAmino(object: ContinuousVestingAccountAmino): ContinuousVestingAccount { - const message = createBaseContinuousVestingAccount(); - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.baseVestingAccount = BaseVestingAccount.fromAmino( - object.base_vesting_account, - ); - } - if (object.start_time !== undefined && object.start_time !== null) { - message.startTime = BigInt(object.start_time); - } - return message; - }, - toAmino(message: ContinuousVestingAccount): ContinuousVestingAccountAmino { - const obj: any = {}; - obj.base_vesting_account = message.baseVestingAccount - ? BaseVestingAccount.toAmino(message.baseVestingAccount) - : undefined; - obj.start_time = - message.startTime !== BigInt(0) - ? message.startTime.toString() - : undefined; - return obj; - }, - fromAminoMsg( - object: ContinuousVestingAccountAminoMsg, - ): ContinuousVestingAccount { - return ContinuousVestingAccount.fromAmino(object.value); - }, - toAminoMsg( - message: ContinuousVestingAccount, - ): ContinuousVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/ContinuousVestingAccount', - value: ContinuousVestingAccount.toAmino(message), - }; - }, fromProtoMsg( message: ContinuousVestingAccountProtoMsg, ): ContinuousVestingAccount { @@ -620,34 +447,6 @@ export const DelayedVestingAccount = { : undefined; return message; }, - fromAmino(object: DelayedVestingAccountAmino): DelayedVestingAccount { - const message = createBaseDelayedVestingAccount(); - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.baseVestingAccount = BaseVestingAccount.fromAmino( - object.base_vesting_account, - ); - } - return message; - }, - toAmino(message: DelayedVestingAccount): DelayedVestingAccountAmino { - const obj: any = {}; - obj.base_vesting_account = message.baseVestingAccount - ? BaseVestingAccount.toAmino(message.baseVestingAccount) - : undefined; - return obj; - }, - fromAminoMsg(object: DelayedVestingAccountAminoMsg): DelayedVestingAccount { - return DelayedVestingAccount.fromAmino(object.value); - }, - toAminoMsg(message: DelayedVestingAccount): DelayedVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/DelayedVestingAccount', - value: DelayedVestingAccount.toAmino(message), - }; - }, fromProtoMsg(message: DelayedVestingAccountProtoMsg): DelayedVestingAccount { return DelayedVestingAccount.decode(message.value); }, @@ -732,34 +531,6 @@ export const Period = { message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: PeriodAmino): Period { - const message = createBasePeriod(); - if (object.length !== undefined && object.length !== null) { - message.length = BigInt(object.length); - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: Period): PeriodAmino { - const obj: any = {}; - obj.length = - message.length !== BigInt(0) ? message.length.toString() : undefined; - if (message.amount) { - obj.amount = message.amount.map(e => (e ? Coin.toAmino(e) : undefined)); - } else { - obj.amount = message.amount; - } - return obj; - }, - fromAminoMsg(object: PeriodAminoMsg): Period { - return Period.fromAmino(object.value); - }, - toAminoMsg(message: Period): PeriodAminoMsg { - return { - type: 'cosmos-sdk/Period', - value: Period.toAmino(message), - }; - }, fromProtoMsg(message: PeriodProtoMsg): Period { return Period.decode(message.value); }, @@ -875,50 +646,6 @@ export const PeriodicVestingAccount = { object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; return message; }, - fromAmino(object: PeriodicVestingAccountAmino): PeriodicVestingAccount { - const message = createBasePeriodicVestingAccount(); - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.baseVestingAccount = BaseVestingAccount.fromAmino( - object.base_vesting_account, - ); - } - if (object.start_time !== undefined && object.start_time !== null) { - message.startTime = BigInt(object.start_time); - } - message.vestingPeriods = - object.vesting_periods?.map(e => Period.fromAmino(e)) || []; - return message; - }, - toAmino(message: PeriodicVestingAccount): PeriodicVestingAccountAmino { - const obj: any = {}; - obj.base_vesting_account = message.baseVestingAccount - ? BaseVestingAccount.toAmino(message.baseVestingAccount) - : undefined; - obj.start_time = - message.startTime !== BigInt(0) - ? message.startTime.toString() - : undefined; - if (message.vestingPeriods) { - obj.vesting_periods = message.vestingPeriods.map(e => - e ? Period.toAmino(e) : undefined, - ); - } else { - obj.vesting_periods = message.vestingPeriods; - } - return obj; - }, - fromAminoMsg(object: PeriodicVestingAccountAminoMsg): PeriodicVestingAccount { - return PeriodicVestingAccount.fromAmino(object.value); - }, - toAminoMsg(message: PeriodicVestingAccount): PeriodicVestingAccountAminoMsg { - return { - type: 'cosmos-sdk/PeriodicVestingAccount', - value: PeriodicVestingAccount.toAmino(message), - }; - }, fromProtoMsg( message: PeriodicVestingAccountProtoMsg, ): PeriodicVestingAccount { @@ -1001,34 +728,6 @@ export const PermanentLockedAccount = { : undefined; return message; }, - fromAmino(object: PermanentLockedAccountAmino): PermanentLockedAccount { - const message = createBasePermanentLockedAccount(); - if ( - object.base_vesting_account !== undefined && - object.base_vesting_account !== null - ) { - message.baseVestingAccount = BaseVestingAccount.fromAmino( - object.base_vesting_account, - ); - } - return message; - }, - toAmino(message: PermanentLockedAccount): PermanentLockedAccountAmino { - const obj: any = {}; - obj.base_vesting_account = message.baseVestingAccount - ? BaseVestingAccount.toAmino(message.baseVestingAccount) - : undefined; - return obj; - }, - fromAminoMsg(object: PermanentLockedAccountAminoMsg): PermanentLockedAccount { - return PermanentLockedAccount.fromAmino(object.value); - }, - toAminoMsg(message: PermanentLockedAccount): PermanentLockedAccountAminoMsg { - return { - type: 'cosmos-sdk/PermanentLockedAccount', - value: PermanentLockedAccount.toAmino(message), - }; - }, fromProtoMsg( message: PermanentLockedAccountProtoMsg, ): PermanentLockedAccount { diff --git a/packages/cosmic-proto/src/codegen/cosmos_proto/cosmos.ts b/packages/cosmic-proto/src/codegen/cosmos_proto/cosmos.ts index 4bc8dd2aa98..d03ebd95360 100644 --- a/packages/cosmic-proto/src/codegen/cosmos_proto/cosmos.ts +++ b/packages/cosmic-proto/src/codegen/cosmos_proto/cosmos.ts @@ -8,7 +8,6 @@ export enum ScalarType { UNRECOGNIZED = -1, } export const ScalarTypeSDKType = ScalarType; -export const ScalarTypeAmino = ScalarType; export function scalarTypeFromJSON(object: any): ScalarType { switch (object) { case 0: @@ -61,28 +60,6 @@ export interface InterfaceDescriptorProtoMsg { typeUrl: '/cosmos_proto.InterfaceDescriptor'; value: Uint8Array; } -/** - * InterfaceDescriptor describes an interface type to be used with - * accepts_interface and implements_interface and declared by declare_interface. - */ -export interface InterfaceDescriptorAmino { - /** - * name is the name of the interface. It should be a short-name (without - * a period) such that the fully qualified name of the interface will be - * package.name, ex. for the package a.b and interface named C, the - * fully-qualified name will be a.b.C. - */ - name?: string; - /** - * description is a human-readable description of the interface and its - * purpose. - */ - description?: string; -} -export interface InterfaceDescriptorAminoMsg { - type: '/cosmos_proto.InterfaceDescriptor'; - value: InterfaceDescriptorAmino; -} /** * InterfaceDescriptor describes an interface type to be used with * accepts_interface and implements_interface and declared by declare_interface. @@ -126,41 +103,6 @@ export interface ScalarDescriptorProtoMsg { typeUrl: '/cosmos_proto.ScalarDescriptor'; value: Uint8Array; } -/** - * ScalarDescriptor describes an scalar type to be used with - * the scalar field option and declared by declare_scalar. - * Scalars extend simple protobuf built-in types with additional - * syntax and semantics, for instance to represent big integers. - * Scalars should ideally define an encoding such that there is only one - * valid syntactical representation for a given semantic meaning, - * i.e. the encoding should be deterministic. - */ -export interface ScalarDescriptorAmino { - /** - * name is the name of the scalar. It should be a short-name (without - * a period) such that the fully qualified name of the scalar will be - * package.name, ex. for the package a.b and scalar named C, the - * fully-qualified name will be a.b.C. - */ - name?: string; - /** - * description is a human-readable description of the scalar and its - * encoding format. For instance a big integer or decimal scalar should - * specify precisely the expected encoding format. - */ - description?: string; - /** - * field_type is the type of field with which this scalar can be used. - * Scalars can be used with one and only one type of field so that - * encoding standards and simple and clear. Currently only string and - * bytes fields are supported for scalars. - */ - field_type?: ScalarType[]; -} -export interface ScalarDescriptorAminoMsg { - type: '/cosmos_proto.ScalarDescriptor'; - value: ScalarDescriptorAmino; -} /** * ScalarDescriptor describes an scalar type to be used with * the scalar field option and declared by declare_scalar. @@ -238,26 +180,6 @@ export const InterfaceDescriptor = { message.description = object.description ?? ''; return message; }, - fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - const message = createBaseInterfaceDescriptor(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - return message; - }, - toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.description = - message.description === '' ? undefined : message.description; - return obj; - }, - fromAminoMsg(object: InterfaceDescriptorAminoMsg): InterfaceDescriptor { - return InterfaceDescriptor.fromAmino(object.value); - }, fromProtoMsg(message: InterfaceDescriptorProtoMsg): InterfaceDescriptor { return InterfaceDescriptor.decode(message.value); }, @@ -356,32 +278,6 @@ export const ScalarDescriptor = { message.fieldType = object.fieldType?.map(e => e) || []; return message; }, - fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { - const message = createBaseScalarDescriptor(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - message.fieldType = object.field_type?.map(e => e) || []; - return message; - }, - toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.description = - message.description === '' ? undefined : message.description; - if (message.fieldType) { - obj.field_type = message.fieldType.map(e => e); - } else { - obj.field_type = message.fieldType; - } - return obj; - }, - fromAminoMsg(object: ScalarDescriptorAminoMsg): ScalarDescriptor { - return ScalarDescriptor.fromAmino(object.value); - }, fromProtoMsg(message: ScalarDescriptorProtoMsg): ScalarDescriptor { return ScalarDescriptor.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/google/api/http.ts b/packages/cosmic-proto/src/codegen/google/api/http.ts index 114c1cd1d59..1d7b9586f1f 100644 --- a/packages/cosmic-proto/src/codegen/google/api/http.ts +++ b/packages/cosmic-proto/src/codegen/google/api/http.ts @@ -27,32 +27,6 @@ export interface HttpProtoMsg { typeUrl: '/google.api.Http'; value: Uint8Array; } -/** - * Defines the HTTP configuration for an API service. It contains a list of - * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method - * to one or more HTTP REST API methods. - */ -export interface HttpAmino { - /** - * A list of HTTP configuration rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ - rules?: HttpRuleAmino[]; - /** - * When set to true, URL path parameters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where "%2F" will be - * left encoded. - * - * The default behavior is to not decode RFC 6570 reserved characters in multi - * segment matches. - */ - fully_decode_reserved_expansion?: boolean; -} -export interface HttpAminoMsg { - type: '/google.api.Http'; - value: HttpAmino; -} /** * Defines the HTTP configuration for an API service. It contains a list of * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method @@ -667,337 +641,6 @@ export interface HttpRuleProtoMsg { * the request or response body to a repeated field. However, some gRPC * Transcoding implementations may not support this feature. */ -export interface HttpRuleAmino { - /** - * Selects a method to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax - * details. - */ - selector?: string; - /** - * Maps to HTTP GET. Used for listing and getting information about - * resources. - */ - get?: string; - /** Maps to HTTP PUT. Used for replacing a resource. */ - put?: string; - /** Maps to HTTP POST. Used for creating a resource or performing an action. */ - post?: string; - /** Maps to HTTP DELETE. Used for deleting a resource. */ - delete?: string; - /** Maps to HTTP PATCH. Used for updating a resource. */ - patch?: string; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave the - * HTTP method unspecified for this rule. The wild-card rule is useful - * for services that provide content to Web (HTML) clients. - */ - custom?: CustomHttpPatternAmino; - /** - * The name of the request field whose value is mapped to the HTTP request - * body, or `*` for mapping all request fields not captured by the path - * pattern to the HTTP body, or omitted for not having any HTTP request body. - * - * NOTE: the referred field must be present at the top-level of the request - * message type. - */ - body?: string; - /** - * Optional. The name of the response field whose value is mapped to the HTTP - * response body. When omitted, the entire response message will be used - * as the HTTP response body. - * - * NOTE: The referred field must be present at the top-level of the response - * message type. - */ - response_body?: string; - /** - * Additional HTTP bindings for the selector. Nested bindings must - * not contain an `additional_bindings` field themselves (that is, - * the nesting may only be one level deep). - */ - additional_bindings?: HttpRuleAmino[]; -} -export interface HttpRuleAminoMsg { - type: '/google.api.HttpRule'; - value: HttpRuleAmino; -} -/** - * # gRPC Transcoding - * - * gRPC Transcoding is a feature for mapping between a gRPC method and one or - * more HTTP REST endpoints. It allows developers to build a single API service - * that supports both gRPC APIs and REST APIs. Many systems, including [Google - * APIs](https://github.com/googleapis/googleapis), - * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC - * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), - * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature - * and use it for large scale production services. - * - * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies - * how different portions of the gRPC request message are mapped to the URL - * path, URL query parameters, and HTTP request body. It also controls how the - * gRPC response message is mapped to the HTTP response body. `HttpRule` is - * typically specified as an `google.api.http` annotation on the gRPC method. - * - * Each mapping specifies a URL path template and an HTTP method. The path - * template may refer to one or more fields in the gRPC request message, as long - * as each field is a non-repeated field with a primitive (non-message) type. - * The path template controls how fields of the request message are mapped to - * the URL path. - * - * Example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get: "/v1/{name=messages/*}" - * }; - * } - * } - * message GetMessageRequest { - * string name = 1; // Mapped to URL path. - * } - * message Message { - * string text = 1; // The resource content. - * } - * - * This enables an HTTP REST to gRPC mapping as below: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` - * - * Any fields in the request message which are not bound by the path template - * automatically become HTTP query parameters if there is no HTTP request body. - * For example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get:"/v1/messages/{message_id}" - * }; - * } - * } - * message GetMessageRequest { - * message SubMessage { - * string subfield = 1; - * } - * string message_id = 1; // Mapped to URL path. - * int64 revision = 2; // Mapped to URL query parameter `revision`. - * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. - * } - * - * This enables a HTTP JSON to RPC mapping as below: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: - * "foo"))` - * - * Note that fields which are mapped to URL query parameters must have a - * primitive type or a repeated primitive type or a non-repeated message type. - * In the case of a repeated type, the parameter can be repeated in the URL - * as `...?param=A¶m=B`. In the case of a message type, each field of the - * message is mapped to a separate parameter, such as - * `...?foo.a=A&foo.b=B&foo.c=C`. - * - * For HTTP methods that allow a request body, the `body` field - * specifies the mapping. Consider a REST update method on the - * message resource collection: - * - * service Messaging { - * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { - * patch: "/v1/messages/{message_id}" - * body: "message" - * }; - * } - * } - * message UpdateMessageRequest { - * string message_id = 1; // mapped to the URL - * Message message = 2; // mapped to the body - * } - * - * The following HTTP JSON to RPC mapping is enabled, where the - * representation of the JSON in the request body is determined by - * protos JSON encoding: - * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" message { text: "Hi!" })` - * - * The special name `*` can be used in the body mapping to define that - * every field not bound by the path template should be mapped to the - * request body. This enables the following alternative definition of - * the update method: - * - * service Messaging { - * rpc UpdateMessage(Message) returns (Message) { - * option (google.api.http) = { - * patch: "/v1/messages/{message_id}" - * body: "*" - * }; - * } - * } - * message Message { - * string message_id = 1; - * string text = 2; - * } - * - * - * The following HTTP JSON to RPC mapping is enabled: - * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` - * - * Note that when using `*` in the body mapping, it is not possible to - * have HTTP parameters, as all fields not bound by the path end in - * the body. This makes this option more rarely used in practice when - * defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. - * - * It is possible to define multiple HTTP methods for one RPC by using - * the `additional_bindings` option. Example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get: "/v1/messages/{message_id}" - * additional_bindings { - * get: "/v1/users/{user_id}/messages/{message_id}" - * } - * }; - * } - * } - * message GetMessageRequest { - * string message_id = 1; - * string user_id = 2; - * } - * - * This enables the following two alternative HTTP JSON to RPC mappings: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: - * "123456")` - * - * ## Rules for HTTP mapping - * - * 1. Leaf request fields (recursive expansion nested messages in the request - * message) are classified into three categories: - * - Fields referred by the path template. They are passed via the URL path. - * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They - * are passed via the HTTP - * request body. - * - All other fields are passed via the URL query parameters, and the - * parameter name is the field path in the request message. A repeated - * field can be represented as multiple query parameters under the same - * name. - * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL - * query parameter, all fields - * are passed via URL path and HTTP request body. - * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP - * request body, all - * fields are passed via URL path and URL query parameters. - * - * ### Path template syntax - * - * Template = "/" Segments [ Verb ] ; - * Segments = Segment { "/" Segment } ; - * Segment = "*" | "**" | LITERAL | Variable ; - * Variable = "{" FieldPath [ "=" Segments ] "}" ; - * FieldPath = IDENT { "." IDENT } ; - * Verb = ":" LITERAL ; - * - * The syntax `*` matches a single URL path segment. The syntax `**` matches - * zero or more URL path segments, which must be the last part of the URL path - * except the `Verb`. - * - * The syntax `Variable` matches part of the URL path as specified by its - * template. A variable template must not contain other variables. If a variable - * matches a single path segment, its template may be omitted, e.g. `{var}` - * is equivalent to `{var=*}`. - * - * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` - * contains any reserved character, such characters should be percent-encoded - * before the matching. - * - * If a variable contains exactly one path segment, such as `"{var}"` or - * `"{var=*}"`, when such a variable is expanded into a URL path on the client - * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The - * server side does the reverse decoding. Such variables show up in the - * [Discovery - * Document](https://developers.google.com/discovery/v1/reference/apis) as - * `{var}`. - * - * If a variable contains multiple path segments, such as `"{var=foo/*}"` - * or `"{var=**}"`, when such a variable is expanded into a URL path on the - * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. - * The server side does the reverse decoding, except "%2F" and "%2f" are left - * unchanged. Such variables show up in the - * [Discovery - * Document](https://developers.google.com/discovery/v1/reference/apis) as - * `{+var}`. - * - * ## Using gRPC API Service Configuration - * - * gRPC API Service Configuration (service config) is a configuration language - * for configuring a gRPC service to become a user-facing product. The - * service config is simply the YAML representation of the `google.api.Service` - * proto message. - * - * As an alternative to annotating your proto file, you can configure gRPC - * transcoding in your service config YAML files. You do this by specifying a - * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same - * effect as the proto annotation. This can be particularly useful if you - * have a proto that is reused in multiple services. Note that any transcoding - * specified in the service config will override any matching transcoding - * configuration in the proto. - * - * Example: - * - * http: - * rules: - * # Selects a gRPC method and applies HttpRule to it. - * - selector: example.v1.Messaging.GetMessage - * get: /v1/messages/{message_id}/{sub.subfield} - * - * ## Special notes - * - * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the - * proto to JSON conversion must follow the [proto3 - * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). - * - * While the single segment variable follows the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** follow RFC 6570 Section - * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion - * does not expand special characters like `?` and `#`, which would lead - * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding - * for multi segment variables. - * - * The path variables **must not** refer to any repeated or mapped field, - * because client libraries are not capable of handling such variable expansion. - * - * The path variables **must not** capture the leading "/" character. The reason - * is that the most common use case "{var}" does not capture the leading "/" - * character. For consistency, all path variables must share the same behavior. - * - * Repeated message fields must not be mapped to URL query parameters, because - * no client library can support such complicated mapping. - * - * If an API needs to use a JSON array for request or response body, it can map - * the request or response body to a repeated field. However, some gRPC - * Transcoding implementations may not support this feature. - */ export interface HttpRuleSDKType { selector: string; get?: string; @@ -1022,17 +665,6 @@ export interface CustomHttpPatternProtoMsg { value: Uint8Array; } /** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPatternAmino { - /** The name of this custom HTTP verb. */ - kind?: string; - /** The path matched by this custom verb. */ - path?: string; -} -export interface CustomHttpPatternAminoMsg { - type: '/google.api.CustomHttpPattern'; - value: CustomHttpPatternAmino; -} -/** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPatternSDKType { kind: string; path: string; @@ -1106,34 +738,6 @@ export const Http = { object.fullyDecodeReservedExpansion ?? false; return message; }, - fromAmino(object: HttpAmino): Http { - const message = createBaseHttp(); - message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; - if ( - object.fully_decode_reserved_expansion !== undefined && - object.fully_decode_reserved_expansion !== null - ) { - message.fullyDecodeReservedExpansion = - object.fully_decode_reserved_expansion; - } - return message; - }, - toAmino(message: Http): HttpAmino { - const obj: any = {}; - if (message.rules) { - obj.rules = message.rules.map(e => (e ? HttpRule.toAmino(e) : undefined)); - } else { - obj.rules = message.rules; - } - obj.fully_decode_reserved_expansion = - message.fullyDecodeReservedExpansion === false - ? undefined - : message.fullyDecodeReservedExpansion; - return obj; - }, - fromAminoMsg(object: HttpAminoMsg): Http { - return Http.fromAmino(object.value); - }, fromProtoMsg(message: HttpProtoMsg): Http { return Http.decode(message.value); }, @@ -1311,65 +915,6 @@ export const HttpRule = { object.additionalBindings?.map(e => HttpRule.fromPartial(e)) || []; return message; }, - fromAmino(object: HttpRuleAmino): HttpRule { - const message = createBaseHttpRule(); - if (object.selector !== undefined && object.selector !== null) { - message.selector = object.selector; - } - if (object.get !== undefined && object.get !== null) { - message.get = object.get; - } - if (object.put !== undefined && object.put !== null) { - message.put = object.put; - } - if (object.post !== undefined && object.post !== null) { - message.post = object.post; - } - if (object.delete !== undefined && object.delete !== null) { - message.delete = object.delete; - } - if (object.patch !== undefined && object.patch !== null) { - message.patch = object.patch; - } - if (object.custom !== undefined && object.custom !== null) { - message.custom = CustomHttpPattern.fromAmino(object.custom); - } - if (object.body !== undefined && object.body !== null) { - message.body = object.body; - } - if (object.response_body !== undefined && object.response_body !== null) { - message.responseBody = object.response_body; - } - message.additionalBindings = - object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; - return message; - }, - toAmino(message: HttpRule): HttpRuleAmino { - const obj: any = {}; - obj.selector = message.selector === '' ? undefined : message.selector; - obj.get = message.get === null ? undefined : message.get; - obj.put = message.put === null ? undefined : message.put; - obj.post = message.post === null ? undefined : message.post; - obj.delete = message.delete === null ? undefined : message.delete; - obj.patch = message.patch === null ? undefined : message.patch; - obj.custom = message.custom - ? CustomHttpPattern.toAmino(message.custom) - : undefined; - obj.body = message.body === '' ? undefined : message.body; - obj.response_body = - message.responseBody === '' ? undefined : message.responseBody; - if (message.additionalBindings) { - obj.additional_bindings = message.additionalBindings.map(e => - e ? HttpRule.toAmino(e) : undefined, - ); - } else { - obj.additional_bindings = message.additionalBindings; - } - return obj; - }, - fromAminoMsg(object: HttpRuleAminoMsg): HttpRule { - return HttpRule.fromAmino(object.value); - }, fromProtoMsg(message: HttpRuleProtoMsg): HttpRule { return HttpRule.decode(message.value); }, @@ -1442,25 +987,6 @@ export const CustomHttpPattern = { message.path = object.path ?? ''; return message; }, - fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { - const message = createBaseCustomHttpPattern(); - if (object.kind !== undefined && object.kind !== null) { - message.kind = object.kind; - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - return message; - }, - toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { - const obj: any = {}; - obj.kind = message.kind === '' ? undefined : message.kind; - obj.path = message.path === '' ? undefined : message.path; - return obj; - }, - fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { - return CustomHttpPattern.fromAmino(object.value); - }, fromProtoMsg(message: CustomHttpPatternProtoMsg): CustomHttpPattern { return CustomHttpPattern.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/google/protobuf/any.ts b/packages/cosmic-proto/src/codegen/google/protobuf/any.ts index 292bd43c063..440bc9193de 100644 --- a/packages/cosmic-proto/src/codegen/google/protobuf/any.ts +++ b/packages/cosmic-proto/src/codegen/google/protobuf/any.ts @@ -121,125 +121,6 @@ export interface AnyProtoMsg { typeUrl: '/google.protobuf.Any'; value: Uint8Array; } -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - */ -export interface AnyAmino { - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - */ - type: string; - /** Must be a valid serialized protocol buffer of the above specified type. */ - value: any; -} -export interface AnyAminoMsg { - type: string; - value: AnyAmino; -} /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -391,21 +272,6 @@ export const Any = { message.value = object.value ?? new Uint8Array(); return message; }, - fromAmino(object: AnyAmino): Any { - return { - typeUrl: object.type, - value: object.value, - }; - }, - toAmino(message: Any): AnyAmino { - const obj: any = {}; - obj.type = message.typeUrl; - obj.value = message.value; - return obj; - }, - fromAminoMsg(object: AnyAminoMsg): Any { - return Any.fromAmino(object.value); - }, fromProtoMsg(message: AnyProtoMsg): Any { return Any.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/google/protobuf/descriptor.ts b/packages/cosmic-proto/src/codegen/google/protobuf/descriptor.ts index 3a0e349ca62..bd12534c9eb 100644 --- a/packages/cosmic-proto/src/codegen/google/protobuf/descriptor.ts +++ b/packages/cosmic-proto/src/codegen/google/protobuf/descriptor.ts @@ -44,7 +44,6 @@ export enum FieldDescriptorProto_Type { UNRECOGNIZED = -1, } export const FieldDescriptorProto_TypeSDKType = FieldDescriptorProto_Type; -export const FieldDescriptorProto_TypeAmino = FieldDescriptorProto_Type; export function fieldDescriptorProto_TypeFromJSON( object: any, ): FieldDescriptorProto_Type { @@ -162,7 +161,6 @@ export enum FieldDescriptorProto_Label { UNRECOGNIZED = -1, } export const FieldDescriptorProto_LabelSDKType = FieldDescriptorProto_Label; -export const FieldDescriptorProto_LabelAmino = FieldDescriptorProto_Label; export function fieldDescriptorProto_LabelFromJSON( object: any, ): FieldDescriptorProto_Label { @@ -211,7 +209,6 @@ export enum FileOptions_OptimizeMode { UNRECOGNIZED = -1, } export const FileOptions_OptimizeModeSDKType = FileOptions_OptimizeMode; -export const FileOptions_OptimizeModeAmino = FileOptions_OptimizeMode; export function fileOptions_OptimizeModeFromJSON( object: any, ): FileOptions_OptimizeMode { @@ -254,7 +251,6 @@ export enum FieldOptions_CType { UNRECOGNIZED = -1, } export const FieldOptions_CTypeSDKType = FieldOptions_CType; -export const FieldOptions_CTypeAmino = FieldOptions_CType; export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { switch (object) { case 0: @@ -295,7 +291,6 @@ export enum FieldOptions_JSType { UNRECOGNIZED = -1, } export const FieldOptions_JSTypeSDKType = FieldOptions_JSType; -export const FieldOptions_JSTypeAmino = FieldOptions_JSType; export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { switch (object) { case 0: @@ -341,8 +336,6 @@ export enum MethodOptions_IdempotencyLevel { } export const MethodOptions_IdempotencyLevelSDKType = MethodOptions_IdempotencyLevel; -export const MethodOptions_IdempotencyLevelAmino = - MethodOptions_IdempotencyLevel; export function methodOptions_IdempotencyLevelFromJSON( object: any, ): MethodOptions_IdempotencyLevel { @@ -388,17 +381,6 @@ export interface FileDescriptorSetProtoMsg { typeUrl: '/google.protobuf.FileDescriptorSet'; value: Uint8Array; } -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSetAmino { - file?: FileDescriptorProtoAmino[]; -} -export interface FileDescriptorSetAminoMsg { - type: '/google.protobuf.FileDescriptorSet'; - value: FileDescriptorSetAmino; -} /** * The protocol compiler can output a FileDescriptorSet containing the .proto * files it parses. @@ -444,43 +426,6 @@ export interface FileDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a complete .proto file. */ -export interface FileDescriptorProtoAmino { - /** file name, relative to root of source tree */ - name?: string; - package?: string; - /** Names of files imported by this file. */ - dependency?: string[]; - /** Indexes of the public imported files in the dependency list above. */ - public_dependency?: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weak_dependency?: number[]; - /** All top-level definitions in this file. */ - message_type?: DescriptorProtoAmino[]; - enum_type?: EnumDescriptorProtoAmino[]; - service?: ServiceDescriptorProtoAmino[]; - extension?: FieldDescriptorProtoAmino[]; - options?: FileOptionsAmino; - /** - * This field contains optional information about the original source code. - * You may safely remove this entire field without harming runtime - * functionality of the descriptors -- the information is needed only by - * development tools. - */ - source_code_info?: SourceCodeInfoAmino; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax?: string; -} -export interface FileDescriptorProtoAminoMsg { - type: '/google.protobuf.FileDescriptorProto'; - value: FileDescriptorProtoAmino; -} -/** Describes a complete .proto file. */ export interface FileDescriptorProtoSDKType { name: string; package: string; @@ -517,27 +462,6 @@ export interface DescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a message type. */ -export interface DescriptorProtoAmino { - name?: string; - field?: FieldDescriptorProtoAmino[]; - extension?: FieldDescriptorProtoAmino[]; - nested_type?: DescriptorProtoAmino[]; - enum_type?: EnumDescriptorProtoAmino[]; - extension_range?: DescriptorProto_ExtensionRangeAmino[]; - oneof_decl?: OneofDescriptorProtoAmino[]; - options?: MessageOptionsAmino; - reserved_range?: DescriptorProto_ReservedRangeAmino[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reserved_name?: string[]; -} -export interface DescriptorProtoAminoMsg { - type: '/google.protobuf.DescriptorProto'; - value: DescriptorProtoAmino; -} -/** Describes a message type. */ export interface DescriptorProtoSDKType { name: string; field: FieldDescriptorProtoSDKType[]; @@ -561,17 +485,6 @@ export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: '/google.protobuf.ExtensionRange'; value: Uint8Array; } -export interface DescriptorProto_ExtensionRangeAmino { - /** Inclusive. */ - start?: number; - /** Exclusive. */ - end?: number; - options?: ExtensionRangeOptionsAmino; -} -export interface DescriptorProto_ExtensionRangeAminoMsg { - type: '/google.protobuf.ExtensionRange'; - value: DescriptorProto_ExtensionRangeAmino; -} export interface DescriptorProto_ExtensionRangeSDKType { start: number; end: number; @@ -592,21 +505,6 @@ export interface DescriptorProto_ReservedRangeProtoMsg { typeUrl: '/google.protobuf.ReservedRange'; value: Uint8Array; } -/** - * Range of reserved tag numbers. Reserved tag numbers may not be used by - * fields or extension ranges in the same message. Reserved ranges may - * not overlap. - */ -export interface DescriptorProto_ReservedRangeAmino { - /** Inclusive. */ - start?: number; - /** Exclusive. */ - end?: number; -} -export interface DescriptorProto_ReservedRangeAminoMsg { - type: '/google.protobuf.ReservedRange'; - value: DescriptorProto_ReservedRangeAmino; -} /** * Range of reserved tag numbers. Reserved tag numbers may not be used by * fields or extension ranges in the same message. Reserved ranges may @@ -624,14 +522,6 @@ export interface ExtensionRangeOptionsProtoMsg { typeUrl: '/google.protobuf.ExtensionRangeOptions'; value: Uint8Array; } -export interface ExtensionRangeOptionsAmino { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface ExtensionRangeOptionsAminoMsg { - type: '/google.protobuf.ExtensionRangeOptions'; - value: ExtensionRangeOptionsAmino; -} export interface ExtensionRangeOptionsSDKType { uninterpreted_option: UninterpretedOptionSDKType[]; } @@ -685,55 +575,6 @@ export interface FieldDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a field within a message. */ -export interface FieldDescriptorProtoAmino { - name?: string; - number?: number; - label?: FieldDescriptorProto_Label; - /** - * If type_name is set, this need not be set. If both this and type_name - * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - */ - type?: FieldDescriptorProto_Type; - /** - * For message and enum types, this is the name of the type. If the name - * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - * rules are used to find the type (i.e. first the nested types within this - * message are searched, then within the parent, on up to the root - * namespace). - */ - type_name?: string; - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ - extendee?: string; - /** - * For numeric types, contains the original text representation of the value. - * For booleans, "true" or "false". - * For strings, contains the default text contents (not escaped in any way). - * For bytes, contains the C escaped value. All bytes >= 128 are escaped. - * TODO(kenton): Base-64 encode? - */ - default_value?: string; - /** - * If set, gives the index of a oneof in the containing type's oneof_decl - * list. This field is a member of that oneof. - */ - oneof_index?: number; - /** - * JSON name of this field. The value is set by protocol compiler. If the - * user has set a "json_name" option on this field, that option's value - * will be used. Otherwise, it's deduced from the field's name by converting - * it to camelCase. - */ - json_name?: string; - options?: FieldOptionsAmino; -} -export interface FieldDescriptorProtoAminoMsg { - type: '/google.protobuf.FieldDescriptorProto'; - value: FieldDescriptorProtoAmino; -} -/** Describes a field within a message. */ export interface FieldDescriptorProtoSDKType { name: string; number: number; @@ -756,15 +597,6 @@ export interface OneofDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a oneof. */ -export interface OneofDescriptorProtoAmino { - name?: string; - options?: OneofOptionsAmino; -} -export interface OneofDescriptorProtoAminoMsg { - type: '/google.protobuf.OneofDescriptorProto'; - value: OneofDescriptorProtoAmino; -} -/** Describes a oneof. */ export interface OneofDescriptorProtoSDKType { name: string; options?: OneofOptionsSDKType; @@ -791,27 +623,6 @@ export interface EnumDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes an enum type. */ -export interface EnumDescriptorProtoAmino { - name?: string; - value?: EnumValueDescriptorProtoAmino[]; - options?: EnumOptionsAmino; - /** - * Range of reserved numeric values. Reserved numeric values may not be used - * by enum values in the same enum declaration. Reserved ranges may not - * overlap. - */ - reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reserved_name?: string[]; -} -export interface EnumDescriptorProtoAminoMsg { - type: '/google.protobuf.EnumDescriptorProto'; - value: EnumDescriptorProtoAmino; -} -/** Describes an enum type. */ export interface EnumDescriptorProtoSDKType { name: string; value: EnumValueDescriptorProtoSDKType[]; @@ -837,24 +648,6 @@ export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { typeUrl: '/google.protobuf.EnumReservedRange'; value: Uint8Array; } -/** - * Range of reserved numeric values. Reserved values may not be used by - * entries in the same enum. Reserved ranges may not overlap. - * - * Note that this is distinct from DescriptorProto.ReservedRange in that it - * is inclusive such that it can appropriately represent the entire int32 - * domain. - */ -export interface EnumDescriptorProto_EnumReservedRangeAmino { - /** Inclusive. */ - start?: number; - /** Inclusive. */ - end?: number; -} -export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { - type: '/google.protobuf.EnumReservedRange'; - value: EnumDescriptorProto_EnumReservedRangeAmino; -} /** * Range of reserved numeric values. Reserved values may not be used by * entries in the same enum. Reserved ranges may not overlap. @@ -878,16 +671,6 @@ export interface EnumValueDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a value within an enum. */ -export interface EnumValueDescriptorProtoAmino { - name?: string; - number?: number; - options?: EnumValueOptionsAmino; -} -export interface EnumValueDescriptorProtoAminoMsg { - type: '/google.protobuf.EnumValueDescriptorProto'; - value: EnumValueDescriptorProtoAmino; -} -/** Describes a value within an enum. */ export interface EnumValueDescriptorProtoSDKType { name: string; number: number; @@ -904,16 +687,6 @@ export interface ServiceDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a service. */ -export interface ServiceDescriptorProtoAmino { - name?: string; - method?: MethodDescriptorProtoAmino[]; - options?: ServiceOptionsAmino; -} -export interface ServiceDescriptorProtoAminoMsg { - type: '/google.protobuf.ServiceDescriptorProto'; - value: ServiceDescriptorProtoAmino; -} -/** Describes a service. */ export interface ServiceDescriptorProtoSDKType { name: string; method: MethodDescriptorProtoSDKType[]; @@ -939,25 +712,6 @@ export interface MethodDescriptorProtoProtoMsg { value: Uint8Array; } /** Describes a method of a service. */ -export interface MethodDescriptorProtoAmino { - name?: string; - /** - * Input and output type names. These are resolved in the same way as - * FieldDescriptorProto.type_name, but must refer to a message type. - */ - input_type?: string; - output_type?: string; - options?: MethodOptionsAmino; - /** Identifies if client streams multiple client messages */ - client_streaming?: boolean; - /** Identifies if server streams multiple server messages */ - server_streaming?: boolean; -} -export interface MethodDescriptorProtoAminoMsg { - type: '/google.protobuf.MethodDescriptorProto'; - value: MethodDescriptorProtoAmino; -} -/** Describes a method of a service. */ export interface MethodDescriptorProtoSDKType { name: string; input_type: string; @@ -1087,127 +841,6 @@ export interface FileOptionsProtoMsg { typeUrl: '/google.protobuf.FileOptions'; value: Uint8Array; } -export interface FileOptionsAmino { - /** - * Sets the Java package where classes generated from this .proto will be - * placed. By default, the proto package is used, but this is often - * inappropriate because proto packages do not normally start with backwards - * domain names. - */ - java_package?: string; - /** - * If set, all the classes from the .proto file are wrapped in a single - * outer class with the given name. This applies to both Proto1 - * (equivalent to the old "--one_java_file" option) and Proto2 (where - * a .proto always translates to a single class, but you may want to - * explicitly choose the class name). - */ - java_outer_classname?: string; - /** - * If set true, then the Java code generator will generate a separate .java - * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the outer class - * named by java_outer_classname. However, the outer class will still be - * generated to contain the file's getDescriptor() method as well as any - * top-level extensions defined in the file. - */ - java_multiple_files?: boolean; - /** This option does nothing. */ - /** @deprecated */ - java_generate_equals_and_hash?: boolean; - /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. - */ - java_string_check_utf8?: boolean; - optimize_for?: FileOptions_OptimizeMode; - /** - * Sets the Go package where structs generated from this .proto will be - * placed. If omitted, the Go package will be derived from the following: - * - The basename of the package import path, if provided. - * - Otherwise, the package statement in the .proto file, if present. - * - Otherwise, the basename of the .proto file, without extension. - */ - go_package?: string; - /** - * Should generic services be generated in each language? "Generic" services - * are not specific to any particular RPC system. They are generated by the - * main code generators in each language (without additional plugins). - * Generic services were the only kind of service generation supported by - * early versions of google.protobuf. - * - * Generic services are now considered deprecated in favor of using plugins - * that generate code specific to your particular RPC system. Therefore, - * these default to false. Old code which depends on generic services should - * explicitly set them to true. - */ - cc_generic_services?: boolean; - java_generic_services?: boolean; - py_generic_services?: boolean; - php_generic_services?: boolean; - /** - * Is this file deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for everything in the file, or it will be completely ignored; in the very - * least, this is a formalization for deprecating files. - */ - deprecated?: boolean; - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ - cc_enable_arenas?: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objc_class_prefix?: string; - /** Namespace for generated classes; defaults to the package. */ - csharp_namespace?: string; - /** - * By default Swift generators will take the proto package and CamelCase it - * replacing '.' with underscore and use that to prefix the types/symbols - * defined. When this options is provided, they will use this value instead - * to prefix the types/symbols defined. - */ - swift_prefix?: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - php_class_prefix?: string; - /** - * Use this option to change the namespace of php generated classes. Default - * is empty. When this option is empty, the package name will be used for - * determining the namespace. - */ - php_namespace?: string; - /** - * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be - * used for determining the namespace. - */ - php_metadata_namespace?: string; - /** - * Use this option to change the package of ruby generated classes. Default - * is empty. When this option is not set, the package name will be used for - * determining the ruby package. - */ - ruby_package?: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface FileOptionsAminoMsg { - type: '/google.protobuf.FileOptions'; - value: FileOptionsAmino; -} export interface FileOptionsSDKType { java_package: string; java_outer_classname: string; @@ -1298,87 +931,21 @@ export interface MessageOptionsProtoMsg { typeUrl: '/google.protobuf.MessageOptions'; value: Uint8Array; } -export interface MessageOptionsAmino { +export interface MessageOptionsSDKType { + message_set_wire_format: boolean; + no_standard_descriptor_accessor: boolean; + deprecated: boolean; + map_entry: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface FieldOptions { /** - * Set true to use the old proto1 MessageSet wire format for extensions. - * This is provided for backwards-compatibility with the MessageSet wire - * format. You should not use this for any other reason: It's less - * efficient, has fewer features, and is more complicated. - * - * The message must be defined exactly as follows: - * message Foo { - * option message_set_wire_format = true; - * extensions 4 to max; - * } - * Note that the message cannot have any defined fields; MessageSets only - * have extensions. - * - * All extensions of your type must be singular messages; e.g. they cannot - * be int32s, enums, or repeated messages. - * - * Because this is an option, the above two restrictions are not enforced by - * the protocol compiler. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! */ - message_set_wire_format?: boolean; - /** - * Disables the generation of the standard "descriptor()" accessor, which can - * conflict with a field of the same name. This is meant to make migration - * from proto1 easier; new code should avoid fields named "descriptor". - */ - no_standard_descriptor_accessor?: boolean; - /** - * Is this message deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the message, or it will be completely ignored; in the very least, - * this is a formalization for deprecating messages. - */ - deprecated?: boolean; - /** - * Whether the message is an automatically generated map entry type for the - * maps field. - * - * For maps fields: - * map map_field = 1; - * The parsed descriptor looks like: - * message MapFieldEntry { - * option map_entry = true; - * optional KeyType key = 1; - * optional ValueType value = 2; - * } - * repeated MapFieldEntry map_field = 1; - * - * Implementations may choose not to generate the map_entry=true message, but - * use a native map in the target language to hold the keys and values. - * The reflection APIs in such implementations still need to work as - * if the field is a repeated message field. - * - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - */ - map_entry?: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface MessageOptionsAminoMsg { - type: '/google.protobuf.MessageOptions'; - value: MessageOptionsAmino; -} -export interface MessageOptionsSDKType { - message_set_wire_format: boolean; - no_standard_descriptor_accessor: boolean; - deprecated: boolean; - map_entry: boolean; - uninterpreted_option: UninterpretedOptionSDKType[]; -} -export interface FieldOptions { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ - ctype: FieldOptions_CType; + ctype: FieldOptions_CType; /** * The packed option can be enabled for repeated primitive fields to enable * a more efficient representation on the wire. Rather than repeatedly @@ -1448,83 +1015,6 @@ export interface FieldOptionsProtoMsg { typeUrl: '/google.protobuf.FieldOptions'; value: Uint8Array; } -export interface FieldOptionsAmino { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ - ctype?: FieldOptions_CType; - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. - */ - packed?: boolean; - /** - * The jstype option determines the JavaScript type used for values of the - * field. The option is permitted only for 64 bit integral and fixed types - * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - * is represented as JavaScript string, which avoids loss of precision that - * can happen when a large value is converted to a floating point JavaScript. - * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - * use the JavaScript "number" type. The behavior of the default option - * JS_NORMAL is implementation dependent. - * - * This option is an enum to permit additional types to be added, e.g. - * goog.math.Integer. - */ - jstype?: FieldOptions_JSType; - /** - * Should this field be parsed lazily? Lazy applies only to message-type - * fields. It means that when the outer message is initially parsed, the - * inner message's contents will not be parsed but instead stored in encoded - * form. The inner message will actually be parsed when it is first accessed. - * - * This is only a hint. Implementations are free to choose whether to use - * eager or lazy parsing regardless of the value of this option. However, - * setting this option true suggests that the protocol author believes that - * using lazy parsing on this field is worth the additional bookkeeping - * overhead typically needed to implement it. - * - * This option does not affect the public interface of any generated code; - * all method signatures remain the same. Furthermore, thread-safety of the - * interface is not affected by this option; const methods remain safe to - * call from multiple threads concurrently, while non-const methods continue - * to require exclusive access. - * - * - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - */ - lazy?: boolean; - /** - * Is this field deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for accessors, or it will be completely ignored; in the very least, this - * is a formalization for deprecating fields. - */ - deprecated?: boolean; - /** For Google-internal migration only. Do not use. */ - weak?: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface FieldOptionsAminoMsg { - type: '/google.protobuf.FieldOptions'; - value: FieldOptionsAmino; -} export interface FieldOptionsSDKType { ctype: FieldOptions_CType; packed: boolean; @@ -1542,14 +1032,6 @@ export interface OneofOptionsProtoMsg { typeUrl: '/google.protobuf.OneofOptions'; value: Uint8Array; } -export interface OneofOptionsAmino { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface OneofOptionsAminoMsg { - type: '/google.protobuf.OneofOptions'; - value: OneofOptionsAmino; -} export interface OneofOptionsSDKType { uninterpreted_option: UninterpretedOptionSDKType[]; } @@ -1573,26 +1055,6 @@ export interface EnumOptionsProtoMsg { typeUrl: '/google.protobuf.EnumOptions'; value: Uint8Array; } -export interface EnumOptionsAmino { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allow_alias?: boolean; - /** - * Is this enum deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum, or it will be completely ignored; in the very least, this - * is a formalization for deprecating enums. - */ - deprecated?: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface EnumOptionsAminoMsg { - type: '/google.protobuf.EnumOptions'; - value: EnumOptionsAmino; -} export interface EnumOptionsSDKType { allow_alias: boolean; deprecated: boolean; @@ -1613,21 +1075,6 @@ export interface EnumValueOptionsProtoMsg { typeUrl: '/google.protobuf.EnumValueOptions'; value: Uint8Array; } -export interface EnumValueOptionsAmino { - /** - * Is this enum value deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum value, or it will be completely ignored; in the very least, - * this is a formalization for deprecating enum values. - */ - deprecated?: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface EnumValueOptionsAminoMsg { - type: '/google.protobuf.EnumValueOptions'; - value: EnumValueOptionsAmino; -} export interface EnumValueOptionsSDKType { deprecated: boolean; uninterpreted_option: UninterpretedOptionSDKType[]; @@ -1647,21 +1094,6 @@ export interface ServiceOptionsProtoMsg { typeUrl: '/google.protobuf.ServiceOptions'; value: Uint8Array; } -export interface ServiceOptionsAmino { - /** - * Is this service deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the service, or it will be completely ignored; in the very least, - * this is a formalization for deprecating services. - */ - deprecated?: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface ServiceOptionsAminoMsg { - type: '/google.protobuf.ServiceOptions'; - value: ServiceOptionsAmino; -} export interface ServiceOptionsSDKType { deprecated: boolean; uninterpreted_option: UninterpretedOptionSDKType[]; @@ -1682,22 +1114,6 @@ export interface MethodOptionsProtoMsg { typeUrl: '/google.protobuf.MethodOptions'; value: Uint8Array; } -export interface MethodOptionsAmino { - /** - * Is this method deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the method, or it will be completely ignored; in the very least, - * this is a formalization for deprecating methods. - */ - deprecated?: boolean; - idempotency_level?: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option?: UninterpretedOptionAmino[]; -} -export interface MethodOptionsAminoMsg { - type: '/google.protobuf.MethodOptions'; - value: MethodOptionsAmino; -} export interface MethodOptionsSDKType { deprecated: boolean; idempotency_level: MethodOptions_IdempotencyLevel; @@ -1728,31 +1144,6 @@ export interface UninterpretedOptionProtoMsg { typeUrl: '/google.protobuf.UninterpretedOption'; value: Uint8Array; } -/** - * A message representing a option the parser does not recognize. This only - * appears in options protos created by the compiler::Parser class. - * DescriptorPool resolves these when building Descriptor objects. Therefore, - * options protos in descriptor objects (e.g. returned by Descriptor::options(), - * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - * in them. - */ -export interface UninterpretedOptionAmino { - name?: UninterpretedOption_NamePartAmino[]; - /** - * The value of the uninterpreted option, in whatever type the tokenizer - * identified it as during parsing. Exactly one of these should be set. - */ - identifier_value?: string; - positive_int_value?: string; - negative_int_value?: string; - double_value?: number; - string_value?: string; - aggregate_value?: string; -} -export interface UninterpretedOptionAminoMsg { - type: '/google.protobuf.UninterpretedOption'; - value: UninterpretedOptionAmino; -} /** * A message representing a option the parser does not recognize. This only * appears in options protos created by the compiler::Parser class. @@ -1785,21 +1176,6 @@ export interface UninterpretedOption_NamePartProtoMsg { typeUrl: '/google.protobuf.NamePart'; value: Uint8Array; } -/** - * The name of the uninterpreted option. Each string represents a segment in - * a dot-separated name. is_extension is true iff a segment represents an - * extension (denoted with parentheses in options specs in .proto files). - * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - * "foo.(bar.baz).qux". - */ -export interface UninterpretedOption_NamePartAmino { - name_part?: string; - is_extension?: boolean; -} -export interface UninterpretedOption_NamePartAminoMsg { - type: '/google.protobuf.NamePart'; - value: UninterpretedOption_NamePartAmino; -} /** * The name of the uninterpreted option. Each string represents a segment in * a dot-separated name. is_extension is true iff a segment represents an @@ -1869,160 +1245,12 @@ export interface SourceCodeInfoProtoMsg { } /** * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface SourceCodeInfoAmino { - /** - * A Location identifies a piece of source code in a .proto file which - * corresponds to a particular definition. This information is intended - * to be useful to IDEs, code indexers, documentation generators, and similar - * tools. - * - * For example, say we have a file like: - * message Foo { - * optional string foo = 1; - * } - * Let's look at just the field definition: - * optional string foo = 1; - * ^ ^^ ^^ ^ ^^^ - * a bc de f ghi - * We have the following locations: - * span path represents - * [a,i) [ 4, 0, 2, 0 ] The whole field definition. - * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - * - * Notes: - * - A location may refer to a repeated field itself (i.e. not to any - * particular index within it). This is used whenever a set of elements are - * logically enclosed in a single code segment. For example, an entire - * extend block (possibly containing multiple extension definitions) will - * have an outer location whose path refers to the "extensions" repeated - * field without an index. - * - Multiple locations may have the same path. This happens when a single - * logical declaration is spread out across multiple places. The most - * obvious example is the "extend" block again -- there may be multiple - * extend blocks in the same scope, each of which will have the same path. - * - A location's span is not always a subset of its parent's span. For - * example, the "extendee" of an extension declaration appears at the - * beginning of the "extend" block and is shared by all extensions within - * the block. - * - Just because a location's span is a subset of some other location's span - * does not mean that it is a descendant. For example, a "group" defines - * both a type and a field in a single declaration. Thus, the locations - * corresponding to the type and field and their components will overlap. - * - Code which tries to interpret locations should probably be designed to - * ignore those that it doesn't understand, as more types of locations could - * be recorded in the future. - */ - location?: SourceCodeInfo_LocationAmino[]; -} -export interface SourceCodeInfoAminoMsg { - type: '/google.protobuf.SourceCodeInfo'; - value: SourceCodeInfoAmino; -} -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface SourceCodeInfoSDKType { - location: SourceCodeInfo_LocationSDKType[]; -} -export interface SourceCodeInfo_Location { - /** - * Identifies which part of the FileDescriptorProto was defined at this - * location. - * - * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition. For - * example, this path: - * [ 4, 3, 2, 7, 1 ] - * refers to: - * file.message_type(3) // 4, 3 - * .field(7) // 2, 7 - * .name() // 1 - * This is because FileDescriptorProto.message_type has field number 4: - * repeated DescriptorProto message_type = 4; - * and DescriptorProto.field has field number 2: - * repeated FieldDescriptorProto field = 2; - * and FieldDescriptorProto.name has field number 1: - * optional string name = 1; - * - * Thus, the above path gives the location of a field name. If we removed - * the last element: - * [ 4, 3, 2, 7 ] - * this path refers to the whole field declaration (from the beginning - * of the label to the terminating semicolon). - */ - path: number[]; - /** - * Always has exactly three or four elements: start line, start column, - * end line (optional, otherwise assumed same as start line), end column. - * These are packed into a single field for efficiency. Note that line - * and column numbers are zero-based -- typically you will want to add - * 1 to each before displaying to a user. - */ - span: number[]; - /** - * If this SourceCodeInfo represents a complete declaration, these are any - * comments appearing before and after the declaration which appear to be - * attached to the declaration. - * - * A series of line comments appearing on consecutive lines, with no other - * tokens appearing on those lines, will be treated as a single comment. - * - * leading_detached_comments will keep paragraphs of comments that appear - * before (but not connected to) the current element. Each paragraph, - * separated by empty lines, will be one comment element in the repeated - * field. - * - * Only the comment content is provided; comment markers (e.g. //) are - * stripped out. For block comments, leading whitespace and an asterisk - * will be stripped from the beginning of each line other than the first. - * Newlines are included in the output. - * - * Examples: - * - * optional int32 foo = 1; // Comment attached to foo. - * // Comment attached to bar. - * optional int32 bar = 2; - * - * optional string baz = 3; - * // Comment attached to baz. - * // Another line attached to baz. - * - * // Comment attached to qux. - * // - * // Another line attached to qux. - * optional double qux = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to qux or corge because there are blank lines separating it from - * // both. - * - * // Detached comment for corge paragraph 2. - * - * optional string corge = 5; - * /* Block comment attached - * * to corge. Leading asterisks - * * will be removed. *\/ - * /* Block comment attached to - * * grault. *\/ - * optional int32 grault = 6; - * - * // ignored detached comments. - */ - leadingComments: string; - trailingComments: string; - leadingDetachedComments: string[]; -} -export interface SourceCodeInfo_LocationProtoMsg { - typeUrl: '/google.protobuf.Location'; - value: Uint8Array; + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfoSDKType { + location: SourceCodeInfo_LocationSDKType[]; } -export interface SourceCodeInfo_LocationAmino { +export interface SourceCodeInfo_Location { /** * Identifies which part of the FileDescriptorProto was defined at this * location. @@ -2048,7 +1276,7 @@ export interface SourceCodeInfo_LocationAmino { * this path refers to the whole field declaration (from the beginning * of the label to the terminating semicolon). */ - path?: number[]; + path: number[]; /** * Always has exactly three or four elements: start line, start column, * end line (optional, otherwise assumed same as start line), end column. @@ -2056,7 +1284,7 @@ export interface SourceCodeInfo_LocationAmino { * and column numbers are zero-based -- typically you will want to add * 1 to each before displaying to a user. */ - span?: number[]; + span: number[]; /** * If this SourceCodeInfo represents a complete declaration, these are any * comments appearing before and after the declaration which appear to be @@ -2106,13 +1334,13 @@ export interface SourceCodeInfo_LocationAmino { * * // ignored detached comments. */ - leading_comments?: string; - trailing_comments?: string; - leading_detached_comments?: string[]; + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; } -export interface SourceCodeInfo_LocationAminoMsg { - type: '/google.protobuf.Location'; - value: SourceCodeInfo_LocationAmino; +export interface SourceCodeInfo_LocationProtoMsg { + typeUrl: '/google.protobuf.Location'; + value: Uint8Array; } export interface SourceCodeInfo_LocationSDKType { path: number[]; @@ -2137,22 +1365,6 @@ export interface GeneratedCodeInfoProtoMsg { typeUrl: '/google.protobuf.GeneratedCodeInfo'; value: Uint8Array; } -/** - * Describes the relationship between generated code and its original source - * file. A GeneratedCodeInfo message is associated with only one generated - * source file, but may contain references to different source .proto files. - */ -export interface GeneratedCodeInfoAmino { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ - annotation?: GeneratedCodeInfo_AnnotationAmino[]; -} -export interface GeneratedCodeInfoAminoMsg { - type: '/google.protobuf.GeneratedCodeInfo'; - value: GeneratedCodeInfoAmino; -} /** * Describes the relationship between generated code and its original source * file. A GeneratedCodeInfo message is associated with only one generated @@ -2185,30 +1397,6 @@ export interface GeneratedCodeInfo_AnnotationProtoMsg { typeUrl: '/google.protobuf.Annotation'; value: Uint8Array; } -export interface GeneratedCodeInfo_AnnotationAmino { - /** - * Identifies the element in the original source .proto file. This field - * is formatted the same as SourceCodeInfo.Location.path. - */ - path?: number[]; - /** Identifies the filesystem path to the original source .proto. */ - source_file?: string; - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ - begin?: number; - /** - * Identifies the ending offset in bytes in the generated code that - * relates to the identified offset. The end offset should be one past - * the last relevant byte (so the length of the text = end - begin). - */ - end?: number; -} -export interface GeneratedCodeInfo_AnnotationAminoMsg { - type: '/google.protobuf.Annotation'; - value: GeneratedCodeInfo_AnnotationAmino; -} export interface GeneratedCodeInfo_AnnotationSDKType { path: number[]; source_file: string; @@ -2275,26 +1463,6 @@ export const FileDescriptorSet = { object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; return message; }, - fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = - object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; - return message; - }, - toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { - const obj: any = {}; - if (message.file) { - obj.file = message.file.map(e => - e ? FileDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.file = message.file; - } - return obj; - }, - fromAminoMsg(object: FileDescriptorSetAminoMsg): FileDescriptorSet { - return FileDescriptorSet.fromAmino(object.value); - }, fromProtoMsg(message: FileDescriptorSetProtoMsg): FileDescriptorSet { return FileDescriptorSet.decode(message.value); }, @@ -2572,100 +1740,6 @@ export const FileDescriptorProto = { message.syntax = object.syntax ?? ''; return message; }, - fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.package !== undefined && object.package !== null) { - message.package = object.package; - } - message.dependency = object.dependency?.map(e => e) || []; - message.publicDependency = object.public_dependency?.map(e => e) || []; - message.weakDependency = object.weak_dependency?.map(e => e) || []; - message.messageType = - object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; - message.enumType = - object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; - message.service = - object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; - message.extension = - object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; - if (object.options !== undefined && object.options !== null) { - message.options = FileOptions.fromAmino(object.options); - } - if ( - object.source_code_info !== undefined && - object.source_code_info !== null - ) { - message.sourceCodeInfo = SourceCodeInfo.fromAmino( - object.source_code_info, - ); - } - if (object.syntax !== undefined && object.syntax !== null) { - message.syntax = object.syntax; - } - return message; - }, - toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.package = message.package === '' ? undefined : message.package; - if (message.dependency) { - obj.dependency = message.dependency.map(e => e); - } else { - obj.dependency = message.dependency; - } - if (message.publicDependency) { - obj.public_dependency = message.publicDependency.map(e => e); - } else { - obj.public_dependency = message.publicDependency; - } - if (message.weakDependency) { - obj.weak_dependency = message.weakDependency.map(e => e); - } else { - obj.weak_dependency = message.weakDependency; - } - if (message.messageType) { - obj.message_type = message.messageType.map(e => - e ? DescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.message_type = message.messageType; - } - if (message.enumType) { - obj.enum_type = message.enumType.map(e => - e ? EnumDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.enum_type = message.enumType; - } - if (message.service) { - obj.service = message.service.map(e => - e ? ServiceDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.service = message.service; - } - if (message.extension) { - obj.extension = message.extension.map(e => - e ? FieldDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.extension = message.extension; - } - obj.options = message.options - ? FileOptions.toAmino(message.options) - : undefined; - obj.source_code_info = message.sourceCodeInfo - ? SourceCodeInfo.toAmino(message.sourceCodeInfo) - : undefined; - obj.syntax = message.syntax === '' ? undefined : message.syntax; - return obj; - }, - fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { - return FileDescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: FileDescriptorProtoProtoMsg): FileDescriptorProto { return FileDescriptorProto.decode(message.value); }, @@ -2923,100 +1997,6 @@ export const DescriptorProto = { message.reservedName = object.reservedName?.map(e => e) || []; return message; }, - fromAmino(object: DescriptorProtoAmino): DescriptorProto { - const message = createBaseDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - message.field = - object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; - message.extension = - object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; - message.nestedType = - object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; - message.enumType = - object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; - message.extensionRange = - object.extension_range?.map(e => - DescriptorProto_ExtensionRange.fromAmino(e), - ) || []; - message.oneofDecl = - object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; - if (object.options !== undefined && object.options !== null) { - message.options = MessageOptions.fromAmino(object.options); - } - message.reservedRange = - object.reserved_range?.map(e => - DescriptorProto_ReservedRange.fromAmino(e), - ) || []; - message.reservedName = object.reserved_name?.map(e => e) || []; - return message; - }, - toAmino(message: DescriptorProto): DescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - if (message.field) { - obj.field = message.field.map(e => - e ? FieldDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.field = message.field; - } - if (message.extension) { - obj.extension = message.extension.map(e => - e ? FieldDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.extension = message.extension; - } - if (message.nestedType) { - obj.nested_type = message.nestedType.map(e => - e ? DescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.nested_type = message.nestedType; - } - if (message.enumType) { - obj.enum_type = message.enumType.map(e => - e ? EnumDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.enum_type = message.enumType; - } - if (message.extensionRange) { - obj.extension_range = message.extensionRange.map(e => - e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined, - ); - } else { - obj.extension_range = message.extensionRange; - } - if (message.oneofDecl) { - obj.oneof_decl = message.oneofDecl.map(e => - e ? OneofDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.oneof_decl = message.oneofDecl; - } - obj.options = message.options - ? MessageOptions.toAmino(message.options) - : undefined; - if (message.reservedRange) { - obj.reserved_range = message.reservedRange.map(e => - e ? DescriptorProto_ReservedRange.toAmino(e) : undefined, - ); - } else { - obj.reserved_range = message.reservedRange; - } - if (message.reservedName) { - obj.reserved_name = message.reservedName.map(e => e); - } else { - obj.reserved_name = message.reservedName; - } - return obj; - }, - fromAminoMsg(object: DescriptorProtoAminoMsg): DescriptorProto { - return DescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: DescriptorProtoProtoMsg): DescriptorProto { return DescriptorProto.decode(message.value); }, @@ -3118,37 +2098,6 @@ export const DescriptorProto_ExtensionRange = { : undefined; return message; }, - fromAmino( - object: DescriptorProto_ExtensionRangeAmino, - ): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } - if (object.options !== undefined && object.options !== null) { - message.options = ExtensionRangeOptions.fromAmino(object.options); - } - return message; - }, - toAmino( - message: DescriptorProto_ExtensionRange, - ): DescriptorProto_ExtensionRangeAmino { - const obj: any = {}; - obj.start = message.start === 0 ? undefined : message.start; - obj.end = message.end === 0 ? undefined : message.end; - obj.options = message.options - ? ExtensionRangeOptions.toAmino(message.options) - : undefined; - return obj; - }, - fromAminoMsg( - object: DescriptorProto_ExtensionRangeAminoMsg, - ): DescriptorProto_ExtensionRange { - return DescriptorProto_ExtensionRange.fromAmino(object.value); - }, fromProtoMsg( message: DescriptorProto_ExtensionRangeProtoMsg, ): DescriptorProto_ExtensionRange { @@ -3230,31 +2179,6 @@ export const DescriptorProto_ReservedRange = { message.end = object.end ?? 0; return message; }, - fromAmino( - object: DescriptorProto_ReservedRangeAmino, - ): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } - return message; - }, - toAmino( - message: DescriptorProto_ReservedRange, - ): DescriptorProto_ReservedRangeAmino { - const obj: any = {}; - obj.start = message.start === 0 ? undefined : message.start; - obj.end = message.end === 0 ? undefined : message.end; - return obj; - }, - fromAminoMsg( - object: DescriptorProto_ReservedRangeAminoMsg, - ): DescriptorProto_ReservedRange { - return DescriptorProto_ReservedRange.fromAmino(object.value); - }, fromProtoMsg( message: DescriptorProto_ReservedRangeProtoMsg, ): DescriptorProto_ReservedRange { @@ -3339,27 +2263,6 @@ export const ExtensionRangeOptions = { ) || []; return message; }, - fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: ExtensionRangeOptionsAminoMsg): ExtensionRangeOptions { - return ExtensionRangeOptions.fromAmino(object.value); - }, fromProtoMsg(message: ExtensionRangeOptionsProtoMsg): ExtensionRangeOptions { return ExtensionRangeOptions.decode(message.value); }, @@ -3533,60 +2436,6 @@ export const FieldDescriptorProto = { : undefined; return message; }, - fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - if (object.type_name !== undefined && object.type_name !== null) { - message.typeName = object.type_name; - } - if (object.extendee !== undefined && object.extendee !== null) { - message.extendee = object.extendee; - } - if (object.default_value !== undefined && object.default_value !== null) { - message.defaultValue = object.default_value; - } - if (object.oneof_index !== undefined && object.oneof_index !== null) { - message.oneofIndex = object.oneof_index; - } - if (object.json_name !== undefined && object.json_name !== null) { - message.jsonName = object.json_name; - } - if (object.options !== undefined && object.options !== null) { - message.options = FieldOptions.fromAmino(object.options); - } - return message; - }, - toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.number = message.number === 0 ? undefined : message.number; - obj.label = message.label === 1 ? undefined : message.label; - obj.type = message.type === 1 ? undefined : message.type; - obj.type_name = message.typeName === '' ? undefined : message.typeName; - obj.extendee = message.extendee === '' ? undefined : message.extendee; - obj.default_value = - message.defaultValue === '' ? undefined : message.defaultValue; - obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; - obj.json_name = message.jsonName === '' ? undefined : message.jsonName; - obj.options = message.options - ? FieldOptions.toAmino(message.options) - : undefined; - return obj; - }, - fromAminoMsg(object: FieldDescriptorProtoAminoMsg): FieldDescriptorProto { - return FieldDescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: FieldDescriptorProtoProtoMsg): FieldDescriptorProto { return FieldDescriptorProto.decode(message.value); }, @@ -3670,27 +2519,6 @@ export const OneofDescriptorProto = { : undefined; return message; }, - fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.options !== undefined && object.options !== null) { - message.options = OneofOptions.fromAmino(object.options); - } - return message; - }, - toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.options = message.options - ? OneofOptions.toAmino(message.options) - : undefined; - return obj; - }, - fromAminoMsg(object: OneofDescriptorProtoAminoMsg): OneofDescriptorProto { - return OneofDescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: OneofDescriptorProtoProtoMsg): OneofDescriptorProto { return OneofDescriptorProto.decode(message.value); }, @@ -3842,53 +2670,6 @@ export const EnumDescriptorProto = { message.reservedName = object.reservedName?.map(e => e) || []; return message; }, - fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - message.value = - object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; - if (object.options !== undefined && object.options !== null) { - message.options = EnumOptions.fromAmino(object.options); - } - message.reservedRange = - object.reserved_range?.map(e => - EnumDescriptorProto_EnumReservedRange.fromAmino(e), - ) || []; - message.reservedName = object.reserved_name?.map(e => e) || []; - return message; - }, - toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - if (message.value) { - obj.value = message.value.map(e => - e ? EnumValueDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.value = message.value; - } - obj.options = message.options - ? EnumOptions.toAmino(message.options) - : undefined; - if (message.reservedRange) { - obj.reserved_range = message.reservedRange.map(e => - e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined, - ); - } else { - obj.reserved_range = message.reservedRange; - } - if (message.reservedName) { - obj.reserved_name = message.reservedName.map(e => e); - } else { - obj.reserved_name = message.reservedName; - } - return obj; - }, - fromAminoMsg(object: EnumDescriptorProtoAminoMsg): EnumDescriptorProto { - return EnumDescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: EnumDescriptorProtoProtoMsg): EnumDescriptorProto { return EnumDescriptorProto.decode(message.value); }, @@ -3950,46 +2731,21 @@ export const EnumDescriptorProto_EnumReservedRange = { return { start: isSet(object.start) ? Number(object.start) : 0, end: isSet(object.end) ? Number(object.end) : 0, - }; - }, - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - fromPartial( - object: Partial, - ): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, - fromAmino( - object: EnumDescriptorProto_EnumReservedRangeAmino, - ): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - if (object.start !== undefined && object.start !== null) { - message.start = object.start; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } - return message; + }; }, - toAmino( - message: EnumDescriptorProto_EnumReservedRange, - ): EnumDescriptorProto_EnumReservedRangeAmino { + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { const obj: any = {}; - obj.start = message.start === 0 ? undefined : message.start; - obj.end = message.end === 0 ? undefined : message.end; + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromAminoMsg( - object: EnumDescriptorProto_EnumReservedRangeAminoMsg, + fromPartial( + object: Partial, ): EnumDescriptorProto_EnumReservedRange { - return EnumDescriptorProto_EnumReservedRange.fromAmino(object.value); + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; }, fromProtoMsg( message: EnumDescriptorProto_EnumReservedRangeProtoMsg, @@ -4093,33 +2849,6 @@ export const EnumValueDescriptorProto = { : undefined; return message; }, - fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.number !== undefined && object.number !== null) { - message.number = object.number; - } - if (object.options !== undefined && object.options !== null) { - message.options = EnumValueOptions.fromAmino(object.options); - } - return message; - }, - toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.number = message.number === 0 ? undefined : message.number; - obj.options = message.options - ? EnumValueOptions.toAmino(message.options) - : undefined; - return obj; - }, - fromAminoMsg( - object: EnumValueDescriptorProtoAminoMsg, - ): EnumValueDescriptorProto { - return EnumValueDescriptorProto.fromAmino(object.value); - }, fromProtoMsg( message: EnumValueDescriptorProtoProtoMsg, ): EnumValueDescriptorProto { @@ -4228,36 +2957,6 @@ export const ServiceDescriptorProto = { : undefined; return message; }, - fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - message.method = - object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; - if (object.options !== undefined && object.options !== null) { - message.options = ServiceOptions.fromAmino(object.options); - } - return message; - }, - toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - if (message.method) { - obj.method = message.method.map(e => - e ? MethodDescriptorProto.toAmino(e) : undefined, - ); - } else { - obj.method = message.method; - } - obj.options = message.options - ? ServiceOptions.toAmino(message.options) - : undefined; - return obj; - }, - fromAminoMsg(object: ServiceDescriptorProtoAminoMsg): ServiceDescriptorProto { - return ServiceDescriptorProto.fromAmino(object.value); - }, fromProtoMsg( message: ServiceDescriptorProtoProtoMsg, ): ServiceDescriptorProto { @@ -4389,52 +3088,6 @@ export const MethodDescriptorProto = { message.serverStreaming = object.serverStreaming ?? false; return message; }, - fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } - if (object.input_type !== undefined && object.input_type !== null) { - message.inputType = object.input_type; - } - if (object.output_type !== undefined && object.output_type !== null) { - message.outputType = object.output_type; - } - if (object.options !== undefined && object.options !== null) { - message.options = MethodOptions.fromAmino(object.options); - } - if ( - object.client_streaming !== undefined && - object.client_streaming !== null - ) { - message.clientStreaming = object.client_streaming; - } - if ( - object.server_streaming !== undefined && - object.server_streaming !== null - ) { - message.serverStreaming = object.server_streaming; - } - return message; - }, - toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name === '' ? undefined : message.name; - obj.input_type = message.inputType === '' ? undefined : message.inputType; - obj.output_type = - message.outputType === '' ? undefined : message.outputType; - obj.options = message.options - ? MethodOptions.toAmino(message.options) - : undefined; - obj.client_streaming = - message.clientStreaming === false ? undefined : message.clientStreaming; - obj.server_streaming = - message.serverStreaming === false ? undefined : message.serverStreaming; - return obj; - }, - fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { - return MethodDescriptorProto.fromAmino(object.value); - }, fromProtoMsg(message: MethodDescriptorProtoProtoMsg): MethodDescriptorProto { return MethodDescriptorProto.decode(message.value); }, @@ -4761,183 +3414,6 @@ export const FileOptions = { ) || []; return message; }, - fromAmino(object: FileOptionsAmino): FileOptions { - const message = createBaseFileOptions(); - if (object.java_package !== undefined && object.java_package !== null) { - message.javaPackage = object.java_package; - } - if ( - object.java_outer_classname !== undefined && - object.java_outer_classname !== null - ) { - message.javaOuterClassname = object.java_outer_classname; - } - if ( - object.java_multiple_files !== undefined && - object.java_multiple_files !== null - ) { - message.javaMultipleFiles = object.java_multiple_files; - } - if ( - object.java_generate_equals_and_hash !== undefined && - object.java_generate_equals_and_hash !== null - ) { - message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; - } - if ( - object.java_string_check_utf8 !== undefined && - object.java_string_check_utf8 !== null - ) { - message.javaStringCheckUtf8 = object.java_string_check_utf8; - } - if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimizeFor = object.optimize_for; - } - if (object.go_package !== undefined && object.go_package !== null) { - message.goPackage = object.go_package; - } - if ( - object.cc_generic_services !== undefined && - object.cc_generic_services !== null - ) { - message.ccGenericServices = object.cc_generic_services; - } - if ( - object.java_generic_services !== undefined && - object.java_generic_services !== null - ) { - message.javaGenericServices = object.java_generic_services; - } - if ( - object.py_generic_services !== undefined && - object.py_generic_services !== null - ) { - message.pyGenericServices = object.py_generic_services; - } - if ( - object.php_generic_services !== undefined && - object.php_generic_services !== null - ) { - message.phpGenericServices = object.php_generic_services; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - if ( - object.cc_enable_arenas !== undefined && - object.cc_enable_arenas !== null - ) { - message.ccEnableArenas = object.cc_enable_arenas; - } - if ( - object.objc_class_prefix !== undefined && - object.objc_class_prefix !== null - ) { - message.objcClassPrefix = object.objc_class_prefix; - } - if ( - object.csharp_namespace !== undefined && - object.csharp_namespace !== null - ) { - message.csharpNamespace = object.csharp_namespace; - } - if (object.swift_prefix !== undefined && object.swift_prefix !== null) { - message.swiftPrefix = object.swift_prefix; - } - if ( - object.php_class_prefix !== undefined && - object.php_class_prefix !== null - ) { - message.phpClassPrefix = object.php_class_prefix; - } - if (object.php_namespace !== undefined && object.php_namespace !== null) { - message.phpNamespace = object.php_namespace; - } - if ( - object.php_metadata_namespace !== undefined && - object.php_metadata_namespace !== null - ) { - message.phpMetadataNamespace = object.php_metadata_namespace; - } - if (object.ruby_package !== undefined && object.ruby_package !== null) { - message.rubyPackage = object.ruby_package; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: FileOptions): FileOptionsAmino { - const obj: any = {}; - obj.java_package = - message.javaPackage === '' ? undefined : message.javaPackage; - obj.java_outer_classname = - message.javaOuterClassname === '' - ? undefined - : message.javaOuterClassname; - obj.java_multiple_files = - message.javaMultipleFiles === false - ? undefined - : message.javaMultipleFiles; - obj.java_generate_equals_and_hash = - message.javaGenerateEqualsAndHash === false - ? undefined - : message.javaGenerateEqualsAndHash; - obj.java_string_check_utf8 = - message.javaStringCheckUtf8 === false - ? undefined - : message.javaStringCheckUtf8; - obj.optimize_for = - message.optimizeFor === 1 ? undefined : message.optimizeFor; - obj.go_package = message.goPackage === '' ? undefined : message.goPackage; - obj.cc_generic_services = - message.ccGenericServices === false - ? undefined - : message.ccGenericServices; - obj.java_generic_services = - message.javaGenericServices === false - ? undefined - : message.javaGenericServices; - obj.py_generic_services = - message.pyGenericServices === false - ? undefined - : message.pyGenericServices; - obj.php_generic_services = - message.phpGenericServices === false - ? undefined - : message.phpGenericServices; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - obj.cc_enable_arenas = - message.ccEnableArenas === false ? undefined : message.ccEnableArenas; - obj.objc_class_prefix = - message.objcClassPrefix === '' ? undefined : message.objcClassPrefix; - obj.csharp_namespace = - message.csharpNamespace === '' ? undefined : message.csharpNamespace; - obj.swift_prefix = - message.swiftPrefix === '' ? undefined : message.swiftPrefix; - obj.php_class_prefix = - message.phpClassPrefix === '' ? undefined : message.phpClassPrefix; - obj.php_namespace = - message.phpNamespace === '' ? undefined : message.phpNamespace; - obj.php_metadata_namespace = - message.phpMetadataNamespace === '' - ? undefined - : message.phpMetadataNamespace; - obj.ruby_package = - message.rubyPackage === '' ? undefined : message.rubyPackage; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: FileOptionsAminoMsg): FileOptions { - return FileOptions.fromAmino(object.value); - }, fromProtoMsg(message: FileOptionsProtoMsg): FileOptions { return FileOptions.decode(message.value); }, @@ -5062,57 +3538,6 @@ export const MessageOptions = { ) || []; return message; }, - fromAmino(object: MessageOptionsAmino): MessageOptions { - const message = createBaseMessageOptions(); - if ( - object.message_set_wire_format !== undefined && - object.message_set_wire_format !== null - ) { - message.messageSetWireFormat = object.message_set_wire_format; - } - if ( - object.no_standard_descriptor_accessor !== undefined && - object.no_standard_descriptor_accessor !== null - ) { - message.noStandardDescriptorAccessor = - object.no_standard_descriptor_accessor; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - if (object.map_entry !== undefined && object.map_entry !== null) { - message.mapEntry = object.map_entry; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: MessageOptions): MessageOptionsAmino { - const obj: any = {}; - obj.message_set_wire_format = - message.messageSetWireFormat === false - ? undefined - : message.messageSetWireFormat; - obj.no_standard_descriptor_accessor = - message.noStandardDescriptorAccessor === false - ? undefined - : message.noStandardDescriptorAccessor; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: MessageOptionsAminoMsg): MessageOptions { - return MessageOptions.fromAmino(object.value); - }, fromProtoMsg(message: MessageOptionsProtoMsg): MessageOptions { return MessageOptions.decode(message.value); }, @@ -5256,52 +3681,6 @@ export const FieldOptions = { ) || []; return message; }, - fromAmino(object: FieldOptionsAmino): FieldOptions { - const message = createBaseFieldOptions(); - if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = object.ctype; - } - if (object.packed !== undefined && object.packed !== null) { - message.packed = object.packed; - } - if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = object.jstype; - } - if (object.lazy !== undefined && object.lazy !== null) { - message.lazy = object.lazy; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - if (object.weak !== undefined && object.weak !== null) { - message.weak = object.weak; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: FieldOptions): FieldOptionsAmino { - const obj: any = {}; - obj.ctype = message.ctype === 1 ? undefined : message.ctype; - obj.packed = message.packed === false ? undefined : message.packed; - obj.jstype = message.jstype === 1 ? undefined : message.jstype; - obj.lazy = message.lazy === false ? undefined : message.lazy; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - obj.weak = message.weak === false ? undefined : message.weak; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: FieldOptionsAminoMsg): FieldOptions { - return FieldOptions.fromAmino(object.value); - }, fromProtoMsg(message: FieldOptionsProtoMsg): FieldOptions { return FieldOptions.decode(message.value); }, @@ -5379,27 +3758,6 @@ export const OneofOptions = { ) || []; return message; }, - fromAmino(object: OneofOptionsAmino): OneofOptions { - const message = createBaseOneofOptions(); - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: OneofOptions): OneofOptionsAmino { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: OneofOptionsAminoMsg): OneofOptions { - return OneofOptions.fromAmino(object.value); - }, fromProtoMsg(message: OneofOptionsProtoMsg): OneofOptions { return OneofOptions.decode(message.value); }, @@ -5497,37 +3855,6 @@ export const EnumOptions = { ) || []; return message; }, - fromAmino(object: EnumOptionsAmino): EnumOptions { - const message = createBaseEnumOptions(); - if (object.allow_alias !== undefined && object.allow_alias !== null) { - message.allowAlias = object.allow_alias; - } - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: EnumOptions): EnumOptionsAmino { - const obj: any = {}; - obj.allow_alias = - message.allowAlias === false ? undefined : message.allowAlias; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: EnumOptionsAminoMsg): EnumOptions { - return EnumOptions.fromAmino(object.value); - }, fromProtoMsg(message: EnumOptionsProtoMsg): EnumOptions { return EnumOptions.decode(message.value); }, @@ -5615,32 +3942,6 @@ export const EnumValueOptions = { ) || []; return message; }, - fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { - const message = createBaseEnumValueOptions(); - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: EnumValueOptions): EnumValueOptionsAmino { - const obj: any = {}; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: EnumValueOptionsAminoMsg): EnumValueOptions { - return EnumValueOptions.fromAmino(object.value); - }, fromProtoMsg(message: EnumValueOptionsProtoMsg): EnumValueOptions { return EnumValueOptions.decode(message.value); }, @@ -5728,32 +4029,6 @@ export const ServiceOptions = { ) || []; return message; }, - fromAmino(object: ServiceOptionsAmino): ServiceOptions { - const message = createBaseServiceOptions(); - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: ServiceOptions): ServiceOptionsAmino { - const obj: any = {}; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: ServiceOptionsAminoMsg): ServiceOptions { - return ServiceOptions.fromAmino(object.value); - }, fromProtoMsg(message: ServiceOptionsProtoMsg): ServiceOptions { return ServiceOptions.decode(message.value); }, @@ -5856,40 +4131,6 @@ export const MethodOptions = { ) || []; return message; }, - fromAmino(object: MethodOptionsAmino): MethodOptions { - const message = createBaseMethodOptions(); - if (object.deprecated !== undefined && object.deprecated !== null) { - message.deprecated = object.deprecated; - } - if ( - object.idempotency_level !== undefined && - object.idempotency_level !== null - ) { - message.idempotencyLevel = object.idempotency_level; - } - message.uninterpretedOption = - object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || - []; - return message; - }, - toAmino(message: MethodOptions): MethodOptionsAmino { - const obj: any = {}; - obj.deprecated = - message.deprecated === false ? undefined : message.deprecated; - obj.idempotency_level = - message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; - if (message.uninterpretedOption) { - obj.uninterpreted_option = message.uninterpretedOption.map(e => - e ? UninterpretedOption.toAmino(e) : undefined, - ); - } else { - obj.uninterpreted_option = message.uninterpretedOption; - } - return obj; - }, - fromAminoMsg(object: MethodOptionsAminoMsg): MethodOptions { - return MethodOptions.fromAmino(object.value); - }, fromProtoMsg(message: MethodOptionsProtoMsg): MethodOptions { return MethodOptions.decode(message.value); }, @@ -6059,73 +4300,6 @@ export const UninterpretedOption = { message.aggregateValue = object.aggregateValue ?? ''; return message; }, - fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = - object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; - if ( - object.identifier_value !== undefined && - object.identifier_value !== null - ) { - message.identifierValue = object.identifier_value; - } - if ( - object.positive_int_value !== undefined && - object.positive_int_value !== null - ) { - message.positiveIntValue = BigInt(object.positive_int_value); - } - if ( - object.negative_int_value !== undefined && - object.negative_int_value !== null - ) { - message.negativeIntValue = BigInt(object.negative_int_value); - } - if (object.double_value !== undefined && object.double_value !== null) { - message.doubleValue = object.double_value; - } - if (object.string_value !== undefined && object.string_value !== null) { - message.stringValue = bytesFromBase64(object.string_value); - } - if ( - object.aggregate_value !== undefined && - object.aggregate_value !== null - ) { - message.aggregateValue = object.aggregate_value; - } - return message; - }, - toAmino(message: UninterpretedOption): UninterpretedOptionAmino { - const obj: any = {}; - if (message.name) { - obj.name = message.name.map(e => - e ? UninterpretedOption_NamePart.toAmino(e) : undefined, - ); - } else { - obj.name = message.name; - } - obj.identifier_value = - message.identifierValue === '' ? undefined : message.identifierValue; - obj.positive_int_value = - message.positiveIntValue !== BigInt(0) - ? message.positiveIntValue.toString() - : undefined; - obj.negative_int_value = - message.negativeIntValue !== BigInt(0) - ? message.negativeIntValue.toString() - : undefined; - obj.double_value = - message.doubleValue === 0 ? undefined : message.doubleValue; - obj.string_value = message.stringValue - ? base64FromBytes(message.stringValue) - : undefined; - obj.aggregate_value = - message.aggregateValue === '' ? undefined : message.aggregateValue; - return obj; - }, - fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { - return UninterpretedOption.fromAmino(object.value); - }, fromProtoMsg(message: UninterpretedOptionProtoMsg): UninterpretedOption { return UninterpretedOption.decode(message.value); }, @@ -6206,32 +4380,6 @@ export const UninterpretedOption_NamePart = { message.isExtension = object.isExtension ?? false; return message; }, - fromAmino( - object: UninterpretedOption_NamePartAmino, - ): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - if (object.name_part !== undefined && object.name_part !== null) { - message.namePart = object.name_part; - } - if (object.is_extension !== undefined && object.is_extension !== null) { - message.isExtension = object.is_extension; - } - return message; - }, - toAmino( - message: UninterpretedOption_NamePart, - ): UninterpretedOption_NamePartAmino { - const obj: any = {}; - obj.name_part = message.namePart === '' ? undefined : message.namePart; - obj.is_extension = - message.isExtension === false ? undefined : message.isExtension; - return obj; - }, - fromAminoMsg( - object: UninterpretedOption_NamePartAminoMsg, - ): UninterpretedOption_NamePart { - return UninterpretedOption_NamePart.fromAmino(object.value); - }, fromProtoMsg( message: UninterpretedOption_NamePartProtoMsg, ): UninterpretedOption_NamePart { @@ -6309,26 +4457,6 @@ export const SourceCodeInfo = { object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, - fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = - object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; - return message; - }, - toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { - const obj: any = {}; - if (message.location) { - obj.location = message.location.map(e => - e ? SourceCodeInfo_Location.toAmino(e) : undefined, - ); - } else { - obj.location = message.location; - } - return obj; - }, - fromAminoMsg(object: SourceCodeInfoAminoMsg): SourceCodeInfo { - return SourceCodeInfo.fromAmino(object.value); - }, fromProtoMsg(message: SourceCodeInfoProtoMsg): SourceCodeInfo { return SourceCodeInfo.decode(message.value); }, @@ -6479,56 +4607,6 @@ export const SourceCodeInfo_Location = { object.leadingDetachedComments?.map(e => e) || []; return message; }, - fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map(e => e) || []; - message.span = object.span?.map(e => e) || []; - if ( - object.leading_comments !== undefined && - object.leading_comments !== null - ) { - message.leadingComments = object.leading_comments; - } - if ( - object.trailing_comments !== undefined && - object.trailing_comments !== null - ) { - message.trailingComments = object.trailing_comments; - } - message.leadingDetachedComments = - object.leading_detached_comments?.map(e => e) || []; - return message; - }, - toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map(e => e); - } else { - obj.path = message.path; - } - if (message.span) { - obj.span = message.span.map(e => e); - } else { - obj.span = message.span; - } - obj.leading_comments = - message.leadingComments === '' ? undefined : message.leadingComments; - obj.trailing_comments = - message.trailingComments === '' ? undefined : message.trailingComments; - if (message.leadingDetachedComments) { - obj.leading_detached_comments = message.leadingDetachedComments.map( - e => e, - ); - } else { - obj.leading_detached_comments = message.leadingDetachedComments; - } - return obj; - }, - fromAminoMsg( - object: SourceCodeInfo_LocationAminoMsg, - ): SourceCodeInfo_Location { - return SourceCodeInfo_Location.fromAmino(object.value); - }, fromProtoMsg( message: SourceCodeInfo_LocationProtoMsg, ): SourceCodeInfo_Location { @@ -6613,27 +4691,6 @@ export const GeneratedCodeInfo = { ) || []; return message; }, - fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = - object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || - []; - return message; - }, - toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { - const obj: any = {}; - if (message.annotation) { - obj.annotation = message.annotation.map(e => - e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined, - ); - } else { - obj.annotation = message.annotation; - } - return obj; - }, - fromAminoMsg(object: GeneratedCodeInfoAminoMsg): GeneratedCodeInfo { - return GeneratedCodeInfo.fromAmino(object.value); - }, fromProtoMsg(message: GeneratedCodeInfoProtoMsg): GeneratedCodeInfo { return GeneratedCodeInfo.decode(message.value); }, @@ -6746,42 +4803,6 @@ export const GeneratedCodeInfo_Annotation = { message.end = object.end ?? 0; return message; }, - fromAmino( - object: GeneratedCodeInfo_AnnotationAmino, - ): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map(e => e) || []; - if (object.source_file !== undefined && object.source_file !== null) { - message.sourceFile = object.source_file; - } - if (object.begin !== undefined && object.begin !== null) { - message.begin = object.begin; - } - if (object.end !== undefined && object.end !== null) { - message.end = object.end; - } - return message; - }, - toAmino( - message: GeneratedCodeInfo_Annotation, - ): GeneratedCodeInfo_AnnotationAmino { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map(e => e); - } else { - obj.path = message.path; - } - obj.source_file = - message.sourceFile === '' ? undefined : message.sourceFile; - obj.begin = message.begin === 0 ? undefined : message.begin; - obj.end = message.end === 0 ? undefined : message.end; - return obj; - }, - fromAminoMsg( - object: GeneratedCodeInfo_AnnotationAminoMsg, - ): GeneratedCodeInfo_Annotation { - return GeneratedCodeInfo_Annotation.fromAmino(object.value); - }, fromProtoMsg( message: GeneratedCodeInfo_AnnotationProtoMsg, ): GeneratedCodeInfo_Annotation { diff --git a/packages/cosmic-proto/src/codegen/google/protobuf/duration.ts b/packages/cosmic-proto/src/codegen/google/protobuf/duration.ts index a115d746ce8..1441e5186f9 100644 --- a/packages/cosmic-proto/src/codegen/google/protobuf/duration.ts +++ b/packages/cosmic-proto/src/codegen/google/protobuf/duration.ts @@ -82,71 +82,6 @@ export interface DurationProtoMsg { typeUrl: '/google.protobuf.Duration'; value: Uint8Array; } -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export type DurationAmino = string; -export interface DurationAminoMsg { - type: '/google.protobuf.Duration'; - value: DurationAmino; -} /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -276,22 +211,6 @@ export const Duration = { message.nanos = object.nanos ?? 0; return message; }, - fromAmino(object: DurationAmino): Duration { - const value = BigInt(object); - return { - seconds: value / BigInt('1000000000'), - nanos: Number(value % BigInt('1000000000')), - }; - }, - toAmino(message: Duration): DurationAmino { - return ( - message.seconds * BigInt('1000000000') + - BigInt(message.nanos) - ).toString(); - }, - fromAminoMsg(object: DurationAminoMsg): Duration { - return Duration.fromAmino(object.value); - }, fromProtoMsg(message: DurationProtoMsg): Duration { return Duration.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/google/protobuf/empty.ts b/packages/cosmic-proto/src/codegen/google/protobuf/empty.ts index fc143db4b8a..d89eb8faf47 100644 --- a/packages/cosmic-proto/src/codegen/google/protobuf/empty.ts +++ b/packages/cosmic-proto/src/codegen/google/protobuf/empty.ts @@ -16,22 +16,6 @@ export interface EmptyProtoMsg { typeUrl: '/google.protobuf.Empty'; value: Uint8Array; } -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - */ -export interface EmptyAmino {} -export interface EmptyAminoMsg { - type: '/google.protobuf.Empty'; - value: EmptyAmino; -} /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request @@ -78,17 +62,6 @@ export const Empty = { const message = createBaseEmpty(); return message; }, - fromAmino(_: EmptyAmino): Empty { - const message = createBaseEmpty(); - return message; - }, - toAmino(_: Empty): EmptyAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: EmptyAminoMsg): Empty { - return Empty.fromAmino(object.value); - }, fromProtoMsg(message: EmptyProtoMsg): Empty { return Empty.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/google/protobuf/timestamp.ts b/packages/cosmic-proto/src/codegen/google/protobuf/timestamp.ts index 4d656537d77..2571fd85e73 100644 --- a/packages/cosmic-proto/src/codegen/google/protobuf/timestamp.ts +++ b/packages/cosmic-proto/src/codegen/google/protobuf/timestamp.ts @@ -1,6 +1,6 @@ //@ts-nocheck import { BinaryReader, BinaryWriter } from '../../binary.js'; -import { isSet, fromJsonTimestamp, fromTimestamp } from '../../helpers.js'; +import { isSet } from '../../helpers.js'; /** * A Timestamp represents a point in time independent of any time zone or local * calendar, encoded as a count of seconds and fractions of seconds at @@ -104,95 +104,6 @@ export interface TimestampProtoMsg { typeUrl: '/google.protobuf.Timestamp'; value: Uint8Array; } -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export type TimestampAmino = string; -export interface TimestampAminoMsg { - type: '/google.protobuf.Timestamp'; - value: TimestampAmino; -} /** * A Timestamp represents a point in time independent of any time zone or local * calendar, encoded as a count of seconds and fractions of seconds at @@ -346,17 +257,6 @@ export const Timestamp = { message.nanos = object.nanos ?? 0; return message; }, - fromAmino(object: TimestampAmino): Timestamp { - return fromJsonTimestamp(object); - }, - toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message) - .toISOString() - .replace(/\.\d+Z$/, 'Z'); - }, - fromAminoMsg(object: TimestampAminoMsg): Timestamp { - return Timestamp.fromAmino(object.value); - }, fromProtoMsg(message: TimestampProtoMsg): Timestamp { return Timestamp.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/ibc/core/channel/v1/channel.ts b/packages/cosmic-proto/src/codegen/ibc/core/channel/v1/channel.ts index b012c58306a..65c0499473e 100644 --- a/packages/cosmic-proto/src/codegen/ibc/core/channel/v1/channel.ts +++ b/packages/cosmic-proto/src/codegen/ibc/core/channel/v1/channel.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { Height, HeightAmino, HeightSDKType } from '../../client/v1/client.js'; +import { Height, HeightSDKType } from '../../client/v1/client.js'; import { BinaryReader, BinaryWriter } from '../../../../binary.js'; import { isSet, @@ -30,7 +30,6 @@ export enum State { UNRECOGNIZED = -1, } export const StateSDKType = State; -export const StateAmino = State; export function stateFromJSON(object: any): State { switch (object) { case 0: @@ -85,7 +84,6 @@ export enum Order { UNRECOGNIZED = -1, } export const OrderSDKType = Order; -export const OrderAmino = Order; export function orderFromJSON(object: any): Order { switch (object) { case 0: @@ -140,30 +138,6 @@ export interface ChannelProtoMsg { typeUrl: '/ibc.core.channel.v1.Channel'; value: Uint8Array; } -/** - * Channel defines pipeline for exactly-once packet delivery between specific - * modules on separate blockchains, which has at least one end capable of - * sending packets and one end capable of receiving packets. - */ -export interface ChannelAmino { - /** current state of the channel end */ - state?: State; - /** whether the channel is ordered or unordered */ - ordering?: Order; - /** counterparty channel end */ - counterparty?: CounterpartyAmino; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops?: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version?: string; -} -export interface ChannelAminoMsg { - type: 'cosmos-sdk/Channel'; - value: ChannelAmino; -} /** * Channel defines pipeline for exactly-once packet delivery between specific * modules on separate blockchains, which has at least one end capable of @@ -203,33 +177,6 @@ export interface IdentifiedChannelProtoMsg { typeUrl: '/ibc.core.channel.v1.IdentifiedChannel'; value: Uint8Array; } -/** - * IdentifiedChannel defines a channel with additional port and channel - * identifier fields. - */ -export interface IdentifiedChannelAmino { - /** current state of the channel end */ - state?: State; - /** whether the channel is ordered or unordered */ - ordering?: Order; - /** counterparty channel end */ - counterparty?: CounterpartyAmino; - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops?: string[]; - /** opaque channel version, which is agreed upon during the handshake */ - version?: string; - /** port identifier */ - port_id?: string; - /** channel identifier */ - channel_id?: string; -} -export interface IdentifiedChannelAminoMsg { - type: 'cosmos-sdk/IdentifiedChannel'; - value: IdentifiedChannelAmino; -} /** * IdentifiedChannel defines a channel with additional port and channel * identifier fields. @@ -255,17 +202,6 @@ export interface CounterpartyProtoMsg { value: Uint8Array; } /** Counterparty defines a channel end counterparty */ -export interface CounterpartyAmino { - /** port on the counterparty chain which owns the other end of the channel. */ - port_id?: string; - /** channel end on the counterparty chain */ - channel_id?: string; -} -export interface CounterpartyAminoMsg { - type: 'cosmos-sdk/Counterparty'; - value: CounterpartyAmino; -} -/** Counterparty defines a channel end counterparty */ export interface CounterpartySDKType { port_id: string; channel_id: string; @@ -298,33 +234,6 @@ export interface PacketProtoMsg { value: Uint8Array; } /** Packet defines a type that carries data across different chains through IBC */ -export interface PacketAmino { - /** - * number corresponds to the order of sends and receives, where a Packet - * with an earlier sequence number must be sent and received before a Packet - * with a later sequence number. - */ - sequence?: string; - /** identifies the port on the sending chain. */ - source_port?: string; - /** identifies the channel end on the sending chain. */ - source_channel?: string; - /** identifies the port on the receiving chain. */ - destination_port?: string; - /** identifies the channel end on the receiving chain. */ - destination_channel?: string; - /** actual opaque bytes transferred directly to the application module */ - data?: string; - /** block height after which the packet times out */ - timeout_height?: HeightAmino; - /** block timestamp (in nanoseconds) after which the packet times out */ - timeout_timestamp?: string; -} -export interface PacketAminoMsg { - type: 'cosmos-sdk/Packet'; - value: PacketAmino; -} -/** Packet defines a type that carries data across different chains through IBC */ export interface PacketSDKType { sequence: bigint; source_port: string; @@ -355,26 +264,6 @@ export interface PacketStateProtoMsg { typeUrl: '/ibc.core.channel.v1.PacketState'; value: Uint8Array; } -/** - * PacketState defines the generic type necessary to retrieve and store - * packet commitments, acknowledgements, and receipts. - * Caller is responsible for knowing the context necessary to interpret this - * state as a commitment, acknowledgement, or a receipt. - */ -export interface PacketStateAmino { - /** channel port identifier. */ - port_id?: string; - /** channel unique identifier. */ - channel_id?: string; - /** packet sequence. */ - sequence?: string; - /** embedded data that represents packet state. */ - data?: string; -} -export interface PacketStateAminoMsg { - type: 'cosmos-sdk/PacketState'; - value: PacketStateAmino; -} /** * PacketState defines the generic type necessary to retrieve and store * packet commitments, acknowledgements, and receipts. @@ -404,23 +293,6 @@ export interface PacketIdProtoMsg { typeUrl: '/ibc.core.channel.v1.PacketId'; value: Uint8Array; } -/** - * PacketId is an identifer for a unique Packet - * Source chains refer to packets by source port/channel - * Destination chains refer to packets by destination port/channel - */ -export interface PacketIdAmino { - /** channel port identifier */ - port_id?: string; - /** channel unique identifier */ - channel_id?: string; - /** packet sequence */ - sequence?: string; -} -export interface PacketIdAminoMsg { - type: 'cosmos-sdk/PacketId'; - value: PacketIdAmino; -} /** * PacketId is an identifer for a unique Packet * Source chains refer to packets by source port/channel @@ -448,23 +320,6 @@ export interface AcknowledgementProtoMsg { typeUrl: '/ibc.core.channel.v1.Acknowledgement'; value: Uint8Array; } -/** - * Acknowledgement is the recommended acknowledgement format to be used by - * app-specific protocols. - * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental - * conflicts with other protobuf message formats used for acknowledgements. - * The first byte of any message with this format will be the non-ASCII values - * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: - * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope - */ -export interface AcknowledgementAmino { - result?: string; - error?: string; -} -export interface AcknowledgementAminoMsg { - type: 'cosmos-sdk/Acknowledgement'; - value: AcknowledgementAmino; -} /** * Acknowledgement is the recommended acknowledgement format to be used by * app-specific protocols. @@ -585,47 +440,6 @@ export const Channel = { message.version = object.version ?? ''; return message; }, - fromAmino(object: ChannelAmino): Channel { - const message = createBaseChannel(); - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromAmino(object.counterparty); - } - message.connectionHops = object.connection_hops?.map(e => e) || []; - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } - return message; - }, - toAmino(message: Channel): ChannelAmino { - const obj: any = {}; - obj.state = message.state === 0 ? undefined : message.state; - obj.ordering = message.ordering === 0 ? undefined : message.ordering; - obj.counterparty = message.counterparty - ? Counterparty.toAmino(message.counterparty) - : undefined; - if (message.connectionHops) { - obj.connection_hops = message.connectionHops.map(e => e); - } else { - obj.connection_hops = message.connectionHops; - } - obj.version = message.version === '' ? undefined : message.version; - return obj; - }, - fromAminoMsg(object: ChannelAminoMsg): Channel { - return Channel.fromAmino(object.value); - }, - toAminoMsg(message: Channel): ChannelAminoMsg { - return { - type: 'cosmos-sdk/Channel', - value: Channel.toAmino(message), - }; - }, fromProtoMsg(message: ChannelProtoMsg): Channel { return Channel.decode(message.value); }, @@ -766,55 +580,6 @@ export const IdentifiedChannel = { message.channelId = object.channelId ?? ''; return message; }, - fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { - const message = createBaseIdentifiedChannel(); - if (object.state !== undefined && object.state !== null) { - message.state = object.state; - } - if (object.ordering !== undefined && object.ordering !== null) { - message.ordering = object.ordering; - } - if (object.counterparty !== undefined && object.counterparty !== null) { - message.counterparty = Counterparty.fromAmino(object.counterparty); - } - message.connectionHops = object.connection_hops?.map(e => e) || []; - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } - if (object.port_id !== undefined && object.port_id !== null) { - message.portId = object.port_id; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channelId = object.channel_id; - } - return message; - }, - toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { - const obj: any = {}; - obj.state = message.state === 0 ? undefined : message.state; - obj.ordering = message.ordering === 0 ? undefined : message.ordering; - obj.counterparty = message.counterparty - ? Counterparty.toAmino(message.counterparty) - : undefined; - if (message.connectionHops) { - obj.connection_hops = message.connectionHops.map(e => e); - } else { - obj.connection_hops = message.connectionHops; - } - obj.version = message.version === '' ? undefined : message.version; - obj.port_id = message.portId === '' ? undefined : message.portId; - obj.channel_id = message.channelId === '' ? undefined : message.channelId; - return obj; - }, - fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { - return IdentifiedChannel.fromAmino(object.value); - }, - toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { - return { - type: 'cosmos-sdk/IdentifiedChannel', - value: IdentifiedChannel.toAmino(message), - }; - }, fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { return IdentifiedChannel.decode(message.value); }, @@ -887,31 +652,6 @@ export const Counterparty = { message.channelId = object.channelId ?? ''; return message; }, - fromAmino(object: CounterpartyAmino): Counterparty { - const message = createBaseCounterparty(); - if (object.port_id !== undefined && object.port_id !== null) { - message.portId = object.port_id; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channelId = object.channel_id; - } - return message; - }, - toAmino(message: Counterparty): CounterpartyAmino { - const obj: any = {}; - obj.port_id = message.portId === '' ? undefined : message.portId; - obj.channel_id = message.channelId === '' ? undefined : message.channelId; - return obj; - }, - fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { - return Counterparty.fromAmino(object.value); - }, - toAminoMsg(message: Counterparty): CounterpartyAminoMsg { - return { - type: 'cosmos-sdk/Counterparty', - value: Counterparty.toAmino(message), - }; - }, fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { return Counterparty.decode(message.value); }, @@ -1080,76 +820,6 @@ export const Packet = { : BigInt(0); return message; }, - fromAmino(object: PacketAmino): Packet { - const message = createBasePacket(); - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - if (object.source_port !== undefined && object.source_port !== null) { - message.sourcePort = object.source_port; - } - if (object.source_channel !== undefined && object.source_channel !== null) { - message.sourceChannel = object.source_channel; - } - if ( - object.destination_port !== undefined && - object.destination_port !== null - ) { - message.destinationPort = object.destination_port; - } - if ( - object.destination_channel !== undefined && - object.destination_channel !== null - ) { - message.destinationChannel = object.destination_channel; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.timeout_height !== undefined && object.timeout_height !== null) { - message.timeoutHeight = Height.fromAmino(object.timeout_height); - } - if ( - object.timeout_timestamp !== undefined && - object.timeout_timestamp !== null - ) { - message.timeoutTimestamp = BigInt(object.timeout_timestamp); - } - return message; - }, - toAmino(message: Packet): PacketAmino { - const obj: any = {}; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - obj.source_port = - message.sourcePort === '' ? undefined : message.sourcePort; - obj.source_channel = - message.sourceChannel === '' ? undefined : message.sourceChannel; - obj.destination_port = - message.destinationPort === '' ? undefined : message.destinationPort; - obj.destination_channel = - message.destinationChannel === '' - ? undefined - : message.destinationChannel; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.timeout_height = message.timeoutHeight - ? Height.toAmino(message.timeoutHeight) - : {}; - obj.timeout_timestamp = - message.timeoutTimestamp !== BigInt(0) - ? message.timeoutTimestamp.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: PacketAminoMsg): Packet { - return Packet.fromAmino(object.value); - }, - toAminoMsg(message: Packet): PacketAminoMsg { - return { - type: 'cosmos-sdk/Packet', - value: Packet.toAmino(message), - }; - }, fromProtoMsg(message: PacketProtoMsg): Packet { return Packet.decode(message.value); }, @@ -1253,40 +923,6 @@ export const PacketState = { message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: PacketStateAmino): PacketState { - const message = createBasePacketState(); - if (object.port_id !== undefined && object.port_id !== null) { - message.portId = object.port_id; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channelId = object.channel_id; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - toAmino(message: PacketState): PacketStateAmino { - const obj: any = {}; - obj.port_id = message.portId === '' ? undefined : message.portId; - obj.channel_id = message.channelId === '' ? undefined : message.channelId; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - return obj; - }, - fromAminoMsg(object: PacketStateAminoMsg): PacketState { - return PacketState.fromAmino(object.value); - }, - toAminoMsg(message: PacketState): PacketStateAminoMsg { - return { - type: 'cosmos-sdk/PacketState', - value: PacketState.toAmino(message), - }; - }, fromProtoMsg(message: PacketStateProtoMsg): PacketState { return PacketState.decode(message.value); }, @@ -1375,36 +1011,6 @@ export const PacketId = { : BigInt(0); return message; }, - fromAmino(object: PacketIdAmino): PacketId { - const message = createBasePacketId(); - if (object.port_id !== undefined && object.port_id !== null) { - message.portId = object.port_id; - } - if (object.channel_id !== undefined && object.channel_id !== null) { - message.channelId = object.channel_id; - } - if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = BigInt(object.sequence); - } - return message; - }, - toAmino(message: PacketId): PacketIdAmino { - const obj: any = {}; - obj.port_id = message.portId === '' ? undefined : message.portId; - obj.channel_id = message.channelId === '' ? undefined : message.channelId; - obj.sequence = - message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; - return obj; - }, - fromAminoMsg(object: PacketIdAminoMsg): PacketId { - return PacketId.fromAmino(object.value); - }, - toAminoMsg(message: PacketId): PacketIdAminoMsg { - return { - type: 'cosmos-sdk/PacketId', - value: PacketId.toAmino(message), - }; - }, fromProtoMsg(message: PacketIdProtoMsg): PacketId { return PacketId.decode(message.value); }, @@ -1481,31 +1087,6 @@ export const Acknowledgement = { message.error = object.error ?? undefined; return message; }, - fromAmino(object: AcknowledgementAmino): Acknowledgement { - const message = createBaseAcknowledgement(); - if (object.result !== undefined && object.result !== null) { - message.result = bytesFromBase64(object.result); - } - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } - return message; - }, - toAmino(message: Acknowledgement): AcknowledgementAmino { - const obj: any = {}; - obj.result = message.result ? base64FromBytes(message.result) : undefined; - obj.error = message.error === null ? undefined : message.error; - return obj; - }, - fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { - return Acknowledgement.fromAmino(object.value); - }, - toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { - return { - type: 'cosmos-sdk/Acknowledgement', - value: Acknowledgement.toAmino(message), - }; - }, fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { return Acknowledgement.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/ibc/core/client/v1/client.ts b/packages/cosmic-proto/src/codegen/ibc/core/client/v1/client.ts index dfe6bea0048..0f814f1e25d 100644 --- a/packages/cosmic-proto/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/cosmic-proto/src/codegen/ibc/core/client/v1/client.ts @@ -1,8 +1,7 @@ //@ts-nocheck -import { Any, AnyAmino, AnySDKType } from '../../../../google/protobuf/any.js'; +import { Any, AnySDKType } from '../../../../google/protobuf/any.js'; import { Plan, - PlanAmino, PlanSDKType, } from '../../../../cosmos/upgrade/v1beta1/upgrade.js'; import { BinaryReader, BinaryWriter } from '../../../../binary.js'; @@ -21,20 +20,6 @@ export interface IdentifiedClientStateProtoMsg { typeUrl: '/ibc.core.client.v1.IdentifiedClientState'; value: Uint8Array; } -/** - * IdentifiedClientState defines a client state with an additional client - * identifier field. - */ -export interface IdentifiedClientStateAmino { - /** client identifier */ - client_id?: string; - /** client state */ - client_state?: AnyAmino; -} -export interface IdentifiedClientStateAminoMsg { - type: 'cosmos-sdk/IdentifiedClientState'; - value: IdentifiedClientStateAmino; -} /** * IdentifiedClientState defines a client state with an additional client * identifier field. @@ -57,20 +42,6 @@ export interface ConsensusStateWithHeightProtoMsg { typeUrl: '/ibc.core.client.v1.ConsensusStateWithHeight'; value: Uint8Array; } -/** - * ConsensusStateWithHeight defines a consensus state with an additional height - * field. - */ -export interface ConsensusStateWithHeightAmino { - /** consensus state height */ - height?: HeightAmino; - /** consensus state */ - consensus_state?: AnyAmino; -} -export interface ConsensusStateWithHeightAminoMsg { - type: 'cosmos-sdk/ConsensusStateWithHeight'; - value: ConsensusStateWithHeightAmino; -} /** * ConsensusStateWithHeight defines a consensus state with an additional height * field. @@ -93,20 +64,6 @@ export interface ClientConsensusStatesProtoMsg { typeUrl: '/ibc.core.client.v1.ClientConsensusStates'; value: Uint8Array; } -/** - * ClientConsensusStates defines all the stored consensus states for a given - * client. - */ -export interface ClientConsensusStatesAmino { - /** client identifier */ - client_id?: string; - /** consensus states and their heights associated with the client */ - consensus_states?: ConsensusStateWithHeightAmino[]; -} -export interface ClientConsensusStatesAminoMsg { - type: 'cosmos-sdk/ClientConsensusStates'; - value: ClientConsensusStatesAmino; -} /** * ClientConsensusStates defines all the stored consensus states for a given * client. @@ -139,29 +96,6 @@ export interface ClientUpdateProposalProtoMsg { typeUrl: '/ibc.core.client.v1.ClientUpdateProposal'; value: Uint8Array; } -/** - * ClientUpdateProposal is a 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). - */ -export interface ClientUpdateProposalAmino { - /** the title of the update proposal */ - title?: string; - /** the description of the proposal */ - description?: string; - /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id?: string; - /** - * the substitute client identifier for the client standing in for the subject - * client - */ - substitute_client_id?: string; -} -export interface ClientUpdateProposalAminoMsg { - type: 'cosmos-sdk/ClientUpdateProposal'; - value: ClientUpdateProposalAmino; -} /** * ClientUpdateProposal is a governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal @@ -198,28 +132,6 @@ export interface UpgradeProposalProtoMsg { typeUrl: '/ibc.core.client.v1.UpgradeProposal'; value: Uint8Array; } -/** - * UpgradeProposal is a gov Content type for initiating an IBC breaking - * upgrade. - */ -export interface UpgradeProposalAmino { - title?: string; - description?: string; - plan?: PlanAmino; - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ - upgraded_client_state?: AnyAmino; -} -export interface UpgradeProposalAminoMsg { - type: 'cosmos-sdk/UpgradeProposal'; - value: UpgradeProposalAmino; -} /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. @@ -253,28 +165,6 @@ 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 @@ -301,15 +191,6 @@ export interface ParamsProtoMsg { value: Uint8Array; } /** Params defines the set of IBC light client parameters. */ -export interface ParamsAmino { - /** allowed_clients defines the list of allowed client state types. */ - 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[]; } @@ -383,33 +264,6 @@ export const IdentifiedClientState = { : undefined; return message; }, - fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { - const message = createBaseIdentifiedClientState(); - if (object.client_id !== undefined && object.client_id !== null) { - message.clientId = object.client_id; - } - if (object.client_state !== undefined && object.client_state !== null) { - message.clientState = Any.fromAmino(object.client_state); - } - return message; - }, - toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { - const obj: any = {}; - obj.client_id = message.clientId === '' ? undefined : message.clientId; - obj.client_state = message.clientState - ? Any.toAmino(message.clientState) - : undefined; - return obj; - }, - fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { - return IdentifiedClientState.fromAmino(object.value); - }, - toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { - return { - type: 'cosmos-sdk/IdentifiedClientState', - value: IdentifiedClientState.toAmino(message), - }; - }, fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { return IdentifiedClientState.decode(message.value); }, @@ -499,40 +353,6 @@ export const ConsensusStateWithHeight = { : undefined; return message; }, - fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { - const message = createBaseConsensusStateWithHeight(); - if (object.height !== undefined && object.height !== null) { - message.height = Height.fromAmino(object.height); - } - if ( - object.consensus_state !== undefined && - object.consensus_state !== null - ) { - message.consensusState = Any.fromAmino(object.consensus_state); - } - return message; - }, - toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { - const obj: any = {}; - obj.height = message.height ? Height.toAmino(message.height) : undefined; - obj.consensus_state = message.consensusState - ? Any.toAmino(message.consensusState) - : undefined; - return obj; - }, - fromAminoMsg( - object: ConsensusStateWithHeightAminoMsg, - ): ConsensusStateWithHeight { - return ConsensusStateWithHeight.fromAmino(object.value); - }, - toAminoMsg( - message: ConsensusStateWithHeight, - ): ConsensusStateWithHeightAminoMsg { - return { - type: 'cosmos-sdk/ConsensusStateWithHeight', - value: ConsensusStateWithHeight.toAmino(message), - }; - }, fromProtoMsg( message: ConsensusStateWithHeightProtoMsg, ): ConsensusStateWithHeight { @@ -627,38 +447,6 @@ export const ClientConsensusStates = { ) || []; return message; }, - fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { - const message = createBaseClientConsensusStates(); - if (object.client_id !== undefined && object.client_id !== null) { - message.clientId = object.client_id; - } - message.consensusStates = - object.consensus_states?.map(e => - ConsensusStateWithHeight.fromAmino(e), - ) || []; - return message; - }, - toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { - const obj: any = {}; - obj.client_id = message.clientId === '' ? undefined : message.clientId; - if (message.consensusStates) { - obj.consensus_states = message.consensusStates.map(e => - e ? ConsensusStateWithHeight.toAmino(e) : undefined, - ); - } else { - obj.consensus_states = message.consensusStates; - } - return obj; - }, - fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { - return ClientConsensusStates.fromAmino(object.value); - }, - toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { - return { - type: 'cosmos-sdk/ClientConsensusStates', - value: ClientConsensusStates.toAmino(message), - }; - }, fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { return ClientConsensusStates.decode(message.value); }, @@ -762,50 +550,6 @@ export const ClientUpdateProposal = { message.substituteClientId = object.substituteClientId ?? ''; return message; }, - fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - if ( - object.subject_client_id !== undefined && - object.subject_client_id !== null - ) { - message.subjectClientId = object.subject_client_id; - } - if ( - object.substitute_client_id !== undefined && - object.substitute_client_id !== null - ) { - message.substituteClientId = object.substitute_client_id; - } - return message; - }, - toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - obj.subject_client_id = - message.subjectClientId === '' ? undefined : message.subjectClientId; - obj.substitute_client_id = - message.substituteClientId === '' - ? undefined - : message.substituteClientId; - return obj; - }, - fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { - return ClientUpdateProposal.fromAmino(object.value); - }, - toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { - return { - type: 'cosmos-sdk/ClientUpdateProposal', - value: ClientUpdateProposal.toAmino(message), - }; - }, fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { return ClientUpdateProposal.decode(message.value); }, @@ -916,45 +660,6 @@ export const UpgradeProposal = { : undefined; return message; }, - fromAmino(object: UpgradeProposalAmino): UpgradeProposal { - const message = createBaseUpgradeProposal(); - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.description !== undefined && object.description !== null) { - message.description = object.description; - } - if (object.plan !== undefined && object.plan !== null) { - message.plan = Plan.fromAmino(object.plan); - } - if ( - object.upgraded_client_state !== undefined && - object.upgraded_client_state !== null - ) { - message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); - } - return message; - }, - toAmino(message: UpgradeProposal): UpgradeProposalAmino { - const obj: any = {}; - obj.title = message.title === '' ? undefined : message.title; - obj.description = - message.description === '' ? undefined : message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; - obj.upgraded_client_state = message.upgradedClientState - ? Any.toAmino(message.upgradedClientState) - : undefined; - return obj; - }, - fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { - return UpgradeProposal.fromAmino(object.value); - }, - toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { - return { - type: 'cosmos-sdk/UpgradeProposal', - value: UpgradeProposal.toAmino(message), - }; - }, fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { return UpgradeProposal.decode(message.value); }, @@ -1039,33 +744,6 @@ export const Height = { : 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); }, @@ -1134,29 +812,6 @@ export const Params = { 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); }, diff --git a/packages/cosmic-proto/src/codegen/index.ts b/packages/cosmic-proto/src/codegen/index.ts index 0bcc4876ed1..77fea02d995 100644 --- a/packages/cosmic-proto/src/codegen/index.ts +++ b/packages/cosmic-proto/src/codegen/index.ts @@ -6,11 +6,9 @@ */ export * from './agoric/bundle.js'; -export * from './agoric/client.js'; export * from './amino/bundle.js'; export * from './cosmos_proto/bundle.js'; export * from './cosmos/bundle.js'; -export * from './cosmos/client.js'; export * from './gogoproto/bundle.js'; export * from './google/bundle.js'; export * from './ibc/bundle.js'; diff --git a/packages/cosmic-proto/src/codegen/tendermint/abci/types.ts b/packages/cosmic-proto/src/codegen/tendermint/abci/types.ts index 9162276b73b..78b5b5e62a4 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/abci/types.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/abci/types.ts @@ -1,19 +1,16 @@ //@ts-nocheck import { Timestamp } from '../../google/protobuf/timestamp.js'; -import { Header, HeaderAmino, HeaderSDKType } from '../types/types.js'; -import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from '../crypto/proof.js'; +import { Header, HeaderSDKType } from '../types/types.js'; +import { ProofOps, ProofOpsSDKType } from '../crypto/proof.js'; import { EvidenceParams, - EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, - ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, - VersionParamsAmino, VersionParamsSDKType, } from '../types/params.js'; -import { PublicKey, PublicKeyAmino, PublicKeySDKType } from '../crypto/keys.js'; +import { PublicKey, PublicKeySDKType } from '../crypto/keys.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, @@ -29,7 +26,6 @@ export enum CheckTxType { UNRECOGNIZED = -1, } export const CheckTxTypeSDKType = CheckTxType; -export const CheckTxTypeAmino = CheckTxType; export function checkTxTypeFromJSON(object: any): CheckTxType { switch (object) { case 0: @@ -71,7 +67,6 @@ export enum ResponseOfferSnapshot_Result { UNRECOGNIZED = -1, } export const ResponseOfferSnapshot_ResultSDKType = ResponseOfferSnapshot_Result; -export const ResponseOfferSnapshot_ResultAmino = ResponseOfferSnapshot_Result; export function responseOfferSnapshot_ResultFromJSON( object: any, ): ResponseOfferSnapshot_Result { @@ -138,8 +133,6 @@ export enum ResponseApplySnapshotChunk_Result { } export const ResponseApplySnapshotChunk_ResultSDKType = ResponseApplySnapshotChunk_Result; -export const ResponseApplySnapshotChunk_ResultAmino = - ResponseApplySnapshotChunk_Result; export function responseApplySnapshotChunk_ResultFromJSON( object: any, ): ResponseApplySnapshotChunk_Result { @@ -196,7 +189,6 @@ export enum EvidenceType { UNRECOGNIZED = -1, } export const EvidenceTypeSDKType = EvidenceType; -export const EvidenceTypeAmino = EvidenceType; export function evidenceTypeFromJSON(object: any): EvidenceType { switch (object) { case 0: @@ -248,27 +240,6 @@ export interface RequestProtoMsg { typeUrl: '/tendermint.abci.Request'; value: Uint8Array; } -export interface RequestAmino { - echo?: RequestEchoAmino; - flush?: RequestFlushAmino; - info?: RequestInfoAmino; - set_option?: RequestSetOptionAmino; - init_chain?: RequestInitChainAmino; - query?: RequestQueryAmino; - begin_block?: RequestBeginBlockAmino; - check_tx?: RequestCheckTxAmino; - deliver_tx?: RequestDeliverTxAmino; - end_block?: RequestEndBlockAmino; - commit?: RequestCommitAmino; - list_snapshots?: RequestListSnapshotsAmino; - offer_snapshot?: RequestOfferSnapshotAmino; - load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; - apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; -} -export interface RequestAminoMsg { - type: '/tendermint.abci.Request'; - value: RequestAmino; -} export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; @@ -293,13 +264,6 @@ export interface RequestEchoProtoMsg { typeUrl: '/tendermint.abci.RequestEcho'; value: Uint8Array; } -export interface RequestEchoAmino { - message?: string; -} -export interface RequestEchoAminoMsg { - type: '/tendermint.abci.RequestEcho'; - value: RequestEchoAmino; -} export interface RequestEchoSDKType { message: string; } @@ -308,11 +272,6 @@ export interface RequestFlushProtoMsg { typeUrl: '/tendermint.abci.RequestFlush'; value: Uint8Array; } -export interface RequestFlushAmino {} -export interface RequestFlushAminoMsg { - type: '/tendermint.abci.RequestFlush'; - value: RequestFlushAmino; -} export interface RequestFlushSDKType {} export interface RequestInfo { version: string; @@ -323,15 +282,6 @@ export interface RequestInfoProtoMsg { typeUrl: '/tendermint.abci.RequestInfo'; value: Uint8Array; } -export interface RequestInfoAmino { - version?: string; - block_version?: string; - p2p_version?: string; -} -export interface RequestInfoAminoMsg { - type: '/tendermint.abci.RequestInfo'; - value: RequestInfoAmino; -} export interface RequestInfoSDKType { version: string; block_version: bigint; @@ -347,15 +297,6 @@ export interface RequestSetOptionProtoMsg { value: Uint8Array; } /** nondeterministic */ -export interface RequestSetOptionAmino { - key?: string; - value?: string; -} -export interface RequestSetOptionAminoMsg { - type: '/tendermint.abci.RequestSetOption'; - value: RequestSetOptionAmino; -} -/** nondeterministic */ export interface RequestSetOptionSDKType { key: string; value: string; @@ -372,18 +313,6 @@ export interface RequestInitChainProtoMsg { typeUrl: '/tendermint.abci.RequestInitChain'; value: Uint8Array; } -export interface RequestInitChainAmino { - time?: string; - chain_id?: string; - consensus_params?: ConsensusParamsAmino; - validators?: ValidatorUpdateAmino[]; - app_state_bytes?: string; - initial_height?: string; -} -export interface RequestInitChainAminoMsg { - type: '/tendermint.abci.RequestInitChain'; - value: RequestInitChainAmino; -} export interface RequestInitChainSDKType { time: Date; chain_id: string; @@ -402,16 +331,6 @@ export interface RequestQueryProtoMsg { typeUrl: '/tendermint.abci.RequestQuery'; value: Uint8Array; } -export interface RequestQueryAmino { - data?: string; - path?: string; - height?: string; - prove?: boolean; -} -export interface RequestQueryAminoMsg { - type: '/tendermint.abci.RequestQuery'; - value: RequestQueryAmino; -} export interface RequestQuerySDKType { data: Uint8Array; path: string; @@ -428,16 +347,6 @@ export interface RequestBeginBlockProtoMsg { typeUrl: '/tendermint.abci.RequestBeginBlock'; value: Uint8Array; } -export interface RequestBeginBlockAmino { - hash?: string; - header?: HeaderAmino; - last_commit_info?: LastCommitInfoAmino; - byzantine_validators?: EvidenceAmino[]; -} -export interface RequestBeginBlockAminoMsg { - type: '/tendermint.abci.RequestBeginBlock'; - value: RequestBeginBlockAmino; -} export interface RequestBeginBlockSDKType { hash: Uint8Array; header: HeaderSDKType; @@ -452,14 +361,6 @@ export interface RequestCheckTxProtoMsg { typeUrl: '/tendermint.abci.RequestCheckTx'; value: Uint8Array; } -export interface RequestCheckTxAmino { - tx?: string; - type?: CheckTxType; -} -export interface RequestCheckTxAminoMsg { - type: '/tendermint.abci.RequestCheckTx'; - value: RequestCheckTxAmino; -} export interface RequestCheckTxSDKType { tx: Uint8Array; type: CheckTxType; @@ -471,13 +372,6 @@ export interface RequestDeliverTxProtoMsg { typeUrl: '/tendermint.abci.RequestDeliverTx'; value: Uint8Array; } -export interface RequestDeliverTxAmino { - tx?: string; -} -export interface RequestDeliverTxAminoMsg { - type: '/tendermint.abci.RequestDeliverTx'; - value: RequestDeliverTxAmino; -} export interface RequestDeliverTxSDKType { tx: Uint8Array; } @@ -488,13 +382,6 @@ export interface RequestEndBlockProtoMsg { typeUrl: '/tendermint.abci.RequestEndBlock'; value: Uint8Array; } -export interface RequestEndBlockAmino { - height?: string; -} -export interface RequestEndBlockAminoMsg { - type: '/tendermint.abci.RequestEndBlock'; - value: RequestEndBlockAmino; -} export interface RequestEndBlockSDKType { height: bigint; } @@ -503,11 +390,6 @@ export interface RequestCommitProtoMsg { typeUrl: '/tendermint.abci.RequestCommit'; value: Uint8Array; } -export interface RequestCommitAmino {} -export interface RequestCommitAminoMsg { - type: '/tendermint.abci.RequestCommit'; - value: RequestCommitAmino; -} export interface RequestCommitSDKType {} /** lists available snapshots */ export interface RequestListSnapshots {} @@ -516,12 +398,6 @@ export interface RequestListSnapshotsProtoMsg { value: Uint8Array; } /** lists available snapshots */ -export interface RequestListSnapshotsAmino {} -export interface RequestListSnapshotsAminoMsg { - type: '/tendermint.abci.RequestListSnapshots'; - value: RequestListSnapshotsAmino; -} -/** lists available snapshots */ export interface RequestListSnapshotsSDKType {} /** offers a snapshot to the application */ export interface RequestOfferSnapshot { @@ -535,17 +411,6 @@ export interface RequestOfferSnapshotProtoMsg { value: Uint8Array; } /** offers a snapshot to the application */ -export interface RequestOfferSnapshotAmino { - /** snapshot offered by peers */ - snapshot?: SnapshotAmino; - /** light client-verified app hash for snapshot height */ - app_hash?: string; -} -export interface RequestOfferSnapshotAminoMsg { - type: '/tendermint.abci.RequestOfferSnapshot'; - value: RequestOfferSnapshotAmino; -} -/** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { snapshot?: SnapshotSDKType; app_hash: Uint8Array; @@ -561,16 +426,6 @@ export interface RequestLoadSnapshotChunkProtoMsg { value: Uint8Array; } /** loads a snapshot chunk */ -export interface RequestLoadSnapshotChunkAmino { - height?: string; - format?: number; - chunk?: number; -} -export interface RequestLoadSnapshotChunkAminoMsg { - type: '/tendermint.abci.RequestLoadSnapshotChunk'; - value: RequestLoadSnapshotChunkAmino; -} -/** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkSDKType { height: bigint; format: number; @@ -587,16 +442,6 @@ export interface RequestApplySnapshotChunkProtoMsg { value: Uint8Array; } /** Applies a snapshot chunk */ -export interface RequestApplySnapshotChunkAmino { - index?: number; - chunk?: string; - sender?: string; -} -export interface RequestApplySnapshotChunkAminoMsg { - type: '/tendermint.abci.RequestApplySnapshotChunk'; - value: RequestApplySnapshotChunkAmino; -} -/** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkSDKType { index: number; chunk: Uint8Array; @@ -624,28 +469,6 @@ export interface ResponseProtoMsg { typeUrl: '/tendermint.abci.Response'; value: Uint8Array; } -export interface ResponseAmino { - exception?: ResponseExceptionAmino; - echo?: ResponseEchoAmino; - flush?: ResponseFlushAmino; - info?: ResponseInfoAmino; - set_option?: ResponseSetOptionAmino; - init_chain?: ResponseInitChainAmino; - query?: ResponseQueryAmino; - begin_block?: ResponseBeginBlockAmino; - check_tx?: ResponseCheckTxAmino; - deliver_tx?: ResponseDeliverTxAmino; - end_block?: ResponseEndBlockAmino; - commit?: ResponseCommitAmino; - list_snapshots?: ResponseListSnapshotsAmino; - offer_snapshot?: ResponseOfferSnapshotAmino; - load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; - apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; -} -export interface ResponseAminoMsg { - type: '/tendermint.abci.Response'; - value: ResponseAmino; -} export interface ResponseSDKType { exception?: ResponseExceptionSDKType; echo?: ResponseEchoSDKType; @@ -673,14 +496,6 @@ export interface ResponseExceptionProtoMsg { value: Uint8Array; } /** nondeterministic */ -export interface ResponseExceptionAmino { - error?: string; -} -export interface ResponseExceptionAminoMsg { - type: '/tendermint.abci.ResponseException'; - value: ResponseExceptionAmino; -} -/** nondeterministic */ export interface ResponseExceptionSDKType { error: string; } @@ -691,13 +506,6 @@ export interface ResponseEchoProtoMsg { typeUrl: '/tendermint.abci.ResponseEcho'; value: Uint8Array; } -export interface ResponseEchoAmino { - message?: string; -} -export interface ResponseEchoAminoMsg { - type: '/tendermint.abci.ResponseEcho'; - value: ResponseEchoAmino; -} export interface ResponseEchoSDKType { message: string; } @@ -706,11 +514,6 @@ export interface ResponseFlushProtoMsg { typeUrl: '/tendermint.abci.ResponseFlush'; value: Uint8Array; } -export interface ResponseFlushAmino {} -export interface ResponseFlushAminoMsg { - type: '/tendermint.abci.ResponseFlush'; - value: ResponseFlushAmino; -} export interface ResponseFlushSDKType {} export interface ResponseInfo { data: string; @@ -723,17 +526,6 @@ export interface ResponseInfoProtoMsg { typeUrl: '/tendermint.abci.ResponseInfo'; value: Uint8Array; } -export interface ResponseInfoAmino { - data?: string; - version?: string; - app_version?: string; - last_block_height?: string; - last_block_app_hash?: string; -} -export interface ResponseInfoAminoMsg { - type: '/tendermint.abci.ResponseInfo'; - value: ResponseInfoAmino; -} export interface ResponseInfoSDKType { data: string; version: string; @@ -753,17 +545,6 @@ export interface ResponseSetOptionProtoMsg { value: Uint8Array; } /** nondeterministic */ -export interface ResponseSetOptionAmino { - code?: number; - /** bytes data = 2; */ - log?: string; - info?: string; -} -export interface ResponseSetOptionAminoMsg { - type: '/tendermint.abci.ResponseSetOption'; - value: ResponseSetOptionAmino; -} -/** nondeterministic */ export interface ResponseSetOptionSDKType { code: number; log: string; @@ -778,15 +559,6 @@ export interface ResponseInitChainProtoMsg { typeUrl: '/tendermint.abci.ResponseInitChain'; value: Uint8Array; } -export interface ResponseInitChainAmino { - consensus_params?: ConsensusParamsAmino; - validators?: ValidatorUpdateAmino[]; - app_hash?: string; -} -export interface ResponseInitChainAminoMsg { - type: '/tendermint.abci.ResponseInitChain'; - value: ResponseInitChainAmino; -} export interface ResponseInitChainSDKType { consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; @@ -809,23 +581,6 @@ export interface ResponseQueryProtoMsg { typeUrl: '/tendermint.abci.ResponseQuery'; value: Uint8Array; } -export interface ResponseQueryAmino { - code?: number; - /** bytes data = 2; // use "value" instead. */ - log?: string; - /** nondeterministic */ - info?: string; - index?: string; - key?: string; - value?: string; - proof_ops?: ProofOpsAmino; - height?: string; - codespace?: string; -} -export interface ResponseQueryAminoMsg { - type: '/tendermint.abci.ResponseQuery'; - value: ResponseQueryAmino; -} export interface ResponseQuerySDKType { code: number; log: string; @@ -844,13 +599,6 @@ export interface ResponseBeginBlockProtoMsg { typeUrl: '/tendermint.abci.ResponseBeginBlock'; value: Uint8Array; } -export interface ResponseBeginBlockAmino { - events?: EventAmino[]; -} -export interface ResponseBeginBlockAminoMsg { - type: '/tendermint.abci.ResponseBeginBlock'; - value: ResponseBeginBlockAmino; -} export interface ResponseBeginBlockSDKType { events: EventSDKType[]; } @@ -870,22 +618,6 @@ export interface ResponseCheckTxProtoMsg { typeUrl: '/tendermint.abci.ResponseCheckTx'; value: Uint8Array; } -export interface ResponseCheckTxAmino { - code?: number; - data?: string; - /** nondeterministic */ - log?: string; - /** nondeterministic */ - info?: string; - gas_wanted?: string; - gas_used?: string; - events?: EventAmino[]; - codespace?: string; -} -export interface ResponseCheckTxAminoMsg { - type: '/tendermint.abci.ResponseCheckTx'; - value: ResponseCheckTxAmino; -} export interface ResponseCheckTxSDKType { code: number; data: Uint8Array; @@ -912,22 +644,6 @@ export interface ResponseDeliverTxProtoMsg { typeUrl: '/tendermint.abci.ResponseDeliverTx'; value: Uint8Array; } -export interface ResponseDeliverTxAmino { - code?: number; - data?: string; - /** nondeterministic */ - log?: string; - /** nondeterministic */ - info?: string; - gas_wanted?: string; - gas_used?: string; - events?: EventAmino[]; - codespace?: string; -} -export interface ResponseDeliverTxAminoMsg { - type: '/tendermint.abci.ResponseDeliverTx'; - value: ResponseDeliverTxAmino; -} export interface ResponseDeliverTxSDKType { code: number; data: Uint8Array; @@ -947,15 +663,6 @@ export interface ResponseEndBlockProtoMsg { typeUrl: '/tendermint.abci.ResponseEndBlock'; value: Uint8Array; } -export interface ResponseEndBlockAmino { - validator_updates?: ValidatorUpdateAmino[]; - consensus_param_updates?: ConsensusParamsAmino; - events?: EventAmino[]; -} -export interface ResponseEndBlockAminoMsg { - type: '/tendermint.abci.ResponseEndBlock'; - value: ResponseEndBlockAmino; -} export interface ResponseEndBlockSDKType { validator_updates: ValidatorUpdateSDKType[]; consensus_param_updates?: ConsensusParamsSDKType; @@ -970,15 +677,6 @@ export interface ResponseCommitProtoMsg { typeUrl: '/tendermint.abci.ResponseCommit'; value: Uint8Array; } -export interface ResponseCommitAmino { - /** reserve 1 */ - data?: string; - retain_height?: string; -} -export interface ResponseCommitAminoMsg { - type: '/tendermint.abci.ResponseCommit'; - value: ResponseCommitAmino; -} export interface ResponseCommitSDKType { data: Uint8Array; retain_height: bigint; @@ -990,13 +688,6 @@ export interface ResponseListSnapshotsProtoMsg { typeUrl: '/tendermint.abci.ResponseListSnapshots'; value: Uint8Array; } -export interface ResponseListSnapshotsAmino { - snapshots?: SnapshotAmino[]; -} -export interface ResponseListSnapshotsAminoMsg { - type: '/tendermint.abci.ResponseListSnapshots'; - value: ResponseListSnapshotsAmino; -} export interface ResponseListSnapshotsSDKType { snapshots: SnapshotSDKType[]; } @@ -1007,13 +698,6 @@ export interface ResponseOfferSnapshotProtoMsg { typeUrl: '/tendermint.abci.ResponseOfferSnapshot'; value: Uint8Array; } -export interface ResponseOfferSnapshotAmino { - result?: ResponseOfferSnapshot_Result; -} -export interface ResponseOfferSnapshotAminoMsg { - type: '/tendermint.abci.ResponseOfferSnapshot'; - value: ResponseOfferSnapshotAmino; -} export interface ResponseOfferSnapshotSDKType { result: ResponseOfferSnapshot_Result; } @@ -1024,13 +708,6 @@ export interface ResponseLoadSnapshotChunkProtoMsg { typeUrl: '/tendermint.abci.ResponseLoadSnapshotChunk'; value: Uint8Array; } -export interface ResponseLoadSnapshotChunkAmino { - chunk?: string; -} -export interface ResponseLoadSnapshotChunkAminoMsg { - type: '/tendermint.abci.ResponseLoadSnapshotChunk'; - value: ResponseLoadSnapshotChunkAmino; -} export interface ResponseLoadSnapshotChunkSDKType { chunk: Uint8Array; } @@ -1045,17 +722,6 @@ export interface ResponseApplySnapshotChunkProtoMsg { typeUrl: '/tendermint.abci.ResponseApplySnapshotChunk'; value: Uint8Array; } -export interface ResponseApplySnapshotChunkAmino { - result?: ResponseApplySnapshotChunk_Result; - /** Chunks to refetch and reapply */ - refetch_chunks?: number[]; - /** Chunk senders to reject and ban */ - reject_senders?: string[]; -} -export interface ResponseApplySnapshotChunkAminoMsg { - type: '/tendermint.abci.ResponseApplySnapshotChunk'; - value: ResponseApplySnapshotChunkAmino; -} export interface ResponseApplySnapshotChunkSDKType { result: ResponseApplySnapshotChunk_Result; refetch_chunks: number[]; @@ -1075,20 +741,6 @@ export interface ConsensusParamsProtoMsg { typeUrl: '/tendermint.abci.ConsensusParams'; value: Uint8Array; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; -} -export interface ConsensusParamsAminoMsg { - type: '/tendermint.abci.ConsensusParams'; - value: ConsensusParamsAmino; -} /** * ConsensusParams contains all consensus-relevant parameters * that can be adjusted by the abci app @@ -1111,17 +763,6 @@ export interface BlockParamsProtoMsg { value: Uint8Array; } /** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** Note: must be greater than 0 */ - max_bytes?: string; - /** Note: must be greater or equal to -1 */ - max_gas?: string; -} -export interface BlockParamsAminoMsg { - type: '/tendermint.abci.BlockParams'; - value: BlockParamsAmino; -} -/** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; @@ -1134,14 +775,6 @@ export interface LastCommitInfoProtoMsg { typeUrl: '/tendermint.abci.LastCommitInfo'; value: Uint8Array; } -export interface LastCommitInfoAmino { - round?: number; - votes?: VoteInfoAmino[]; -} -export interface LastCommitInfoAminoMsg { - type: '/tendermint.abci.LastCommitInfo'; - value: LastCommitInfoAmino; -} export interface LastCommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; @@ -1159,19 +792,6 @@ export interface EventProtoMsg { typeUrl: '/tendermint.abci.Event'; value: Uint8Array; } -/** - * Event allows application developers to attach additional information to - * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. - * Later, transactions may be queried using these events. - */ -export interface EventAmino { - type?: string; - attributes?: EventAttributeAmino[]; -} -export interface EventAminoMsg { - type: '/tendermint.abci.Event'; - value: EventAmino; -} /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -1193,17 +813,6 @@ export interface EventAttributeProtoMsg { value: Uint8Array; } /** EventAttribute is a single key-value pair, associated with an event. */ -export interface EventAttributeAmino { - key?: string; - value?: string; - /** nondeterministic */ - index?: boolean; -} -export interface EventAttributeAminoMsg { - type: '/tendermint.abci.EventAttribute'; - value: EventAttributeAmino; -} -/** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { key: Uint8Array; value: Uint8Array; @@ -1224,21 +833,6 @@ export interface TxResultProtoMsg { typeUrl: '/tendermint.abci.TxResult'; value: Uint8Array; } -/** - * TxResult contains results of executing the transaction. - * - * One usage is indexing transaction results. - */ -export interface TxResultAmino { - height?: string; - index?: number; - tx?: string; - result?: ResponseDeliverTxAmino; -} -export interface TxResultAminoMsg { - type: '/tendermint.abci.TxResult'; - value: TxResultAmino; -} /** * TxResult contains results of executing the transaction. * @@ -1265,20 +859,6 @@ export interface ValidatorProtoMsg { value: Uint8Array; } /** Validator */ -export interface ValidatorAmino { - /** - * The first 20 bytes of SHA256(public key) - * PubKey pub_key = 2 [(gogoproto.nullable)=false]; - */ - address?: string; - /** The voting power */ - power?: string; -} -export interface ValidatorAminoMsg { - type: '/tendermint.abci.Validator'; - value: ValidatorAmino; -} -/** Validator */ export interface ValidatorSDKType { address: Uint8Array; power: bigint; @@ -1293,15 +873,6 @@ export interface ValidatorUpdateProtoMsg { value: Uint8Array; } /** ValidatorUpdate */ -export interface ValidatorUpdateAmino { - pub_key?: PublicKeyAmino; - power?: string; -} -export interface ValidatorUpdateAminoMsg { - type: '/tendermint.abci.ValidatorUpdate'; - value: ValidatorUpdateAmino; -} -/** ValidatorUpdate */ export interface ValidatorUpdateSDKType { pub_key: PublicKeySDKType; power: bigint; @@ -1316,15 +887,6 @@ export interface VoteInfoProtoMsg { value: Uint8Array; } /** VoteInfo */ -export interface VoteInfoAmino { - validator?: ValidatorAmino; - signed_last_block?: boolean; -} -export interface VoteInfoAminoMsg { - type: '/tendermint.abci.VoteInfo'; - value: VoteInfoAmino; -} -/** VoteInfo */ export interface VoteInfoSDKType { validator: ValidatorSDKType; signed_last_block: boolean; @@ -1348,25 +910,6 @@ export interface EvidenceProtoMsg { typeUrl: '/tendermint.abci.Evidence'; value: Uint8Array; } -export interface EvidenceAmino { - type?: EvidenceType; - /** The offending validator */ - validator?: ValidatorAmino; - /** The height when the offense occurred */ - height?: string; - /** The corresponding time where the offense occurred */ - time?: string; - /** - * Total voting power of the validator set in case the ABCI application does - * not store historical validators. - * https://github.com/tendermint/tendermint/issues/4581 - */ - total_voting_power?: string; -} -export interface EvidenceAminoMsg { - type: '/tendermint.abci.Evidence'; - value: EvidenceAmino; -} export interface EvidenceSDKType { type: EvidenceType; validator: ValidatorSDKType; @@ -1390,22 +933,6 @@ export interface SnapshotProtoMsg { typeUrl: '/tendermint.abci.Snapshot'; value: Uint8Array; } -export interface SnapshotAmino { - /** The height at which the snapshot was taken */ - height?: string; - /** The application-specific snapshot format */ - format?: number; - /** Number of chunks in the snapshot */ - chunks?: number; - /** Arbitrary snapshot hash, equal only if identical */ - hash?: string; - /** Arbitrary application metadata */ - metadata?: string; -} -export interface SnapshotAminoMsg { - type: '/tendermint.abci.Snapshot'; - value: SnapshotAmino; -} export interface SnapshotSDKType { height: bigint; format: number; @@ -1758,113 +1285,6 @@ export const Request = { : undefined; return message; }, - fromAmino(object: RequestAmino): Request { - const message = createBaseRequest(); - if (object.echo !== undefined && object.echo !== null) { - message.echo = RequestEcho.fromAmino(object.echo); - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = RequestFlush.fromAmino(object.flush); - } - if (object.info !== undefined && object.info !== null) { - message.info = RequestInfo.fromAmino(object.info); - } - if (object.set_option !== undefined && object.set_option !== null) { - message.setOption = RequestSetOption.fromAmino(object.set_option); - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.initChain = RequestInitChain.fromAmino(object.init_chain); - } - if (object.query !== undefined && object.query !== null) { - message.query = RequestQuery.fromAmino(object.query); - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.checkTx = RequestCheckTx.fromAmino(object.check_tx); - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); - } - if (object.end_block !== undefined && object.end_block !== null) { - message.endBlock = RequestEndBlock.fromAmino(object.end_block); - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = RequestCommit.fromAmino(object.commit); - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.listSnapshots = RequestListSnapshots.fromAmino( - object.list_snapshots, - ); - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offerSnapshot = RequestOfferSnapshot.fromAmino( - object.offer_snapshot, - ); - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino( - object.load_snapshot_chunk, - ); - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino( - object.apply_snapshot_chunk, - ); - } - return message; - }, - toAmino(message: Request): RequestAmino { - const obj: any = {}; - obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; - obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; - obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption - ? RequestSetOption.toAmino(message.setOption) - : undefined; - obj.init_chain = message.initChain - ? RequestInitChain.toAmino(message.initChain) - : undefined; - obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; - obj.begin_block = message.beginBlock - ? RequestBeginBlock.toAmino(message.beginBlock) - : undefined; - obj.check_tx = message.checkTx - ? RequestCheckTx.toAmino(message.checkTx) - : undefined; - obj.deliver_tx = message.deliverTx - ? RequestDeliverTx.toAmino(message.deliverTx) - : undefined; - obj.end_block = message.endBlock - ? RequestEndBlock.toAmino(message.endBlock) - : undefined; - obj.commit = message.commit - ? RequestCommit.toAmino(message.commit) - : undefined; - obj.list_snapshots = message.listSnapshots - ? RequestListSnapshots.toAmino(message.listSnapshots) - : undefined; - obj.offer_snapshot = message.offerSnapshot - ? RequestOfferSnapshot.toAmino(message.offerSnapshot) - : undefined; - obj.load_snapshot_chunk = message.loadSnapshotChunk - ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) - : undefined; - obj.apply_snapshot_chunk = message.applySnapshotChunk - ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) - : undefined; - return obj; - }, - fromAminoMsg(object: RequestAminoMsg): Request { - return Request.fromAmino(object.value); - }, fromProtoMsg(message: RequestProtoMsg): Request { return Request.decode(message.value); }, @@ -1927,21 +1347,6 @@ export const RequestEcho = { message.message = object.message ?? ''; return message; }, - fromAmino(object: RequestEchoAmino): RequestEcho { - const message = createBaseRequestEcho(); - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } - return message; - }, - toAmino(message: RequestEcho): RequestEchoAmino { - const obj: any = {}; - obj.message = message.message === '' ? undefined : message.message; - return obj; - }, - fromAminoMsg(object: RequestEchoAminoMsg): RequestEcho { - return RequestEcho.fromAmino(object.value); - }, fromProtoMsg(message: RequestEchoProtoMsg): RequestEcho { return RequestEcho.decode(message.value); }, @@ -1992,17 +1397,6 @@ export const RequestFlush = { const message = createBaseRequestFlush(); return message; }, - fromAmino(_: RequestFlushAmino): RequestFlush { - const message = createBaseRequestFlush(); - return message; - }, - toAmino(_: RequestFlush): RequestFlushAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: RequestFlushAminoMsg): RequestFlush { - return RequestFlush.fromAmino(object.value); - }, fromProtoMsg(message: RequestFlushProtoMsg): RequestFlush { return RequestFlush.decode(message.value); }, @@ -2097,35 +1491,6 @@ export const RequestInfo = { : BigInt(0); return message; }, - fromAmino(object: RequestInfoAmino): RequestInfo { - const message = createBaseRequestInfo(); - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } - if (object.block_version !== undefined && object.block_version !== null) { - message.blockVersion = BigInt(object.block_version); - } - if (object.p2p_version !== undefined && object.p2p_version !== null) { - message.p2pVersion = BigInt(object.p2p_version); - } - return message; - }, - toAmino(message: RequestInfo): RequestInfoAmino { - const obj: any = {}; - obj.version = message.version === '' ? undefined : message.version; - obj.block_version = - message.blockVersion !== BigInt(0) - ? message.blockVersion.toString() - : undefined; - obj.p2p_version = - message.p2pVersion !== BigInt(0) - ? message.p2pVersion.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { - return RequestInfo.fromAmino(object.value); - }, fromProtoMsg(message: RequestInfoProtoMsg): RequestInfo { return RequestInfo.decode(message.value); }, @@ -2198,25 +1563,6 @@ export const RequestSetOption = { message.value = object.value ?? ''; return message; }, - fromAmino(object: RequestSetOptionAmino): RequestSetOption { - const message = createBaseRequestSetOption(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: RequestSetOption): RequestSetOptionAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.value = message.value === '' ? undefined : message.value; - return obj; - }, - fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { - return RequestSetOption.fromAmino(object.value); - }, fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { return RequestSetOption.decode(message.value); }, @@ -2372,63 +1718,6 @@ export const RequestInitChain = { : BigInt(0); return message; }, - fromAmino(object: RequestInitChainAmino): RequestInitChain { - const message = createBaseRequestInitChain(); - if (object.time !== undefined && object.time !== null) { - message.time = fromTimestamp(Timestamp.fromAmino(object.time)); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chainId = object.chain_id; - } - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensusParams = ConsensusParams.fromAmino( - object.consensus_params, - ); - } - message.validators = - object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; - if ( - object.app_state_bytes !== undefined && - object.app_state_bytes !== null - ) { - message.appStateBytes = bytesFromBase64(object.app_state_bytes); - } - if (object.initial_height !== undefined && object.initial_height !== null) { - message.initialHeight = BigInt(object.initial_height); - } - return message; - }, - toAmino(message: RequestInitChain): RequestInitChainAmino { - const obj: any = {}; - obj.time = message.time - ? Timestamp.toAmino(toTimestamp(message.time)) - : undefined; - obj.chain_id = message.chainId === '' ? undefined : message.chainId; - obj.consensus_params = message.consensusParams - ? ConsensusParams.toAmino(message.consensusParams) - : undefined; - if (message.validators) { - obj.validators = message.validators.map(e => - e ? ValidatorUpdate.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - obj.app_state_bytes = message.appStateBytes - ? base64FromBytes(message.appStateBytes) - : undefined; - obj.initial_height = - message.initialHeight !== BigInt(0) - ? message.initialHeight.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: RequestInitChainAminoMsg): RequestInitChain { - return RequestInitChain.fromAmino(object.value); - }, fromProtoMsg(message: RequestInitChainProtoMsg): RequestInitChain { return RequestInitChain.decode(message.value); }, @@ -2532,34 +1821,6 @@ export const RequestQuery = { message.prove = object.prove ?? false; return message; }, - fromAmino(object: RequestQueryAmino): RequestQuery { - const message = createBaseRequestQuery(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.path !== undefined && object.path !== null) { - message.path = object.path; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.prove !== undefined && object.prove !== null) { - message.prove = object.prove; - } - return message; - }, - toAmino(message: RequestQuery): RequestQueryAmino { - const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.path = message.path === '' ? undefined : message.path; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.prove = message.prove === false ? undefined : message.prove; - return obj; - }, - fromAminoMsg(object: RequestQueryAminoMsg): RequestQuery { - return RequestQuery.fromAmino(object.value); - }, fromProtoMsg(message: RequestQueryProtoMsg): RequestQuery { return RequestQuery.decode(message.value); }, @@ -2686,45 +1947,6 @@ export const RequestBeginBlock = { object.byzantineValidators?.map(e => Evidence.fromPartial(e)) || []; return message; }, - fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { - const message = createBaseRequestBeginBlock(); - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); - } - if ( - object.last_commit_info !== undefined && - object.last_commit_info !== null - ) { - message.lastCommitInfo = LastCommitInfo.fromAmino( - object.last_commit_info, - ); - } - message.byzantineValidators = - object.byzantine_validators?.map(e => Evidence.fromAmino(e)) || []; - return message; - }, - toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { - const obj: any = {}; - obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.last_commit_info = message.lastCommitInfo - ? LastCommitInfo.toAmino(message.lastCommitInfo) - : undefined; - if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => - e ? Evidence.toAmino(e) : undefined, - ); - } else { - obj.byzantine_validators = message.byzantineValidators; - } - return obj; - }, - fromAminoMsg(object: RequestBeginBlockAminoMsg): RequestBeginBlock { - return RequestBeginBlock.fromAmino(object.value); - }, fromProtoMsg(message: RequestBeginBlockProtoMsg): RequestBeginBlock { return RequestBeginBlock.decode(message.value); }, @@ -2800,25 +2022,6 @@ export const RequestCheckTx = { message.type = object.type ?? 0; return message; }, - fromAmino(object: RequestCheckTxAmino): RequestCheckTx { - const message = createBaseRequestCheckTx(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - return message; - }, - toAmino(message: RequestCheckTx): RequestCheckTxAmino { - const obj: any = {}; - obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - obj.type = message.type === 0 ? undefined : message.type; - return obj; - }, - fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { - return RequestCheckTx.fromAmino(object.value); - }, fromProtoMsg(message: RequestCheckTxProtoMsg): RequestCheckTx { return RequestCheckTx.decode(message.value); }, @@ -2884,21 +2087,6 @@ export const RequestDeliverTx = { message.tx = object.tx ?? new Uint8Array(); return message; }, - fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { - const message = createBaseRequestDeliverTx(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - return message; - }, - toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { - const obj: any = {}; - obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - return obj; - }, - fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { - return RequestDeliverTx.fromAmino(object.value); - }, fromProtoMsg(message: RequestDeliverTxProtoMsg): RequestDeliverTx { return RequestDeliverTx.decode(message.value); }, @@ -2967,22 +2155,6 @@ export const RequestEndBlock = { : BigInt(0); return message; }, - fromAmino(object: RequestEndBlockAmino): RequestEndBlock { - const message = createBaseRequestEndBlock(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - return message; - }, - toAmino(message: RequestEndBlock): RequestEndBlockAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - return obj; - }, - fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { - return RequestEndBlock.fromAmino(object.value); - }, fromProtoMsg(message: RequestEndBlockProtoMsg): RequestEndBlock { return RequestEndBlock.decode(message.value); }, @@ -3033,17 +2205,6 @@ export const RequestCommit = { const message = createBaseRequestCommit(); return message; }, - fromAmino(_: RequestCommitAmino): RequestCommit { - const message = createBaseRequestCommit(); - return message; - }, - toAmino(_: RequestCommit): RequestCommitAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: RequestCommitAminoMsg): RequestCommit { - return RequestCommit.fromAmino(object.value); - }, fromProtoMsg(message: RequestCommitProtoMsg): RequestCommit { return RequestCommit.decode(message.value); }, @@ -3097,17 +2258,6 @@ export const RequestListSnapshots = { const message = createBaseRequestListSnapshots(); return message; }, - fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { - const message = createBaseRequestListSnapshots(); - return message; - }, - toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: RequestListSnapshotsAminoMsg): RequestListSnapshots { - return RequestListSnapshots.fromAmino(object.value); - }, fromProtoMsg(message: RequestListSnapshotsProtoMsg): RequestListSnapshots { return RequestListSnapshots.decode(message.value); }, @@ -3196,29 +2346,6 @@ export const RequestOfferSnapshot = { message.appHash = object.appHash ?? new Uint8Array(); return message; }, - fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { - const message = createBaseRequestOfferSnapshot(); - if (object.snapshot !== undefined && object.snapshot !== null) { - message.snapshot = Snapshot.fromAmino(object.snapshot); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.appHash = bytesFromBase64(object.app_hash); - } - return message; - }, - toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { - const obj: any = {}; - obj.snapshot = message.snapshot - ? Snapshot.toAmino(message.snapshot) - : undefined; - obj.app_hash = message.appHash - ? base64FromBytes(message.appHash) - : undefined; - return obj; - }, - fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { - return RequestOfferSnapshot.fromAmino(object.value); - }, fromProtoMsg(message: RequestOfferSnapshotProtoMsg): RequestOfferSnapshot { return RequestOfferSnapshot.decode(message.value); }, @@ -3312,32 +2439,6 @@ export const RequestLoadSnapshotChunk = { message.chunk = object.chunk ?? 0; return message; }, - fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { - const message = createBaseRequestLoadSnapshotChunk(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = object.chunk; - } - return message; - }, - toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.format = message.format === 0 ? undefined : message.format; - obj.chunk = message.chunk === 0 ? undefined : message.chunk; - return obj; - }, - fromAminoMsg( - object: RequestLoadSnapshotChunkAminoMsg, - ): RequestLoadSnapshotChunk { - return RequestLoadSnapshotChunk.fromAmino(object.value); - }, fromProtoMsg( message: RequestLoadSnapshotChunkProtoMsg, ): RequestLoadSnapshotChunk { @@ -3434,31 +2535,6 @@ export const RequestApplySnapshotChunk = { message.sender = object.sender ?? ''; return message; }, - fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { - const message = createBaseRequestApplySnapshotChunk(); - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); - } - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - return message; - }, - toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { - const obj: any = {}; - obj.index = message.index === 0 ? undefined : message.index; - obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; - obj.sender = message.sender === '' ? undefined : message.sender; - return obj; - }, - fromAminoMsg( - object: RequestApplySnapshotChunkAminoMsg, - ): RequestApplySnapshotChunk { - return RequestApplySnapshotChunk.fromAmino(object.value); - }, fromProtoMsg( message: RequestApplySnapshotChunkProtoMsg, ): RequestApplySnapshotChunk { @@ -3845,123 +2921,6 @@ export const Response = { : undefined; return message; }, - fromAmino(object: ResponseAmino): Response { - const message = createBaseResponse(); - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromAmino(object.exception); - } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromAmino(object.echo); - } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromAmino(object.flush); - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromAmino(object.info); - } - if (object.set_option !== undefined && object.set_option !== null) { - message.setOption = ResponseSetOption.fromAmino(object.set_option); - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.initChain = ResponseInitChain.fromAmino(object.init_chain); - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromAmino(object.query); - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); - } - if (object.end_block !== undefined && object.end_block !== null) { - message.endBlock = ResponseEndBlock.fromAmino(object.end_block); - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromAmino(object.commit); - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.listSnapshots = ResponseListSnapshots.fromAmino( - object.list_snapshots, - ); - } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offerSnapshot = ResponseOfferSnapshot.fromAmino( - object.offer_snapshot, - ); - } - if ( - object.load_snapshot_chunk !== undefined && - object.load_snapshot_chunk !== null - ) { - message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino( - object.load_snapshot_chunk, - ); - } - if ( - object.apply_snapshot_chunk !== undefined && - object.apply_snapshot_chunk !== null - ) { - message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino( - object.apply_snapshot_chunk, - ); - } - return message; - }, - toAmino(message: Response): ResponseAmino { - const obj: any = {}; - obj.exception = message.exception - ? ResponseException.toAmino(message.exception) - : undefined; - obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; - obj.flush = message.flush - ? ResponseFlush.toAmino(message.flush) - : undefined; - obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption - ? ResponseSetOption.toAmino(message.setOption) - : undefined; - obj.init_chain = message.initChain - ? ResponseInitChain.toAmino(message.initChain) - : undefined; - obj.query = message.query - ? ResponseQuery.toAmino(message.query) - : undefined; - obj.begin_block = message.beginBlock - ? ResponseBeginBlock.toAmino(message.beginBlock) - : undefined; - obj.check_tx = message.checkTx - ? ResponseCheckTx.toAmino(message.checkTx) - : undefined; - obj.deliver_tx = message.deliverTx - ? ResponseDeliverTx.toAmino(message.deliverTx) - : undefined; - obj.end_block = message.endBlock - ? ResponseEndBlock.toAmino(message.endBlock) - : undefined; - obj.commit = message.commit - ? ResponseCommit.toAmino(message.commit) - : undefined; - obj.list_snapshots = message.listSnapshots - ? ResponseListSnapshots.toAmino(message.listSnapshots) - : undefined; - obj.offer_snapshot = message.offerSnapshot - ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) - : undefined; - obj.load_snapshot_chunk = message.loadSnapshotChunk - ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) - : undefined; - obj.apply_snapshot_chunk = message.applySnapshotChunk - ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) - : undefined; - return obj; - }, - fromAminoMsg(object: ResponseAminoMsg): Response { - return Response.fromAmino(object.value); - }, fromProtoMsg(message: ResponseProtoMsg): Response { return Response.decode(message.value); }, @@ -4024,21 +2983,6 @@ export const ResponseException = { message.error = object.error ?? ''; return message; }, - fromAmino(object: ResponseExceptionAmino): ResponseException { - const message = createBaseResponseException(); - if (object.error !== undefined && object.error !== null) { - message.error = object.error; - } - return message; - }, - toAmino(message: ResponseException): ResponseExceptionAmino { - const obj: any = {}; - obj.error = message.error === '' ? undefined : message.error; - return obj; - }, - fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { - return ResponseException.fromAmino(object.value); - }, fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { return ResponseException.decode(message.value); }, @@ -4101,21 +3045,6 @@ export const ResponseEcho = { message.message = object.message ?? ''; return message; }, - fromAmino(object: ResponseEchoAmino): ResponseEcho { - const message = createBaseResponseEcho(); - if (object.message !== undefined && object.message !== null) { - message.message = object.message; - } - return message; - }, - toAmino(message: ResponseEcho): ResponseEchoAmino { - const obj: any = {}; - obj.message = message.message === '' ? undefined : message.message; - return obj; - }, - fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { - return ResponseEcho.fromAmino(object.value); - }, fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { return ResponseEcho.decode(message.value); }, @@ -4166,17 +3095,6 @@ export const ResponseFlush = { const message = createBaseResponseFlush(); return message; }, - fromAmino(_: ResponseFlushAmino): ResponseFlush { - const message = createBaseResponseFlush(); - return message; - }, - toAmino(_: ResponseFlush): ResponseFlushAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { - return ResponseFlush.fromAmino(object.value); - }, fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { return ResponseFlush.decode(message.value); }, @@ -4298,51 +3216,6 @@ export const ResponseInfo = { message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseInfoAmino): ResponseInfo { - const message = createBaseResponseInfo(); - if (object.data !== undefined && object.data !== null) { - message.data = object.data; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } - if (object.app_version !== undefined && object.app_version !== null) { - message.appVersion = BigInt(object.app_version); - } - if ( - object.last_block_height !== undefined && - object.last_block_height !== null - ) { - message.lastBlockHeight = BigInt(object.last_block_height); - } - if ( - object.last_block_app_hash !== undefined && - object.last_block_app_hash !== null - ) { - message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); - } - return message; - }, - toAmino(message: ResponseInfo): ResponseInfoAmino { - const obj: any = {}; - obj.data = message.data === '' ? undefined : message.data; - obj.version = message.version === '' ? undefined : message.version; - obj.app_version = - message.appVersion !== BigInt(0) - ? message.appVersion.toString() - : undefined; - obj.last_block_height = - message.lastBlockHeight !== BigInt(0) - ? message.lastBlockHeight.toString() - : undefined; - obj.last_block_app_hash = message.lastBlockAppHash - ? base64FromBytes(message.lastBlockAppHash) - : undefined; - return obj; - }, - fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { - return ResponseInfo.fromAmino(object.value); - }, fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { return ResponseInfo.decode(message.value); }, @@ -4425,29 +3298,6 @@ export const ResponseSetOption = { message.info = object.info ?? ''; return message; }, - fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { - const message = createBaseResponseSetOption(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - return message; - }, - toAmino(message: ResponseSetOption): ResponseSetOptionAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.log = message.log === '' ? undefined : message.log; - obj.info = message.info === '' ? undefined : message.info; - return obj; - }, - fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { - return ResponseSetOption.fromAmino(object.value); - }, fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { return ResponseSetOption.decode(message.value); }, @@ -4556,46 +3406,9 @@ export const ResponseInitChain = { ? ConsensusParams.fromPartial(object.consensusParams) : undefined; message.validators = - object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; - message.appHash = object.appHash ?? new Uint8Array(); - return message; - }, - fromAmino(object: ResponseInitChainAmino): ResponseInitChain { - const message = createBaseResponseInitChain(); - if ( - object.consensus_params !== undefined && - object.consensus_params !== null - ) { - message.consensusParams = ConsensusParams.fromAmino( - object.consensus_params, - ); - } - message.validators = - object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; - if (object.app_hash !== undefined && object.app_hash !== null) { - message.appHash = bytesFromBase64(object.app_hash); - } - return message; - }, - toAmino(message: ResponseInitChain): ResponseInitChainAmino { - const obj: any = {}; - obj.consensus_params = message.consensusParams - ? ConsensusParams.toAmino(message.consensusParams) - : undefined; - if (message.validators) { - obj.validators = message.validators.map(e => - e ? ValidatorUpdate.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - obj.app_hash = message.appHash - ? base64FromBytes(message.appHash) - : undefined; - return obj; - }, - fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { - return ResponseInitChain.fromAmino(object.value); + object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appHash = object.appHash ?? new Uint8Array(); + return message; }, fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { return ResponseInitChain.decode(message.value); @@ -4765,57 +3578,6 @@ export const ResponseQuery = { message.codespace = object.codespace ?? ''; return message; }, - fromAmino(object: ResponseQueryAmino): ResponseQuery { - const message = createBaseResponseQuery(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.index !== undefined && object.index !== null) { - message.index = BigInt(object.index); - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proofOps = ProofOps.fromAmino(object.proof_ops); - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } - return message; - }, - toAmino(message: ResponseQuery): ResponseQueryAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.log = message.log === '' ? undefined : message.log; - obj.info = message.info === '' ? undefined : message.info; - obj.index = - message.index !== BigInt(0) ? message.index.toString() : undefined; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.value = message.value ? base64FromBytes(message.value) : undefined; - obj.proof_ops = message.proofOps - ? ProofOps.toAmino(message.proofOps) - : undefined; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.codespace = message.codespace === '' ? undefined : message.codespace; - return obj; - }, - fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { - return ResponseQuery.fromAmino(object.value); - }, fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { return ResponseQuery.decode(message.value); }, @@ -4887,23 +3649,6 @@ export const ResponseBeginBlock = { message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, - fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { - const message = createBaseResponseBeginBlock(); - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - return message; - }, - toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { - const obj: any = {}; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - return obj; - }, - fromAminoMsg(object: ResponseBeginBlockAminoMsg): ResponseBeginBlock { - return ResponseBeginBlock.fromAmino(object.value); - }, fromProtoMsg(message: ResponseBeginBlockProtoMsg): ResponseBeginBlock { return ResponseBeginBlock.decode(message.value); }, @@ -5059,55 +3804,6 @@ export const ResponseCheckTx = { message.codespace = object.codespace ?? ''; return message; }, - fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { - const message = createBaseResponseCheckTx(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } - return message; - }, - toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.log = message.log === '' ? undefined : message.log; - obj.info = message.info === '' ? undefined : message.info; - obj.gas_wanted = - message.gasWanted !== BigInt(0) - ? message.gasWanted.toString() - : undefined; - obj.gas_used = - message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - obj.codespace = message.codespace === '' ? undefined : message.codespace; - return obj; - }, - fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { - return ResponseCheckTx.fromAmino(object.value); - }, fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { return ResponseCheckTx.decode(message.value); }, @@ -5263,55 +3959,6 @@ export const ResponseDeliverTx = { message.codespace = object.codespace ?? ''; return message; }, - fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { - const message = createBaseResponseDeliverTx(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } - return message; - }, - toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.log = message.log === '' ? undefined : message.log; - obj.info = message.info === '' ? undefined : message.info; - obj.gas_wanted = - message.gasWanted !== BigInt(0) - ? message.gasWanted.toString() - : undefined; - obj.gas_used = - message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - obj.codespace = message.codespace === '' ? undefined : message.codespace; - return obj; - }, - fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { - return ResponseDeliverTx.fromAmino(object.value); - }, fromProtoMsg(message: ResponseDeliverTxProtoMsg): ResponseDeliverTx { return ResponseDeliverTx.decode(message.value); }, @@ -5426,43 +4073,6 @@ export const ResponseEndBlock = { message.events = object.events?.map(e => Event.fromPartial(e)) || []; return message; }, - fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { - const message = createBaseResponseEndBlock(); - message.validatorUpdates = - object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; - if ( - object.consensus_param_updates !== undefined && - object.consensus_param_updates !== null - ) { - message.consensusParamUpdates = ConsensusParams.fromAmino( - object.consensus_param_updates, - ); - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - return message; - }, - toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { - const obj: any = {}; - if (message.validatorUpdates) { - obj.validator_updates = message.validatorUpdates.map(e => - e ? ValidatorUpdate.toAmino(e) : undefined, - ); - } else { - obj.validator_updates = message.validatorUpdates; - } - obj.consensus_param_updates = message.consensusParamUpdates - ? ConsensusParams.toAmino(message.consensusParamUpdates) - : undefined; - if (message.events) { - obj.events = message.events.map(e => (e ? Event.toAmino(e) : undefined)); - } else { - obj.events = message.events; - } - return obj; - }, - fromAminoMsg(object: ResponseEndBlockAminoMsg): ResponseEndBlock { - return ResponseEndBlock.fromAmino(object.value); - }, fromProtoMsg(message: ResponseEndBlockProtoMsg): ResponseEndBlock { return ResponseEndBlock.decode(message.value); }, @@ -5546,28 +4156,6 @@ export const ResponseCommit = { : BigInt(0); return message; }, - fromAmino(object: ResponseCommitAmino): ResponseCommit { - const message = createBaseResponseCommit(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.retain_height !== undefined && object.retain_height !== null) { - message.retainHeight = BigInt(object.retain_height); - } - return message; - }, - toAmino(message: ResponseCommit): ResponseCommitAmino { - const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.retain_height = - message.retainHeight !== BigInt(0) - ? message.retainHeight.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ResponseCommitAminoMsg): ResponseCommit { - return ResponseCommit.fromAmino(object.value); - }, fromProtoMsg(message: ResponseCommitProtoMsg): ResponseCommit { return ResponseCommit.decode(message.value); }, @@ -5642,25 +4230,6 @@ export const ResponseListSnapshots = { object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; return message; }, - fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { - const message = createBaseResponseListSnapshots(); - message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; - return message; - }, - toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { - const obj: any = {}; - if (message.snapshots) { - obj.snapshots = message.snapshots.map(e => - e ? Snapshot.toAmino(e) : undefined, - ); - } else { - obj.snapshots = message.snapshots; - } - return obj; - }, - fromAminoMsg(object: ResponseListSnapshotsAminoMsg): ResponseListSnapshots { - return ResponseListSnapshots.fromAmino(object.value); - }, fromProtoMsg(message: ResponseListSnapshotsProtoMsg): ResponseListSnapshots { return ResponseListSnapshots.decode(message.value); }, @@ -5729,21 +4298,6 @@ export const ResponseOfferSnapshot = { message.result = object.result ?? 0; return message; }, - fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { - const message = createBaseResponseOfferSnapshot(); - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } - return message; - }, - toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { - const obj: any = {}; - obj.result = message.result === 0 ? undefined : message.result; - return obj; - }, - fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { - return ResponseOfferSnapshot.fromAmino(object.value); - }, fromProtoMsg(message: ResponseOfferSnapshotProtoMsg): ResponseOfferSnapshot { return ResponseOfferSnapshot.decode(message.value); }, @@ -5816,23 +4370,6 @@ export const ResponseLoadSnapshotChunk = { message.chunk = object.chunk ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { - const message = createBaseResponseLoadSnapshotChunk(); - if (object.chunk !== undefined && object.chunk !== null) { - message.chunk = bytesFromBase64(object.chunk); - } - return message; - }, - toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { - const obj: any = {}; - obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; - return obj; - }, - fromAminoMsg( - object: ResponseLoadSnapshotChunkAminoMsg, - ): ResponseLoadSnapshotChunk { - return ResponseLoadSnapshotChunk.fromAmino(object.value); - }, fromProtoMsg( message: ResponseLoadSnapshotChunkProtoMsg, ): ResponseLoadSnapshotChunk { @@ -5948,39 +4485,6 @@ export const ResponseApplySnapshotChunk = { message.rejectSenders = object.rejectSenders?.map(e => e) || []; return message; }, - fromAmino( - object: ResponseApplySnapshotChunkAmino, - ): ResponseApplySnapshotChunk { - const message = createBaseResponseApplySnapshotChunk(); - if (object.result !== undefined && object.result !== null) { - message.result = object.result; - } - message.refetchChunks = object.refetch_chunks?.map(e => e) || []; - message.rejectSenders = object.reject_senders?.map(e => e) || []; - return message; - }, - toAmino( - message: ResponseApplySnapshotChunk, - ): ResponseApplySnapshotChunkAmino { - const obj: any = {}; - obj.result = message.result === 0 ? undefined : message.result; - if (message.refetchChunks) { - obj.refetch_chunks = message.refetchChunks.map(e => e); - } else { - obj.refetch_chunks = message.refetchChunks; - } - if (message.rejectSenders) { - obj.reject_senders = message.rejectSenders.map(e => e); - } else { - obj.reject_senders = message.rejectSenders; - } - return obj; - }, - fromAminoMsg( - object: ResponseApplySnapshotChunkAminoMsg, - ): ResponseApplySnapshotChunk { - return ResponseApplySnapshotChunk.fromAmino(object.value); - }, fromProtoMsg( message: ResponseApplySnapshotChunkProtoMsg, ): ResponseApplySnapshotChunk { @@ -6115,39 +4619,6 @@ export const ConsensusParams = { : undefined; return message; }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { - const message = createBaseConsensusParams(); - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromAmino(object.block); - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromAmino(object.evidence); - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromAmino(object.validator); - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromAmino(object.version); - } - return message; - }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { - const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence - ? EvidenceParams.toAmino(message.evidence) - : undefined; - obj.validator = message.validator - ? ValidatorParams.toAmino(message.validator) - : undefined; - obj.version = message.version - ? VersionParams.toAmino(message.version) - : undefined; - return obj; - }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); - }, fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { return ConsensusParams.decode(message.value); }, @@ -6232,27 +4703,6 @@ export const BlockParams = { : BigInt(0); return message; }, - fromAmino(object: BlockParamsAmino): BlockParams { - const message = createBaseBlockParams(); - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.maxBytes = BigInt(object.max_bytes); - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.maxGas = BigInt(object.max_gas); - } - return message; - }, - toAmino(message: BlockParams): BlockParamsAmino { - const obj: any = {}; - obj.max_bytes = - message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; - obj.max_gas = - message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; - return obj; - }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); - }, fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { return BlockParams.decode(message.value); }, @@ -6331,27 +4781,6 @@ export const LastCommitInfo = { message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: LastCommitInfoAmino): LastCommitInfo { - const message = createBaseLastCommitInfo(); - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } - message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; - return message; - }, - toAmino(message: LastCommitInfo): LastCommitInfoAmino { - const obj: any = {}; - obj.round = message.round === 0 ? undefined : message.round; - if (message.votes) { - obj.votes = message.votes.map(e => (e ? VoteInfo.toAmino(e) : undefined)); - } else { - obj.votes = message.votes; - } - return obj; - }, - fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { - return LastCommitInfo.fromAmino(object.value); - }, fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { return LastCommitInfo.decode(message.value); }, @@ -6435,30 +4864,6 @@ export const Event = { object.attributes?.map(e => EventAttribute.fromPartial(e)) || []; return message; }, - fromAmino(object: EventAmino): Event { - const message = createBaseEvent(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - message.attributes = - object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; - return message; - }, - toAmino(message: Event): EventAmino { - const obj: any = {}; - obj.type = message.type === '' ? undefined : message.type; - if (message.attributes) { - obj.attributes = message.attributes.map(e => - e ? EventAttribute.toAmino(e) : undefined, - ); - } else { - obj.attributes = message.attributes; - } - return obj; - }, - fromAminoMsg(object: EventAminoMsg): Event { - return Event.fromAmino(object.value); - }, fromProtoMsg(message: EventProtoMsg): Event { return Event.decode(message.value); }, @@ -6549,29 +4954,6 @@ export const EventAttribute = { message.index = object.index ?? false; return message; }, - fromAmino(object: EventAttributeAmino): EventAttribute { - const message = createBaseEventAttribute(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } - return message; - }, - toAmino(message: EventAttribute): EventAttributeAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.value = message.value ? base64FromBytes(message.value) : undefined; - obj.index = message.index === false ? undefined : message.index; - return obj; - }, - fromAminoMsg(object: EventAttributeAminoMsg): EventAttribute { - return EventAttribute.fromAmino(object.value); - }, fromProtoMsg(message: EventAttributeProtoMsg): EventAttribute { return EventAttribute.decode(message.value); }, @@ -6684,36 +5066,6 @@ export const TxResult = { : undefined; return message; }, - fromAmino(object: TxResultAmino): TxResult { - const message = createBaseTxResult(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromAmino(object.result); - } - return message; - }, - toAmino(message: TxResult): TxResultAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.index = message.index === 0 ? undefined : message.index; - obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - obj.result = message.result - ? ResponseDeliverTx.toAmino(message.result) - : undefined; - return obj; - }, - fromAminoMsg(object: TxResultAminoMsg): TxResult { - return TxResult.fromAmino(object.value); - }, fromProtoMsg(message: TxResultProtoMsg): TxResult { return TxResult.decode(message.value); }, @@ -6795,28 +5147,6 @@ export const Validator = { : BigInt(0); return message; }, - fromAmino(object: ValidatorAmino): Validator { - const message = createBaseValidator(); - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.power !== undefined && object.power !== null) { - message.power = BigInt(object.power); - } - return message; - }, - toAmino(message: Validator): ValidatorAmino { - const obj: any = {}; - obj.address = message.address - ? base64FromBytes(message.address) - : undefined; - obj.power = - message.power !== BigInt(0) ? message.power.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ValidatorAminoMsg): Validator { - return Validator.fromAmino(object.value); - }, fromProtoMsg(message: ValidatorProtoMsg): Validator { return Validator.decode(message.value); }, @@ -6901,28 +5231,6 @@ export const ValidatorUpdate = { : BigInt(0); return message; }, - fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { - const message = createBaseValidatorUpdate(); - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pubKey = PublicKey.fromAmino(object.pub_key); - } - if (object.power !== undefined && object.power !== null) { - message.power = BigInt(object.power); - } - return message; - }, - toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { - const obj: any = {}; - obj.pub_key = message.pubKey - ? PublicKey.toAmino(message.pubKey) - : undefined; - obj.power = - message.power !== BigInt(0) ? message.power.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ValidatorUpdateAminoMsg): ValidatorUpdate { - return ValidatorUpdate.fromAmino(object.value); - }, fromProtoMsg(message: ValidatorUpdateProtoMsg): ValidatorUpdate { return ValidatorUpdate.decode(message.value); }, @@ -7006,31 +5314,6 @@ export const VoteInfo = { message.signedLastBlock = object.signedLastBlock ?? false; return message; }, - fromAmino(object: VoteInfoAmino): VoteInfo { - const message = createBaseVoteInfo(); - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromAmino(object.validator); - } - if ( - object.signed_last_block !== undefined && - object.signed_last_block !== null - ) { - message.signedLastBlock = object.signed_last_block; - } - return message; - }, - toAmino(message: VoteInfo): VoteInfoAmino { - const obj: any = {}; - obj.validator = message.validator - ? Validator.toAmino(message.validator) - : undefined; - obj.signed_last_block = - message.signedLastBlock === false ? undefined : message.signedLastBlock; - return obj; - }, - fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { - return VoteInfo.fromAmino(object.value); - }, fromProtoMsg(message: VoteInfoProtoMsg): VoteInfo { return VoteInfo.decode(message.value); }, @@ -7160,48 +5443,6 @@ export const Evidence = { : BigInt(0); return message; }, - fromAmino(object: EvidenceAmino): Evidence { - const message = createBaseEvidence(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = Validator.fromAmino(object.validator); - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.time !== undefined && object.time !== null) { - message.time = fromTimestamp(Timestamp.fromAmino(object.time)); - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.totalVotingPower = BigInt(object.total_voting_power); - } - return message; - }, - toAmino(message: Evidence): EvidenceAmino { - const obj: any = {}; - obj.type = message.type === 0 ? undefined : message.type; - obj.validator = message.validator - ? Validator.toAmino(message.validator) - : undefined; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.time = message.time - ? Timestamp.toAmino(toTimestamp(message.time)) - : undefined; - obj.total_voting_power = - message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); - }, fromProtoMsg(message: EvidenceProtoMsg): Evidence { return Evidence.decode(message.value); }, @@ -7320,40 +5561,6 @@ export const Snapshot = { message.metadata = object.metadata ?? new Uint8Array(); return message; }, - fromAmino(object: SnapshotAmino): Snapshot { - const message = createBaseSnapshot(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.format !== undefined && object.format !== null) { - message.format = object.format; - } - if (object.chunks !== undefined && object.chunks !== null) { - message.chunks = object.chunks; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = bytesFromBase64(object.metadata); - } - return message; - }, - toAmino(message: Snapshot): SnapshotAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.format = message.format === 0 ? undefined : message.format; - obj.chunks = message.chunks === 0 ? undefined : message.chunks; - obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; - obj.metadata = message.metadata - ? base64FromBytes(message.metadata) - : undefined; - return obj; - }, - fromAminoMsg(object: SnapshotAminoMsg): Snapshot { - return Snapshot.fromAmino(object.value); - }, fromProtoMsg(message: SnapshotProtoMsg): Snapshot { return Snapshot.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/crypto/keys.ts b/packages/cosmic-proto/src/codegen/tendermint/crypto/keys.ts index 3b2f5191f85..5feb6fa3c36 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/crypto/keys.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/crypto/keys.ts @@ -11,15 +11,6 @@ export interface PublicKeyProtoMsg { value: Uint8Array; } /** PublicKey defines the keys available for use with Tendermint Validators */ -export interface PublicKeyAmino { - ed25519?: string; - secp256k1?: string; -} -export interface PublicKeyAminoMsg { - type: '/tendermint.crypto.PublicKey'; - value: PublicKeyAmino; -} -/** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKeySDKType { ed25519?: Uint8Array; secp256k1?: Uint8Array; @@ -95,29 +86,6 @@ export const PublicKey = { message.secp256k1 = object.secp256k1 ?? undefined; return message; }, - fromAmino(object: PublicKeyAmino): PublicKey { - const message = createBasePublicKey(); - if (object.ed25519 !== undefined && object.ed25519 !== null) { - message.ed25519 = bytesFromBase64(object.ed25519); - } - if (object.secp256k1 !== undefined && object.secp256k1 !== null) { - message.secp256k1 = bytesFromBase64(object.secp256k1); - } - return message; - }, - toAmino(message: PublicKey): PublicKeyAmino { - const obj: any = {}; - obj.ed25519 = message.ed25519 - ? base64FromBytes(message.ed25519) - : undefined; - obj.secp256k1 = message.secp256k1 - ? base64FromBytes(message.secp256k1) - : undefined; - return obj; - }, - fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { - return PublicKey.fromAmino(object.value); - }, fromProtoMsg(message: PublicKeyProtoMsg): PublicKey { return PublicKey.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/crypto/proof.ts b/packages/cosmic-proto/src/codegen/tendermint/crypto/proof.ts index d272c343f75..6be7142998a 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/crypto/proof.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/crypto/proof.ts @@ -11,16 +11,6 @@ export interface ProofProtoMsg { typeUrl: '/tendermint.crypto.Proof'; value: Uint8Array; } -export interface ProofAmino { - total?: string; - index?: string; - leaf_hash?: string; - aunts?: string[]; -} -export interface ProofAminoMsg { - type: '/tendermint.crypto.Proof'; - value: ProofAmino; -} export interface ProofSDKType { total: bigint; index: bigint; @@ -37,16 +27,6 @@ export interface ValueOpProtoMsg { typeUrl: '/tendermint.crypto.ValueOp'; value: Uint8Array; } -export interface ValueOpAmino { - /** Encoded in ProofOp.Key. */ - key?: string; - /** To encode in ProofOp.Data */ - proof?: ProofAmino; -} -export interface ValueOpAminoMsg { - type: '/tendermint.crypto.ValueOp'; - value: ValueOpAmino; -} export interface ValueOpSDKType { key: Uint8Array; proof?: ProofSDKType; @@ -60,15 +40,6 @@ export interface DominoOpProtoMsg { typeUrl: '/tendermint.crypto.DominoOp'; value: Uint8Array; } -export interface DominoOpAmino { - key?: string; - input?: string; - output?: string; -} -export interface DominoOpAminoMsg { - type: '/tendermint.crypto.DominoOp'; - value: DominoOpAmino; -} export interface DominoOpSDKType { key: string; input: string; @@ -88,20 +59,6 @@ export interface ProofOpProtoMsg { typeUrl: '/tendermint.crypto.ProofOp'; value: Uint8Array; } -/** - * ProofOp defines an operation used for calculating Merkle root - * The data could be arbitrary format, providing nessecary data - * for example neighbouring node hash - */ -export interface ProofOpAmino { - type?: string; - key?: string; - data?: string; -} -export interface ProofOpAminoMsg { - type: '/tendermint.crypto.ProofOp'; - value: ProofOpAmino; -} /** * ProofOp defines an operation used for calculating Merkle root * The data could be arbitrary format, providing nessecary data @@ -121,14 +78,6 @@ export interface ProofOpsProtoMsg { value: Uint8Array; } /** ProofOps is Merkle proof defined by the list of ProofOps */ -export interface ProofOpsAmino { - ops?: ProofOpAmino[]; -} -export interface ProofOpsAminoMsg { - type: '/tendermint.crypto.ProofOps'; - value: ProofOpsAmino; -} -/** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOpsSDKType { ops: ProofOpSDKType[]; } @@ -232,39 +181,6 @@ export const Proof = { message.aunts = object.aunts?.map(e => e) || []; return message; }, - fromAmino(object: ProofAmino): Proof { - const message = createBaseProof(); - if (object.total !== undefined && object.total !== null) { - message.total = BigInt(object.total); - } - if (object.index !== undefined && object.index !== null) { - message.index = BigInt(object.index); - } - if (object.leaf_hash !== undefined && object.leaf_hash !== null) { - message.leafHash = bytesFromBase64(object.leaf_hash); - } - message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: Proof): ProofAmino { - const obj: any = {}; - obj.total = - message.total !== BigInt(0) ? message.total.toString() : undefined; - obj.index = - message.index !== BigInt(0) ? message.index.toString() : undefined; - obj.leaf_hash = message.leafHash - ? base64FromBytes(message.leafHash) - : undefined; - if (message.aunts) { - obj.aunts = message.aunts.map(e => base64FromBytes(e)); - } else { - obj.aunts = message.aunts; - } - return obj; - }, - fromAminoMsg(object: ProofAminoMsg): Proof { - return Proof.fromAmino(object.value); - }, fromProtoMsg(message: ProofProtoMsg): Proof { return Proof.decode(message.value); }, @@ -344,25 +260,6 @@ export const ValueOp = { : undefined; return message; }, - fromAmino(object: ValueOpAmino): ValueOp { - const message = createBaseValueOp(); - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromAmino(object.proof); - } - return message; - }, - toAmino(message: ValueOp): ValueOpAmino { - const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; - return obj; - }, - fromAminoMsg(object: ValueOpAminoMsg): ValueOp { - return ValueOp.fromAmino(object.value); - }, fromProtoMsg(message: ValueOpProtoMsg): ValueOp { return ValueOp.decode(message.value); }, @@ -445,29 +342,6 @@ export const DominoOp = { message.output = object.output ?? ''; return message; }, - fromAmino(object: DominoOpAmino): DominoOp { - const message = createBaseDominoOp(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.input !== undefined && object.input !== null) { - message.input = object.input; - } - if (object.output !== undefined && object.output !== null) { - message.output = object.output; - } - return message; - }, - toAmino(message: DominoOp): DominoOpAmino { - const obj: any = {}; - obj.key = message.key === '' ? undefined : message.key; - obj.input = message.input === '' ? undefined : message.input; - obj.output = message.output === '' ? undefined : message.output; - return obj; - }, - fromAminoMsg(object: DominoOpAminoMsg): DominoOp { - return DominoOp.fromAmino(object.value); - }, fromProtoMsg(message: DominoOpProtoMsg): DominoOp { return DominoOp.decode(message.value); }, @@ -558,29 +432,6 @@ export const ProofOp = { message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: ProofOpAmino): ProofOp { - const message = createBaseProofOp(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - return message; - }, - toAmino(message: ProofOp): ProofOpAmino { - const obj: any = {}; - obj.type = message.type === '' ? undefined : message.type; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - return obj; - }, - fromAminoMsg(object: ProofOpAminoMsg): ProofOp { - return ProofOp.fromAmino(object.value); - }, fromProtoMsg(message: ProofOpProtoMsg): ProofOp { return ProofOp.decode(message.value); }, @@ -649,23 +500,6 @@ export const ProofOps = { message.ops = object.ops?.map(e => ProofOp.fromPartial(e)) || []; return message; }, - fromAmino(object: ProofOpsAmino): ProofOps { - const message = createBaseProofOps(); - message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; - return message; - }, - toAmino(message: ProofOps): ProofOpsAmino { - const obj: any = {}; - if (message.ops) { - obj.ops = message.ops.map(e => (e ? ProofOp.toAmino(e) : undefined)); - } else { - obj.ops = message.ops; - } - return obj; - }, - fromAminoMsg(object: ProofOpsAminoMsg): ProofOps { - return ProofOps.fromAmino(object.value); - }, fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { return ProofOps.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/libs/bits/types.ts b/packages/cosmic-proto/src/codegen/tendermint/libs/bits/types.ts index 09f6ea5778f..8f51d55a4ce 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/libs/bits/types.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/libs/bits/types.ts @@ -9,14 +9,6 @@ export interface BitArrayProtoMsg { typeUrl: '/tendermint.libs.bits.BitArray'; value: Uint8Array; } -export interface BitArrayAmino { - bits?: string; - elems?: string[]; -} -export interface BitArrayAminoMsg { - type: '/tendermint.libs.bits.BitArray'; - value: BitArrayAmino; -} export interface BitArraySDKType { bits: bigint; elems: bigint[]; @@ -99,27 +91,6 @@ export const BitArray = { message.elems = object.elems?.map(e => BigInt(e.toString())) || []; return message; }, - fromAmino(object: BitArrayAmino): BitArray { - const message = createBaseBitArray(); - if (object.bits !== undefined && object.bits !== null) { - message.bits = BigInt(object.bits); - } - message.elems = object.elems?.map(e => BigInt(e)) || []; - return message; - }, - toAmino(message: BitArray): BitArrayAmino { - const obj: any = {}; - obj.bits = message.bits !== BigInt(0) ? message.bits.toString() : undefined; - if (message.elems) { - obj.elems = message.elems.map(e => e.toString()); - } else { - obj.elems = message.elems; - } - return obj; - }, - fromAminoMsg(object: BitArrayAminoMsg): BitArray { - return BitArray.fromAmino(object.value); - }, fromProtoMsg(message: BitArrayProtoMsg): BitArray { return BitArray.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/p2p/types.ts b/packages/cosmic-proto/src/codegen/tendermint/p2p/types.ts index da9d8a9e162..8839a2231d9 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/p2p/types.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/p2p/types.ts @@ -18,15 +18,6 @@ export interface ProtocolVersionProtoMsg { typeUrl: '/tendermint.p2p.ProtocolVersion'; value: Uint8Array; } -export interface ProtocolVersionAmino { - p2p?: string; - block?: string; - app?: string; -} -export interface ProtocolVersionAminoMsg { - type: '/tendermint.p2p.ProtocolVersion'; - value: ProtocolVersionAmino; -} export interface ProtocolVersionSDKType { p2p: bigint; block: bigint; @@ -46,20 +37,6 @@ export interface NodeInfoProtoMsg { typeUrl: '/tendermint.p2p.NodeInfo'; value: Uint8Array; } -export interface NodeInfoAmino { - protocol_version?: ProtocolVersionAmino; - node_id?: string; - listen_addr?: string; - network?: string; - version?: string; - channels?: string; - moniker?: string; - other?: NodeInfoOtherAmino; -} -export interface NodeInfoAminoMsg { - type: '/tendermint.p2p.NodeInfo'; - value: NodeInfoAmino; -} export interface NodeInfoSDKType { protocol_version: ProtocolVersionSDKType; node_id: string; @@ -78,14 +55,6 @@ export interface NodeInfoOtherProtoMsg { typeUrl: '/tendermint.p2p.NodeInfoOther'; value: Uint8Array; } -export interface NodeInfoOtherAmino { - tx_index?: string; - rpc_address?: string; -} -export interface NodeInfoOtherAminoMsg { - type: '/tendermint.p2p.NodeInfoOther'; - value: NodeInfoOtherAmino; -} export interface NodeInfoOtherSDKType { tx_index: string; rpc_address: string; @@ -99,15 +68,6 @@ export interface PeerInfoProtoMsg { typeUrl: '/tendermint.p2p.PeerInfo'; value: Uint8Array; } -export interface PeerInfoAmino { - id?: string; - address_info?: PeerAddressInfoAmino[]; - last_connected?: string; -} -export interface PeerInfoAminoMsg { - type: '/tendermint.p2p.PeerInfo'; - value: PeerInfoAmino; -} export interface PeerInfoSDKType { id: string; address_info: PeerAddressInfoSDKType[]; @@ -123,16 +83,6 @@ export interface PeerAddressInfoProtoMsg { typeUrl: '/tendermint.p2p.PeerAddressInfo'; value: Uint8Array; } -export interface PeerAddressInfoAmino { - address?: string; - last_dial_success?: string; - last_dial_failure?: string; - dial_failures?: number; -} -export interface PeerAddressInfoAminoMsg { - type: '/tendermint.p2p.PeerAddressInfo'; - value: PeerAddressInfoAmino; -} export interface PeerAddressInfoSDKType { address: string; last_dial_success?: Date; @@ -220,30 +170,6 @@ export const ProtocolVersion = { : BigInt(0); return message; }, - fromAmino(object: ProtocolVersionAmino): ProtocolVersion { - const message = createBaseProtocolVersion(); - if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = BigInt(object.p2p); - } - if (object.block !== undefined && object.block !== null) { - message.block = BigInt(object.block); - } - if (object.app !== undefined && object.app !== null) { - message.app = BigInt(object.app); - } - return message; - }, - toAmino(message: ProtocolVersion): ProtocolVersionAmino { - const obj: any = {}; - obj.p2p = message.p2p !== BigInt(0) ? message.p2p.toString() : undefined; - obj.block = - message.block !== BigInt(0) ? message.block.toString() : undefined; - obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ProtocolVersionAminoMsg): ProtocolVersion { - return ProtocolVersion.fromAmino(object.value); - }, fromProtoMsg(message: ProtocolVersionProtoMsg): ProtocolVersion { return ProtocolVersion.decode(message.value); }, @@ -403,61 +329,6 @@ export const NodeInfo = { : undefined; return message; }, - fromAmino(object: NodeInfoAmino): NodeInfo { - const message = createBaseNodeInfo(); - if ( - object.protocol_version !== undefined && - object.protocol_version !== null - ) { - message.protocolVersion = ProtocolVersion.fromAmino( - object.protocol_version, - ); - } - if (object.node_id !== undefined && object.node_id !== null) { - message.nodeId = object.node_id; - } - if (object.listen_addr !== undefined && object.listen_addr !== null) { - message.listenAddr = object.listen_addr; - } - if (object.network !== undefined && object.network !== null) { - message.network = object.network; - } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; - } - if (object.channels !== undefined && object.channels !== null) { - message.channels = bytesFromBase64(object.channels); - } - if (object.moniker !== undefined && object.moniker !== null) { - message.moniker = object.moniker; - } - if (object.other !== undefined && object.other !== null) { - message.other = NodeInfoOther.fromAmino(object.other); - } - return message; - }, - toAmino(message: NodeInfo): NodeInfoAmino { - const obj: any = {}; - obj.protocol_version = message.protocolVersion - ? ProtocolVersion.toAmino(message.protocolVersion) - : undefined; - obj.node_id = message.nodeId === '' ? undefined : message.nodeId; - obj.listen_addr = - message.listenAddr === '' ? undefined : message.listenAddr; - obj.network = message.network === '' ? undefined : message.network; - obj.version = message.version === '' ? undefined : message.version; - obj.channels = message.channels - ? base64FromBytes(message.channels) - : undefined; - obj.moniker = message.moniker === '' ? undefined : message.moniker; - obj.other = message.other - ? NodeInfoOther.toAmino(message.other) - : undefined; - return obj; - }, - fromAminoMsg(object: NodeInfoAminoMsg): NodeInfo { - return NodeInfo.fromAmino(object.value); - }, fromProtoMsg(message: NodeInfoProtoMsg): NodeInfo { return NodeInfo.decode(message.value); }, @@ -530,26 +401,6 @@ export const NodeInfoOther = { message.rpcAddress = object.rpcAddress ?? ''; return message; }, - fromAmino(object: NodeInfoOtherAmino): NodeInfoOther { - const message = createBaseNodeInfoOther(); - if (object.tx_index !== undefined && object.tx_index !== null) { - message.txIndex = object.tx_index; - } - if (object.rpc_address !== undefined && object.rpc_address !== null) { - message.rpcAddress = object.rpc_address; - } - return message; - }, - toAmino(message: NodeInfoOther): NodeInfoOtherAmino { - const obj: any = {}; - obj.tx_index = message.txIndex === '' ? undefined : message.txIndex; - obj.rpc_address = - message.rpcAddress === '' ? undefined : message.rpcAddress; - return obj; - }, - fromAminoMsg(object: NodeInfoOtherAminoMsg): NodeInfoOther { - return NodeInfoOther.fromAmino(object.value); - }, fromProtoMsg(message: NodeInfoOtherProtoMsg): NodeInfoOther { return NodeInfoOther.decode(message.value); }, @@ -651,38 +502,6 @@ export const PeerInfo = { message.lastConnected = object.lastConnected ?? undefined; return message; }, - fromAmino(object: PeerInfoAmino): PeerInfo { - const message = createBasePeerInfo(); - if (object.id !== undefined && object.id !== null) { - message.id = object.id; - } - message.addressInfo = - object.address_info?.map(e => PeerAddressInfo.fromAmino(e)) || []; - if (object.last_connected !== undefined && object.last_connected !== null) { - message.lastConnected = fromTimestamp( - Timestamp.fromAmino(object.last_connected), - ); - } - return message; - }, - toAmino(message: PeerInfo): PeerInfoAmino { - const obj: any = {}; - obj.id = message.id === '' ? undefined : message.id; - if (message.addressInfo) { - obj.address_info = message.addressInfo.map(e => - e ? PeerAddressInfo.toAmino(e) : undefined, - ); - } else { - obj.address_info = message.addressInfo; - } - obj.last_connected = message.lastConnected - ? Timestamp.toAmino(toTimestamp(message.lastConnected)) - : undefined; - return obj; - }, - fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { - return PeerInfo.fromAmino(object.value); - }, fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { return PeerInfo.decode(message.value); }, @@ -794,48 +613,6 @@ export const PeerAddressInfo = { message.dialFailures = object.dialFailures ?? 0; return message; }, - fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { - const message = createBasePeerAddressInfo(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if ( - object.last_dial_success !== undefined && - object.last_dial_success !== null - ) { - message.lastDialSuccess = fromTimestamp( - Timestamp.fromAmino(object.last_dial_success), - ); - } - if ( - object.last_dial_failure !== undefined && - object.last_dial_failure !== null - ) { - message.lastDialFailure = fromTimestamp( - Timestamp.fromAmino(object.last_dial_failure), - ); - } - if (object.dial_failures !== undefined && object.dial_failures !== null) { - message.dialFailures = object.dial_failures; - } - return message; - }, - toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { - const obj: any = {}; - obj.address = message.address === '' ? undefined : message.address; - obj.last_dial_success = message.lastDialSuccess - ? Timestamp.toAmino(toTimestamp(message.lastDialSuccess)) - : undefined; - obj.last_dial_failure = message.lastDialFailure - ? Timestamp.toAmino(toTimestamp(message.lastDialFailure)) - : undefined; - obj.dial_failures = - message.dialFailures === 0 ? undefined : message.dialFailures; - return obj; - }, - fromAminoMsg(object: PeerAddressInfoAminoMsg): PeerAddressInfo { - return PeerAddressInfo.fromAmino(object.value); - }, fromProtoMsg(message: PeerAddressInfoProtoMsg): PeerAddressInfo { return PeerAddressInfo.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/types/block.ts b/packages/cosmic-proto/src/codegen/tendermint/types/block.ts index e1c52e7ffd5..f9ccb0479e3 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/types/block.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/types/block.ts @@ -1,20 +1,13 @@ //@ts-nocheck import { Header, - HeaderAmino, HeaderSDKType, Data, - DataAmino, DataSDKType, Commit, - CommitAmino, CommitSDKType, } from './types.js'; -import { - EvidenceList, - EvidenceListAmino, - EvidenceListSDKType, -} from './evidence.js'; +import { EvidenceList, EvidenceListSDKType } from './evidence.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; export interface Block { @@ -27,16 +20,6 @@ export interface BlockProtoMsg { typeUrl: '/tendermint.types.Block'; value: Uint8Array; } -export interface BlockAmino { - header?: HeaderAmino; - data?: DataAmino; - evidence?: EvidenceListAmino; - last_commit?: CommitAmino; -} -export interface BlockAminoMsg { - type: '/tendermint.types.Block'; - value: BlockAmino; -} export interface BlockSDKType { header: HeaderSDKType; data: DataSDKType; @@ -146,37 +129,6 @@ export const Block = { : undefined; return message; }, - fromAmino(object: BlockAmino): Block { - const message = createBaseBlock(); - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); - } - if (object.data !== undefined && object.data !== null) { - message.data = Data.fromAmino(object.data); - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceList.fromAmino(object.evidence); - } - if (object.last_commit !== undefined && object.last_commit !== null) { - message.lastCommit = Commit.fromAmino(object.last_commit); - } - return message; - }, - toAmino(message: Block): BlockAmino { - const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.data = message.data ? Data.toAmino(message.data) : undefined; - obj.evidence = message.evidence - ? EvidenceList.toAmino(message.evidence) - : undefined; - obj.last_commit = message.lastCommit - ? Commit.toAmino(message.lastCommit) - : undefined; - return obj; - }, - fromAminoMsg(object: BlockAminoMsg): Block { - return Block.fromAmino(object.value); - }, fromProtoMsg(message: BlockProtoMsg): Block { return Block.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/types/evidence.ts b/packages/cosmic-proto/src/codegen/tendermint/types/evidence.ts index 5f54c1654b9..206f64bd55e 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/types/evidence.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/types/evidence.ts @@ -1,14 +1,7 @@ //@ts-nocheck -import { - Vote, - VoteAmino, - VoteSDKType, - LightBlock, - LightBlockAmino, - LightBlockSDKType, -} from './types.js'; +import { Vote, VoteSDKType, LightBlock, LightBlockSDKType } from './types.js'; import { Timestamp } from '../../google/protobuf/timestamp.js'; -import { Validator, ValidatorAmino, ValidatorSDKType } from './validator.js'; +import { Validator, ValidatorSDKType } from './validator.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, @@ -24,14 +17,6 @@ export interface EvidenceProtoMsg { typeUrl: '/tendermint.types.Evidence'; value: Uint8Array; } -export interface EvidenceAmino { - duplicate_vote_evidence?: DuplicateVoteEvidenceAmino; - light_client_attack_evidence?: LightClientAttackEvidenceAmino; -} -export interface EvidenceAminoMsg { - type: '/tendermint.types.Evidence'; - value: EvidenceAmino; -} export interface EvidenceSDKType { duplicate_vote_evidence?: DuplicateVoteEvidenceSDKType; light_client_attack_evidence?: LightClientAttackEvidenceSDKType; @@ -49,18 +34,6 @@ export interface DuplicateVoteEvidenceProtoMsg { value: Uint8Array; } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ -export interface DuplicateVoteEvidenceAmino { - vote_a?: VoteAmino; - vote_b?: VoteAmino; - total_voting_power?: string; - validator_power?: string; - timestamp?: string; -} -export interface DuplicateVoteEvidenceAminoMsg { - type: '/tendermint.types.DuplicateVoteEvidence'; - value: DuplicateVoteEvidenceAmino; -} -/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidenceSDKType { vote_a?: VoteSDKType; vote_b?: VoteSDKType; @@ -81,18 +54,6 @@ export interface LightClientAttackEvidenceProtoMsg { value: Uint8Array; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ -export interface LightClientAttackEvidenceAmino { - conflicting_block?: LightBlockAmino; - common_height?: string; - byzantine_validators?: ValidatorAmino[]; - total_voting_power?: string; - timestamp?: string; -} -export interface LightClientAttackEvidenceAminoMsg { - type: '/tendermint.types.LightClientAttackEvidence'; - value: LightClientAttackEvidenceAmino; -} -/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceSDKType { conflicting_block?: LightBlockSDKType; common_height: bigint; @@ -107,13 +68,6 @@ export interface EvidenceListProtoMsg { typeUrl: '/tendermint.types.EvidenceList'; value: Uint8Array; } -export interface EvidenceListAmino { - evidence?: EvidenceAmino[]; -} -export interface EvidenceListAminoMsg { - type: '/tendermint.types.EvidenceList'; - value: EvidenceListAmino; -} export interface EvidenceListSDKType { evidence: EvidenceSDKType[]; } @@ -208,39 +162,6 @@ export const Evidence = { : undefined; return message; }, - fromAmino(object: EvidenceAmino): Evidence { - const message = createBaseEvidence(); - if ( - object.duplicate_vote_evidence !== undefined && - object.duplicate_vote_evidence !== null - ) { - message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino( - object.duplicate_vote_evidence, - ); - } - if ( - object.light_client_attack_evidence !== undefined && - object.light_client_attack_evidence !== null - ) { - message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino( - object.light_client_attack_evidence, - ); - } - return message; - }, - toAmino(message: Evidence): EvidenceAmino { - const obj: any = {}; - obj.duplicate_vote_evidence = message.duplicateVoteEvidence - ? DuplicateVoteEvidence.toAmino(message.duplicateVoteEvidence) - : undefined; - obj.light_client_attack_evidence = message.lightClientAttackEvidence - ? LightClientAttackEvidence.toAmino(message.lightClientAttackEvidence) - : undefined; - return obj; - }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); - }, fromProtoMsg(message: EvidenceProtoMsg): Evidence { return Evidence.decode(message.value); }, @@ -376,51 +297,6 @@ export const DuplicateVoteEvidence = { message.timestamp = object.timestamp ?? undefined; return message; }, - fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { - const message = createBaseDuplicateVoteEvidence(); - if (object.vote_a !== undefined && object.vote_a !== null) { - message.voteA = Vote.fromAmino(object.vote_a); - } - if (object.vote_b !== undefined && object.vote_b !== null) { - message.voteB = Vote.fromAmino(object.vote_b); - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.totalVotingPower = BigInt(object.total_voting_power); - } - if ( - object.validator_power !== undefined && - object.validator_power !== null - ) { - message.validatorPower = BigInt(object.validator_power); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); - } - return message; - }, - toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { - const obj: any = {}; - obj.vote_a = message.voteA ? Vote.toAmino(message.voteA) : undefined; - obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; - obj.total_voting_power = - message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() - : undefined; - obj.validator_power = - message.validatorPower !== BigInt(0) - ? message.validatorPower.toString() - : undefined; - obj.timestamp = message.timestamp - ? Timestamp.toAmino(toTimestamp(message.timestamp)) - : undefined; - return obj; - }, - fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { - return DuplicateVoteEvidence.fromAmino(object.value); - }, fromProtoMsg(message: DuplicateVoteEvidenceProtoMsg): DuplicateVoteEvidence { return DuplicateVoteEvidence.decode(message.value); }, @@ -572,60 +448,6 @@ export const LightClientAttackEvidence = { message.timestamp = object.timestamp ?? undefined; return message; }, - fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { - const message = createBaseLightClientAttackEvidence(); - if ( - object.conflicting_block !== undefined && - object.conflicting_block !== null - ) { - message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); - } - if (object.common_height !== undefined && object.common_height !== null) { - message.commonHeight = BigInt(object.common_height); - } - message.byzantineValidators = - object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.totalVotingPower = BigInt(object.total_voting_power); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); - } - return message; - }, - toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { - const obj: any = {}; - obj.conflicting_block = message.conflictingBlock - ? LightBlock.toAmino(message.conflictingBlock) - : undefined; - obj.common_height = - message.commonHeight !== BigInt(0) - ? message.commonHeight.toString() - : undefined; - if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.byzantine_validators = message.byzantineValidators; - } - obj.total_voting_power = - message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() - : undefined; - obj.timestamp = message.timestamp - ? Timestamp.toAmino(toTimestamp(message.timestamp)) - : undefined; - return obj; - }, - fromAminoMsg( - object: LightClientAttackEvidenceAminoMsg, - ): LightClientAttackEvidence { - return LightClientAttackEvidence.fromAmino(object.value); - }, fromProtoMsg( message: LightClientAttackEvidenceProtoMsg, ): LightClientAttackEvidence { @@ -700,25 +522,6 @@ export const EvidenceList = { message.evidence = object.evidence?.map(e => Evidence.fromPartial(e)) || []; return message; }, - fromAmino(object: EvidenceListAmino): EvidenceList { - const message = createBaseEvidenceList(); - message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; - return message; - }, - toAmino(message: EvidenceList): EvidenceListAmino { - const obj: any = {}; - if (message.evidence) { - obj.evidence = message.evidence.map(e => - e ? Evidence.toAmino(e) : undefined, - ); - } else { - obj.evidence = message.evidence; - } - return obj; - }, - fromAminoMsg(object: EvidenceListAminoMsg): EvidenceList { - return EvidenceList.fromAmino(object.value); - }, fromProtoMsg(message: EvidenceListProtoMsg): EvidenceList { return EvidenceList.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/types/params.ts b/packages/cosmic-proto/src/codegen/tendermint/types/params.ts index 75b44884d47..c1bd7922063 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/types/params.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/types/params.ts @@ -1,9 +1,5 @@ //@ts-nocheck -import { - Duration, - DurationAmino, - DurationSDKType, -} from '../../google/protobuf/duration.js'; +import { Duration, DurationSDKType } from '../../google/protobuf/duration.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet } from '../../helpers.js'; /** @@ -20,20 +16,6 @@ export interface ConsensusParamsProtoMsg { typeUrl: '/tendermint.types.ConsensusParams'; value: Uint8Array; } -/** - * ConsensusParams contains consensus critical parameters that determine the - * validity of blocks. - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; -} -export interface ConsensusParamsAminoMsg { - type: '/tendermint.types.ConsensusParams'; - value: ConsensusParamsAmino; -} /** * ConsensusParams contains consensus critical parameters that determine the * validity of blocks. @@ -69,30 +51,6 @@ export interface BlockParamsProtoMsg { value: Uint8Array; } /** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** - * Max block size, in bytes. - * Note: must be greater than 0 - */ - max_bytes?: string; - /** - * Max gas per block. - * Note: must be greater or equal to -1 - */ - max_gas?: string; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - time_iota_ms?: string; -} -export interface BlockParamsAminoMsg { - type: '/tendermint.types.BlockParams'; - value: BlockParamsAmino; -} -/** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; @@ -127,34 +85,6 @@ export interface EvidenceParamsProtoMsg { value: Uint8Array; } /** EvidenceParams determine how we handle evidence of malfeasance. */ -export interface EvidenceParamsAmino { - /** - * Max age of evidence, in blocks. - * - * The basic formula for calculating this is: MaxAgeDuration / {average block - * time}. - */ - max_age_num_blocks?: string; - /** - * Max age of evidence, in time. - * - * It should correspond with an app's "unbonding period" or other similar - * mechanism for handling [Nothing-At-Stake - * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - */ - max_age_duration?: DurationAmino; - /** - * This sets the maximum size of total evidence in bytes that can be committed in a single block. - * and should fall comfortably under the max block bytes. - * Default is 1048576 or 1MB - */ - max_bytes?: string; -} -export interface EvidenceParamsAminoMsg { - type: '/tendermint.types.EvidenceParams'; - value: EvidenceParamsAmino; -} -/** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParamsSDKType { max_age_num_blocks: bigint; max_age_duration: DurationSDKType; @@ -171,17 +101,6 @@ export interface ValidatorParamsProtoMsg { typeUrl: '/tendermint.types.ValidatorParams'; value: Uint8Array; } -/** - * ValidatorParams restrict the public key types validators can use. - * NOTE: uses ABCI pubkey naming, not Amino names. - */ -export interface ValidatorParamsAmino { - pub_key_types?: string[]; -} -export interface ValidatorParamsAminoMsg { - type: '/tendermint.types.ValidatorParams'; - value: ValidatorParamsAmino; -} /** * ValidatorParams restrict the public key types validators can use. * NOTE: uses ABCI pubkey naming, not Amino names. @@ -198,14 +117,6 @@ export interface VersionParamsProtoMsg { value: Uint8Array; } /** VersionParams contains the ABCI application version. */ -export interface VersionParamsAmino { - app_version?: string; -} -export interface VersionParamsAminoMsg { - type: '/tendermint.types.VersionParams'; - value: VersionParamsAmino; -} -/** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { app_version: bigint; } @@ -222,19 +133,6 @@ export interface HashedParamsProtoMsg { typeUrl: '/tendermint.types.HashedParams'; value: Uint8Array; } -/** - * HashedParams is a subset of ConsensusParams. - * - * It is hashed into the Header.ConsensusHash. - */ -export interface HashedParamsAmino { - block_max_bytes?: string; - block_max_gas?: string; -} -export interface HashedParamsAminoMsg { - type: '/tendermint.types.HashedParams'; - value: HashedParamsAmino; -} /** * HashedParams is a subset of ConsensusParams. * @@ -361,39 +259,6 @@ export const ConsensusParams = { : undefined; return message; }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { - const message = createBaseConsensusParams(); - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromAmino(object.block); - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromAmino(object.evidence); - } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromAmino(object.validator); - } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromAmino(object.version); - } - return message; - }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { - const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence - ? EvidenceParams.toAmino(message.evidence) - : undefined; - obj.validator = message.validator - ? ValidatorParams.toAmino(message.validator) - : undefined; - obj.version = message.version - ? VersionParams.toAmino(message.version) - : undefined; - return obj; - }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); - }, fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { return ConsensusParams.decode(message.value); }, @@ -494,34 +359,6 @@ export const BlockParams = { : BigInt(0); return message; }, - fromAmino(object: BlockParamsAmino): BlockParams { - const message = createBaseBlockParams(); - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.maxBytes = BigInt(object.max_bytes); - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.maxGas = BigInt(object.max_gas); - } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.timeIotaMs = BigInt(object.time_iota_ms); - } - return message; - }, - toAmino(message: BlockParams): BlockParamsAmino { - const obj: any = {}; - obj.max_bytes = - message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; - obj.max_gas = - message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; - obj.time_iota_ms = - message.timeIotaMs !== BigInt(0) - ? message.timeIotaMs.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); - }, fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { return BlockParams.decode(message.value); }, @@ -627,41 +464,6 @@ export const EvidenceParams = { : BigInt(0); return message; }, - fromAmino(object: EvidenceParamsAmino): EvidenceParams { - const message = createBaseEvidenceParams(); - if ( - object.max_age_num_blocks !== undefined && - object.max_age_num_blocks !== null - ) { - message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); - } - if ( - object.max_age_duration !== undefined && - object.max_age_duration !== null - ) { - message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); - } - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.maxBytes = BigInt(object.max_bytes); - } - return message; - }, - toAmino(message: EvidenceParams): EvidenceParamsAmino { - const obj: any = {}; - obj.max_age_num_blocks = - message.maxAgeNumBlocks !== BigInt(0) - ? message.maxAgeNumBlocks.toString() - : undefined; - obj.max_age_duration = message.maxAgeDuration - ? Duration.toAmino(message.maxAgeDuration) - : undefined; - obj.max_bytes = - message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; - return obj; - }, - fromAminoMsg(object: EvidenceParamsAminoMsg): EvidenceParams { - return EvidenceParams.fromAmino(object.value); - }, fromProtoMsg(message: EvidenceParamsProtoMsg): EvidenceParams { return EvidenceParams.decode(message.value); }, @@ -730,23 +532,6 @@ export const ValidatorParams = { message.pubKeyTypes = object.pubKeyTypes?.map(e => e) || []; return message; }, - fromAmino(object: ValidatorParamsAmino): ValidatorParams { - const message = createBaseValidatorParams(); - message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; - return message; - }, - toAmino(message: ValidatorParams): ValidatorParamsAmino { - const obj: any = {}; - if (message.pubKeyTypes) { - obj.pub_key_types = message.pubKeyTypes.map(e => e); - } else { - obj.pub_key_types = message.pubKeyTypes; - } - return obj; - }, - fromAminoMsg(object: ValidatorParamsAminoMsg): ValidatorParams { - return ValidatorParams.fromAmino(object.value); - }, fromProtoMsg(message: ValidatorParamsProtoMsg): ValidatorParams { return ValidatorParams.decode(message.value); }, @@ -815,24 +600,6 @@ export const VersionParams = { : BigInt(0); return message; }, - fromAmino(object: VersionParamsAmino): VersionParams { - const message = createBaseVersionParams(); - if (object.app_version !== undefined && object.app_version !== null) { - message.appVersion = BigInt(object.app_version); - } - return message; - }, - toAmino(message: VersionParams): VersionParamsAmino { - const obj: any = {}; - obj.app_version = - message.appVersion !== BigInt(0) - ? message.appVersion.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { - return VersionParams.fromAmino(object.value); - }, fromProtoMsg(message: VersionParamsProtoMsg): VersionParams { return VersionParams.decode(message.value); }, @@ -917,34 +684,6 @@ export const HashedParams = { : BigInt(0); return message; }, - fromAmino(object: HashedParamsAmino): HashedParams { - const message = createBaseHashedParams(); - if ( - object.block_max_bytes !== undefined && - object.block_max_bytes !== null - ) { - message.blockMaxBytes = BigInt(object.block_max_bytes); - } - if (object.block_max_gas !== undefined && object.block_max_gas !== null) { - message.blockMaxGas = BigInt(object.block_max_gas); - } - return message; - }, - toAmino(message: HashedParams): HashedParamsAmino { - const obj: any = {}; - obj.block_max_bytes = - message.blockMaxBytes !== BigInt(0) - ? message.blockMaxBytes.toString() - : undefined; - obj.block_max_gas = - message.blockMaxGas !== BigInt(0) - ? message.blockMaxGas.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: HashedParamsAminoMsg): HashedParams { - return HashedParams.fromAmino(object.value); - }, fromProtoMsg(message: HashedParamsProtoMsg): HashedParams { return HashedParams.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/types/types.ts b/packages/cosmic-proto/src/codegen/tendermint/types/types.ts index 79b6fc3adc8..98fda587bea 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/types/types.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/types/types.ts @@ -1,16 +1,8 @@ //@ts-nocheck -import { Proof, ProofAmino, ProofSDKType } from '../crypto/proof.js'; -import { - Consensus, - ConsensusAmino, - ConsensusSDKType, -} from '../version/types.js'; +import { Proof, ProofSDKType } from '../crypto/proof.js'; +import { Consensus, ConsensusSDKType } from '../version/types.js'; import { Timestamp } from '../../google/protobuf/timestamp.js'; -import { - ValidatorSet, - ValidatorSetAmino, - ValidatorSetSDKType, -} from './validator.js'; +import { ValidatorSet, ValidatorSetSDKType } from './validator.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, @@ -29,7 +21,6 @@ export enum BlockIDFlag { UNRECOGNIZED = -1, } export const BlockIDFlagSDKType = BlockIDFlag; -export const BlockIDFlagAmino = BlockIDFlag; export function blockIDFlagFromJSON(object: any): BlockIDFlag { switch (object) { case 0: @@ -76,7 +67,6 @@ export enum SignedMsgType { UNRECOGNIZED = -1, } export const SignedMsgTypeSDKType = SignedMsgType; -export const SignedMsgTypeAmino = SignedMsgType; export function signedMsgTypeFromJSON(object: any): SignedMsgType { switch (object) { case 0: @@ -122,15 +112,6 @@ export interface PartSetHeaderProtoMsg { value: Uint8Array; } /** PartsetHeader */ -export interface PartSetHeaderAmino { - total?: number; - hash?: string; -} -export interface PartSetHeaderAminoMsg { - type: '/tendermint.types.PartSetHeader'; - value: PartSetHeaderAmino; -} -/** PartsetHeader */ export interface PartSetHeaderSDKType { total: number; hash: Uint8Array; @@ -144,15 +125,6 @@ export interface PartProtoMsg { typeUrl: '/tendermint.types.Part'; value: Uint8Array; } -export interface PartAmino { - index?: number; - bytes?: string; - proof?: ProofAmino; -} -export interface PartAminoMsg { - type: '/tendermint.types.Part'; - value: PartAmino; -} export interface PartSDKType { index: number; bytes: Uint8Array; @@ -168,15 +140,6 @@ export interface BlockIDProtoMsg { value: Uint8Array; } /** BlockID */ -export interface BlockIDAmino { - hash?: string; - part_set_header?: PartSetHeaderAmino; -} -export interface BlockIDAminoMsg { - type: '/tendermint.types.BlockID'; - value: BlockIDAmino; -} -/** BlockID */ export interface BlockIDSDKType { hash: Uint8Array; part_set_header: PartSetHeaderSDKType; @@ -212,36 +175,6 @@ export interface HeaderProtoMsg { value: Uint8Array; } /** Header defines the structure of a Tendermint block header. */ -export interface HeaderAmino { - /** basic block info */ - version?: ConsensusAmino; - chain_id?: string; - height?: string; - time?: string; - /** prev block info */ - last_block_id?: BlockIDAmino; - /** hashes of block data */ - last_commit_hash?: string; - data_hash?: string; - /** hashes from the app output from the prev block */ - validators_hash?: string; - /** validators for the next block */ - next_validators_hash?: string; - /** consensus params for current block */ - consensus_hash?: string; - /** state after txs from the previous block */ - app_hash?: string; - last_results_hash?: string; - /** consensus info */ - evidence_hash?: string; - /** original proposer of the block */ - proposer_address?: string; -} -export interface HeaderAminoMsg { - type: '/tendermint.types.Header'; - value: HeaderAmino; -} -/** Header defines the structure of a Tendermint block header. */ export interface HeaderSDKType { version: ConsensusSDKType; chain_id: string; @@ -272,19 +205,6 @@ export interface DataProtoMsg { value: Uint8Array; } /** Data contains the set of transactions included in the block */ -export interface DataAmino { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ - txs?: string[]; -} -export interface DataAminoMsg { - type: '/tendermint.types.Data'; - value: DataAmino; -} -/** Data contains the set of transactions included in the block */ export interface DataSDKType { txs: Uint8Array[]; } @@ -307,25 +227,6 @@ export interface VoteProtoMsg { typeUrl: '/tendermint.types.Vote'; value: Uint8Array; } -/** - * Vote represents a prevote, precommit, or commit vote from validators for - * consensus. - */ -export interface VoteAmino { - type?: SignedMsgType; - height?: string; - round?: number; - /** zero if vote is nil. */ - block_id?: BlockIDAmino; - timestamp?: string; - validator_address?: string; - validator_index?: number; - signature?: string; -} -export interface VoteAminoMsg { - type: '/tendermint.types.Vote'; - value: VoteAmino; -} /** * Vote represents a prevote, precommit, or commit vote from validators for * consensus. @@ -352,17 +253,6 @@ export interface CommitProtoMsg { value: Uint8Array; } /** Commit contains the evidence that a block was committed by a set of validators. */ -export interface CommitAmino { - height?: string; - round?: number; - block_id?: BlockIDAmino; - signatures?: CommitSigAmino[]; -} -export interface CommitAminoMsg { - type: '/tendermint.types.Commit'; - value: CommitAmino; -} -/** Commit contains the evidence that a block was committed by a set of validators. */ export interface CommitSDKType { height: bigint; round: number; @@ -381,17 +271,6 @@ export interface CommitSigProtoMsg { value: Uint8Array; } /** CommitSig is a part of the Vote included in a Commit. */ -export interface CommitSigAmino { - block_id_flag?: BlockIDFlag; - validator_address?: string; - timestamp?: string; - signature?: string; -} -export interface CommitSigAminoMsg { - type: '/tendermint.types.CommitSig'; - value: CommitSigAmino; -} -/** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSigSDKType { block_id_flag: BlockIDFlag; validator_address: Uint8Array; @@ -411,19 +290,6 @@ export interface ProposalProtoMsg { typeUrl: '/tendermint.types.Proposal'; value: Uint8Array; } -export interface ProposalAmino { - type?: SignedMsgType; - height?: string; - round?: number; - pol_round?: number; - block_id?: BlockIDAmino; - timestamp?: string; - signature?: string; -} -export interface ProposalAminoMsg { - type: '/tendermint.types.Proposal'; - value: ProposalAmino; -} export interface ProposalSDKType { type: SignedMsgType; height: bigint; @@ -441,14 +307,6 @@ export interface SignedHeaderProtoMsg { typeUrl: '/tendermint.types.SignedHeader'; value: Uint8Array; } -export interface SignedHeaderAmino { - header?: HeaderAmino; - commit?: CommitAmino; -} -export interface SignedHeaderAminoMsg { - type: '/tendermint.types.SignedHeader'; - value: SignedHeaderAmino; -} export interface SignedHeaderSDKType { header?: HeaderSDKType; commit?: CommitSDKType; @@ -461,14 +319,6 @@ export interface LightBlockProtoMsg { typeUrl: '/tendermint.types.LightBlock'; value: Uint8Array; } -export interface LightBlockAmino { - signed_header?: SignedHeaderAmino; - validator_set?: ValidatorSetAmino; -} -export interface LightBlockAminoMsg { - type: '/tendermint.types.LightBlock'; - value: LightBlockAmino; -} export interface LightBlockSDKType { signed_header?: SignedHeaderSDKType; validator_set?: ValidatorSetSDKType; @@ -483,16 +333,6 @@ export interface BlockMetaProtoMsg { typeUrl: '/tendermint.types.BlockMeta'; value: Uint8Array; } -export interface BlockMetaAmino { - block_id?: BlockIDAmino; - block_size?: string; - header?: HeaderAmino; - num_txs?: string; -} -export interface BlockMetaAminoMsg { - type: '/tendermint.types.BlockMeta'; - value: BlockMetaAmino; -} export interface BlockMetaSDKType { block_id: BlockIDSDKType; block_size: bigint; @@ -510,16 +350,6 @@ export interface TxProofProtoMsg { value: Uint8Array; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ -export interface TxProofAmino { - root_hash?: string; - data?: string; - proof?: ProofAmino; -} -export interface TxProofAminoMsg { - type: '/tendermint.types.TxProof'; - value: TxProofAmino; -} -/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProofSDKType { root_hash: Uint8Array; data: Uint8Array; @@ -589,25 +419,6 @@ export const PartSetHeader = { message.hash = object.hash ?? new Uint8Array(); return message; }, - fromAmino(object: PartSetHeaderAmino): PartSetHeader { - const message = createBasePartSetHeader(); - if (object.total !== undefined && object.total !== null) { - message.total = object.total; - } - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - return message; - }, - toAmino(message: PartSetHeader): PartSetHeaderAmino { - const obj: any = {}; - obj.total = message.total === 0 ? undefined : message.total; - obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; - return obj; - }, - fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { - return PartSetHeader.fromAmino(object.value); - }, fromProtoMsg(message: PartSetHeaderProtoMsg): PartSetHeader { return PartSetHeader.decode(message.value); }, @@ -699,29 +510,6 @@ export const Part = { : undefined; return message; }, - fromAmino(object: PartAmino): Part { - const message = createBasePart(); - if (object.index !== undefined && object.index !== null) { - message.index = object.index; - } - if (object.bytes !== undefined && object.bytes !== null) { - message.bytes = bytesFromBase64(object.bytes); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromAmino(object.proof); - } - return message; - }, - toAmino(message: Part): PartAmino { - const obj: any = {}; - obj.index = message.index === 0 ? undefined : message.index; - obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; - obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; - return obj; - }, - fromAminoMsg(object: PartAminoMsg): Part { - return Part.fromAmino(object.value); - }, fromProtoMsg(message: PartProtoMsg): Part { return Part.decode(message.value); }, @@ -810,30 +598,6 @@ export const BlockID = { : undefined; return message; }, - fromAmino(object: BlockIDAmino): BlockID { - const message = createBaseBlockID(); - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if ( - object.part_set_header !== undefined && - object.part_set_header !== null - ) { - message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); - } - return message; - }, - toAmino(message: BlockID): BlockIDAmino { - const obj: any = {}; - obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; - obj.part_set_header = message.partSetHeader - ? PartSetHeader.toAmino(message.partSetHeader) - : undefined; - return obj; - }, - fromAminoMsg(object: BlockIDAminoMsg): BlockID { - return BlockID.fromAmino(object.value); - }, fromProtoMsg(message: BlockIDProtoMsg): BlockID { return BlockID.decode(message.value); }, @@ -1112,113 +876,6 @@ export const Header = { message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, - fromAmino(object: HeaderAmino): Header { - const message = createBaseHeader(); - if (object.version !== undefined && object.version !== null) { - message.version = Consensus.fromAmino(object.version); - } - if (object.chain_id !== undefined && object.chain_id !== null) { - message.chainId = object.chain_id; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.time !== undefined && object.time !== null) { - message.time = fromTimestamp(Timestamp.fromAmino(object.time)); - } - if (object.last_block_id !== undefined && object.last_block_id !== null) { - message.lastBlockId = BlockID.fromAmino(object.last_block_id); - } - if ( - object.last_commit_hash !== undefined && - object.last_commit_hash !== null - ) { - message.lastCommitHash = bytesFromBase64(object.last_commit_hash); - } - if (object.data_hash !== undefined && object.data_hash !== null) { - message.dataHash = bytesFromBase64(object.data_hash); - } - if ( - object.validators_hash !== undefined && - object.validators_hash !== null - ) { - message.validatorsHash = bytesFromBase64(object.validators_hash); - } - if ( - object.next_validators_hash !== undefined && - object.next_validators_hash !== null - ) { - message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); - } - if (object.consensus_hash !== undefined && object.consensus_hash !== null) { - message.consensusHash = bytesFromBase64(object.consensus_hash); - } - if (object.app_hash !== undefined && object.app_hash !== null) { - message.appHash = bytesFromBase64(object.app_hash); - } - if ( - object.last_results_hash !== undefined && - object.last_results_hash !== null - ) { - message.lastResultsHash = bytesFromBase64(object.last_results_hash); - } - if (object.evidence_hash !== undefined && object.evidence_hash !== null) { - message.evidenceHash = bytesFromBase64(object.evidence_hash); - } - if ( - object.proposer_address !== undefined && - object.proposer_address !== null - ) { - message.proposerAddress = bytesFromBase64(object.proposer_address); - } - return message; - }, - toAmino(message: Header): HeaderAmino { - const obj: any = {}; - obj.version = message.version - ? Consensus.toAmino(message.version) - : undefined; - obj.chain_id = message.chainId === '' ? undefined : message.chainId; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.time = message.time - ? Timestamp.toAmino(toTimestamp(message.time)) - : undefined; - obj.last_block_id = message.lastBlockId - ? BlockID.toAmino(message.lastBlockId) - : undefined; - obj.last_commit_hash = message.lastCommitHash - ? base64FromBytes(message.lastCommitHash) - : undefined; - obj.data_hash = message.dataHash - ? base64FromBytes(message.dataHash) - : undefined; - obj.validators_hash = message.validatorsHash - ? base64FromBytes(message.validatorsHash) - : undefined; - obj.next_validators_hash = message.nextValidatorsHash - ? base64FromBytes(message.nextValidatorsHash) - : undefined; - obj.consensus_hash = message.consensusHash - ? base64FromBytes(message.consensusHash) - : undefined; - obj.app_hash = message.appHash - ? base64FromBytes(message.appHash) - : undefined; - obj.last_results_hash = message.lastResultsHash - ? base64FromBytes(message.lastResultsHash) - : undefined; - obj.evidence_hash = message.evidenceHash - ? base64FromBytes(message.evidenceHash) - : undefined; - obj.proposer_address = message.proposerAddress - ? base64FromBytes(message.proposerAddress) - : undefined; - return obj; - }, - fromAminoMsg(object: HeaderAminoMsg): Header { - return Header.fromAmino(object.value); - }, fromProtoMsg(message: HeaderProtoMsg): Header { return Header.decode(message.value); }, @@ -1289,23 +946,6 @@ export const Data = { message.txs = object.txs?.map(e => e) || []; return message; }, - fromAmino(object: DataAmino): Data { - const message = createBaseData(); - message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: Data): DataAmino { - const obj: any = {}; - if (message.txs) { - obj.txs = message.txs.map(e => base64FromBytes(e)); - } else { - obj.txs = message.txs; - } - return obj; - }, - fromAminoMsg(object: DataAminoMsg): Data { - return Data.fromAmino(object.value); - }, fromProtoMsg(message: DataProtoMsg): Data { return Data.decode(message.value); }, @@ -1476,65 +1116,6 @@ export const Vote = { message.signature = object.signature ?? new Uint8Array(); return message; }, - fromAmino(object: VoteAmino): Vote { - const message = createBaseVote(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.blockId = BlockID.fromAmino(object.block_id); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = bytesFromBase64(object.validator_address); - } - if ( - object.validator_index !== undefined && - object.validator_index !== null - ) { - message.validatorIndex = object.validator_index; - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - toAmino(message: Vote): VoteAmino { - const obj: any = {}; - obj.type = message.type === 0 ? undefined : message.type; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.round = message.round === 0 ? undefined : message.round; - obj.block_id = message.blockId - ? BlockID.toAmino(message.blockId) - : undefined; - obj.timestamp = message.timestamp - ? Timestamp.toAmino(toTimestamp(message.timestamp)) - : undefined; - obj.validator_address = message.validatorAddress - ? base64FromBytes(message.validatorAddress) - : undefined; - obj.validator_index = - message.validatorIndex === 0 ? undefined : message.validatorIndex; - obj.signature = message.signature - ? base64FromBytes(message.signature) - : undefined; - return obj; - }, - fromAminoMsg(object: VoteAminoMsg): Vote { - return Vote.fromAmino(object.value); - }, fromProtoMsg(message: VoteProtoMsg): Vote { return Vote.decode(message.value); }, @@ -1650,41 +1231,6 @@ export const Commit = { object.signatures?.map(e => CommitSig.fromPartial(e)) || []; return message; }, - fromAmino(object: CommitAmino): Commit { - const message = createBaseCommit(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.blockId = BlockID.fromAmino(object.block_id); - } - message.signatures = - object.signatures?.map(e => CommitSig.fromAmino(e)) || []; - return message; - }, - toAmino(message: Commit): CommitAmino { - const obj: any = {}; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.round = message.round === 0 ? undefined : message.round; - obj.block_id = message.blockId - ? BlockID.toAmino(message.blockId) - : undefined; - if (message.signatures) { - obj.signatures = message.signatures.map(e => - e ? CommitSig.toAmino(e) : undefined, - ); - } else { - obj.signatures = message.signatures; - } - return obj; - }, - fromAminoMsg(object: CommitAminoMsg): Commit { - return Commit.fromAmino(object.value); - }, fromProtoMsg(message: CommitProtoMsg): Commit { return Commit.decode(message.value); }, @@ -1800,43 +1346,6 @@ export const CommitSig = { message.signature = object.signature ?? new Uint8Array(); return message; }, - fromAmino(object: CommitSigAmino): CommitSig { - const message = createBaseCommitSig(); - if (object.block_id_flag !== undefined && object.block_id_flag !== null) { - message.blockIdFlag = object.block_id_flag; - } - if ( - object.validator_address !== undefined && - object.validator_address !== null - ) { - message.validatorAddress = bytesFromBase64(object.validator_address); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - toAmino(message: CommitSig): CommitSigAmino { - const obj: any = {}; - obj.block_id_flag = - message.blockIdFlag === 0 ? undefined : message.blockIdFlag; - obj.validator_address = message.validatorAddress - ? base64FromBytes(message.validatorAddress) - : undefined; - obj.timestamp = message.timestamp - ? Timestamp.toAmino(toTimestamp(message.timestamp)) - : undefined; - obj.signature = message.signature - ? base64FromBytes(message.signature) - : undefined; - return obj; - }, - fromAminoMsg(object: CommitSigAminoMsg): CommitSig { - return CommitSig.fromAmino(object.value); - }, fromProtoMsg(message: CommitSigProtoMsg): CommitSig { return CommitSig.decode(message.value); }, @@ -1988,52 +1497,6 @@ export const Proposal = { message.signature = object.signature ?? new Uint8Array(); return message; }, - fromAmino(object: ProposalAmino): Proposal { - const message = createBaseProposal(); - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - if (object.round !== undefined && object.round !== null) { - message.round = object.round; - } - if (object.pol_round !== undefined && object.pol_round !== null) { - message.polRound = object.pol_round; - } - if (object.block_id !== undefined && object.block_id !== null) { - message.blockId = BlockID.fromAmino(object.block_id); - } - if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); - } - if (object.signature !== undefined && object.signature !== null) { - message.signature = bytesFromBase64(object.signature); - } - return message; - }, - toAmino(message: Proposal): ProposalAmino { - const obj: any = {}; - obj.type = message.type === 0 ? undefined : message.type; - obj.height = - message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.round = message.round === 0 ? undefined : message.round; - obj.pol_round = message.polRound === 0 ? undefined : message.polRound; - obj.block_id = message.blockId - ? BlockID.toAmino(message.blockId) - : undefined; - obj.timestamp = message.timestamp - ? Timestamp.toAmino(toTimestamp(message.timestamp)) - : undefined; - obj.signature = message.signature - ? base64FromBytes(message.signature) - : undefined; - return obj; - }, - fromAminoMsg(object: ProposalAminoMsg): Proposal { - return Proposal.fromAmino(object.value); - }, fromProtoMsg(message: ProposalProtoMsg): Proposal { return Proposal.decode(message.value); }, @@ -2114,25 +1577,6 @@ export const SignedHeader = { : undefined; return message; }, - fromAmino(object: SignedHeaderAmino): SignedHeader { - const message = createBaseSignedHeader(); - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = Commit.fromAmino(object.commit); - } - return message; - }, - toAmino(message: SignedHeader): SignedHeaderAmino { - const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.commit = message.commit ? Commit.toAmino(message.commit) : undefined; - return obj; - }, - fromAminoMsg(object: SignedHeaderAminoMsg): SignedHeader { - return SignedHeader.fromAmino(object.value); - }, fromProtoMsg(message: SignedHeaderProtoMsg): SignedHeader { return SignedHeader.decode(message.value); }, @@ -2227,29 +1671,6 @@ export const LightBlock = { : undefined; return message; }, - fromAmino(object: LightBlockAmino): LightBlock { - const message = createBaseLightBlock(); - if (object.signed_header !== undefined && object.signed_header !== null) { - message.signedHeader = SignedHeader.fromAmino(object.signed_header); - } - if (object.validator_set !== undefined && object.validator_set !== null) { - message.validatorSet = ValidatorSet.fromAmino(object.validator_set); - } - return message; - }, - toAmino(message: LightBlock): LightBlockAmino { - const obj: any = {}; - obj.signed_header = message.signedHeader - ? SignedHeader.toAmino(message.signedHeader) - : undefined; - obj.validator_set = message.validatorSet - ? ValidatorSet.toAmino(message.validatorSet) - : undefined; - return obj; - }, - fromAminoMsg(object: LightBlockAminoMsg): LightBlock { - return LightBlock.fromAmino(object.value); - }, fromProtoMsg(message: LightBlockProtoMsg): LightBlock { return LightBlock.decode(message.value); }, @@ -2366,39 +1787,6 @@ export const BlockMeta = { : BigInt(0); return message; }, - fromAmino(object: BlockMetaAmino): BlockMeta { - const message = createBaseBlockMeta(); - if (object.block_id !== undefined && object.block_id !== null) { - message.blockId = BlockID.fromAmino(object.block_id); - } - if (object.block_size !== undefined && object.block_size !== null) { - message.blockSize = BigInt(object.block_size); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); - } - if (object.num_txs !== undefined && object.num_txs !== null) { - message.numTxs = BigInt(object.num_txs); - } - return message; - }, - toAmino(message: BlockMeta): BlockMetaAmino { - const obj: any = {}; - obj.block_id = message.blockId - ? BlockID.toAmino(message.blockId) - : undefined; - obj.block_size = - message.blockSize !== BigInt(0) - ? message.blockSize.toString() - : undefined; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.num_txs = - message.numTxs !== BigInt(0) ? message.numTxs.toString() : undefined; - return obj; - }, - fromAminoMsg(object: BlockMetaAminoMsg): BlockMeta { - return BlockMeta.fromAmino(object.value); - }, fromProtoMsg(message: BlockMetaProtoMsg): BlockMeta { return BlockMeta.decode(message.value); }, @@ -2495,31 +1883,6 @@ export const TxProof = { : undefined; return message; }, - fromAmino(object: TxProofAmino): TxProof { - const message = createBaseTxProof(); - if (object.root_hash !== undefined && object.root_hash !== null) { - message.rootHash = bytesFromBase64(object.root_hash); - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.proof !== undefined && object.proof !== null) { - message.proof = Proof.fromAmino(object.proof); - } - return message; - }, - toAmino(message: TxProof): TxProofAmino { - const obj: any = {}; - obj.root_hash = message.rootHash - ? base64FromBytes(message.rootHash) - : undefined; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; - return obj; - }, - fromAminoMsg(object: TxProofAminoMsg): TxProof { - return TxProof.fromAmino(object.value); - }, fromProtoMsg(message: TxProofProtoMsg): TxProof { return TxProof.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/types/validator.ts b/packages/cosmic-proto/src/codegen/tendermint/types/validator.ts index 3057780fafe..403bf61a21f 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/types/validator.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/types/validator.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { PublicKey, PublicKeyAmino, PublicKeySDKType } from '../crypto/keys.js'; +import { PublicKey, PublicKeySDKType } from '../crypto/keys.js'; import { BinaryReader, BinaryWriter } from '../../binary.js'; import { isSet, bytesFromBase64, base64FromBytes } from '../../helpers.js'; export interface ValidatorSet { @@ -11,15 +11,6 @@ export interface ValidatorSetProtoMsg { typeUrl: '/tendermint.types.ValidatorSet'; value: Uint8Array; } -export interface ValidatorSetAmino { - validators?: ValidatorAmino[]; - proposer?: ValidatorAmino; - total_voting_power?: string; -} -export interface ValidatorSetAminoMsg { - type: '/tendermint.types.ValidatorSet'; - value: ValidatorSetAmino; -} export interface ValidatorSetSDKType { validators: ValidatorSDKType[]; proposer?: ValidatorSDKType; @@ -35,16 +26,6 @@ export interface ValidatorProtoMsg { typeUrl: '/tendermint.types.Validator'; value: Uint8Array; } -export interface ValidatorAmino { - address?: string; - pub_key?: PublicKeyAmino; - voting_power?: string; - proposer_priority?: string; -} -export interface ValidatorAminoMsg { - type: '/tendermint.types.Validator'; - value: ValidatorAmino; -} export interface ValidatorSDKType { address: Uint8Array; pub_key: PublicKeySDKType; @@ -59,14 +40,6 @@ export interface SimpleValidatorProtoMsg { typeUrl: '/tendermint.types.SimpleValidator'; value: Uint8Array; } -export interface SimpleValidatorAmino { - pub_key?: PublicKeyAmino; - voting_power?: string; -} -export interface SimpleValidatorAminoMsg { - type: '/tendermint.types.SimpleValidator'; - value: SimpleValidatorAmino; -} export interface SimpleValidatorSDKType { pub_key?: PublicKeySDKType; voting_power: bigint; @@ -165,42 +138,6 @@ export const ValidatorSet = { : BigInt(0); return message; }, - fromAmino(object: ValidatorSetAmino): ValidatorSet { - const message = createBaseValidatorSet(); - message.validators = - object.validators?.map(e => Validator.fromAmino(e)) || []; - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = Validator.fromAmino(object.proposer); - } - if ( - object.total_voting_power !== undefined && - object.total_voting_power !== null - ) { - message.totalVotingPower = BigInt(object.total_voting_power); - } - return message; - }, - toAmino(message: ValidatorSet): ValidatorSetAmino { - const obj: any = {}; - if (message.validators) { - obj.validators = message.validators.map(e => - e ? Validator.toAmino(e) : undefined, - ); - } else { - obj.validators = message.validators; - } - obj.proposer = message.proposer - ? Validator.toAmino(message.proposer) - : undefined; - obj.total_voting_power = - message.totalVotingPower !== BigInt(0) - ? message.totalVotingPower.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ValidatorSetAminoMsg): ValidatorSet { - return ValidatorSet.fromAmino(object.value); - }, fromProtoMsg(message: ValidatorSetProtoMsg): ValidatorSet { return ValidatorSet.decode(message.value); }, @@ -320,46 +257,6 @@ export const Validator = { : BigInt(0); return message; }, - fromAmino(object: ValidatorAmino): Validator { - const message = createBaseValidator(); - if (object.address !== undefined && object.address !== null) { - message.address = bytesFromBase64(object.address); - } - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pubKey = PublicKey.fromAmino(object.pub_key); - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.votingPower = BigInt(object.voting_power); - } - if ( - object.proposer_priority !== undefined && - object.proposer_priority !== null - ) { - message.proposerPriority = BigInt(object.proposer_priority); - } - return message; - }, - toAmino(message: Validator): ValidatorAmino { - const obj: any = {}; - obj.address = message.address - ? base64FromBytes(message.address) - : undefined; - obj.pub_key = message.pubKey - ? PublicKey.toAmino(message.pubKey) - : undefined; - obj.voting_power = - message.votingPower !== BigInt(0) - ? message.votingPower.toString() - : undefined; - obj.proposer_priority = - message.proposerPriority !== BigInt(0) - ? message.proposerPriority.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: ValidatorAminoMsg): Validator { - return Validator.fromAmino(object.value); - }, fromProtoMsg(message: ValidatorProtoMsg): Validator { return Validator.decode(message.value); }, @@ -446,30 +343,6 @@ export const SimpleValidator = { : BigInt(0); return message; }, - fromAmino(object: SimpleValidatorAmino): SimpleValidator { - const message = createBaseSimpleValidator(); - if (object.pub_key !== undefined && object.pub_key !== null) { - message.pubKey = PublicKey.fromAmino(object.pub_key); - } - if (object.voting_power !== undefined && object.voting_power !== null) { - message.votingPower = BigInt(object.voting_power); - } - return message; - }, - toAmino(message: SimpleValidator): SimpleValidatorAmino { - const obj: any = {}; - obj.pub_key = message.pubKey - ? PublicKey.toAmino(message.pubKey) - : undefined; - obj.voting_power = - message.votingPower !== BigInt(0) - ? message.votingPower.toString() - : undefined; - return obj; - }, - fromAminoMsg(object: SimpleValidatorAminoMsg): SimpleValidator { - return SimpleValidator.fromAmino(object.value); - }, fromProtoMsg(message: SimpleValidatorProtoMsg): SimpleValidator { return SimpleValidator.decode(message.value); }, diff --git a/packages/cosmic-proto/src/codegen/tendermint/version/types.ts b/packages/cosmic-proto/src/codegen/tendermint/version/types.ts index 5b86a9f4667..a6c36b877ff 100644 --- a/packages/cosmic-proto/src/codegen/tendermint/version/types.ts +++ b/packages/cosmic-proto/src/codegen/tendermint/version/types.ts @@ -14,19 +14,6 @@ export interface AppProtoMsg { typeUrl: '/tendermint.version.App'; value: Uint8Array; } -/** - * App includes the protocol and software version for the application. - * This information is included in ResponseInfo. The App.Protocol can be - * updated in ResponseEndBlock. - */ -export interface AppAmino { - protocol?: string; - software?: string; -} -export interface AppAminoMsg { - type: '/tendermint.version.App'; - value: AppAmino; -} /** * App includes the protocol and software version for the application. * This information is included in ResponseInfo. The App.Protocol can be @@ -49,19 +36,6 @@ export interface ConsensusProtoMsg { typeUrl: '/tendermint.version.Consensus'; value: Uint8Array; } -/** - * Consensus captures the consensus rules for processing a block in the blockchain, - * including all blockchain data structures and the rules of the application's - * state transition machine. - */ -export interface ConsensusAmino { - block?: string; - app?: string; -} -export interface ConsensusAminoMsg { - type: '/tendermint.version.Consensus'; - value: ConsensusAmino; -} /** * Consensus captures the consensus rules for processing a block in the blockchain, * including all blockchain data structures and the rules of the application's @@ -136,26 +110,6 @@ export const App = { message.software = object.software ?? ''; return message; }, - fromAmino(object: AppAmino): App { - const message = createBaseApp(); - if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = BigInt(object.protocol); - } - if (object.software !== undefined && object.software !== null) { - message.software = object.software; - } - return message; - }, - toAmino(message: App): AppAmino { - const obj: any = {}; - obj.protocol = - message.protocol !== BigInt(0) ? message.protocol.toString() : undefined; - obj.software = message.software === '' ? undefined : message.software; - return obj; - }, - fromAminoMsg(object: AppAminoMsg): App { - return App.fromAmino(object.value); - }, fromProtoMsg(message: AppProtoMsg): App { return App.decode(message.value); }, @@ -236,26 +190,6 @@ export const Consensus = { : BigInt(0); return message; }, - fromAmino(object: ConsensusAmino): Consensus { - const message = createBaseConsensus(); - if (object.block !== undefined && object.block !== null) { - message.block = BigInt(object.block); - } - if (object.app !== undefined && object.app !== null) { - message.app = BigInt(object.app); - } - return message; - }, - toAmino(message: Consensus): ConsensusAmino { - const obj: any = {}; - obj.block = - message.block !== BigInt(0) ? message.block.toString() : undefined; - obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; - return obj; - }, - fromAminoMsg(object: ConsensusAminoMsg): Consensus { - return Consensus.fromAmino(object.value); - }, fromProtoMsg(message: ConsensusProtoMsg): Consensus { return Consensus.decode(message.value); }, diff --git a/packages/cosmic-proto/src/index.ts b/packages/cosmic-proto/src/index.ts index f1c0cdd71d6..8643097653e 100644 --- a/packages/cosmic-proto/src/index.ts +++ b/packages/cosmic-proto/src/index.ts @@ -1,31 +1,3 @@ -import { Registry } from '@cosmjs/proto-signing'; -import { defaultRegistryTypes } from '@cosmjs/stargate'; -import type { Any } from './codegen/google/protobuf/any.js'; -import { agoricProtoRegistry } from './codegen/index.js'; -import type { TypedJson } from './helpers.js'; - export * from './codegen/index.js'; export * from './helpers.js'; - -/** - * - * @returns the registry that getSigningAgoricClientOptions() returns but without aminoTypes - */ -export const makeAgoricRegistry = () => { - return new Registry([...defaultRegistryTypes, ...agoricProtoRegistry]); -}; - -/** - * @see {@link https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto} - * @param [registry] - */ -export const makeProtoConverter = ( - registry: Registry = makeAgoricRegistry(), -) => { - const convertToJson = (protoAny: Any): TypedJson => { - const fields = registry.decode(protoAny); - return { '@type': protoAny.typeUrl, ...fields }; - }; - return convertToJson; -}; diff --git a/packages/cosmic-proto/test/snapshots/test-exports.js.md b/packages/cosmic-proto/test/snapshots/test-exports.js.md index a2395e4cd6b..11890826051 100644 --- a/packages/cosmic-proto/test/snapshots/test-exports.js.md +++ b/packages/cosmic-proto/test/snapshots/test-exports.js.md @@ -13,25 +13,15 @@ Generated by [AVA](https://avajs.dev). 'BinaryWriter', 'WireType', 'agoric', - 'agoricAminoConverters', - 'agoricProtoRegistry', 'amino', 'cosmos', - 'cosmosAminoConverters', - 'cosmosProtoRegistry', 'cosmos_proto', - 'getSigningAgoricClient', - 'getSigningAgoricClientOptions', - 'getSigningCosmosClient', - 'getSigningCosmosClientOptions', 'gogoproto', 'google', 'ibc', 'int64FromString', 'int64Length', 'int64ToString', - 'makeAgoricRegistry', - 'makeProtoConverter', 'readInt32', 'readUInt32', 'tendermint', @@ -100,7 +90,6 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 [ - 'ClientFactory', 'lien', 'swingset', 'vbank', @@ -114,7 +103,6 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 [ - 'ClientFactory', 'auth', 'authz', 'bank', diff --git a/packages/cosmic-proto/test/snapshots/test-exports.js.snap b/packages/cosmic-proto/test/snapshots/test-exports.js.snap index 8e13db055592574e400c67c2f869d14153b9debe..26e36c8403fb1c107e5819c08844addf0223a56c 100644 GIT binary patch literal 1128 zcmV-u1eg0kRzVC88eE4 zRQIcSQ_kzEPF200?tu_o=t{(uL0lzqC0QA8;YJX|g=FD!1eZc^>ehYdR-L+c_G*!=ALvi+GQ&;87#9I+b1i67?@OaUx)TJ{(02W0)dUUJ*_;~zAYG;USdq7$JEWeTdegrSsS_Ts+u&Toh69H2V zE{w%yT}snwvfvFZg@xuUbSB;yRn5Fh8=Jk?(jT(my4l6L=fEP1Zo@9pI|CLv>pIk; zig&+2B^Ey6w6W-6a`94T@yc>?@wv?6mF3jp^RB2~c(pTxo^*M8&^m9kU?}ZVE^iOL zKB&yX7e>J=%NBmxsdRL-#_BR~yFQaZu8J-)aEpdM->$Fsm_SjKc8rQ`4WJ2035() z03HB12JkOVXmu&u>iM_2`&|tc(|ViTh?zFIUN59LW4hcYZBic9WIL0|HF_~k8q?%{ zO_2HEQTMF&ERMF=`H2 z`#cI16XWDOn_-R7bGAntQIu12F2P7?xz~S{a~i&LJW9g%0K@=31#lO@52u!}5OF4Q znpN!W$mvvU)u=eg2~%h#UTvqtR4bBo8rAnH&wEG3o*Mh*{Xt^H>G>t`>9fJ$9L_@hP_}Y*Sqznon>l|hBu5rEVwIY` uyPcb?%G%I_#GvA)D$lfYqf|L=hKdefUN=aUTTGkBS^ftDTdMo83jhETf*h3q literal 1300 zcmV+v1?&1jRzVJ@&fIC}vs z+I8ZjsUM3700000000A(R!fK+MHv2Sx_f4_kL)w=#7B%q1rf};2p)8^n}rQo+-zbJ zPf{~o+gol=)ug&+b|<1Bf)~Yj6a*p3MNb|CK?!&eZ-N-`pyENnqk0nrMbpz$HT{@j z$()A&`|AIzzQ5}0|Heiwl=ZFXt(#199Wus+&vtkuXfxWBI(p-V?^8`*^1gCVLHr|C z^7uCZ?g01`z&HU;65u%kY!KjW0^B6P7XSn)tpXzR=)8E=tj6N;4H1nrCP;32jYDE!SDV zBdt1yR5m1!##v0bVoTR$)Q~o3)s{};LrU+lr4!n~(j!)ug!FPVW*KzUp!)-+FYrKc z5iE4iu^4hDwBd~z-m$^F7n+(&VRtq@Anjted^YXg0cq2`T-pgk-xJ6{W)3oGr3|DD zLfhRb6L)ycwszVCC%Dk_bIVFLE@;I?UD#K0rjRotMtUCKh_<;1BBq~gL_t*adh%V$>qplBTmrBI;1+d0{($wZ&9tKk{z%l?1;9UTp0{8*Izu2YK z<$SBB&&T!71d2t`I=k9pkuLOlCc_!h<%G0Kd03M>xlFdvvsu!RCMSDZqlz~2d-Ag7 z3@58)JJM3ofZdyxuK;)tz-It{2JqiKYnkk6kv5m8ro+UX&60+w*<)?;&{s?hlXG8= zHAK(JE^WZ3teR6PMn=nxWXLIKc;%mzgw-VgX8~*icpbp|06ytC(yzP8Sjo#cp3DNv zw610U6KVx?W3)KtnFmx5$!piB*eZzPwo?Ow6=Jj<$~q0}o0N-!aa7I4GU6l?)_@E4 zM@pTkSQP=_9RN20d=B7S0KfGf>=6PyO@Om^=Wg>lzS4?cFxEjPOkQ5b70k)~UzamNm@CB0J^Rx7P$plJX5ZO76|n??F=mj3~A KyT1Rd4FCYfYj9Qo diff --git a/packages/cosmic-proto/test/test-helpers.js b/packages/cosmic-proto/test/test-helpers.js index e1eed639cc7..b91c299d421 100644 --- a/packages/cosmic-proto/test/test-helpers.js +++ b/packages/cosmic-proto/test/test-helpers.js @@ -2,11 +2,7 @@ import test from 'ava'; import { cosmos } from '../dist/codegen/cosmos/bundle.js'; -import { - getSigningAgoricClientOptions, - makeProtoConverter, - typedJson, -} from '../dist/index.js'; +import { typedJson } from '../dist/index.js'; const mockMsgSend = { fromAddress: 'agoric1from', @@ -20,39 +16,6 @@ test('MsgSend', t => { }); }); -test('registry', t => { - const { registry } = getSigningAgoricClientOptions(); - t.truthy(registry.lookupType('/cosmos.bank.v1beta1.MsgSend')); - - const proto = registry.encodeAsAny({ - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: mockMsgSend, - }); - t.like(proto, { - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - }); - - t.deepEqual(registry.decode(proto), mockMsgSend); -}); - -test('normalize', t => { - const { registry } = getSigningAgoricClientOptions(); - const convert = makeProtoConverter(registry); - - const protoJson = { - '@type': '/cosmos.bank.v1beta1.MsgSend', - ...mockMsgSend, - }; - - const proto = registry.encodeAsAny({ - typeUrl: '/cosmos.bank.v1beta1.MsgSend', - value: mockMsgSend, - }); - t.deepEqual(convert(proto), protoJson); - const { '@type': _, ...value } = protoJson; - t.deepEqual(registry.decode(proto), value); -}); - test('typedJson', t => { const address = 'addr'; const qabr = typedJson('/cosmos.bank.v1beta1.QueryAllBalancesRequest', { diff --git a/packages/cosmic-proto/test/test-readme.js b/packages/cosmic-proto/test/test-readme.js index 7f6a5a3666b..945afa643cc 100644 --- a/packages/cosmic-proto/test/test-readme.js +++ b/packages/cosmic-proto/test/test-readme.js @@ -9,6 +9,7 @@ const RPC_ENDPOINT = ''; // Skip because we don't have a real endpoint, still tests the types test.skip('RPC Clients', async t => { + // @ts-expect-error const { createRPCQueryClient } = agoric.ClientFactory; const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); @@ -16,7 +17,8 @@ test.skip('RPC Clients', async t => { t.truthy(swingsetParams); }); -test('Composing Messages', t => { +test.failing('Composing Messages', t => { + // @ts-expect-error const { sendPacket } = agoric.vibc.MessageComposer.withTypeUrl; t.truthy(sendPacket); });