From 7f38f1f207cba25c3f6e3b07542f40090c628cee Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:56:11 -0400 Subject: [PATCH 01/13] feat(wip): starship integration --- package.json | 2 +- starship/configs/config.workflow.yaml | 55 --------------------------- starship/configs/config.yaml | 37 +++++++++--------- starship/configs/starship.yaml | 3 -- 4 files changed, 19 insertions(+), 78 deletions(-) delete mode 100644 starship/configs/config.workflow.yaml delete mode 100644 starship/configs/starship.yaml diff --git a/package.json b/package.json index 988584a..4f7ab15 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "test": "jest", "test:watch": "jest --watch", "test:debug": "node --inspect node_modules/.bin/jest --runInBand", - "starship": "starship --config ./starship/configs/starship.yaml", + "starship": "starship --config ./starship/configs/config.yaml", "starship:test": "jest --config ./jest.starship.config.js --verbose --bail", "starship:debug": "jest --config ./jest.starship.config.js --runInBand --verbose --bail", "starship:watch": "jest --watch --config ./jest.starship.config.js" diff --git a/starship/configs/config.workflow.yaml b/starship/configs/config.workflow.yaml deleted file mode 100644 index d55a0db..0000000 --- a/starship/configs/config.workflow.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: manifestjs -version: v1.2.1 - -chains: - - id: manifest-ledger-beta - name: manifest - image: ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.12 - numValidators: 1 - ports: - rest: 1317 - rpc: 26657 - faucet: 8007 - resources: - cpu: "0.2" - memory: "200M" - - id: cosmos-2 - name: cosmoshub - numValidators: 1 - ports: - rest: 1313 - rpc: 26653 - faucet: 8003 - resources: - cpu: "0.2" - memory: "200M" - -relayers: - - name: manifest-cosmos - type: hermes - replicas: 1 - chains: - - manifest-ledger-beta - - cosmos-2 - resources: - cpu: "0.1" - memory: "100M" - -registry: - enabled: true - ports: - rest: 8081 - grpc: 9091 - resources: - cpu: "0.1" - memory: "100M" - -exposer: - resources: - cpu: "0.1" - memory: "100M" - -faucet: - resources: - cpu: "0.1" - memory: "100M" diff --git a/starship/configs/config.yaml b/starship/configs/config.yaml index 44312e3..6ffd684 100644 --- a/starship/configs/config.yaml +++ b/starship/configs/config.yaml @@ -1,39 +1,38 @@ -name: manifestjs -version: v1.2.1 +name: starship-manifestjs +version: v0.2.12 chains: - id: manifest-ledger-beta - name: manifest + name: custom image: ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.12 + home: /root/.manifest + binary: manifestd + prefix: manifest + denom: umfx + coins: 1000000000000000000umfx + hdPath: m/44'/118'/0'/0/0 + coinType: 118 + repo: https://github.com/liftedinit/manifest-ledger numValidators: 1 ports: rest: 1317 rpc: 26657 - faucet: 8007 - - id: cosmos-2 name: cosmoshub numValidators: 1 ports: rest: 1313 rpc: 26653 - faucet: 8003 - -relayers: - - name: manifest-cosmos - type: hermes - replicas: 1 - chains: - - manifest-ledger-beta - - cosmos-2 -explorer: - enabled: true - ports: - rest: 8080 +#relayers: +# - name: manifest-cosmos +# type: hermes +# replicas: 1 +# chains: +# - manifest-ledger-beta +# - cosmos-2 registry: enabled: true ports: rest: 8081 - grpc: 9091 diff --git a/starship/configs/starship.yaml b/starship/configs/starship.yaml deleted file mode 100644 index d70f891..0000000 --- a/starship/configs/starship.yaml +++ /dev/null @@ -1,3 +0,0 @@ -helmName: manifestjs -helmFile: ./config.yaml -helmVersion: v0.1.38 From ff34b20486cb40dd2c1c9f2d024ec5bb01446f94 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:36:17 -0400 Subject: [PATCH 02/13] chore: enable faucet, relayer and explorer --- starship/configs/config.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/starship/configs/config.yaml b/starship/configs/config.yaml index 6ffd684..72b00c5 100644 --- a/starship/configs/config.yaml +++ b/starship/configs/config.yaml @@ -4,7 +4,7 @@ version: v0.2.12 chains: - id: manifest-ledger-beta name: custom - image: ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.12 + image: ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.13 home: /root/.manifest binary: manifestd prefix: manifest @@ -17,22 +17,30 @@ chains: ports: rest: 1317 rpc: 26657 + faucet: 8001 - id: cosmos-2 name: cosmoshub numValidators: 1 ports: rest: 1313 rpc: 26653 + faucet: 8002 -#relayers: -# - name: manifest-cosmos -# type: hermes -# replicas: 1 -# chains: -# - manifest-ledger-beta -# - cosmos-2 +relayers: + - name: manifest-cosmos + type: hermes + replicas: 1 + chains: + - manifest-ledger-beta + - cosmos-2 registry: enabled: true ports: rest: 8081 + +explorer: + enabled: true + type: ping-pub + ports: + rest: 8080 From 57d9faa3b9457d070b086edc72d1a86b1cc736c1 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:36:40 -0400 Subject: [PATCH 03/13] test: setup and ibc transfer test --- starship/__tests__/setup.test.ts | 18 +++--- starship/__tests__/token.test.ts | 108 +++++++++++++++---------------- 2 files changed, 61 insertions(+), 65 deletions(-) diff --git a/starship/__tests__/setup.test.ts b/starship/__tests__/setup.test.ts index 0c2d887..cc2e143 100644 --- a/starship/__tests__/setup.test.ts +++ b/starship/__tests__/setup.test.ts @@ -1,25 +1,25 @@ // @ts-nocheck -import { StargateClient } from '@cosmjs/stargate'; -import path from 'path'; -import { ConfigContext, useChain, useRegistry } from 'starshipjs'; +import { StargateClient } from "@cosmjs/stargate"; +import path from "path"; +import { ConfigContext, useChain, useRegistry } from "starshipjs"; beforeAll(async () => { - const configFile = path.join(__dirname, '..', 'configs', 'config.yaml'); + const configFile = path.join(__dirname, "..", "configs", "config.yaml"); ConfigContext.setConfigFile(configFile); - ConfigContext.setRegistry(await useRegistry(configFile)) + ConfigContext.setRegistry(await useRegistry(configFile)); }); -describe('Test clients', () => { +describe("Test clients", () => { let client; beforeAll(async () => { - const { getRpcEndpoint } = useChain('osmosis'); + const { getRpcEndpoint } = useChain("manifest-ledger-beta"); client = await StargateClient.connect(await getRpcEndpoint()); }); - it('check chain height', async () => { + it("check chain height", async () => { const height = await client.getHeight(); expect(height).toBeGreaterThan(0); }); -}); \ No newline at end of file +}); diff --git a/starship/__tests__/token.test.ts b/starship/__tests__/token.test.ts index 02e2659..b9ee6fa 100644 --- a/starship/__tests__/token.test.ts +++ b/starship/__tests__/token.test.ts @@ -1,34 +1,32 @@ -import './setup.test'; +import "./setup.test"; -import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'; -import { assertIsDeliverTxSuccess, StargateClient } from '@cosmjs/stargate'; -import { generateMnemonic, useChain } from 'starshipjs'; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { assertIsDeliverTxSuccess, StargateClient } from "@cosmjs/stargate"; +import { generateMnemonic, useChain } from "starshipjs"; -import { getSigningOsmosisClient, ibc } from '../../src'; +import { getSigningManifestClient, ibc } from "../../src"; +import { MsgTransfer } from "../../src/codegen/ibc/applications/transfer/v1/tx"; -describe('Token transfers', () => { +describe("Token transfers", () => { let wallet, denom, address; let chainInfo, getCoin, getRpcEndpoint, creditFromFaucet; beforeAll(async () => { - ({ - chainInfo, - getCoin, - getRpcEndpoint, - creditFromFaucet - } = useChain('osmosis')); + ({ chainInfo, getCoin, getRpcEndpoint, creditFromFaucet } = useChain( + "manifest-ledger-beta" + )); denom = (await getCoin()).base; // Initialize wallet wallet = await DirectSecp256k1HdWallet.fromMnemonic(generateMnemonic(), { - prefix: chainInfo.chain.bech32_prefix + prefix: chainInfo.chain.bech32_prefix, }); address = (await wallet.getAccounts())[0].address; await creditFromFaucet(address); }); - it('send osmosis token to address', async () => { + it("send manifest token to address", async () => { // Initialize wallet const wallet2 = await DirectSecp256k1HdWallet.fromMnemonic( generateMnemonic(), @@ -36,33 +34,33 @@ describe('Token transfers', () => { ); const address2 = (await wallet2.getAccounts())[0].address; - const signingClient = await getSigningOsmosisClient({ + const signingClient = await getSigningManifestClient({ rpcEndpoint: await getRpcEndpoint(), - signer: wallet + signer: wallet, }); const fee = { amount: [ { denom, - amount: '100000' - } + amount: "100000", + }, ], - gas: '550000' + gas: "550000", }; const token = { - amount: '10000000', - denom + amount: "10000000", + denom, }; - // Transfer uosmo tokens from faceut + // Transfer umfx tokens from facet await signingClient.sendTokens( address, address2, [token], fee, - 'send tokens test' + "send tokens test" ); const balance = await signingClient.getBalance(address2, denom); @@ -71,20 +69,14 @@ describe('Token transfers', () => { expect(balance.denom).toEqual(denom); }, 10000); - it('send ibc osmo tokens to address on cosmos chain', async () => { - const signingClient = await getSigningOsmosisClient({ + it("send ibc umfx tokens to address on cosmos chain", async () => { + const signingClient = await getSigningManifestClient({ rpcEndpoint: await getRpcEndpoint(), - signer: wallet + signer: wallet, }); - const { - chainInfo: cosmosChainInfo, - getRpcEndpoint: cosmosRpcEndpoint - } = useChain('cosmoshub'); - - const { - getRpcEndpoint: osmosisRpcEndpoint - } = useChain('osmosis'); + const { chainInfo: cosmosChainInfo, getRpcEndpoint: cosmosRpcEndpoint } = + useChain("cosmoshub"); // Initialize wallet address for cosmos chain const cosmosWallet = await DirectSecp256k1HdWallet.fromMnemonic( @@ -107,7 +99,7 @@ describe('Token transfers', () => { const { port_id: sourcePort, channel_id: sourceChannel } = ibcInfo.channels[0].chain_1; - // Transfer osmosis tokens via IBC to cosmos chain + // Transfer manifest tokens via IBC to cosmos chain const currentTime = Math.floor(Date.now() / 1000); const timeoutTime = currentTime + 300; // 5 minutes @@ -115,54 +107,58 @@ describe('Token transfers', () => { amount: [ { denom, - amount: '100000' - } + amount: "100000", + }, ], - gas: '550000' + gas: "550000", }; const token = { denom, - amount: '10000000' + amount: "10000000", }; // send ibc tokens - const resp = await signingClient.sendIbcTokens( + const transferMsg = { + typeUrl: MsgTransfer.typeUrl, + value: MsgTransfer.fromPartial({ + sourcePort, + sourceChannel, + sender: address, + receiver: cosmosAddress, + token: token, + timeoutTimestamp: BigInt(timeoutTime) * BigInt(1_000_000_000), // Timeout in nanoseconds + }), + }; + const resp = await signingClient.signAndBroadcast( address, - cosmosAddress, - token, - sourcePort, - sourceChannel, - undefined, - timeoutTime, + [transferMsg], fee ); assertIsDeliverTxSuccess(resp); // Check osmos in address on cosmos chain - const cosmosClient = await StargateClient.connect(await cosmosRpcEndpoint()); + const cosmosClient = await StargateClient.connect( + await cosmosRpcEndpoint() + ); const balances = await cosmosClient.getAllBalances(cosmosAddress); // check balances expect(balances.length).toEqual(1); const ibcBalance = balances.find((balance) => { - return balance.denom.startsWith('ibc/'); + return balance.denom.startsWith("ibc/"); }); - // @ts-ignore expect(ibcBalance.amount).toEqual(token.amount); - // @ts-ignore - expect(ibcBalance.denom).toContain('ibc/'); + expect(ibcBalance.denom).toContain("ibc/"); // check ibc denom trace of the same const queryClient = await ibc.ClientFactory.createRPCQueryClient({ - rpcEndpoint: await cosmosRpcEndpoint() + rpcEndpoint: await cosmosRpcEndpoint(), }); const trace = await queryClient.ibc.applications.transfer.v1.denomTrace({ - // @ts-ignore - hash: ibcBalance.denom.replace('ibc/', '') + hash: ibcBalance.denom.replace("ibc/", ""), }); - // @ts-ignore expect(trace.denomTrace.baseDenom).toEqual(denom); }, 10000); -}); \ No newline at end of file +}); From 77cf55dafb360dca07f48a981a61b7c6cca83759 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:28:22 -0400 Subject: [PATCH 04/13] fix!: update the manifest protobuf The `manifest-ledger` commit 76de251 fixed the manifest proto namespace, adding an additional layer, i.e., manifest.v1.* -> liftedinit.manifest.v1.* This change was released in manifest-ledger alpha.12 --- .../manifest/v1/genesis.proto | 2 +- .../{ => liftedinit}/manifest/v1/query.proto | 4 +- proto/{ => liftedinit}/manifest/v1/tx.proto | 4 +- src/codegen/manifest/bundle.ts | 34 - src/codegen/manifest/client.ts | 47 -- src/codegen/manifest/lcd.ts | 99 --- src/codegen/manifest/rpc.query.ts | 70 -- src/codegen/manifest/rpc.tx.ts | 52 -- src/codegen/manifest/v1/genesis.ts | 158 ----- src/codegen/manifest/v1/query.lcd.ts | 17 - src/codegen/manifest/v1/query.rpc.Query.ts | 30 - src/codegen/manifest/v1/query.ts | 152 ----- src/codegen/manifest/v1/tx.amino.ts | 18 - src/codegen/manifest/v1/tx.registry.ts | 71 -- src/codegen/manifest/v1/tx.rpc.msg.ts | 42 -- src/codegen/manifest/v1/tx.ts | 639 ------------------ 16 files changed, 5 insertions(+), 1434 deletions(-) rename proto/{ => liftedinit}/manifest/v1/genesis.proto (94%) rename proto/{ => liftedinit}/manifest/v1/query.proto (89%) rename proto/{ => liftedinit}/manifest/v1/tx.proto (97%) delete mode 100644 src/codegen/manifest/bundle.ts delete mode 100644 src/codegen/manifest/client.ts delete mode 100644 src/codegen/manifest/lcd.ts delete mode 100644 src/codegen/manifest/rpc.query.ts delete mode 100644 src/codegen/manifest/rpc.tx.ts delete mode 100644 src/codegen/manifest/v1/genesis.ts delete mode 100644 src/codegen/manifest/v1/query.lcd.ts delete mode 100644 src/codegen/manifest/v1/query.rpc.Query.ts delete mode 100644 src/codegen/manifest/v1/query.ts delete mode 100644 src/codegen/manifest/v1/tx.amino.ts delete mode 100644 src/codegen/manifest/v1/tx.registry.ts delete mode 100644 src/codegen/manifest/v1/tx.rpc.msg.ts delete mode 100644 src/codegen/manifest/v1/tx.ts diff --git a/proto/manifest/v1/genesis.proto b/proto/liftedinit/manifest/v1/genesis.proto similarity index 94% rename from proto/manifest/v1/genesis.proto rename to proto/liftedinit/manifest/v1/genesis.proto index 9c6d220..c71731a 100644 --- a/proto/manifest/v1/genesis.proto +++ b/proto/liftedinit/manifest/v1/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package manifest.v1; +package liftedinit.manifest.v1; import "gogoproto/gogo.proto"; import "amino/amino.proto"; diff --git a/proto/manifest/v1/query.proto b/proto/liftedinit/manifest/v1/query.proto similarity index 89% rename from proto/manifest/v1/query.proto rename to proto/liftedinit/manifest/v1/query.proto index eeae4d0..2e01276 100644 --- a/proto/manifest/v1/query.proto +++ b/proto/liftedinit/manifest/v1/query.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package manifest.v1; +package liftedinit.manifest.v1; import "google/api/annotations.proto"; -import "manifest/v1/genesis.proto"; +import "liftedinit/manifest/v1/genesis.proto"; option go_package = "github.com/liftedinit/manifest-ledger/x/manifest/types"; diff --git a/proto/manifest/v1/tx.proto b/proto/liftedinit/manifest/v1/tx.proto similarity index 97% rename from proto/manifest/v1/tx.proto rename to proto/liftedinit/manifest/v1/tx.proto index f44b9a9..8cee74f 100644 --- a/proto/manifest/v1/tx.proto +++ b/proto/liftedinit/manifest/v1/tx.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package manifest.v1; +package liftedinit.manifest.v1; import "cosmos/msg/v1/msg.proto"; -import "manifest/v1/genesis.proto"; +import "liftedinit/manifest/v1/genesis.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/src/codegen/manifest/bundle.ts b/src/codegen/manifest/bundle.ts deleted file mode 100644 index 30c4e2e..0000000 --- a/src/codegen/manifest/bundle.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as _132 from "./module/v1/module"; -import * as _133 from "./v1/genesis"; -import * as _134 from "./v1/query"; -import * as _135 from "./v1/tx"; -import * as _253 from "./v1/tx.amino"; -import * as _254 from "./v1/tx.registry"; -import * as _255 from "./v1/query.lcd"; -import * as _256 from "./v1/query.rpc.Query"; -import * as _257 from "./v1/tx.rpc.msg"; -import * as _274 from "./lcd"; -import * as _275 from "./rpc.query"; -import * as _276 from "./rpc.tx"; -export namespace manifest { - export namespace module { - export const v1 = { - ..._132 - }; - } - export const v1 = { - ..._133, - ..._134, - ..._135, - ..._253, - ..._254, - ..._255, - ..._256, - ..._257 - }; - export const ClientFactory = { - ..._274, - ..._275, - ..._276 - }; -} \ No newline at end of file diff --git a/src/codegen/manifest/client.ts b/src/codegen/manifest/client.ts deleted file mode 100644 index 97e5b21..0000000 --- a/src/codegen/manifest/client.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; -import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; -import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import * as manifestV1TxRegistry from "./v1/tx.registry"; -import * as manifestV1TxAmino from "./v1/tx.amino"; -export const manifestAminoConverters = { - ...manifestV1TxAmino.AminoConverter -}; -export const manifestProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...manifestV1TxRegistry.registry]; -export const getSigningManifestClientOptions = ({ - defaultTypes = defaultRegistryTypes -}: { - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; -} = {}): { - registry: Registry; - aminoTypes: AminoTypes; -} => { - const registry = new Registry([...defaultTypes, ...manifestProtoRegistry]); - const aminoTypes = new AminoTypes({ - ...manifestAminoConverters - }); - return { - registry, - aminoTypes - }; -}; -export const getSigningManifestClient = async ({ - rpcEndpoint, - signer, - defaultTypes = defaultRegistryTypes -}: { - rpcEndpoint: string | HttpEndpoint; - signer: OfflineSigner; - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; -}) => { - const { - registry, - aminoTypes - } = getSigningManifestClientOptions({ - defaultTypes - }); - const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry: (registry as any), - aminoTypes - }); - return client; -}; \ No newline at end of file diff --git a/src/codegen/manifest/lcd.ts b/src/codegen/manifest/lcd.ts deleted file mode 100644 index 7905882..0000000 --- a/src/codegen/manifest/lcd.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { LCDClient } from "@cosmology/lcd"; -export const createLCDClient = async ({ - restEndpoint -}: { - restEndpoint: string; -}) => { - const requestClient = new LCDClient({ - restEndpoint - }); - return { - cosmos: { - auth: { - v1beta1: new (await import("../cosmos/auth/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - base: { - node: { - v1beta1: new (await import("../cosmos/base/node/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - } - }, - circuit: { - v1: new (await import("../cosmos/circuit/v1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - consensus: { - v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/query.lcd")).LCDQueryClient({ - requestClient - }), - v1beta1: new (await import("../cosmos/gov/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - group: { - v1: new (await import("../cosmos/group/v1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - mint: { - v1beta1: new (await import("../cosmos/mint/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - params: { - v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, - tx: { - v1beta1: new (await import("../cosmos/tx/v1beta1/service.lcd")).LCDQueryClient({ - requestClient - }) - }, - upgrade: { - v1beta1: new (await import("../cosmos/upgrade/v1beta1/query.lcd")).LCDQueryClient({ - requestClient - }) - } - }, - manifest: { - v1: new (await import("./v1/query.lcd")).LCDQueryClient({ - requestClient - }) - } - }; -}; \ No newline at end of file diff --git a/src/codegen/manifest/rpc.query.ts b/src/codegen/manifest/rpc.query.ts deleted file mode 100644 index 8d55a87..0000000 --- a/src/codegen/manifest/rpc.query.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import { QueryClient } from "@cosmjs/stargate"; -export const createRPCQueryClient = async ({ - rpcEndpoint -}: { - rpcEndpoint: string | HttpEndpoint; -}) => { - const tmClient = await connectComet(rpcEndpoint); - const client = new QueryClient(tmClient); - return { - cosmos: { - auth: { - v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - authz: { - v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - bank: { - v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - base: { - node: { - v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) - } - }, - circuit: { - v1: (await import("../cosmos/circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - consensus: { - v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - distribution: { - v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - feegrant: { - v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - gov: { - v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), - v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - group: { - v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, - mint: { - v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - orm: { - query: { - v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) - } - }, - params: { - v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - staking: { - v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - }, - tx: { - v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) - }, - upgrade: { - v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) - } - }, - manifest: { - v1: (await import("./v1/query.rpc.Query")).createRpcQueryExtension(client) - } - }; -}; \ No newline at end of file diff --git a/src/codegen/manifest/rpc.tx.ts b/src/codegen/manifest/rpc.tx.ts deleted file mode 100644 index b6d4d29..0000000 --- a/src/codegen/manifest/rpc.tx.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Rpc } from "../helpers"; -export const createRPCMsgClient = async ({ - rpc -}: { - rpc: Rpc; -}) => ({ - cosmos: { - auth: { - v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - authz: { - v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - bank: { - v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - circuit: { - v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - consensus: { - v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - distribution: { - v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - feegrant: { - v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - gov: { - v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), - v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - group: { - v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - mint: { - v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - staking: { - v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - upgrade: { - v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - }, - vesting: { - v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) - } - }, - manifest: { - v1: new (await import("./v1/tx.rpc.msg")).MsgClientImpl(rpc) - } -}); \ No newline at end of file diff --git a/src/codegen/manifest/v1/genesis.ts b/src/codegen/manifest/v1/genesis.ts deleted file mode 100644 index 1c72589..0000000 --- a/src/codegen/manifest/v1/genesis.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { BinaryReader, BinaryWriter } from "../../binary"; -import { DeepPartial, Exact } from "../../helpers"; -/** GenesisState defines the module genesis state */ -export interface GenesisState { - /** Params defines all the paramaters of the module. */ - params: Params; -} -export interface GenesisStateProtoMsg { - typeUrl: "/manifest.v1.GenesisState"; - value: Uint8Array; -} -/** GenesisState defines the module genesis state */ -export interface GenesisStateAmino { - /** Params defines all the paramaters of the module. */ - params?: ParamsAmino; -} -export interface GenesisStateAminoMsg { - type: "/manifest.v1.GenesisState"; - value: GenesisStateAmino; -} -/** GenesisState defines the module genesis state */ -export interface GenesisStateSDKType { - params: ParamsSDKType; -} -/** Params defines the set of module parameters. */ -export interface Params {} -export interface ParamsProtoMsg { - typeUrl: "/manifest.v1.Params"; - value: Uint8Array; -} -/** Params defines the set of module parameters. */ -export interface ParamsAmino {} -export interface ParamsAminoMsg { - type: "manifest/params"; - value: ParamsAmino; -} -/** Params defines the set of module parameters. */ -export interface ParamsSDKType {} -function createBaseGenesisState(): GenesisState { - return { - params: Params.fromPartial({}) - }; -} -export const GenesisState = { - typeUrl: "/manifest.v1.GenesisState", - encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): GenesisState { - const message = createBaseGenesisState(); - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - }, - fromAmino(object: GenesisStateAmino): GenesisState { - const message = createBaseGenesisState(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { - return GenesisState.decode(message.value); - }, - toProto(message: GenesisState): Uint8Array { - return GenesisState.encode(message).finish(); - }, - toProtoMsg(message: GenesisState): GenesisStateProtoMsg { - return { - typeUrl: "/manifest.v1.GenesisState", - value: GenesisState.encode(message).finish() - }; - } -}; -function createBaseParams(): Params { - return {}; -} -export const Params = { - typeUrl: "/manifest.v1.Params", - aminoType: "manifest/params", - encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(_: I): Params { - const message = createBaseParams(); - return message; - }, - fromAmino(_: ParamsAmino): Params { - const message = createBaseParams(); - return message; - }, - toAmino(_: Params): ParamsAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "manifest/params", - value: Params.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/manifest.v1.Params", - value: Params.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/src/codegen/manifest/v1/query.lcd.ts b/src/codegen/manifest/v1/query.lcd.ts deleted file mode 100644 index 52fb1b8..0000000 --- a/src/codegen/manifest/v1/query.lcd.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; -export class LCDQueryClient { - req: LCDClient; - constructor({ - requestClient - }: { - requestClient: LCDClient; - }) { - this.req = requestClient; - } - /* Params queries all parameters of the module. */ - params = async (_params: QueryParamsRequest = {}): Promise => { - const endpoint = `manifest/v1/params`; - return await this.req.get(endpoint); - }; -} \ No newline at end of file diff --git a/src/codegen/manifest/v1/query.rpc.Query.ts b/src/codegen/manifest/v1/query.rpc.Query.ts deleted file mode 100644 index c970f59..0000000 --- a/src/codegen/manifest/v1/query.rpc.Query.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; -import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse } from "./query"; -/** Query provides defines the gRPC querier service. */ -export interface Query { - /** Params queries all parameters of the module. */ - params(request?: QueryParamsRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - /* Params queries all parameters of the module. */ - params = async (request: QueryParamsRequest = {}): Promise => { - const data = QueryParamsRequest.encode(request).finish(); - const promise = this.rpc.request("manifest.v1.Query", "Params", data); - return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); - }; -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - params(request?: QueryParamsRequest): Promise { - return queryService.params(request); - } - }; -}; \ No newline at end of file diff --git a/src/codegen/manifest/v1/query.ts b/src/codegen/manifest/v1/query.ts deleted file mode 100644 index b4b42d0..0000000 --- a/src/codegen/manifest/v1/query.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { DeepPartial, Exact } from "../../helpers"; -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequest {} -export interface QueryParamsRequestProtoMsg { - typeUrl: "/manifest.v1.QueryParamsRequest"; - value: Uint8Array; -} -/** QueryParamsRequest is the request type for the Query/Params RPC method. */ -export interface QueryParamsRequestAmino {} -export interface QueryParamsRequestAminoMsg { - type: "/manifest.v1.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 { - /** params defines the parameters of the module. */ - params?: Params; -} -export interface QueryParamsResponseProtoMsg { - typeUrl: "/manifest.v1.QueryParamsResponse"; - 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: "/manifest.v1.QueryParamsResponse"; - value: QueryParamsResponseAmino; -} -/** QueryParamsResponse is the response type for the Query/Params RPC method. */ -export interface QueryParamsResponseSDKType { - params?: ParamsSDKType; -} -function createBaseQueryParamsRequest(): QueryParamsRequest { - return {}; -} -export const QueryParamsRequest = { - typeUrl: "/manifest.v1.QueryParamsRequest", - encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(_: I): 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); - }, - toProto(message: QueryParamsRequest): Uint8Array { - return QueryParamsRequest.encode(message).finish(); - }, - toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { - return { - typeUrl: "/manifest.v1.QueryParamsRequest", - value: QueryParamsRequest.encode(message).finish() - }; - } -}; -function createBaseQueryParamsResponse(): QueryParamsResponse { - return { - params: undefined - }; -} -export const QueryParamsResponse = { - typeUrl: "/manifest.v1.QueryParamsResponse", - encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryParamsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): QueryParamsResponse { - const message = createBaseQueryParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : 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); - }, - toProto(message: QueryParamsResponse): Uint8Array { - return QueryParamsResponse.encode(message).finish(); - }, - toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { - return { - typeUrl: "/manifest.v1.QueryParamsResponse", - value: QueryParamsResponse.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/src/codegen/manifest/v1/tx.amino.ts b/src/codegen/manifest/v1/tx.amino.ts deleted file mode 100644 index 862904d..0000000 --- a/src/codegen/manifest/v1/tx.amino.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MsgUpdateParams, MsgPayout, MsgBurnHeldBalance } from "./tx"; -export const AminoConverter = { - "/manifest.v1.MsgUpdateParams": { - aminoType: "/manifest.v1.MsgUpdateParams", - toAmino: MsgUpdateParams.toAmino, - fromAmino: MsgUpdateParams.fromAmino - }, - "/manifest.v1.MsgPayout": { - aminoType: "/manifest.v1.MsgPayout", - toAmino: MsgPayout.toAmino, - fromAmino: MsgPayout.fromAmino - }, - "/manifest.v1.MsgBurnHeldBalance": { - aminoType: "/manifest.v1.MsgBurnHeldBalance", - toAmino: MsgBurnHeldBalance.toAmino, - fromAmino: MsgBurnHeldBalance.fromAmino - } -}; \ No newline at end of file diff --git a/src/codegen/manifest/v1/tx.registry.ts b/src/codegen/manifest/v1/tx.registry.ts deleted file mode 100644 index 36ed1fd..0000000 --- a/src/codegen/manifest/v1/tx.registry.ts +++ /dev/null @@ -1,71 +0,0 @@ -//@ts-nocheck -import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgUpdateParams, MsgPayout, MsgBurnHeldBalance } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/manifest.v1.MsgUpdateParams", MsgUpdateParams], ["/manifest.v1.MsgPayout", MsgPayout], ["/manifest.v1.MsgBurnHeldBalance", MsgBurnHeldBalance]]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - updateParams(value: MsgUpdateParams) { - return { - typeUrl: "/manifest.v1.MsgUpdateParams", - value: MsgUpdateParams.encode(value).finish() - }; - }, - payout(value: MsgPayout) { - return { - typeUrl: "/manifest.v1.MsgPayout", - value: MsgPayout.encode(value).finish() - }; - }, - burnHeldBalance(value: MsgBurnHeldBalance) { - return { - typeUrl: "/manifest.v1.MsgBurnHeldBalance", - value: MsgBurnHeldBalance.encode(value).finish() - }; - } - }, - withTypeUrl: { - updateParams(value: MsgUpdateParams) { - return { - typeUrl: "/manifest.v1.MsgUpdateParams", - value - }; - }, - payout(value: MsgPayout) { - return { - typeUrl: "/manifest.v1.MsgPayout", - value - }; - }, - burnHeldBalance(value: MsgBurnHeldBalance) { - return { - typeUrl: "/manifest.v1.MsgBurnHeldBalance", - value - }; - } - }, - fromPartial: { - updateParams(value: MsgUpdateParams) { - return { - typeUrl: "/manifest.v1.MsgUpdateParams", - value: MsgUpdateParams.fromPartial(value) - }; - }, - payout(value: MsgPayout) { - return { - typeUrl: "/manifest.v1.MsgPayout", - value: MsgPayout.fromPartial(value) - }; - }, - burnHeldBalance(value: MsgBurnHeldBalance) { - return { - typeUrl: "/manifest.v1.MsgBurnHeldBalance", - value: MsgBurnHeldBalance.fromPartial(value) - }; - } - } -}; \ No newline at end of file diff --git a/src/codegen/manifest/v1/tx.rpc.msg.ts b/src/codegen/manifest/v1/tx.rpc.msg.ts deleted file mode 100644 index d2e7332..0000000 --- a/src/codegen/manifest/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; -import { MsgUpdateParams, MsgUpdateParamsResponse, MsgPayout, MsgPayoutResponse, MsgBurnHeldBalance, MsgBurnHeldBalanceResponse } from "./tx"; -/** Msg defines the Msg service. */ -export interface Msg { - /** - * UpdateParams defines a governance operation for updating the parameters. - * - * Since: cosmos-sdk 0.47 - */ - updateParams(request: MsgUpdateParams): Promise; - /** Payout allows the authority to manually pay out stakeholders. */ - payout(request: MsgPayout): Promise; - /** BurnHeldBalance allows a tokenholder to burn coins they own. */ - burnHeldBalance(request: MsgBurnHeldBalance): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - } - /* UpdateParams defines a governance operation for updating the parameters. - - Since: cosmos-sdk 0.47 */ - updateParams = async (request: MsgUpdateParams): Promise => { - const data = MsgUpdateParams.encode(request).finish(); - const promise = this.rpc.request("manifest.v1.Msg", "UpdateParams", data); - return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); - }; - /* Payout allows the authority to manually pay out stakeholders. */ - payout = async (request: MsgPayout): Promise => { - const data = MsgPayout.encode(request).finish(); - const promise = this.rpc.request("manifest.v1.Msg", "Payout", data); - return promise.then(data => MsgPayoutResponse.decode(new BinaryReader(data))); - }; - /* BurnHeldBalance allows a tokenholder to burn coins they own. */ - burnHeldBalance = async (request: MsgBurnHeldBalance): Promise => { - const data = MsgBurnHeldBalance.encode(request).finish(); - const promise = this.rpc.request("manifest.v1.Msg", "BurnHeldBalance", data); - return promise.then(data => MsgBurnHeldBalanceResponse.decode(new BinaryReader(data))); - }; -} \ No newline at end of file diff --git a/src/codegen/manifest/v1/tx.ts b/src/codegen/manifest/v1/tx.ts deleted file mode 100644 index 7f7250b..0000000 --- a/src/codegen/manifest/v1/tx.ts +++ /dev/null @@ -1,639 +0,0 @@ -import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; -import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { DeepPartial, Exact } from "../../helpers"; -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParams { - /** authority is the address of the controlling account. */ - authority: string; - /** - * params defines the parameters to update. - * - * NOTE: All parameters must be supplied. - */ - params: Params; -} -export interface MsgUpdateParamsProtoMsg { - typeUrl: "/manifest.v1.MsgUpdateParams"; - value: Uint8Array; -} -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsAmino { - /** authority is the address of the controlling account. */ - authority?: string; - /** - * params defines the parameters to update. - * - * NOTE: All parameters must be supplied. - */ - params?: ParamsAmino; -} -export interface MsgUpdateParamsAminoMsg { - type: "/manifest.v1.MsgUpdateParams"; - value: MsgUpdateParamsAmino; -} -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsSDKType { - authority: string; - params: ParamsSDKType; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponse {} -export interface MsgUpdateParamsResponseProtoMsg { - typeUrl: "/manifest.v1.MsgUpdateParamsResponse"; - value: Uint8Array; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponseAmino {} -export interface MsgUpdateParamsResponseAminoMsg { - type: "/manifest.v1.MsgUpdateParamsResponse"; - value: MsgUpdateParamsResponseAmino; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponseSDKType {} -/** MsgPayout is the Msg/Payout request type. */ -export interface MsgPayout { - /** authority is the address of the controlling account. */ - authority: string; - /** payout_pairs are the pairs of addresses and coins to be paid out. */ - payoutPairs: PayoutPair[]; -} -export interface MsgPayoutProtoMsg { - typeUrl: "/manifest.v1.MsgPayout"; - value: Uint8Array; -} -/** MsgPayout is the Msg/Payout request type. */ -export interface MsgPayoutAmino { - /** authority is the address of the controlling account. */ - authority?: string; - /** payout_pairs are the pairs of addresses and coins to be paid out. */ - payout_pairs: PayoutPairAmino[]; -} -export interface MsgPayoutAminoMsg { - type: "/manifest.v1.MsgPayout"; - value: MsgPayoutAmino; -} -/** MsgPayout is the Msg/Payout request type. */ -export interface MsgPayoutSDKType { - authority: string; - payout_pairs: PayoutPairSDKType[]; -} -/** PayoutPair is the object that pairs an address with a coin to be paid out. */ -export interface PayoutPair { - address: string; - coin: Coin; -} -export interface PayoutPairProtoMsg { - typeUrl: "/manifest.v1.PayoutPair"; - value: Uint8Array; -} -/** PayoutPair is the object that pairs an address with a coin to be paid out. */ -export interface PayoutPairAmino { - address?: string; - coin: CoinAmino; -} -export interface PayoutPairAminoMsg { - type: "/manifest.v1.PayoutPair"; - value: PayoutPairAmino; -} -/** PayoutPair is the object that pairs an address with a coin to be paid out. */ -export interface PayoutPairSDKType { - address: string; - coin: CoinSDKType; -} -/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ -export interface MsgPayoutResponse {} -export interface MsgPayoutResponseProtoMsg { - typeUrl: "/manifest.v1.MsgPayoutResponse"; - value: Uint8Array; -} -/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ -export interface MsgPayoutResponseAmino {} -export interface MsgPayoutResponseAminoMsg { - type: "/manifest.v1.MsgPayoutResponse"; - value: MsgPayoutResponseAmino; -} -/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ -export interface MsgPayoutResponseSDKType {} -/** MsgPayout is the Msg/BurnHeldBalance request type. */ -export interface MsgBurnHeldBalance { - /** sender is the address of the tokenholder. */ - authority: string; - /** burn_coins are the coins to be burned by the tokenholder. */ - burnCoins: Coin[]; -} -export interface MsgBurnHeldBalanceProtoMsg { - typeUrl: "/manifest.v1.MsgBurnHeldBalance"; - value: Uint8Array; -} -/** MsgPayout is the Msg/BurnHeldBalance request type. */ -export interface MsgBurnHeldBalanceAmino { - /** sender is the address of the tokenholder. */ - authority?: string; - /** burn_coins are the coins to be burned by the tokenholder. */ - burn_coins: CoinAmino[]; -} -export interface MsgBurnHeldBalanceAminoMsg { - type: "/manifest.v1.MsgBurnHeldBalance"; - value: MsgBurnHeldBalanceAmino; -} -/** MsgPayout is the Msg/BurnHeldBalance request type. */ -export interface MsgBurnHeldBalanceSDKType { - authority: string; - burn_coins: CoinSDKType[]; -} -/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ -export interface MsgBurnHeldBalanceResponse {} -export interface MsgBurnHeldBalanceResponseProtoMsg { - typeUrl: "/manifest.v1.MsgBurnHeldBalanceResponse"; - value: Uint8Array; -} -/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ -export interface MsgBurnHeldBalanceResponseAmino {} -export interface MsgBurnHeldBalanceResponseAminoMsg { - type: "/manifest.v1.MsgBurnHeldBalanceResponse"; - value: MsgBurnHeldBalanceResponseAmino; -} -/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ -export interface MsgBurnHeldBalanceResponseSDKType {} -function createBaseMsgUpdateParams(): MsgUpdateParams { - return { - authority: "", - params: Params.fromPartial({}) - }; -} -export const MsgUpdateParams = { - typeUrl: "/manifest.v1.MsgUpdateParams", - encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.params = Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): MsgUpdateParams { - const message = createBaseMsgUpdateParams(); - message.authority = object.authority ?? ""; - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - }, - fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { - const message = createBaseMsgUpdateParams(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { - const obj: any = {}; - obj.authority = message.authority === "" ? undefined : message.authority; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - return obj; - }, - fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { - return MsgUpdateParams.fromAmino(object.value); - }, - fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { - return MsgUpdateParams.decode(message.value); - }, - toProto(message: MsgUpdateParams): Uint8Array { - return MsgUpdateParams.encode(message).finish(); - }, - toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { - return { - typeUrl: "/manifest.v1.MsgUpdateParams", - value: MsgUpdateParams.encode(message).finish() - }; - } -}; -function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { - return {}; -} -export const MsgUpdateParamsResponse = { - typeUrl: "/manifest.v1.MsgUpdateParamsResponse", - encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParamsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse(); - return message; - }, - fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse(); - return message; - }, - toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.fromAmino(object.value); - }, - fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.decode(message.value); - }, - toProto(message: MsgUpdateParamsResponse): Uint8Array { - return MsgUpdateParamsResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { - return { - typeUrl: "/manifest.v1.MsgUpdateParamsResponse", - value: MsgUpdateParamsResponse.encode(message).finish() - }; - } -}; -function createBaseMsgPayout(): MsgPayout { - return { - authority: "", - payoutPairs: [] - }; -} -export const MsgPayout = { - typeUrl: "/manifest.v1.MsgPayout", - encode(message: MsgPayout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - for (const v of message.payoutPairs) { - PayoutPair.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgPayout { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgPayout(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.payoutPairs.push(PayoutPair.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): MsgPayout { - const message = createBaseMsgPayout(); - message.authority = object.authority ?? ""; - message.payoutPairs = object.payoutPairs?.map(e => PayoutPair.fromPartial(e)) || []; - return message; - }, - fromAmino(object: MsgPayoutAmino): MsgPayout { - const message = createBaseMsgPayout(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - message.payoutPairs = object.payout_pairs?.map(e => PayoutPair.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgPayout): MsgPayoutAmino { - const obj: any = {}; - obj.authority = message.authority === "" ? undefined : message.authority; - if (message.payoutPairs) { - obj.payout_pairs = message.payoutPairs.map(e => e ? PayoutPair.toAmino(e) : undefined); - } else { - obj.payout_pairs = message.payoutPairs; - } - return obj; - }, - fromAminoMsg(object: MsgPayoutAminoMsg): MsgPayout { - return MsgPayout.fromAmino(object.value); - }, - fromProtoMsg(message: MsgPayoutProtoMsg): MsgPayout { - return MsgPayout.decode(message.value); - }, - toProto(message: MsgPayout): Uint8Array { - return MsgPayout.encode(message).finish(); - }, - toProtoMsg(message: MsgPayout): MsgPayoutProtoMsg { - return { - typeUrl: "/manifest.v1.MsgPayout", - value: MsgPayout.encode(message).finish() - }; - } -}; -function createBasePayoutPair(): PayoutPair { - return { - address: "", - coin: Coin.fromPartial({}) - }; -} -export const PayoutPair = { - typeUrl: "/manifest.v1.PayoutPair", - encode(message: PayoutPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.coin !== undefined) { - Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PayoutPair { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePayoutPair(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.coin = Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): PayoutPair { - const message = createBasePayoutPair(); - message.address = object.address ?? ""; - message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; - return message; - }, - fromAmino(object: PayoutPairAmino): PayoutPair { - const message = createBasePayoutPair(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.coin !== undefined && object.coin !== null) { - message.coin = Coin.fromAmino(object.coin); - } - return message; - }, - toAmino(message: PayoutPair): PayoutPairAmino { - const obj: any = {}; - obj.address = message.address === "" ? undefined : message.address; - obj.coin = message.coin ? Coin.toAmino(message.coin) : Coin.toAmino(Coin.fromPartial({})); - return obj; - }, - fromAminoMsg(object: PayoutPairAminoMsg): PayoutPair { - return PayoutPair.fromAmino(object.value); - }, - fromProtoMsg(message: PayoutPairProtoMsg): PayoutPair { - return PayoutPair.decode(message.value); - }, - toProto(message: PayoutPair): Uint8Array { - return PayoutPair.encode(message).finish(); - }, - toProtoMsg(message: PayoutPair): PayoutPairProtoMsg { - return { - typeUrl: "/manifest.v1.PayoutPair", - value: PayoutPair.encode(message).finish() - }; - } -}; -function createBaseMsgPayoutResponse(): MsgPayoutResponse { - return {}; -} -export const MsgPayoutResponse = { - typeUrl: "/manifest.v1.MsgPayoutResponse", - encode(_: MsgPayoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgPayoutResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgPayoutResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(_: I): MsgPayoutResponse { - const message = createBaseMsgPayoutResponse(); - return message; - }, - fromAmino(_: MsgPayoutResponseAmino): MsgPayoutResponse { - const message = createBaseMsgPayoutResponse(); - return message; - }, - toAmino(_: MsgPayoutResponse): MsgPayoutResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgPayoutResponseAminoMsg): MsgPayoutResponse { - return MsgPayoutResponse.fromAmino(object.value); - }, - fromProtoMsg(message: MsgPayoutResponseProtoMsg): MsgPayoutResponse { - return MsgPayoutResponse.decode(message.value); - }, - toProto(message: MsgPayoutResponse): Uint8Array { - return MsgPayoutResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgPayoutResponse): MsgPayoutResponseProtoMsg { - return { - typeUrl: "/manifest.v1.MsgPayoutResponse", - value: MsgPayoutResponse.encode(message).finish() - }; - } -}; -function createBaseMsgBurnHeldBalance(): MsgBurnHeldBalance { - return { - authority: "", - burnCoins: [] - }; -} -export const MsgBurnHeldBalance = { - typeUrl: "/manifest.v1.MsgBurnHeldBalance", - encode(message: MsgBurnHeldBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - for (const v of message.burnCoins) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnHeldBalance { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBurnHeldBalance(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.burnCoins.push(Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(object: I): MsgBurnHeldBalance { - const message = createBaseMsgBurnHeldBalance(); - message.authority = object.authority ?? ""; - message.burnCoins = object.burnCoins?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: MsgBurnHeldBalanceAmino): MsgBurnHeldBalance { - const message = createBaseMsgBurnHeldBalance(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - message.burnCoins = object.burn_coins?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgBurnHeldBalance): MsgBurnHeldBalanceAmino { - const obj: any = {}; - obj.authority = message.authority === "" ? undefined : message.authority; - if (message.burnCoins) { - obj.burn_coins = message.burnCoins.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.burn_coins = message.burnCoins; - } - return obj; - }, - fromAminoMsg(object: MsgBurnHeldBalanceAminoMsg): MsgBurnHeldBalance { - return MsgBurnHeldBalance.fromAmino(object.value); - }, - fromProtoMsg(message: MsgBurnHeldBalanceProtoMsg): MsgBurnHeldBalance { - return MsgBurnHeldBalance.decode(message.value); - }, - toProto(message: MsgBurnHeldBalance): Uint8Array { - return MsgBurnHeldBalance.encode(message).finish(); - }, - toProtoMsg(message: MsgBurnHeldBalance): MsgBurnHeldBalanceProtoMsg { - return { - typeUrl: "/manifest.v1.MsgBurnHeldBalance", - value: MsgBurnHeldBalance.encode(message).finish() - }; - } -}; -function createBaseMsgBurnHeldBalanceResponse(): MsgBurnHeldBalanceResponse { - return {}; -} -export const MsgBurnHeldBalanceResponse = { - typeUrl: "/manifest.v1.MsgBurnHeldBalanceResponse", - encode(_: MsgBurnHeldBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnHeldBalanceResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgBurnHeldBalanceResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial, I>>(_: I): MsgBurnHeldBalanceResponse { - const message = createBaseMsgBurnHeldBalanceResponse(); - return message; - }, - fromAmino(_: MsgBurnHeldBalanceResponseAmino): MsgBurnHeldBalanceResponse { - const message = createBaseMsgBurnHeldBalanceResponse(); - return message; - }, - toAmino(_: MsgBurnHeldBalanceResponse): MsgBurnHeldBalanceResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgBurnHeldBalanceResponseAminoMsg): MsgBurnHeldBalanceResponse { - return MsgBurnHeldBalanceResponse.fromAmino(object.value); - }, - fromProtoMsg(message: MsgBurnHeldBalanceResponseProtoMsg): MsgBurnHeldBalanceResponse { - return MsgBurnHeldBalanceResponse.decode(message.value); - }, - toProto(message: MsgBurnHeldBalanceResponse): Uint8Array { - return MsgBurnHeldBalanceResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgBurnHeldBalanceResponse): MsgBurnHeldBalanceResponseProtoMsg { - return { - typeUrl: "/manifest.v1.MsgBurnHeldBalanceResponse", - value: MsgBurnHeldBalanceResponse.encode(message).finish() - }; - } -}; \ No newline at end of file From 80510c6aee35d2b2e61a19e12bacdd8c87269b15 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:36:06 -0400 Subject: [PATCH 05/13] fix: manifest poa admin address --- starship/configs/config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/starship/configs/config.yaml b/starship/configs/config.yaml index 72b00c5..ef112a5 100644 --- a/starship/configs/config.yaml +++ b/starship/configs/config.yaml @@ -14,6 +14,11 @@ chains: coinType: 118 repo: https://github.com/liftedinit/manifest-ledger numValidators: 1 + env: + # This is the address of the `genesis` entry defined in + # https://github.com/cosmology-tech/starship/blob/main/starship/charts/devnet/configs/keys.json + - name: POA_ADMIN_ADDRESS + value: manifest1qjtcxl86z0zua2egcsz4ncff2gzlcndzrtglqv ports: rest: 1317 rpc: 26657 From b857ad82ca821cb9f958d0a446267e8e1f2ff421 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:36:23 -0400 Subject: [PATCH 06/13] fix: signer function name --- starship/__tests__/token.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/starship/__tests__/token.test.ts b/starship/__tests__/token.test.ts index b9ee6fa..fd59905 100644 --- a/starship/__tests__/token.test.ts +++ b/starship/__tests__/token.test.ts @@ -4,8 +4,8 @@ import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { assertIsDeliverTxSuccess, StargateClient } from "@cosmjs/stargate"; import { generateMnemonic, useChain } from "starshipjs"; -import { getSigningManifestClient, ibc } from "../../src"; import { MsgTransfer } from "../../src/codegen/ibc/applications/transfer/v1/tx"; +import {getSigningLiftedinitClient, ibc} from "../../src"; describe("Token transfers", () => { let wallet, denom, address; @@ -34,7 +34,7 @@ describe("Token transfers", () => { ); const address2 = (await wallet2.getAccounts())[0].address; - const signingClient = await getSigningManifestClient({ + const signingClient = await getSigningLiftedinitClient({ rpcEndpoint: await getRpcEndpoint(), signer: wallet, }); @@ -54,7 +54,7 @@ describe("Token transfers", () => { denom, }; - // Transfer umfx tokens from facet + // Transfer umfx tokens from faucet await signingClient.sendTokens( address, address2, @@ -70,7 +70,7 @@ describe("Token transfers", () => { }, 10000); it("send ibc umfx tokens to address on cosmos chain", async () => { - const signingClient = await getSigningManifestClient({ + const signingClient = await getSigningLiftedinitClient({ rpcEndpoint: await getRpcEndpoint(), signer: wallet, }); From a7231ad56d047c26faeba18635fe1edbcc7831b3 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:36:56 -0400 Subject: [PATCH 07/13] chore: add liftedinit proto --- src/codegen/liftedinit/bundle.ts | 36 + src/codegen/liftedinit/client.ts | 45 ++ src/codegen/liftedinit/lcd.ts | 101 +++ src/codegen/liftedinit/manifest/v1/genesis.ts | 158 +++++ .../liftedinit/manifest/v1/query.lcd.ts | 17 + .../liftedinit/manifest/v1/query.rpc.Query.ts | 30 + src/codegen/liftedinit/manifest/v1/query.ts | 152 +++++ .../liftedinit/manifest/v1/tx.amino.ts | 18 + .../liftedinit/manifest/v1/tx.registry.ts | 71 ++ .../liftedinit/manifest/v1/tx.rpc.msg.ts | 42 ++ src/codegen/liftedinit/manifest/v1/tx.ts | 639 ++++++++++++++++++ src/codegen/liftedinit/rpc.query.ts | 72 ++ src/codegen/liftedinit/rpc.tx.ts | 54 ++ 13 files changed, 1435 insertions(+) create mode 100644 src/codegen/liftedinit/bundle.ts create mode 100644 src/codegen/liftedinit/client.ts create mode 100644 src/codegen/liftedinit/lcd.ts create mode 100644 src/codegen/liftedinit/manifest/v1/genesis.ts create mode 100644 src/codegen/liftedinit/manifest/v1/query.lcd.ts create mode 100644 src/codegen/liftedinit/manifest/v1/query.rpc.Query.ts create mode 100644 src/codegen/liftedinit/manifest/v1/query.ts create mode 100644 src/codegen/liftedinit/manifest/v1/tx.amino.ts create mode 100644 src/codegen/liftedinit/manifest/v1/tx.registry.ts create mode 100644 src/codegen/liftedinit/manifest/v1/tx.rpc.msg.ts create mode 100644 src/codegen/liftedinit/manifest/v1/tx.ts create mode 100644 src/codegen/liftedinit/rpc.query.ts create mode 100644 src/codegen/liftedinit/rpc.tx.ts diff --git a/src/codegen/liftedinit/bundle.ts b/src/codegen/liftedinit/bundle.ts new file mode 100644 index 0000000..e828f9d --- /dev/null +++ b/src/codegen/liftedinit/bundle.ts @@ -0,0 +1,36 @@ +import * as _112 from "./manifest/module/v1/module"; +import * as _113 from "./manifest/v1/genesis"; +import * as _114 from "./manifest/v1/query"; +import * as _115 from "./manifest/v1/tx"; +import * as _232 from "./manifest/v1/tx.amino"; +import * as _233 from "./manifest/v1/tx.registry"; +import * as _234 from "./manifest/v1/query.lcd"; +import * as _235 from "./manifest/v1/query.rpc.Query"; +import * as _236 from "./manifest/v1/tx.rpc.msg"; +import * as _253 from "./lcd"; +import * as _254 from "./rpc.query"; +import * as _255 from "./rpc.tx"; +export namespace liftedinit { + export namespace manifest { + export namespace module { + export const v1 = { + ..._112 + }; + } + export const v1 = { + ..._113, + ..._114, + ..._115, + ..._232, + ..._233, + ..._234, + ..._235, + ..._236 + }; + } + export const ClientFactory = { + ..._253, + ..._254, + ..._255 + }; +} \ No newline at end of file diff --git a/src/codegen/liftedinit/client.ts b/src/codegen/liftedinit/client.ts new file mode 100644 index 0000000..9a6d606 --- /dev/null +++ b/src/codegen/liftedinit/client.ts @@ -0,0 +1,45 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as liftedinitManifestV1TxRegistry from "./manifest/v1/tx.registry"; +import * as liftedinitManifestV1TxAmino from "./manifest/v1/tx.amino"; +export const liftedinitAminoConverters = { + ...liftedinitManifestV1TxAmino.AminoConverter +}; +export const liftedinitProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...liftedinitManifestV1TxRegistry.registry]; +export const getSigningLiftedinitClientOptions = ({ + defaultTypes = defaultRegistryTypes +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...liftedinitProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...liftedinitAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningLiftedinitClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningLiftedinitClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/lcd.ts b/src/codegen/liftedinit/lcd.ts new file mode 100644 index 0000000..bf87939 --- /dev/null +++ b/src/codegen/liftedinit/lcd.ts @@ -0,0 +1,101 @@ +import { LCDClient } from "@cosmology/lcd"; +export const createLCDClient = async ({ + restEndpoint +}: { + restEndpoint: string; +}) => { + const requestClient = new LCDClient({ + restEndpoint + }); + return { + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + base: { + node: { + v1beta1: new (await import("../cosmos/base/node/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + } + }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/query.lcd")).LCDQueryClient({ + requestClient + }), + v1beta1: new (await import("../cosmos/gov/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + group: { + v1: new (await import("../cosmos/group/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + params: { + v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + tx: { + v1beta1: new (await import("../cosmos/tx/v1beta1/service.lcd")).LCDQueryClient({ + requestClient + }) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + } + }, + liftedinit: { + manifest: { + v1: new (await import("./manifest/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + } + } + }; +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/genesis.ts b/src/codegen/liftedinit/manifest/v1/genesis.ts new file mode 100644 index 0000000..a4d0245 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/genesis.ts @@ -0,0 +1,158 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, Exact } from "../../../helpers"; +/** GenesisState defines the module genesis state */ +export interface GenesisState { + /** Params defines all the paramaters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/liftedinit.manifest.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the module genesis state */ +export interface GenesisStateAmino { + /** Params defines all the paramaters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/liftedinit.manifest.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the module genesis state */ +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +/** Params defines the set of module parameters. */ +export interface Params {} +export interface ParamsProtoMsg { + typeUrl: "/liftedinit.manifest.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of module parameters. */ +export interface ParamsAmino {} +export interface ParamsAminoMsg { + type: "manifest/params"; + value: ParamsAmino; +} +/** Params defines the set of module parameters. */ +export interface ParamsSDKType {} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/liftedinit.manifest.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return {}; +} +export const Params = { + typeUrl: "/liftedinit.manifest.v1.Params", + aminoType: "manifest/params", + encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(_: I): Params { + const message = createBaseParams(); + return message; + }, + fromAmino(_: ParamsAmino): Params { + const message = createBaseParams(); + return message; + }, + toAmino(_: Params): ParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "manifest/params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/query.lcd.ts b/src/codegen/liftedinit/manifest/v1/query.lcd.ts new file mode 100644 index 0000000..52fb1b8 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/query.lcd.ts @@ -0,0 +1,17 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + } + /* Params queries all parameters of the module. */ + params = async (_params: QueryParamsRequest = {}): Promise => { + const endpoint = `manifest/v1/params`; + return await this.req.get(endpoint); + }; +} \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/query.rpc.Query.ts b/src/codegen/liftedinit/manifest/v1/query.rpc.Query.ts new file mode 100644 index 0000000..77691aa --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/query.rpc.Query.ts @@ -0,0 +1,30 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** Params queries all parameters of the module. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + /* Params queries all parameters of the module. */ + params = async (request: QueryParamsRequest = {}): Promise => { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("liftedinit.manifest.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + }; +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/query.ts b/src/codegen/liftedinit/manifest/v1/query.ts new file mode 100644 index 0000000..a066c16 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/query.ts @@ -0,0 +1,152 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, Exact } from "../../../helpers"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/liftedinit.manifest.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/liftedinit.manifest.v1.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 { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/liftedinit.manifest.v1.QueryParamsResponse"; + 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: "/liftedinit.manifest.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params?: ParamsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/liftedinit.manifest.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(_: I): 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); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/liftedinit.manifest.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : 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); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/tx.amino.ts b/src/codegen/liftedinit/manifest/v1/tx.amino.ts new file mode 100644 index 0000000..3d488a5 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgUpdateParams, MsgPayout, MsgBurnHeldBalance } from "./tx"; +export const AminoConverter = { + "/liftedinit.manifest.v1.MsgUpdateParams": { + aminoType: "/liftedinit.manifest.v1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/liftedinit.manifest.v1.MsgPayout": { + aminoType: "/liftedinit.manifest.v1.MsgPayout", + toAmino: MsgPayout.toAmino, + fromAmino: MsgPayout.fromAmino + }, + "/liftedinit.manifest.v1.MsgBurnHeldBalance": { + aminoType: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + toAmino: MsgBurnHeldBalance.toAmino, + fromAmino: MsgBurnHeldBalance.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/tx.registry.ts b/src/codegen/liftedinit/manifest/v1/tx.registry.ts new file mode 100644 index 0000000..ed2fdcc --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams, MsgPayout, MsgBurnHeldBalance } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/liftedinit.manifest.v1.MsgUpdateParams", MsgUpdateParams], ["/liftedinit.manifest.v1.MsgPayout", MsgPayout], ["/liftedinit.manifest.v1.MsgBurnHeldBalance", MsgBurnHeldBalance]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + payout(value: MsgPayout) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgPayout", + value: MsgPayout.encode(value).finish() + }; + }, + burnHeldBalance(value: MsgBurnHeldBalance) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + value: MsgBurnHeldBalance.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams", + value + }; + }, + payout(value: MsgPayout) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgPayout", + value + }; + }, + burnHeldBalance(value: MsgBurnHeldBalance) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + payout(value: MsgPayout) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgPayout", + value: MsgPayout.fromPartial(value) + }; + }, + burnHeldBalance(value: MsgBurnHeldBalance) { + return { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + value: MsgBurnHeldBalance.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/tx.rpc.msg.ts b/src/codegen/liftedinit/manifest/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..e356563 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/tx.rpc.msg.ts @@ -0,0 +1,42 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse, MsgPayout, MsgPayoutResponse, MsgBurnHeldBalance, MsgBurnHeldBalanceResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the parameters. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** Payout allows the authority to manually pay out stakeholders. */ + payout(request: MsgPayout): Promise; + /** BurnHeldBalance allows a tokenholder to burn coins they own. */ + burnHeldBalance(request: MsgBurnHeldBalance): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + /* UpdateParams defines a governance operation for updating the parameters. + + Since: cosmos-sdk 0.47 */ + updateParams = async (request: MsgUpdateParams): Promise => { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("liftedinit.manifest.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + }; + /* Payout allows the authority to manually pay out stakeholders. */ + payout = async (request: MsgPayout): Promise => { + const data = MsgPayout.encode(request).finish(); + const promise = this.rpc.request("liftedinit.manifest.v1.Msg", "Payout", data); + return promise.then(data => MsgPayoutResponse.decode(new BinaryReader(data))); + }; + /* BurnHeldBalance allows a tokenholder to burn coins they own. */ + burnHeldBalance = async (request: MsgBurnHeldBalance): Promise => { + const data = MsgBurnHeldBalance.encode(request).finish(); + const promise = this.rpc.request("liftedinit.manifest.v1.Msg", "BurnHeldBalance", data); + return promise.then(data => MsgBurnHeldBalanceResponse.decode(new BinaryReader(data))); + }; +} \ No newline at end of file diff --git a/src/codegen/liftedinit/manifest/v1/tx.ts b/src/codegen/liftedinit/manifest/v1/tx.ts new file mode 100644 index 0000000..3fce410 --- /dev/null +++ b/src/codegen/liftedinit/manifest/v1/tx.ts @@ -0,0 +1,639 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { DeepPartial, Exact } from "../../../helpers"; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address of the controlling account. */ + authority: string; + /** + * params defines the parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address of the controlling account. */ + authority?: string; + /** + * params defines the parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/liftedinit.manifest.v1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/liftedinit.manifest.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** MsgPayout is the Msg/Payout request type. */ +export interface MsgPayout { + /** authority is the address of the controlling account. */ + authority: string; + /** payout_pairs are the pairs of addresses and coins to be paid out. */ + payoutPairs: PayoutPair[]; +} +export interface MsgPayoutProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgPayout"; + value: Uint8Array; +} +/** MsgPayout is the Msg/Payout request type. */ +export interface MsgPayoutAmino { + /** authority is the address of the controlling account. */ + authority?: string; + /** payout_pairs are the pairs of addresses and coins to be paid out. */ + payout_pairs: PayoutPairAmino[]; +} +export interface MsgPayoutAminoMsg { + type: "/liftedinit.manifest.v1.MsgPayout"; + value: MsgPayoutAmino; +} +/** MsgPayout is the Msg/Payout request type. */ +export interface MsgPayoutSDKType { + authority: string; + payout_pairs: PayoutPairSDKType[]; +} +/** PayoutPair is the object that pairs an address with a coin to be paid out. */ +export interface PayoutPair { + address: string; + coin: Coin; +} +export interface PayoutPairProtoMsg { + typeUrl: "/liftedinit.manifest.v1.PayoutPair"; + value: Uint8Array; +} +/** PayoutPair is the object that pairs an address with a coin to be paid out. */ +export interface PayoutPairAmino { + address?: string; + coin: CoinAmino; +} +export interface PayoutPairAminoMsg { + type: "/liftedinit.manifest.v1.PayoutPair"; + value: PayoutPairAmino; +} +/** PayoutPair is the object that pairs an address with a coin to be paid out. */ +export interface PayoutPairSDKType { + address: string; + coin: CoinSDKType; +} +/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ +export interface MsgPayoutResponse {} +export interface MsgPayoutResponseProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgPayoutResponse"; + value: Uint8Array; +} +/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ +export interface MsgPayoutResponseAmino {} +export interface MsgPayoutResponseAminoMsg { + type: "/liftedinit.manifest.v1.MsgPayoutResponse"; + value: MsgPayoutResponseAmino; +} +/** MsgPayoutResponse defines the response structure for executing a MsgPayout message. */ +export interface MsgPayoutResponseSDKType {} +/** MsgPayout is the Msg/BurnHeldBalance request type. */ +export interface MsgBurnHeldBalance { + /** sender is the address of the tokenholder. */ + authority: string; + /** burn_coins are the coins to be burned by the tokenholder. */ + burnCoins: Coin[]; +} +export interface MsgBurnHeldBalanceProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance"; + value: Uint8Array; +} +/** MsgPayout is the Msg/BurnHeldBalance request type. */ +export interface MsgBurnHeldBalanceAmino { + /** sender is the address of the tokenholder. */ + authority?: string; + /** burn_coins are the coins to be burned by the tokenholder. */ + burn_coins: CoinAmino[]; +} +export interface MsgBurnHeldBalanceAminoMsg { + type: "/liftedinit.manifest.v1.MsgBurnHeldBalance"; + value: MsgBurnHeldBalanceAmino; +} +/** MsgPayout is the Msg/BurnHeldBalance request type. */ +export interface MsgBurnHeldBalanceSDKType { + authority: string; + burn_coins: CoinSDKType[]; +} +/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ +export interface MsgBurnHeldBalanceResponse {} +export interface MsgBurnHeldBalanceResponseProtoMsg { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalanceResponse"; + value: Uint8Array; +} +/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ +export interface MsgBurnHeldBalanceResponseAmino {} +export interface MsgBurnHeldBalanceResponseAminoMsg { + type: "/liftedinit.manifest.v1.MsgBurnHeldBalanceResponse"; + value: MsgBurnHeldBalanceResponseAmino; +} +/** MsgBurnHeldBalanceResponse defines the response structure for executing a MsgBurnHeldBalance message. */ +export interface MsgBurnHeldBalanceResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(_: I): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPayout(): MsgPayout { + return { + authority: "", + payoutPairs: [] + }; +} +export const MsgPayout = { + typeUrl: "/liftedinit.manifest.v1.MsgPayout", + encode(message: MsgPayout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.payoutPairs) { + PayoutPair.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPayout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.payoutPairs.push(PayoutPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): MsgPayout { + const message = createBaseMsgPayout(); + message.authority = object.authority ?? ""; + message.payoutPairs = object.payoutPairs?.map(e => PayoutPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgPayoutAmino): MsgPayout { + const message = createBaseMsgPayout(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.payoutPairs = object.payout_pairs?.map(e => PayoutPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgPayout): MsgPayoutAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.payoutPairs) { + obj.payout_pairs = message.payoutPairs.map(e => e ? PayoutPair.toAmino(e) : undefined); + } else { + obj.payout_pairs = message.payoutPairs; + } + return obj; + }, + fromAminoMsg(object: MsgPayoutAminoMsg): MsgPayout { + return MsgPayout.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPayoutProtoMsg): MsgPayout { + return MsgPayout.decode(message.value); + }, + toProto(message: MsgPayout): Uint8Array { + return MsgPayout.encode(message).finish(); + }, + toProtoMsg(message: MsgPayout): MsgPayoutProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgPayout", + value: MsgPayout.encode(message).finish() + }; + } +}; +function createBasePayoutPair(): PayoutPair { + return { + address: "", + coin: Coin.fromPartial({}) + }; +} +export const PayoutPair = { + typeUrl: "/liftedinit.manifest.v1.PayoutPair", + encode(message: PayoutPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PayoutPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePayoutPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): PayoutPair { + const message = createBasePayoutPair(); + message.address = object.address ?? ""; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + return message; + }, + fromAmino(object: PayoutPairAmino): PayoutPair { + const message = createBasePayoutPair(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino(message: PayoutPair): PayoutPairAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.coin = message.coin ? Coin.toAmino(message.coin) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: PayoutPairAminoMsg): PayoutPair { + return PayoutPair.fromAmino(object.value); + }, + fromProtoMsg(message: PayoutPairProtoMsg): PayoutPair { + return PayoutPair.decode(message.value); + }, + toProto(message: PayoutPair): Uint8Array { + return PayoutPair.encode(message).finish(); + }, + toProtoMsg(message: PayoutPair): PayoutPairProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.PayoutPair", + value: PayoutPair.encode(message).finish() + }; + } +}; +function createBaseMsgPayoutResponse(): MsgPayoutResponse { + return {}; +} +export const MsgPayoutResponse = { + typeUrl: "/liftedinit.manifest.v1.MsgPayoutResponse", + encode(_: MsgPayoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPayoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(_: I): MsgPayoutResponse { + const message = createBaseMsgPayoutResponse(); + return message; + }, + fromAmino(_: MsgPayoutResponseAmino): MsgPayoutResponse { + const message = createBaseMsgPayoutResponse(); + return message; + }, + toAmino(_: MsgPayoutResponse): MsgPayoutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPayoutResponseAminoMsg): MsgPayoutResponse { + return MsgPayoutResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPayoutResponseProtoMsg): MsgPayoutResponse { + return MsgPayoutResponse.decode(message.value); + }, + toProto(message: MsgPayoutResponse): Uint8Array { + return MsgPayoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPayoutResponse): MsgPayoutResponseProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgPayoutResponse", + value: MsgPayoutResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBurnHeldBalance(): MsgBurnHeldBalance { + return { + authority: "", + burnCoins: [] + }; +} +export const MsgBurnHeldBalance = { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + encode(message: MsgBurnHeldBalance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.burnCoins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnHeldBalance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnHeldBalance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.burnCoins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(object: I): MsgBurnHeldBalance { + const message = createBaseMsgBurnHeldBalance(); + message.authority = object.authority ?? ""; + message.burnCoins = object.burnCoins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgBurnHeldBalanceAmino): MsgBurnHeldBalance { + const message = createBaseMsgBurnHeldBalance(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.burnCoins = object.burn_coins?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgBurnHeldBalance): MsgBurnHeldBalanceAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.burnCoins) { + obj.burn_coins = message.burnCoins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.burn_coins = message.burnCoins; + } + return obj; + }, + fromAminoMsg(object: MsgBurnHeldBalanceAminoMsg): MsgBurnHeldBalance { + return MsgBurnHeldBalance.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnHeldBalanceProtoMsg): MsgBurnHeldBalance { + return MsgBurnHeldBalance.decode(message.value); + }, + toProto(message: MsgBurnHeldBalance): Uint8Array { + return MsgBurnHeldBalance.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnHeldBalance): MsgBurnHeldBalanceProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalance", + value: MsgBurnHeldBalance.encode(message).finish() + }; + } +}; +function createBaseMsgBurnHeldBalanceResponse(): MsgBurnHeldBalanceResponse { + return {}; +} +export const MsgBurnHeldBalanceResponse = { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalanceResponse", + encode(_: MsgBurnHeldBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnHeldBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnHeldBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial, I>>(_: I): MsgBurnHeldBalanceResponse { + const message = createBaseMsgBurnHeldBalanceResponse(); + return message; + }, + fromAmino(_: MsgBurnHeldBalanceResponseAmino): MsgBurnHeldBalanceResponse { + const message = createBaseMsgBurnHeldBalanceResponse(); + return message; + }, + toAmino(_: MsgBurnHeldBalanceResponse): MsgBurnHeldBalanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnHeldBalanceResponseAminoMsg): MsgBurnHeldBalanceResponse { + return MsgBurnHeldBalanceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnHeldBalanceResponseProtoMsg): MsgBurnHeldBalanceResponse { + return MsgBurnHeldBalanceResponse.decode(message.value); + }, + toProto(message: MsgBurnHeldBalanceResponse): Uint8Array { + return MsgBurnHeldBalanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnHeldBalanceResponse): MsgBurnHeldBalanceResponseProtoMsg { + return { + typeUrl: "/liftedinit.manifest.v1.MsgBurnHeldBalanceResponse", + value: MsgBurnHeldBalanceResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/rpc.query.ts b/src/codegen/liftedinit/rpc.query.ts new file mode 100644 index 0000000..4630de0 --- /dev/null +++ b/src/codegen/liftedinit/rpc.query.ts @@ -0,0 +1,72 @@ +import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await connectComet(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + node: { + v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + circuit: { + v1: (await import("../cosmos/circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + liftedinit: { + manifest: { + v1: (await import("./manifest/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/src/codegen/liftedinit/rpc.tx.ts b/src/codegen/liftedinit/rpc.tx.ts new file mode 100644 index 0000000..df16315 --- /dev/null +++ b/src/codegen/liftedinit/rpc.tx.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + vesting: { + v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + liftedinit: { + manifest: { + v1: new (await import("./manifest/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file From 118a731e9179d28724889842c76d89ba3662be64 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:37:13 -0400 Subject: [PATCH 08/13] test: manifest payout test --- starship/__tests__/manifest.test.ts | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 starship/__tests__/manifest.test.ts diff --git a/starship/__tests__/manifest.test.ts b/starship/__tests__/manifest.test.ts new file mode 100644 index 0000000..05b61d3 --- /dev/null +++ b/starship/__tests__/manifest.test.ts @@ -0,0 +1,89 @@ +import "./setup.test"; + +import {generateMnemonic, useChain} from "starshipjs"; +import {DirectSecp256k1HdWallet} from "@cosmjs/proto-signing"; +import {assertIsDeliverTxSuccess} from "@cosmjs/stargate"; +import {MsgPayout} from "../../src/codegen/liftedinit/manifest/v1/tx"; +import {getSigningLiftedinitClient} from "../../src"; + +// This is the POA_ADMIN_ADDRESS mnemonic as defined in the config.yaml file +const poaAdminMnemonic = 'razor dog gown public private couple ecology paper flee connect local robot diamond stay rude join sound win ribbon soup kidney glass robot vehicle' + +describe('manifest module', () => { + let wallet, denom, address; + let chainInfo, getCoin, getRpcEndpoint, creditFromFaucet; + + beforeAll(async () => { + ({ chainInfo, getCoin, getRpcEndpoint, creditFromFaucet } = useChain( + "manifest-ledger-beta" + )); + denom = (await getCoin()).base; + + // Initialize wallet + wallet = await DirectSecp256k1HdWallet.fromMnemonic(poaAdminMnemonic, { + prefix: chainInfo.chain.bech32_prefix, + }); + address = (await wallet.getAccounts())[0].address; + + await creditFromFaucet(address); + }) + + test('mint tokens', async () => { + const wallet2 = await DirectSecp256k1HdWallet.fromMnemonic( + generateMnemonic(), + { prefix: chainInfo.chain.bech32_prefix } + ); + const address2 = (await wallet2.getAccounts())[0].address; + + const signingClient = await getSigningLiftedinitClient({ + rpcEndpoint: await getRpcEndpoint(), + signer: wallet, + }); + + const fee = { + amount: [ + { + denom, + amount: "100000", + }, + ], + gas: "550000", + }; + + const initialAmount = 1; + const mintAmount = 1000000; + const resultBalance = initialAmount + mintAmount; + + // Send tokens to address2 so it exists in the ledger + await signingClient.sendTokens( + address, + address2, + [{amount: initialAmount.toString(), denom}], + fee, + "send 1 token to address2" + ); + + // Get the current balance + const balance = await signingClient.getBalance(address2, denom); + expect(balance.amount).toEqual(initialAmount.toString()); + expect(balance.denom).toEqual(denom); + + // Mint tokens + const payoutMsg = { + typeUrl: MsgPayout.typeUrl, + value: MsgPayout.fromPartial({ + authority: address, + payoutPairs: [ + {address: address2, coin: {denom, amount: mintAmount.toString()}}, + ], + }) + } + const resp = await signingClient.signAndBroadcast(address, [payoutMsg], fee); + + assertIsDeliverTxSuccess(resp); + + const balance2 = await signingClient.getBalance(address2, denom); + expect(balance2.amount).toBe(resultBalance.toString()); + expect(balance2.denom).toBe(denom); + }) +}); From 0886fbdf8976b4147d6bde7fbd897833b06fd25c Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:37:41 -0400 Subject: [PATCH 09/13] fix: export --- src/codegen/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/index.ts b/src/codegen/index.ts index 7219ec3..d7cd6e9 100644 --- a/src/codegen/index.ts +++ b/src/codegen/index.ts @@ -13,8 +13,8 @@ export * from "./gogoproto/bundle"; export * from "./google/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; -export * from "./manifest/bundle"; -export * from "./manifest/client"; +export * from "./liftedinit/bundle"; +export * from "./liftedinit/client"; export * from "./osmosis/bundle"; export * from "./osmosis/client"; export * from "./strangelove_ventures/bundle"; From 01ddcb808fda04fc30c9f19c8ef532f81a40bf09 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:38:39 -0400 Subject: [PATCH 10/13] chore: codegen --- src/codegen/confio/proofs.ts | 12 +- src/codegen/cosmos/auth/v1beta1/query.ts | 24 +- src/codegen/cosmos/authz/v1beta1/authz.ts | 12 +- src/codegen/cosmos/authz/v1beta1/tx.ts | 6 +- src/codegen/cosmos/bundle.ts | 746 ++++++++---------- src/codegen/cosmos/circuit/v1/types.ts | 2 +- src/codegen/cosmos/client.ts | 2 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 12 +- src/codegen/cosmos/feegrant/v1beta1/tx.ts | 6 +- src/codegen/cosmos/gov/v1/gov.ts | 4 +- src/codegen/cosmos/gov/v1/query.ts | 2 +- src/codegen/cosmos/gov/v1/tx.ts | 8 +- src/codegen/cosmos/gov/v1beta1/gov.ts | 12 +- src/codegen/cosmos/gov/v1beta1/query.ts | 2 +- src/codegen/cosmos/gov/v1beta1/tx.ts | 8 +- src/codegen/cosmos/group/v1/events.ts | 4 +- src/codegen/cosmos/group/v1/tx.ts | 32 +- src/codegen/cosmos/group/v1/types.ts | 12 +- src/codegen/cosmos/staking/v1beta1/authz.ts | 2 +- src/codegen/cosmos/staking/v1beta1/staking.ts | 6 +- src/codegen/cosmos/staking/v1beta1/tx.ts | 4 +- .../cosmos/tx/signing/v1beta1/signing.ts | 2 +- src/codegen/cosmos/tx/v1beta1/service.ts | 4 +- src/codegen/cosmos/tx/v1beta1/tx.ts | 4 +- src/codegen/cosmos_proto/cosmos.ts | 4 +- src/codegen/gogoproto/bundle.ts | 4 +- src/codegen/google/bundle.ts | 20 +- src/codegen/google/protobuf/descriptor.ts | 12 +- src/codegen/ibc/bundle.ts | 180 ++--- src/codegen/ibc/client.ts | 4 +- src/codegen/ibc/core/channel/v1/channel.ts | 8 +- .../ibc/core/connection/v1/connection.ts | 4 +- .../solomachine/v1/solomachine.ts | 4 +- .../solomachine/v2/solomachine.ts | 4 +- src/codegen/osmosis/bundle.ts | 52 +- src/codegen/osmosis/client.ts | 4 +- src/codegen/strangelove_ventures/bundle.ts | 58 +- src/codegen/strangelove_ventures/client.ts | 4 +- src/codegen/strangelove_ventures/poa/v1/tx.ts | 4 +- .../strangelove_ventures/poa/v1/validator.ts | 6 +- src/codegen/tendermint/abci/types.ts | 16 +- src/codegen/tendermint/bundle.ts | 44 +- src/codegen/tendermint/types/types.ts | 8 +- 43 files changed, 613 insertions(+), 755 deletions(-) diff --git a/src/codegen/confio/proofs.ts b/src/codegen/confio/proofs.ts index e1f90a3..1d2e547 100644 --- a/src/codegen/confio/proofs.ts +++ b/src/codegen/confio/proofs.ts @@ -1077,16 +1077,16 @@ export const LeafOp = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.hash = (reader.int32() as any); + message.hash = reader.int32() as any; break; case 2: - message.prehashKey = (reader.int32() as any); + message.prehashKey = reader.int32() as any; break; case 3: - message.prehashValue = (reader.int32() as any); + message.prehashValue = reader.int32() as any; break; case 4: - message.length = (reader.int32() as any); + message.length = reader.int32() as any; break; case 5: message.prefix = reader.bytes(); @@ -1180,7 +1180,7 @@ export const InnerOp = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.hash = (reader.int32() as any); + message.hash = reader.int32() as any; break; case 2: message.prefix = reader.bytes(); @@ -1402,7 +1402,7 @@ export const InnerSpec = { message.emptyChild = reader.bytes(); break; case 6: - message.hash = (reader.int32() as any); + message.hash = reader.int32() as any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/auth/v1beta1/query.ts b/src/codegen/cosmos/auth/v1beta1/query.ts index cdbb026..4c420eb 100644 --- a/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/src/codegen/cosmos/auth/v1beta1/query.ts @@ -696,7 +696,7 @@ export const QueryAccountsResponse = { aminoType: "cosmos-sdk/QueryAccountsResponse", encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -711,7 +711,7 @@ export const QueryAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((Any.decode(reader, reader.uint32()) as Any)); + message.accounts.push(Any.decode(reader, reader.uint32()) as Any); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -740,7 +740,7 @@ export const QueryAccountsResponse = { toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1AccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1AccountI_ToAmino(e as Any) : undefined); } else { obj.accounts = message.accounts; } @@ -849,7 +849,7 @@ export const QueryAccountResponse = { aminoType: "cosmos-sdk/QueryAccountResponse", encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { - Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.account as Any, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -861,7 +861,7 @@ export const QueryAccountResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = (Cosmos_authv1beta1AccountI_InterfaceDecoder(reader) as Any); + message.account = Cosmos_authv1beta1AccountI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -884,7 +884,7 @@ export const QueryAccountResponse = { }, toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { const obj: any = {}; - obj.account = message.account ? Cosmos_authv1beta1AccountI_ToAmino((message.account as Any)) : undefined; + obj.account = message.account ? Cosmos_authv1beta1AccountI_ToAmino(message.account as Any) : undefined; return obj; }, fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { @@ -1103,7 +1103,7 @@ export const QueryModuleAccountsResponse = { aminoType: "cosmos-sdk/QueryModuleAccountsResponse", encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(v! as Any, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -1115,7 +1115,7 @@ export const QueryModuleAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((Any.decode(reader, reader.uint32()) as Any)); + message.accounts.push(Any.decode(reader, reader.uint32()) as Any); break; default: reader.skipType(tag & 7); @@ -1137,7 +1137,7 @@ export const QueryModuleAccountsResponse = { toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1ModuleAccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1ModuleAccountI_ToAmino(e as Any) : undefined); } else { obj.accounts = message.accounts; } @@ -1245,7 +1245,7 @@ export const QueryModuleAccountByNameResponse = { aminoType: "cosmos-sdk/QueryModuleAccountByNameResponse", encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { - Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.account as Any, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -1257,7 +1257,7 @@ export const QueryModuleAccountByNameResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = (Cosmos_authv1beta1ModuleAccountI_InterfaceDecoder(reader) as Any); + message.account = Cosmos_authv1beta1ModuleAccountI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1280,7 +1280,7 @@ export const QueryModuleAccountByNameResponse = { }, toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { const obj: any = {}; - obj.account = message.account ? Cosmos_authv1beta1ModuleAccountI_ToAmino((message.account as Any)) : undefined; + obj.account = message.account ? Cosmos_authv1beta1ModuleAccountI_ToAmino(message.account as Any) : undefined; return obj; }, fromAminoMsg(object: QueryModuleAccountByNameResponseAminoMsg): QueryModuleAccountByNameResponse { diff --git a/src/codegen/cosmos/authz/v1beta1/authz.ts b/src/codegen/cosmos/authz/v1beta1/authz.ts index e068e9b..475092a 100644 --- a/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -228,7 +228,7 @@ export const Grant = { aminoType: "cosmos-sdk/Grant", encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authorization !== undefined) { - Any.encode((message.authorization as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.authorization as Any, writer.uint32(10).fork()).ldelim(); } if (message.expiration !== undefined) { Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); @@ -243,7 +243,7 @@ export const Grant = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authorization = (Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any); + message.authorization = Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any; break; case 2: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -273,7 +273,7 @@ export const Grant = { }, toAmino(message: Grant): GrantAmino { const obj: any = {}; - obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino((message.authorization as Any)) : undefined; + obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino(message.authorization as Any) : undefined; obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, @@ -318,7 +318,7 @@ export const GrantAuthorization = { writer.uint32(18).string(message.grantee); } if (message.authorization !== undefined) { - Any.encode((message.authorization as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(message.authorization as Any, writer.uint32(26).fork()).ldelim(); } if (message.expiration !== undefined) { Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); @@ -339,7 +339,7 @@ export const GrantAuthorization = { message.grantee = reader.string(); break; case 3: - message.authorization = (Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any); + message.authorization = Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any; break; case 4: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -379,7 +379,7 @@ export const GrantAuthorization = { const obj: any = {}; obj.granter = message.granter === "" ? undefined : message.granter; obj.grantee = message.grantee === "" ? undefined : message.grantee; - obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino((message.authorization as Any)) : undefined; + obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino(message.authorization as Any) : undefined; obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, diff --git a/src/codegen/cosmos/authz/v1beta1/tx.ts b/src/codegen/cosmos/authz/v1beta1/tx.ts index 3cb4086..9be3363 100644 --- a/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -338,7 +338,7 @@ export const MsgExec = { writer.uint32(10).string(message.grantee); } for (const v of message.msgs) { - Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(v! as Any, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -353,7 +353,7 @@ export const MsgExec = { message.grantee = reader.string(); break; case 2: - message.msgs.push((Any.decode(reader, reader.uint32()) as Any)); + message.msgs.push(Any.decode(reader, reader.uint32()) as Any); break; default: reader.skipType(tag & 7); @@ -380,7 +380,7 @@ export const MsgExec = { const obj: any = {}; obj.grantee = message.grantee === "" ? undefined : message.grantee; if (message.msgs) { - obj.msgs = message.msgs.map(e => e ? Cosmos_basev1beta1Msg_ToAmino((e as Any)) : undefined); + obj.msgs = message.msgs.map(e => e ? Cosmos_basev1beta1Msg_ToAmino(e as Any) : undefined); } else { obj.msgs = message.msgs; } diff --git a/src/codegen/cosmos/bundle.ts b/src/codegen/cosmos/bundle.ts index 1741718..fe72c3c 100644 --- a/src/codegen/cosmos/bundle.ts +++ b/src/codegen/cosmos/bundle.ts @@ -1,182 +1,162 @@ import * as _3 from "./app/runtime/v1alpha1/module"; -import * as _4 from "./auth/module/v1/module"; -import * as _5 from "./auth/v1beta1/auth"; -import * as _6 from "./auth/v1beta1/genesis"; -import * as _7 from "./auth/v1beta1/query"; -import * as _8 from "./auth/v1beta1/tx"; -import * as _9 from "./authz/module/v1/module"; -import * as _10 from "./authz/v1beta1/authz"; -import * as _11 from "./authz/v1beta1/event"; -import * as _12 from "./authz/v1beta1/genesis"; -import * as _13 from "./authz/v1beta1/query"; -import * as _14 from "./authz/v1beta1/tx"; -import * as _15 from "./bank/module/v1/module"; -import * as _16 from "./bank/v1beta1/authz"; -import * as _17 from "./bank/v1beta1/bank"; -import * as _18 from "./bank/v1beta1/genesis"; -import * as _19 from "./bank/v1beta1/query"; -import * as _20 from "./bank/v1beta1/tx"; -import * as _21 from "./base/abci/v1beta1/abci"; -import * as _22 from "./base/node/v1beta1/query"; -import * as _23 from "./base/query/v1beta1/pagination"; -import * as _24 from "./base/reflection/v2alpha1/reflection"; -import * as _25 from "./base/v1beta1/coin"; -import * as _26 from "./circuit/module/v1/module"; -import * as _27 from "./circuit/v1/query"; -import * as _28 from "./circuit/v1/tx"; -import * as _29 from "./circuit/v1/types"; -import * as _30 from "./consensus/module/v1/module"; -import * as _31 from "./consensus/v1/query"; -import * as _32 from "./consensus/v1/tx"; -import * as _33 from "./crisis/module/v1/module"; -import * as _34 from "./crypto/ed25519/keys"; -import * as _35 from "./crypto/hd/v1/hd"; -import * as _36 from "./crypto/keyring/v1/record"; -import * as _37 from "./crypto/multisig/keys"; -import * as _38 from "./crypto/secp256k1/keys"; -import * as _39 from "./crypto/secp256r1/keys"; -import * as _40 from "./distribution/module/v1/module"; -import * as _41 from "./distribution/v1beta1/distribution"; -import * as _42 from "./distribution/v1beta1/genesis"; -import * as _43 from "./distribution/v1beta1/query"; -import * as _44 from "./distribution/v1beta1/tx"; -import * as _45 from "./evidence/module/v1/module"; -import * as _46 from "./feegrant/module/v1/module"; -import * as _47 from "./feegrant/v1beta1/feegrant"; -import * as _48 from "./feegrant/v1beta1/genesis"; -import * as _49 from "./feegrant/v1beta1/query"; -import * as _50 from "./feegrant/v1beta1/tx"; -import * as _51 from "./genutil/module/v1/module"; -import * as _52 from "./gov/module/v1/module"; -import * as _53 from "./gov/v1/genesis"; -import * as _54 from "./gov/v1/gov"; -import * as _55 from "./gov/v1/query"; -import * as _56 from "./gov/v1/tx"; -import * as _57 from "./gov/v1beta1/genesis"; -import * as _58 from "./gov/v1beta1/gov"; -import * as _59 from "./gov/v1beta1/query"; -import * as _60 from "./gov/v1beta1/tx"; -import * as _61 from "./group/module/v1/module"; -import * as _62 from "./group/v1/events"; -import * as _63 from "./group/v1/genesis"; -import * as _64 from "./group/v1/query"; -import * as _65 from "./group/v1/tx"; -import * as _66 from "./group/v1/types"; -import * as _67 from "./mint/module/v1/module"; -import * as _68 from "./mint/v1beta1/genesis"; -import * as _69 from "./mint/v1beta1/mint"; -import * as _70 from "./mint/v1beta1/query"; -import * as _71 from "./mint/v1beta1/tx"; -import * as _72 from "./msg/textual/v1/textual"; -import * as _73 from "./nft/module/v1/module"; -import * as _74 from "./orm/module/v1alpha1/module"; -import * as _75 from "./orm/query/v1alpha1/query"; -import * as _76 from "./params/module/v1/module"; -import * as _77 from "./params/v1beta1/params"; -import * as _78 from "./params/v1beta1/query"; -import * as _79 from "./query/v1/query"; -import * as _80 from "./reflection/v1/reflection"; -import * as _81 from "./slashing/module/v1/module"; -import * as _82 from "./staking/module/v1/module"; -import * as _83 from "./staking/v1beta1/authz"; -import * as _84 from "./staking/v1beta1/genesis"; -import * as _85 from "./staking/v1beta1/query"; -import * as _86 from "./staking/v1beta1/staking"; -import * as _87 from "./staking/v1beta1/tx"; -import * as _88 from "./store/internal/kv/v1beta1/kv"; -import * as _89 from "./store/snapshots/v1/snapshot"; -import * as _90 from "./store/streaming/abci/grpc"; -import * as _91 from "./store/v1beta1/commit_info"; -import * as _92 from "./store/v1beta1/listening"; -import * as _93 from "./tx/config/v1/config"; -import * as _94 from "./tx/signing/v1beta1/signing"; -import * as _95 from "./tx/v1beta1/service"; -import * as _96 from "./tx/v1beta1/tx"; -import * as _97 from "./upgrade/module/v1/module"; -import * as _98 from "./upgrade/v1beta1/query"; -import * as _99 from "./upgrade/v1beta1/tx"; -import * as _100 from "./upgrade/v1beta1/upgrade"; -import * as _101 from "./vesting/module/v1/module"; -import * as _102 from "./vesting/v1beta1/tx"; -import * as _103 from "./vesting/v1beta1/vesting"; -import * as _158 from "./auth/v1beta1/tx.amino"; -import * as _159 from "./authz/v1beta1/tx.amino"; -import * as _160 from "./bank/v1beta1/tx.amino"; -import * as _161 from "./circuit/v1/tx.amino"; -import * as _162 from "./consensus/v1/tx.amino"; -import * as _163 from "./distribution/v1beta1/tx.amino"; -import * as _164 from "./feegrant/v1beta1/tx.amino"; -import * as _165 from "./gov/v1/tx.amino"; -import * as _166 from "./gov/v1beta1/tx.amino"; -import * as _167 from "./group/v1/tx.amino"; -import * as _168 from "./mint/v1beta1/tx.amino"; -import * as _169 from "./staking/v1beta1/tx.amino"; -import * as _170 from "./upgrade/v1beta1/tx.amino"; -import * as _171 from "./vesting/v1beta1/tx.amino"; -import * as _172 from "./auth/v1beta1/tx.registry"; -import * as _173 from "./authz/v1beta1/tx.registry"; -import * as _174 from "./bank/v1beta1/tx.registry"; -import * as _175 from "./circuit/v1/tx.registry"; -import * as _176 from "./consensus/v1/tx.registry"; -import * as _177 from "./distribution/v1beta1/tx.registry"; -import * as _178 from "./feegrant/v1beta1/tx.registry"; -import * as _179 from "./gov/v1/tx.registry"; -import * as _180 from "./gov/v1beta1/tx.registry"; -import * as _181 from "./group/v1/tx.registry"; -import * as _182 from "./mint/v1beta1/tx.registry"; -import * as _183 from "./staking/v1beta1/tx.registry"; -import * as _184 from "./upgrade/v1beta1/tx.registry"; -import * as _185 from "./vesting/v1beta1/tx.registry"; -import * as _186 from "./auth/v1beta1/query.lcd"; -import * as _187 from "./authz/v1beta1/query.lcd"; -import * as _188 from "./bank/v1beta1/query.lcd"; -import * as _189 from "./base/node/v1beta1/query.lcd"; -import * as _190 from "./circuit/v1/query.lcd"; -import * as _191 from "./consensus/v1/query.lcd"; -import * as _192 from "./distribution/v1beta1/query.lcd"; -import * as _193 from "./feegrant/v1beta1/query.lcd"; -import * as _194 from "./gov/v1/query.lcd"; -import * as _195 from "./gov/v1beta1/query.lcd"; -import * as _196 from "./group/v1/query.lcd"; -import * as _197 from "./mint/v1beta1/query.lcd"; -import * as _198 from "./params/v1beta1/query.lcd"; -import * as _199 from "./staking/v1beta1/query.lcd"; -import * as _200 from "./tx/v1beta1/service.lcd"; -import * as _201 from "./upgrade/v1beta1/query.lcd"; -import * as _202 from "./auth/v1beta1/query.rpc.Query"; -import * as _203 from "./authz/v1beta1/query.rpc.Query"; -import * as _204 from "./bank/v1beta1/query.rpc.Query"; -import * as _205 from "./base/node/v1beta1/query.rpc.Service"; -import * as _206 from "./circuit/v1/query.rpc.Query"; -import * as _207 from "./consensus/v1/query.rpc.Query"; -import * as _208 from "./distribution/v1beta1/query.rpc.Query"; -import * as _209 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _210 from "./gov/v1/query.rpc.Query"; -import * as _211 from "./gov/v1beta1/query.rpc.Query"; -import * as _212 from "./group/v1/query.rpc.Query"; -import * as _213 from "./mint/v1beta1/query.rpc.Query"; -import * as _214 from "./orm/query/v1alpha1/query.rpc.Query"; -import * as _215 from "./params/v1beta1/query.rpc.Query"; -import * as _216 from "./staking/v1beta1/query.rpc.Query"; -import * as _217 from "./tx/v1beta1/service.rpc.Service"; -import * as _218 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _219 from "./auth/v1beta1/tx.rpc.msg"; -import * as _220 from "./authz/v1beta1/tx.rpc.msg"; -import * as _221 from "./bank/v1beta1/tx.rpc.msg"; -import * as _222 from "./circuit/v1/tx.rpc.msg"; -import * as _223 from "./consensus/v1/tx.rpc.msg"; -import * as _224 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _225 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _226 from "./gov/v1/tx.rpc.msg"; -import * as _227 from "./gov/v1beta1/tx.rpc.msg"; -import * as _228 from "./group/v1/tx.rpc.msg"; -import * as _229 from "./mint/v1beta1/tx.rpc.msg"; -import * as _230 from "./staking/v1beta1/tx.rpc.msg"; -import * as _231 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _232 from "./vesting/v1beta1/tx.rpc.msg"; -import * as _268 from "./lcd"; -import * as _269 from "./rpc.query"; -import * as _270 from "./rpc.tx"; +import * as _4 from "./auth/v1beta1/auth"; +import * as _5 from "./auth/v1beta1/genesis"; +import * as _6 from "./auth/v1beta1/query"; +import * as _7 from "./auth/v1beta1/tx"; +import * as _8 from "./authz/v1beta1/authz"; +import * as _9 from "./authz/v1beta1/event"; +import * as _10 from "./authz/v1beta1/genesis"; +import * as _11 from "./authz/v1beta1/query"; +import * as _12 from "./authz/v1beta1/tx"; +import * as _13 from "./bank/v1beta1/authz"; +import * as _14 from "./bank/v1beta1/bank"; +import * as _15 from "./bank/v1beta1/genesis"; +import * as _16 from "./bank/v1beta1/query"; +import * as _17 from "./bank/v1beta1/tx"; +import * as _18 from "./base/abci/v1beta1/abci"; +import * as _19 from "./base/node/v1beta1/query"; +import * as _20 from "./base/query/v1beta1/pagination"; +import * as _21 from "./base/reflection/v2alpha1/reflection"; +import * as _22 from "./base/v1beta1/coin"; +import * as _23 from "./circuit/v1/query"; +import * as _24 from "./circuit/v1/tx"; +import * as _25 from "./circuit/v1/types"; +import * as _26 from "./consensus/v1/query"; +import * as _27 from "./consensus/v1/tx"; +import * as _28 from "./crypto/ed25519/keys"; +import * as _29 from "./crypto/hd/v1/hd"; +import * as _30 from "./crypto/keyring/v1/record"; +import * as _31 from "./crypto/multisig/keys"; +import * as _32 from "./crypto/secp256k1/keys"; +import * as _33 from "./crypto/secp256r1/keys"; +import * as _34 from "./distribution/v1beta1/distribution"; +import * as _35 from "./distribution/v1beta1/genesis"; +import * as _36 from "./distribution/v1beta1/query"; +import * as _37 from "./distribution/v1beta1/tx"; +import * as _38 from "./feegrant/v1beta1/feegrant"; +import * as _39 from "./feegrant/v1beta1/genesis"; +import * as _40 from "./feegrant/v1beta1/query"; +import * as _41 from "./feegrant/v1beta1/tx"; +import * as _42 from "./gov/v1/genesis"; +import * as _43 from "./gov/v1/gov"; +import * as _44 from "./gov/v1/query"; +import * as _45 from "./gov/v1/tx"; +import * as _46 from "./gov/v1beta1/genesis"; +import * as _47 from "./gov/v1beta1/gov"; +import * as _48 from "./gov/v1beta1/query"; +import * as _49 from "./gov/v1beta1/tx"; +import * as _50 from "./group/v1/events"; +import * as _51 from "./group/v1/genesis"; +import * as _52 from "./group/v1/query"; +import * as _53 from "./group/v1/tx"; +import * as _54 from "./group/v1/types"; +import * as _55 from "./mint/v1beta1/genesis"; +import * as _56 from "./mint/v1beta1/mint"; +import * as _57 from "./mint/v1beta1/query"; +import * as _58 from "./mint/v1beta1/tx"; +import * as _59 from "./msg/textual/v1/textual"; +import * as _60 from "./orm/query/v1alpha1/query"; +import * as _61 from "./params/v1beta1/params"; +import * as _62 from "./params/v1beta1/query"; +import * as _63 from "./query/v1/query"; +import * as _64 from "./reflection/v1/reflection"; +import * as _65 from "./staking/v1beta1/authz"; +import * as _66 from "./staking/v1beta1/genesis"; +import * as _67 from "./staking/v1beta1/query"; +import * as _68 from "./staking/v1beta1/staking"; +import * as _69 from "./staking/v1beta1/tx"; +import * as _70 from "./store/internal/kv/v1beta1/kv"; +import * as _71 from "./store/snapshots/v1/snapshot"; +import * as _72 from "./store/streaming/abci/grpc"; +import * as _73 from "./store/v1beta1/commit_info"; +import * as _74 from "./store/v1beta1/listening"; +import * as _75 from "./tx/config/v1/config"; +import * as _76 from "./tx/signing/v1beta1/signing"; +import * as _77 from "./tx/v1beta1/service"; +import * as _78 from "./tx/v1beta1/tx"; +import * as _79 from "./upgrade/v1beta1/query"; +import * as _80 from "./upgrade/v1beta1/tx"; +import * as _81 from "./upgrade/v1beta1/upgrade"; +import * as _82 from "./vesting/v1beta1/tx"; +import * as _83 from "./vesting/v1beta1/vesting"; +import * as _137 from "./auth/v1beta1/tx.amino"; +import * as _138 from "./authz/v1beta1/tx.amino"; +import * as _139 from "./bank/v1beta1/tx.amino"; +import * as _140 from "./circuit/v1/tx.amino"; +import * as _141 from "./consensus/v1/tx.amino"; +import * as _142 from "./distribution/v1beta1/tx.amino"; +import * as _143 from "./feegrant/v1beta1/tx.amino"; +import * as _144 from "./gov/v1/tx.amino"; +import * as _145 from "./gov/v1beta1/tx.amino"; +import * as _146 from "./group/v1/tx.amino"; +import * as _147 from "./mint/v1beta1/tx.amino"; +import * as _148 from "./staking/v1beta1/tx.amino"; +import * as _149 from "./upgrade/v1beta1/tx.amino"; +import * as _150 from "./vesting/v1beta1/tx.amino"; +import * as _151 from "./auth/v1beta1/tx.registry"; +import * as _152 from "./authz/v1beta1/tx.registry"; +import * as _153 from "./bank/v1beta1/tx.registry"; +import * as _154 from "./circuit/v1/tx.registry"; +import * as _155 from "./consensus/v1/tx.registry"; +import * as _156 from "./distribution/v1beta1/tx.registry"; +import * as _157 from "./feegrant/v1beta1/tx.registry"; +import * as _158 from "./gov/v1/tx.registry"; +import * as _159 from "./gov/v1beta1/tx.registry"; +import * as _160 from "./group/v1/tx.registry"; +import * as _161 from "./mint/v1beta1/tx.registry"; +import * as _162 from "./staking/v1beta1/tx.registry"; +import * as _163 from "./upgrade/v1beta1/tx.registry"; +import * as _164 from "./vesting/v1beta1/tx.registry"; +import * as _165 from "./auth/v1beta1/query.lcd"; +import * as _166 from "./authz/v1beta1/query.lcd"; +import * as _167 from "./bank/v1beta1/query.lcd"; +import * as _168 from "./base/node/v1beta1/query.lcd"; +import * as _169 from "./circuit/v1/query.lcd"; +import * as _170 from "./consensus/v1/query.lcd"; +import * as _171 from "./distribution/v1beta1/query.lcd"; +import * as _172 from "./feegrant/v1beta1/query.lcd"; +import * as _173 from "./gov/v1/query.lcd"; +import * as _174 from "./gov/v1beta1/query.lcd"; +import * as _175 from "./group/v1/query.lcd"; +import * as _176 from "./mint/v1beta1/query.lcd"; +import * as _177 from "./params/v1beta1/query.lcd"; +import * as _178 from "./staking/v1beta1/query.lcd"; +import * as _179 from "./tx/v1beta1/service.lcd"; +import * as _180 from "./upgrade/v1beta1/query.lcd"; +import * as _181 from "./auth/v1beta1/query.rpc.Query"; +import * as _182 from "./authz/v1beta1/query.rpc.Query"; +import * as _183 from "./bank/v1beta1/query.rpc.Query"; +import * as _184 from "./base/node/v1beta1/query.rpc.Service"; +import * as _185 from "./circuit/v1/query.rpc.Query"; +import * as _186 from "./consensus/v1/query.rpc.Query"; +import * as _187 from "./distribution/v1beta1/query.rpc.Query"; +import * as _188 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _189 from "./gov/v1/query.rpc.Query"; +import * as _190 from "./gov/v1beta1/query.rpc.Query"; +import * as _191 from "./group/v1/query.rpc.Query"; +import * as _192 from "./mint/v1beta1/query.rpc.Query"; +import * as _193 from "./orm/query/v1alpha1/query.rpc.Query"; +import * as _194 from "./params/v1beta1/query.rpc.Query"; +import * as _195 from "./staking/v1beta1/query.rpc.Query"; +import * as _196 from "./tx/v1beta1/service.rpc.Service"; +import * as _197 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _198 from "./auth/v1beta1/tx.rpc.msg"; +import * as _199 from "./authz/v1beta1/tx.rpc.msg"; +import * as _200 from "./bank/v1beta1/tx.rpc.msg"; +import * as _201 from "./circuit/v1/tx.rpc.msg"; +import * as _202 from "./consensus/v1/tx.rpc.msg"; +import * as _203 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _204 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _205 from "./gov/v1/tx.rpc.msg"; +import * as _206 from "./gov/v1beta1/tx.rpc.msg"; +import * as _207 from "./group/v1/tx.rpc.msg"; +import * as _208 from "./mint/v1beta1/tx.rpc.msg"; +import * as _209 from "./staking/v1beta1/tx.rpc.msg"; +import * as _210 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _211 from "./vesting/v1beta1/tx.rpc.msg"; +import * as _247 from "./lcd"; +import * as _248 from "./rpc.query"; +import * as _249 from "./rpc.tx"; export namespace cosmos { export namespace app { export namespace runtime { @@ -186,419 +166,309 @@ export namespace cosmos { } } export namespace auth { - export namespace module { - export const v1 = { - ..._4 - }; - } export const v1beta1 = { + ..._4, ..._5, ..._6, ..._7, - ..._8, - ..._158, - ..._172, - ..._186, - ..._202, - ..._219 + ..._137, + ..._151, + ..._165, + ..._181, + ..._198 }; } export namespace authz { - export namespace module { - export const v1 = { - ..._9 - }; - } export const v1beta1 = { + ..._8, + ..._9, ..._10, ..._11, ..._12, - ..._13, - ..._14, - ..._159, - ..._173, - ..._187, - ..._203, - ..._220 + ..._138, + ..._152, + ..._166, + ..._182, + ..._199 }; } export namespace bank { - export namespace module { - export const v1 = { - ..._15 - }; - } export const v1beta1 = { + ..._13, + ..._14, + ..._15, ..._16, ..._17, - ..._18, - ..._19, - ..._20, - ..._160, - ..._174, - ..._188, - ..._204, - ..._221 + ..._139, + ..._153, + ..._167, + ..._183, + ..._200 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._21 + ..._18 }; } export namespace node { export const v1beta1 = { - ..._22, - ..._189, - ..._205 + ..._19, + ..._168, + ..._184 }; } export namespace query { export const v1beta1 = { - ..._23 + ..._20 }; } export namespace reflection { export const v2alpha1 = { - ..._24 + ..._21 }; } export const v1beta1 = { - ..._25 + ..._22 }; } export namespace circuit { - export namespace module { - export const v1 = { - ..._26 - }; - } export const v1 = { - ..._27, - ..._28, - ..._29, - ..._161, - ..._175, - ..._190, - ..._206, - ..._222 + ..._23, + ..._24, + ..._25, + ..._140, + ..._154, + ..._169, + ..._185, + ..._201 }; } export namespace consensus { - export namespace module { - export const v1 = { - ..._30 - }; - } export const v1 = { - ..._31, - ..._32, - ..._162, - ..._176, - ..._191, - ..._207, - ..._223 + ..._26, + ..._27, + ..._141, + ..._155, + ..._170, + ..._186, + ..._202 }; } - export namespace crisis { - export namespace module { - export const v1 = { - ..._33 - }; - } - } export namespace crypto { export const ed25519 = { - ..._34 + ..._28 }; export namespace hd { export const v1 = { - ..._35 + ..._29 }; } export namespace keyring { export const v1 = { - ..._36 + ..._30 }; } export const multisig = { - ..._37 + ..._31 }; export const secp256k1 = { - ..._38 + ..._32 }; export const secp256r1 = { - ..._39 + ..._33 }; } export namespace distribution { - export namespace module { - export const v1 = { - ..._40 - }; - } export const v1beta1 = { - ..._41, - ..._42, - ..._43, - ..._44, - ..._163, - ..._177, - ..._192, - ..._208, - ..._224 + ..._34, + ..._35, + ..._36, + ..._37, + ..._142, + ..._156, + ..._171, + ..._187, + ..._203 }; } - export namespace evidence { - export namespace module { - export const v1 = { - ..._45 - }; - } - } export namespace feegrant { - export namespace module { - export const v1 = { - ..._46 - }; - } export const v1beta1 = { - ..._47, - ..._48, - ..._49, - ..._50, - ..._164, - ..._178, - ..._193, - ..._209, - ..._225 + ..._38, + ..._39, + ..._40, + ..._41, + ..._143, + ..._157, + ..._172, + ..._188, + ..._204 }; } - export namespace genutil { - export namespace module { - export const v1 = { - ..._51 - }; - } - } export namespace gov { - export namespace module { - export const v1 = { - ..._52 - }; - } export const v1 = { - ..._53, - ..._54, - ..._55, - ..._56, - ..._165, - ..._179, - ..._194, - ..._210, - ..._226 + ..._42, + ..._43, + ..._44, + ..._45, + ..._144, + ..._158, + ..._173, + ..._189, + ..._205 }; export const v1beta1 = { - ..._57, - ..._58, - ..._59, - ..._60, - ..._166, - ..._180, - ..._195, - ..._211, - ..._227 + ..._46, + ..._47, + ..._48, + ..._49, + ..._145, + ..._159, + ..._174, + ..._190, + ..._206 }; } export namespace group { - export namespace module { - export const v1 = { - ..._61 - }; - } export const v1 = { - ..._62, - ..._63, - ..._64, - ..._65, - ..._66, - ..._167, - ..._181, - ..._196, - ..._212, - ..._228 + ..._50, + ..._51, + ..._52, + ..._53, + ..._54, + ..._146, + ..._160, + ..._175, + ..._191, + ..._207 }; } export namespace mint { - export namespace module { - export const v1 = { - ..._67 - }; - } export const v1beta1 = { - ..._68, - ..._69, - ..._70, - ..._71, - ..._168, - ..._182, - ..._197, - ..._213, - ..._229 + ..._55, + ..._56, + ..._57, + ..._58, + ..._147, + ..._161, + ..._176, + ..._192, + ..._208 }; } export namespace msg { export namespace textual { export const v1 = { - ..._72 - }; - } - } - export namespace nft { - export namespace module { - export const v1 = { - ..._73 + ..._59 }; } } export namespace orm { - export namespace module { - export const v1alpha1 = { - ..._74 - }; - } export namespace query { export const v1alpha1 = { - ..._75, - ..._214 + ..._60, + ..._193 }; } } export namespace params { - export namespace module { - export const v1 = { - ..._76 - }; - } export const v1beta1 = { - ..._77, - ..._78, - ..._198, - ..._215 + ..._61, + ..._62, + ..._177, + ..._194 }; } export namespace query { export const v1 = { - ..._79 + ..._63 }; } export namespace reflection { export const v1 = { - ..._80 + ..._64 }; } - export namespace slashing { - export namespace module { - export const v1 = { - ..._81 - }; - } - } export namespace staking { - export namespace module { - export const v1 = { - ..._82 - }; - } export const v1beta1 = { - ..._83, - ..._84, - ..._85, - ..._86, - ..._87, - ..._169, - ..._183, - ..._199, - ..._216, - ..._230 + ..._65, + ..._66, + ..._67, + ..._68, + ..._69, + ..._148, + ..._162, + ..._178, + ..._195, + ..._209 }; } export namespace store { export namespace internal { export namespace kv { export const v1beta1 = { - ..._88 + ..._70 }; } } export namespace snapshots { export const v1 = { - ..._89 + ..._71 }; } export namespace streaming { export const abci = { - ..._90 + ..._72 }; } export const v1beta1 = { - ..._91, - ..._92 + ..._73, + ..._74 }; } export namespace tx { export namespace config { export const v1 = { - ..._93 + ..._75 }; } export namespace signing { export const v1beta1 = { - ..._94 + ..._76 }; } export const v1beta1 = { - ..._95, - ..._96, - ..._200, - ..._217 + ..._77, + ..._78, + ..._179, + ..._196 }; } export namespace upgrade { - export namespace module { - export const v1 = { - ..._97 - }; - } export const v1beta1 = { - ..._98, - ..._99, - ..._100, - ..._170, - ..._184, - ..._201, - ..._218, - ..._231 + ..._79, + ..._80, + ..._81, + ..._149, + ..._163, + ..._180, + ..._197, + ..._210 }; } export namespace vesting { - export namespace module { - export const v1 = { - ..._101 - }; - } export const v1beta1 = { - ..._102, - ..._103, - ..._171, - ..._185, - ..._232 + ..._82, + ..._83, + ..._150, + ..._164, + ..._211 }; } export const ClientFactory = { - ..._268, - ..._269, - ..._270 + ..._247, + ..._248, + ..._249 }; } \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/types.ts b/src/codegen/cosmos/circuit/v1/types.ts index 134ca6b..0a92919 100644 --- a/src/codegen/cosmos/circuit/v1/types.ts +++ b/src/codegen/cosmos/circuit/v1/types.ts @@ -179,7 +179,7 @@ export const Permissions = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.level = (reader.int32() as any); + message.level = reader.int32() as any; break; case 2: message.limitTypeUrls.push(reader.string()); diff --git a/src/codegen/cosmos/client.ts b/src/codegen/cosmos/client.ts index 5feea10..0b5af88 100644 --- a/src/codegen/cosmos/client.ts +++ b/src/codegen/cosmos/client.ts @@ -71,7 +71,7 @@ export const getSigningCosmosClient = async ({ aminoTypes } = getSigningCosmosClientOptions(); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry: (registry as any), + registry: registry as any, aminoTypes }); return client; diff --git a/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts index ded4815..cd1e946 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -410,7 +410,7 @@ export const AllowedMsgAllowance = { aminoType: "cosmos-sdk/AllowedMsgAllowance", encode(message: AllowedMsgAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowance !== undefined) { - Any.encode((message.allowance as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.allowance as Any, writer.uint32(10).fork()).ldelim(); } for (const v of message.allowedMessages) { writer.uint32(18).string(v!); @@ -425,7 +425,7 @@ export const AllowedMsgAllowance = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.allowance = (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any); + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any; break; case 2: message.allowedMessages.push(reader.string()); @@ -453,7 +453,7 @@ export const AllowedMsgAllowance = { }, toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino { const obj: any = {}; - obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino(message.allowance as Any) : undefined; if (message.allowedMessages) { obj.allowed_messages = message.allowedMessages.map(e => e); } else { @@ -501,7 +501,7 @@ export const Grant = { writer.uint32(18).string(message.grantee); } if (message.allowance !== undefined) { - Any.encode((message.allowance as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(message.allowance as Any, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -519,7 +519,7 @@ export const Grant = { message.grantee = reader.string(); break; case 3: - message.allowance = (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any); + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -552,7 +552,7 @@ export const Grant = { const obj: any = {}; obj.granter = message.granter === "" ? undefined : message.granter; obj.grantee = message.grantee === "" ? undefined : message.grantee; - obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino(message.allowance as Any) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { diff --git a/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/src/codegen/cosmos/feegrant/v1beta1/tx.ts index 8d6517e..575650d 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/tx.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -179,7 +179,7 @@ export const MsgGrantAllowance = { writer.uint32(18).string(message.grantee); } if (message.allowance !== undefined) { - Any.encode((message.allowance as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(message.allowance as Any, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -197,7 +197,7 @@ export const MsgGrantAllowance = { message.grantee = reader.string(); break; case 3: - message.allowance = (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any); + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -230,7 +230,7 @@ export const MsgGrantAllowance = { const obj: any = {}; obj.granter = message.granter === "" ? undefined : message.granter; obj.grantee = message.grantee === "" ? undefined : message.grantee; - obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino(message.allowance as Any) : undefined; return obj; }, fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { diff --git a/src/codegen/cosmos/gov/v1/gov.ts b/src/codegen/cosmos/gov/v1/gov.ts index 5182b5c..1e6b923 100644 --- a/src/codegen/cosmos/gov/v1/gov.ts +++ b/src/codegen/cosmos/gov/v1/gov.ts @@ -750,7 +750,7 @@ export const WeightedVoteOption = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 2: message.weight = reader.string(); @@ -986,7 +986,7 @@ export const Proposal = { message.messages.push(Any.decode(reader, reader.uint32())); break; case 3: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 4: message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); diff --git a/src/codegen/cosmos/gov/v1/query.ts b/src/codegen/cosmos/gov/v1/query.ts index ffee222..1fd60c8 100644 --- a/src/codegen/cosmos/gov/v1/query.ts +++ b/src/codegen/cosmos/gov/v1/query.ts @@ -804,7 +804,7 @@ export const QueryProposalsRequest = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalStatus = (reader.int32() as any); + message.proposalStatus = reader.int32() as any; break; case 2: message.voter = reader.string(); diff --git a/src/codegen/cosmos/gov/v1/tx.ts b/src/codegen/cosmos/gov/v1/tx.ts index b70fdd1..6fdcaf3 100644 --- a/src/codegen/cosmos/gov/v1/tx.ts +++ b/src/codegen/cosmos/gov/v1/tx.ts @@ -707,7 +707,7 @@ export const MsgExecLegacyContent = { aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim(); } if (message.authority !== "") { writer.uint32(18).string(message.authority); @@ -722,7 +722,7 @@ export const MsgExecLegacyContent = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; break; case 2: message.authority = reader.string(); @@ -752,7 +752,7 @@ export const MsgExecLegacyContent = { }, toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { const obj: any = {}; - obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any)) : undefined; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) : undefined; obj.authority = message.authority === "" ? undefined : message.authority; return obj; }, @@ -875,7 +875,7 @@ export const MsgVote = { message.voter = reader.string(); break; case 3: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 4: message.metadata = reader.string(); diff --git a/src/codegen/cosmos/gov/v1beta1/gov.ts b/src/codegen/cosmos/gov/v1beta1/gov.ts index 0941d93..93bf424 100644 --- a/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -562,7 +562,7 @@ export const WeightedVoteOption = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 2: message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); @@ -818,7 +818,7 @@ export const Proposal = { writer.uint32(8).uint64(message.proposalId); } if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(message.content as Any, writer.uint32(18).fork()).ldelim(); } if (message.status !== 0) { writer.uint32(24).int32(message.status); @@ -854,10 +854,10 @@ export const Proposal = { message.proposalId = reader.uint64(); break; case 2: - message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; break; case 3: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 4: message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); @@ -929,7 +929,7 @@ export const Proposal = { 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.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) : TallyResult.toAmino(TallyResult.fromPartial({})); obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); @@ -1111,7 +1111,7 @@ export const Vote = { message.voter = reader.string(); break; case 3: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 4: message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); diff --git a/src/codegen/cosmos/gov/v1beta1/query.ts b/src/codegen/cosmos/gov/v1beta1/query.ts index 5e69321..8ccb128 100644 --- a/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/src/codegen/cosmos/gov/v1beta1/query.ts @@ -601,7 +601,7 @@ export const QueryProposalsRequest = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalStatus = (reader.int32() as any); + message.proposalStatus = reader.int32() as any; break; case 2: message.voter = reader.string(); diff --git a/src/codegen/cosmos/gov/v1beta1/tx.ts b/src/codegen/cosmos/gov/v1beta1/tx.ts index 372c39e..11ce633 100644 --- a/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -248,7 +248,7 @@ export const MsgSubmitProposal = { aminoType: "cosmos-sdk/MsgSubmitProposal", encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim(); } for (const v of message.initialDeposit) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -266,7 +266,7 @@ export const MsgSubmitProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); + message.content = Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any; break; case 2: message.initialDeposit.push(Coin.decode(reader, reader.uint32())); @@ -301,7 +301,7 @@ export const MsgSubmitProposal = { }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; - obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any)) : undefined; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino(message.content as Any) : undefined; if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -438,7 +438,7 @@ export const MsgVote = { message.voter = reader.string(); break; case 3: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/group/v1/events.ts b/src/codegen/cosmos/group/v1/events.ts index 111c8d8..70da736 100644 --- a/src/codegen/cosmos/group/v1/events.ts +++ b/src/codegen/cosmos/group/v1/events.ts @@ -769,7 +769,7 @@ export const EventExec = { message.proposalId = reader.uint64(); break; case 2: - message.result = (reader.int32() as any); + message.result = reader.int32() as any; break; case 3: message.logs = reader.string(); @@ -945,7 +945,7 @@ export const EventProposalPruned = { message.proposalId = reader.uint64(); break; case 2: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 3: message.tallyResult = TallyResult.decode(reader, reader.uint32()); diff --git a/src/codegen/cosmos/group/v1/tx.ts b/src/codegen/cosmos/group/v1/tx.ts index c6daf66..6f4303f 100644 --- a/src/codegen/cosmos/group/v1/tx.ts +++ b/src/codegen/cosmos/group/v1/tx.ts @@ -1472,7 +1472,7 @@ export const MsgCreateGroupPolicy = { writer.uint32(26).string(message.metadata); } if (message.decisionPolicy !== undefined) { - Any.encode((message.decisionPolicy as Any), writer.uint32(34).fork()).ldelim(); + Any.encode(message.decisionPolicy as Any, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -1493,7 +1493,7 @@ export const MsgCreateGroupPolicy = { message.metadata = reader.string(); break; case 4: - message.decisionPolicy = (Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any); + message.decisionPolicy = Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1531,7 +1531,7 @@ export const MsgCreateGroupPolicy = { 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_groupv1DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupv1DecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; return obj; }, fromAminoMsg(object: MsgCreateGroupPolicyAminoMsg): MsgCreateGroupPolicy { @@ -1807,7 +1807,7 @@ export const MsgCreateGroupWithPolicy = { writer.uint32(40).bool(message.groupPolicyAsAdmin); } if (message.decisionPolicy !== undefined) { - Any.encode((message.decisionPolicy as Any), writer.uint32(50).fork()).ldelim(); + Any.encode(message.decisionPolicy as Any, writer.uint32(50).fork()).ldelim(); } return writer; }, @@ -1834,7 +1834,7 @@ export const MsgCreateGroupWithPolicy = { message.groupPolicyAsAdmin = reader.bool(); break; case 6: - message.decisionPolicy = (Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any); + message.decisionPolicy = Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -1884,7 +1884,7 @@ export const MsgCreateGroupWithPolicy = { 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_groupv1DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupv1DecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; return obj; }, fromAminoMsg(object: MsgCreateGroupWithPolicyAminoMsg): MsgCreateGroupWithPolicy { @@ -2009,7 +2009,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { writer.uint32(18).string(message.groupPolicyAddress); } if (message.decisionPolicy !== undefined) { - Any.encode((message.decisionPolicy as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(message.decisionPolicy as Any, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -2027,7 +2027,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { message.groupPolicyAddress = reader.string(); break; case 3: - message.decisionPolicy = (Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any); + message.decisionPolicy = Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); @@ -2060,7 +2060,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { const obj: any = {}; obj.admin = message.admin === "" ? undefined : message.admin; obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; - obj.decision_policy = message.decisionPolicy ? Cosmos_groupv1DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupv1DecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; return obj; }, fromAminoMsg(object: MsgUpdateGroupPolicyDecisionPolicyAminoMsg): MsgUpdateGroupPolicyDecisionPolicy { @@ -2318,7 +2318,7 @@ export const MsgSubmitProposal = { writer.uint32(26).string(message.metadata); } for (const v of message.messages) { - Any.encode((v! as Any), writer.uint32(34).fork()).ldelim(); + Any.encode(v! as Any, writer.uint32(34).fork()).ldelim(); } if (message.exec !== 0) { writer.uint32(40).int32(message.exec); @@ -2348,10 +2348,10 @@ export const MsgSubmitProposal = { message.metadata = reader.string(); break; case 4: - message.messages.push((Any.decode(reader, reader.uint32()) as Any)); + message.messages.push(Any.decode(reader, reader.uint32()) as Any); break; case 5: - message.exec = (reader.int32() as any); + message.exec = reader.int32() as any; break; case 6: message.title = reader.string(); @@ -2408,7 +2408,7 @@ export const MsgSubmitProposal = { } obj.metadata = message.metadata === "" ? undefined : message.metadata; if (message.messages) { - obj.messages = message.messages.map(e => e ? Cosmos_basev1beta1Msg_ToAmino((e as Any)) : undefined); + obj.messages = message.messages.map(e => e ? Cosmos_basev1beta1Msg_ToAmino(e as Any) : undefined); } else { obj.messages = message.messages; } @@ -2692,13 +2692,13 @@ export const MsgVote = { message.voter = reader.string(); break; case 3: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 4: message.metadata = reader.string(); break; case 5: - message.exec = (reader.int32() as any); + message.exec = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -2927,7 +2927,7 @@ export const MsgExecResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.result = (reader.int32() as any); + message.result = reader.int32() as any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/group/v1/types.ts b/src/codegen/cosmos/group/v1/types.ts index 814ddc1..bf5a7fe 100644 --- a/src/codegen/cosmos/group/v1/types.ts +++ b/src/codegen/cosmos/group/v1/types.ts @@ -1544,7 +1544,7 @@ export const GroupPolicyInfo = { writer.uint32(40).uint64(message.version); } if (message.decisionPolicy !== undefined) { - Any.encode((message.decisionPolicy as Any), writer.uint32(50).fork()).ldelim(); + Any.encode(message.decisionPolicy as Any, writer.uint32(50).fork()).ldelim(); } if (message.createdAt !== undefined) { Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).ldelim(); @@ -1574,7 +1574,7 @@ export const GroupPolicyInfo = { message.version = reader.uint64(); break; case 6: - message.decisionPolicy = (Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any); + message.decisionPolicy = Cosmos_groupv1DecisionPolicy_InterfaceDecoder(reader) as Any; break; case 7: message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -1629,7 +1629,7 @@ export const GroupPolicyInfo = { 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_groupv1DecisionPolicy_ToAmino((message.decisionPolicy as Any)) : undefined; + obj.decision_policy = message.decisionPolicy ? Cosmos_groupv1DecisionPolicy_ToAmino(message.decisionPolicy as Any) : undefined; obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : new Date(); return obj; }, @@ -1750,7 +1750,7 @@ export const Proposal = { message.groupPolicyVersion = reader.uint64(); break; case 8: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 9: message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); @@ -1759,7 +1759,7 @@ export const Proposal = { message.votingPeriodEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 11: - message.executorResult = (reader.int32() as any); + message.executorResult = reader.int32() as any; break; case 12: message.messages.push(Any.decode(reader, reader.uint32())); @@ -2035,7 +2035,7 @@ export const Vote = { message.voter = reader.string(); break; case 3: - message.option = (reader.int32() as any); + message.option = reader.int32() as any; break; case 4: message.metadata = reader.string(); diff --git a/src/codegen/cosmos/staking/v1beta1/authz.ts b/src/codegen/cosmos/staking/v1beta1/authz.ts index da526a0..de55bab 100644 --- a/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -188,7 +188,7 @@ export const StakeAuthorization = { message.denyList = StakeAuthorization_Validators.decode(reader, reader.uint32()); break; case 4: - message.authorizationType = (reader.int32() as any); + message.authorizationType = reader.int32() as any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/staking/v1beta1/staking.ts b/src/codegen/cosmos/staking/v1beta1/staking.ts index 36304a0..5536a73 100644 --- a/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -1342,7 +1342,7 @@ export const Validator = { writer.uint32(10).string(message.operatorAddress); } if (message.consensusPubkey !== undefined) { - Any.encode((message.consensusPubkey as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(message.consensusPubkey as Any, writer.uint32(18).fork()).ldelim(); } if (message.jailed === true) { writer.uint32(24).bool(message.jailed); @@ -1392,13 +1392,13 @@ export const Validator = { message.operatorAddress = reader.string(); break; case 2: - message.consensusPubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.consensusPubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; break; case 3: message.jailed = reader.bool(); break; case 4: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 5: message.tokens = reader.string(); diff --git a/src/codegen/cosmos/staking/v1beta1/tx.ts b/src/codegen/cosmos/staking/v1beta1/tx.ts index 7cf488b..0b00ba8 100644 --- a/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -483,7 +483,7 @@ export const MsgCreateValidator = { writer.uint32(42).string(message.validatorAddress); } if (message.pubkey !== undefined) { - Any.encode((message.pubkey as Any), writer.uint32(50).fork()).ldelim(); + Any.encode(message.pubkey as Any, writer.uint32(50).fork()).ldelim(); } if (message.value !== undefined) { Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); @@ -513,7 +513,7 @@ export const MsgCreateValidator = { message.validatorAddress = reader.string(); break; case 6: - message.pubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.pubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; break; case 7: message.value = Coin.decode(reader, reader.uint32()); diff --git a/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index e60b1b4..c3b78fc 100644 --- a/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -536,7 +536,7 @@ export const SignatureDescriptor_Data_Single = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mode = (reader.int32() as any); + message.mode = reader.int32() as any; break; case 2: message.signature = reader.bytes(); diff --git a/src/codegen/cosmos/tx/v1beta1/service.ts b/src/codegen/cosmos/tx/v1beta1/service.ts index 45eda13..bac4737 100644 --- a/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/src/codegen/cosmos/tx/v1beta1/service.ts @@ -900,7 +900,7 @@ export const GetTxsEventRequest = { message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 3: - message.orderBy = (reader.int32() as any); + message.orderBy = reader.int32() as any; break; case 4: message.page = reader.uint64(); @@ -1123,7 +1123,7 @@ export const BroadcastTxRequest = { message.txBytes = reader.bytes(); break; case 2: - message.mode = (reader.int32() as any); + message.mode = reader.int32() as any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/tx/v1beta1/tx.ts b/src/codegen/cosmos/tx/v1beta1/tx.ts index c6dd052..97f78e3 100644 --- a/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -1612,7 +1612,7 @@ export const ModeInfo_Single = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mode = (reader.int32() as any); + message.mode = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -1976,7 +1976,7 @@ export const AuxSignerData = { message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); break; case 3: - message.mode = (reader.int32() as any); + message.mode = reader.int32() as any; break; case 4: message.sig = reader.bytes(); diff --git a/src/codegen/cosmos_proto/cosmos.ts b/src/codegen/cosmos_proto/cosmos.ts index c14727c..f2972eb 100644 --- a/src/codegen/cosmos_proto/cosmos.ts +++ b/src/codegen/cosmos_proto/cosmos.ts @@ -289,10 +289,10 @@ export const ScalarDescriptor = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.fieldType.push((reader.int32() as any)); + message.fieldType.push(reader.int32() as any); } } else { - message.fieldType.push((reader.int32() as any)); + message.fieldType.push(reader.int32() as any); } break; default: diff --git a/src/codegen/gogoproto/bundle.ts b/src/codegen/gogoproto/bundle.ts index 6aa5126..a0a941d 100644 --- a/src/codegen/gogoproto/bundle.ts +++ b/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _104 from "./gogo"; +import * as _84 from "./gogo"; export const gogoproto = { - ..._104 + ..._84 }; \ No newline at end of file diff --git a/src/codegen/google/bundle.ts b/src/codegen/google/bundle.ts index a41e035..a26c72d 100644 --- a/src/codegen/google/bundle.ts +++ b/src/codegen/google/bundle.ts @@ -1,14 +1,14 @@ -import * as _105 from "./protobuf/any"; -import * as _106 from "./protobuf/descriptor"; -import * as _107 from "./protobuf/duration"; -import * as _108 from "./protobuf/empty"; -import * as _109 from "./protobuf/timestamp"; +import * as _85 from "./protobuf/any"; +import * as _86 from "./protobuf/descriptor"; +import * as _87 from "./protobuf/duration"; +import * as _88 from "./protobuf/empty"; +import * as _89 from "./protobuf/timestamp"; export namespace google { export const protobuf = { - ..._105, - ..._106, - ..._107, - ..._108, - ..._109 + ..._85, + ..._86, + ..._87, + ..._88, + ..._89 }; } \ No newline at end of file diff --git a/src/codegen/google/protobuf/descriptor.ts b/src/codegen/google/protobuf/descriptor.ts index 3e7b41e..6388d15 100644 --- a/src/codegen/google/protobuf/descriptor.ts +++ b/src/codegen/google/protobuf/descriptor.ts @@ -2965,10 +2965,10 @@ export const FieldDescriptorProto = { message.number = reader.int32(); break; case 4: - message.label = (reader.int32() as any); + message.label = reader.int32() as any; break; case 5: - message.type = (reader.int32() as any); + message.type = reader.int32() as any; break; case 6: message.typeName = reader.string(); @@ -3755,7 +3755,7 @@ export const FileOptions = { message.javaStringCheckUtf8 = reader.bool(); break; case 9: - message.optimizeFor = (reader.int32() as any); + message.optimizeFor = reader.int32() as any; break; case 11: message.goPackage = reader.string(); @@ -4102,13 +4102,13 @@ export const FieldOptions = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ctype = (reader.int32() as any); + message.ctype = reader.int32() as any; break; case 2: message.packed = reader.bool(); break; case 6: - message.jstype = (reader.int32() as any); + message.jstype = reader.int32() as any; break; case 5: message.lazy = reader.bool(); @@ -4534,7 +4534,7 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotencyLevel = (reader.int32() as any); + message.idempotencyLevel = reader.int32() as any; break; case 999: message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); diff --git a/src/codegen/ibc/bundle.ts b/src/codegen/ibc/bundle.ts index 6a18170..0313671 100644 --- a/src/codegen/ibc/bundle.ts +++ b/src/codegen/ibc/bundle.ts @@ -1,136 +1,136 @@ -import * as _110 from "./applications/transfer/v1/genesis"; -import * as _111 from "./applications/transfer/v1/query"; -import * as _112 from "./applications/transfer/v1/transfer"; -import * as _113 from "./applications/transfer/v1/tx"; -import * as _114 from "./applications/transfer/v2/packet"; -import * as _115 from "./core/channel/v1/channel"; -import * as _116 from "./core/channel/v1/genesis"; -import * as _117 from "./core/channel/v1/query"; -import * as _118 from "./core/channel/v1/tx"; -import * as _119 from "./core/client/v1/client"; -import * as _120 from "./core/client/v1/genesis"; -import * as _121 from "./core/client/v1/query"; -import * as _122 from "./core/client/v1/tx"; -import * as _123 from "./core/commitment/v1/commitment"; -import * as _124 from "./core/connection/v1/connection"; -import * as _125 from "./core/connection/v1/genesis"; -import * as _126 from "./core/connection/v1/query"; -import * as _127 from "./core/connection/v1/tx"; -import * as _128 from "./lightclients/localhost/v1/localhost"; -import * as _129 from "./lightclients/solomachine/v1/solomachine"; -import * as _130 from "./lightclients/solomachine/v2/solomachine"; -import * as _131 from "./lightclients/tendermint/v1/tendermint"; -import * as _233 from "./applications/transfer/v1/tx.amino"; -import * as _234 from "./core/channel/v1/tx.amino"; -import * as _235 from "./core/client/v1/tx.amino"; -import * as _236 from "./core/connection/v1/tx.amino"; -import * as _237 from "./applications/transfer/v1/tx.registry"; -import * as _238 from "./core/channel/v1/tx.registry"; -import * as _239 from "./core/client/v1/tx.registry"; -import * as _240 from "./core/connection/v1/tx.registry"; -import * as _241 from "./applications/transfer/v1/query.lcd"; -import * as _242 from "./core/channel/v1/query.lcd"; -import * as _243 from "./core/client/v1/query.lcd"; -import * as _244 from "./core/connection/v1/query.lcd"; -import * as _245 from "./applications/transfer/v1/query.rpc.Query"; -import * as _246 from "./core/channel/v1/query.rpc.Query"; -import * as _247 from "./core/client/v1/query.rpc.Query"; -import * as _248 from "./core/connection/v1/query.rpc.Query"; -import * as _249 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _250 from "./core/channel/v1/tx.rpc.msg"; -import * as _251 from "./core/client/v1/tx.rpc.msg"; -import * as _252 from "./core/connection/v1/tx.rpc.msg"; -import * as _271 from "./lcd"; -import * as _272 from "./rpc.query"; -import * as _273 from "./rpc.tx"; +import * as _90 from "./applications/transfer/v1/genesis"; +import * as _91 from "./applications/transfer/v1/query"; +import * as _92 from "./applications/transfer/v1/transfer"; +import * as _93 from "./applications/transfer/v1/tx"; +import * as _94 from "./applications/transfer/v2/packet"; +import * as _95 from "./core/channel/v1/channel"; +import * as _96 from "./core/channel/v1/genesis"; +import * as _97 from "./core/channel/v1/query"; +import * as _98 from "./core/channel/v1/tx"; +import * as _99 from "./core/client/v1/client"; +import * as _100 from "./core/client/v1/genesis"; +import * as _101 from "./core/client/v1/query"; +import * as _102 from "./core/client/v1/tx"; +import * as _103 from "./core/commitment/v1/commitment"; +import * as _104 from "./core/connection/v1/connection"; +import * as _105 from "./core/connection/v1/genesis"; +import * as _106 from "./core/connection/v1/query"; +import * as _107 from "./core/connection/v1/tx"; +import * as _108 from "./lightclients/localhost/v1/localhost"; +import * as _109 from "./lightclients/solomachine/v1/solomachine"; +import * as _110 from "./lightclients/solomachine/v2/solomachine"; +import * as _111 from "./lightclients/tendermint/v1/tendermint"; +import * as _212 from "./applications/transfer/v1/tx.amino"; +import * as _213 from "./core/channel/v1/tx.amino"; +import * as _214 from "./core/client/v1/tx.amino"; +import * as _215 from "./core/connection/v1/tx.amino"; +import * as _216 from "./applications/transfer/v1/tx.registry"; +import * as _217 from "./core/channel/v1/tx.registry"; +import * as _218 from "./core/client/v1/tx.registry"; +import * as _219 from "./core/connection/v1/tx.registry"; +import * as _220 from "./applications/transfer/v1/query.lcd"; +import * as _221 from "./core/channel/v1/query.lcd"; +import * as _222 from "./core/client/v1/query.lcd"; +import * as _223 from "./core/connection/v1/query.lcd"; +import * as _224 from "./applications/transfer/v1/query.rpc.Query"; +import * as _225 from "./core/channel/v1/query.rpc.Query"; +import * as _226 from "./core/client/v1/query.rpc.Query"; +import * as _227 from "./core/connection/v1/query.rpc.Query"; +import * as _228 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _229 from "./core/channel/v1/tx.rpc.msg"; +import * as _230 from "./core/client/v1/tx.rpc.msg"; +import * as _231 from "./core/connection/v1/tx.rpc.msg"; +import * as _250 from "./lcd"; +import * as _251 from "./rpc.query"; +import * as _252 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace transfer { export const v1 = { - ..._110, - ..._111, - ..._112, - ..._113, - ..._233, - ..._237, - ..._241, - ..._245, - ..._249 + ..._90, + ..._91, + ..._92, + ..._93, + ..._212, + ..._216, + ..._220, + ..._224, + ..._228 }; export const v2 = { - ..._114 + ..._94 }; } } export namespace core { export namespace channel { export const v1 = { - ..._115, - ..._116, - ..._117, - ..._118, - ..._234, - ..._238, - ..._242, - ..._246, - ..._250 + ..._95, + ..._96, + ..._97, + ..._98, + ..._213, + ..._217, + ..._221, + ..._225, + ..._229 }; } export namespace client { export const v1 = { - ..._119, - ..._120, - ..._121, - ..._122, - ..._235, - ..._239, - ..._243, - ..._247, - ..._251 + ..._99, + ..._100, + ..._101, + ..._102, + ..._214, + ..._218, + ..._222, + ..._226, + ..._230 }; } export namespace commitment { export const v1 = { - ..._123 + ..._103 }; } export namespace connection { export const v1 = { - ..._124, - ..._125, - ..._126, - ..._127, - ..._236, - ..._240, - ..._244, - ..._248, - ..._252 + ..._104, + ..._105, + ..._106, + ..._107, + ..._215, + ..._219, + ..._223, + ..._227, + ..._231 }; } } export namespace lightclients { export namespace localhost { export const v1 = { - ..._128 + ..._108 }; } export namespace solomachine { export const v1 = { - ..._129 + ..._109 }; export const v2 = { - ..._130 + ..._110 }; } export namespace tendermint { export const v1 = { - ..._131 + ..._111 }; } } export const ClientFactory = { - ..._271, - ..._272, - ..._273 + ..._250, + ..._251, + ..._252 }; } \ No newline at end of file diff --git a/src/codegen/ibc/client.ts b/src/codegen/ibc/client.ts index 1256ef0..adfdcc1 100644 --- a/src/codegen/ibc/client.ts +++ b/src/codegen/ibc/client.ts @@ -18,8 +18,6 @@ export const ibcAminoConverters = { export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes -}: { - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; } = {}): { registry: Registry; aminoTypes: AminoTypes; @@ -49,7 +47,7 @@ export const getSigningIbcClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry: (registry as any), + registry: registry as any, aminoTypes }); return client; diff --git a/src/codegen/ibc/core/channel/v1/channel.ts b/src/codegen/ibc/core/channel/v1/channel.ts index 87d7d33..76e3d94 100644 --- a/src/codegen/ibc/core/channel/v1/channel.ts +++ b/src/codegen/ibc/core/channel/v1/channel.ts @@ -467,10 +467,10 @@ export const Channel = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = (reader.int32() as any); + message.state = reader.int32() as any; break; case 2: - message.ordering = (reader.int32() as any); + message.ordering = reader.int32() as any; break; case 3: message.counterparty = Counterparty.decode(reader, reader.uint32()); @@ -595,10 +595,10 @@ export const IdentifiedChannel = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = (reader.int32() as any); + message.state = reader.int32() as any; break; case 2: - message.ordering = (reader.int32() as any); + message.ordering = reader.int32() as any; break; case 3: message.counterparty = Counterparty.decode(reader, reader.uint32()); diff --git a/src/codegen/ibc/core/connection/v1/connection.ts b/src/codegen/ibc/core/connection/v1/connection.ts index ebbf5dc..6c5c963 100644 --- a/src/codegen/ibc/core/connection/v1/connection.ts +++ b/src/codegen/ibc/core/connection/v1/connection.ts @@ -392,7 +392,7 @@ export const ConnectionEnd = { message.versions.push(Version.decode(reader, reader.uint32())); break; case 3: - message.state = (reader.int32() as any); + message.state = reader.int32() as any; break; case 4: message.counterparty = Counterparty.decode(reader, reader.uint32()); @@ -519,7 +519,7 @@ export const IdentifiedConnection = { message.versions.push(Version.decode(reader, reader.uint32())); break; case 4: - message.state = (reader.int32() as any); + message.state = reader.int32() as any; break; case 5: message.counterparty = Counterparty.decode(reader, reader.uint32()); diff --git a/src/codegen/ibc/lightclients/solomachine/v1/solomachine.ts b/src/codegen/ibc/lightclients/solomachine/v1/solomachine.ts index 87ed524..bc9cf0b 100644 --- a/src/codegen/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/src/codegen/ibc/lightclients/solomachine/v1/solomachine.ts @@ -1107,7 +1107,7 @@ export const SignatureAndData = { message.signature = reader.bytes(); break; case 2: - message.dataType = (reader.int32() as any); + message.dataType = reader.int32() as any; break; case 3: message.data = reader.bytes(); @@ -1305,7 +1305,7 @@ export const SignBytes = { message.diversifier = reader.string(); break; case 4: - message.dataType = (reader.int32() as any); + message.dataType = reader.int32() as any; break; case 5: message.data = reader.bytes(); diff --git a/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts b/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts index 610352c..0d4b5fb 100644 --- a/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts @@ -1107,7 +1107,7 @@ export const SignatureAndData = { message.signature = reader.bytes(); break; case 2: - message.dataType = (reader.int32() as any); + message.dataType = reader.int32() as any; break; case 3: message.data = reader.bytes(); @@ -1305,7 +1305,7 @@ export const SignBytes = { message.diversifier = reader.string(); break; case 4: - message.dataType = (reader.int32() as any); + message.dataType = reader.int32() as any; break; case 5: message.data = reader.bytes(); diff --git a/src/codegen/osmosis/bundle.ts b/src/codegen/osmosis/bundle.ts index d012379..742c714 100644 --- a/src/codegen/osmosis/bundle.ts +++ b/src/codegen/osmosis/bundle.ts @@ -1,34 +1,34 @@ -import * as _136 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _137 from "./tokenfactory/v1beta1/genesis"; -import * as _138 from "./tokenfactory/v1beta1/params"; -import * as _139 from "./tokenfactory/v1beta1/query"; -import * as _140 from "./tokenfactory/v1beta1/tx"; -import * as _258 from "./tokenfactory/v1beta1/tx.amino"; -import * as _259 from "./tokenfactory/v1beta1/tx.registry"; -import * as _260 from "./tokenfactory/v1beta1/query.lcd"; -import * as _261 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _262 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _277 from "./lcd"; -import * as _278 from "./rpc.query"; -import * as _279 from "./rpc.tx"; +import * as _116 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _117 from "./tokenfactory/v1beta1/genesis"; +import * as _118 from "./tokenfactory/v1beta1/params"; +import * as _119 from "./tokenfactory/v1beta1/query"; +import * as _120 from "./tokenfactory/v1beta1/tx"; +import * as _237 from "./tokenfactory/v1beta1/tx.amino"; +import * as _238 from "./tokenfactory/v1beta1/tx.registry"; +import * as _239 from "./tokenfactory/v1beta1/query.lcd"; +import * as _240 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _241 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _256 from "./lcd"; +import * as _257 from "./rpc.query"; +import * as _258 from "./rpc.tx"; export namespace osmosis { export namespace tokenfactory { export const v1beta1 = { - ..._136, - ..._137, - ..._138, - ..._139, - ..._140, - ..._258, - ..._259, - ..._260, - ..._261, - ..._262 + ..._116, + ..._117, + ..._118, + ..._119, + ..._120, + ..._237, + ..._238, + ..._239, + ..._240, + ..._241 }; } export const ClientFactory = { - ..._277, - ..._278, - ..._279 + ..._256, + ..._257, + ..._258 }; } \ No newline at end of file diff --git a/src/codegen/osmosis/client.ts b/src/codegen/osmosis/client.ts index da4bf43..9d55be2 100644 --- a/src/codegen/osmosis/client.ts +++ b/src/codegen/osmosis/client.ts @@ -9,8 +9,6 @@ export const osmosisAminoConverters = { export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisTokenfactoryV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes -}: { - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; } = {}): { registry: Registry; aminoTypes: AminoTypes; @@ -40,7 +38,7 @@ export const getSigningOsmosisClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry: (registry as any), + registry: registry as any, aminoTypes }); return client; diff --git a/src/codegen/strangelove_ventures/bundle.ts b/src/codegen/strangelove_ventures/bundle.ts index 1ebd94a..58196f0 100644 --- a/src/codegen/strangelove_ventures/bundle.ts +++ b/src/codegen/strangelove_ventures/bundle.ts @@ -1,40 +1,34 @@ -import * as _141 from "./poa/module/v1/module"; -import * as _142 from "./poa/v1/genesis"; -import * as _143 from "./poa/v1/params"; -import * as _144 from "./poa/v1/query"; -import * as _145 from "./poa/v1/tx"; -import * as _146 from "./poa/v1/validator"; -import * as _263 from "./poa/v1/tx.amino"; -import * as _264 from "./poa/v1/tx.registry"; -import * as _265 from "./poa/v1/query.lcd"; -import * as _266 from "./poa/v1/query.rpc.Query"; -import * as _267 from "./poa/v1/tx.rpc.msg"; -import * as _280 from "./lcd"; -import * as _281 from "./rpc.query"; -import * as _282 from "./rpc.tx"; +import * as _121 from "./poa/v1/genesis"; +import * as _122 from "./poa/v1/params"; +import * as _123 from "./poa/v1/query"; +import * as _124 from "./poa/v1/tx"; +import * as _125 from "./poa/v1/validator"; +import * as _242 from "./poa/v1/tx.amino"; +import * as _243 from "./poa/v1/tx.registry"; +import * as _244 from "./poa/v1/query.lcd"; +import * as _245 from "./poa/v1/query.rpc.Query"; +import * as _246 from "./poa/v1/tx.rpc.msg"; +import * as _259 from "./lcd"; +import * as _260 from "./rpc.query"; +import * as _261 from "./rpc.tx"; export namespace strangelove_ventures { export namespace poa { - export namespace module { - export const v1 = { - ..._141 - }; - } export const v1 = { - ..._142, - ..._143, - ..._144, - ..._145, - ..._146, - ..._263, - ..._264, - ..._265, - ..._266, - ..._267 + ..._121, + ..._122, + ..._123, + ..._124, + ..._125, + ..._242, + ..._243, + ..._244, + ..._245, + ..._246 }; } export const ClientFactory = { - ..._280, - ..._281, - ..._282 + ..._259, + ..._260, + ..._261 }; } \ No newline at end of file diff --git a/src/codegen/strangelove_ventures/client.ts b/src/codegen/strangelove_ventures/client.ts index b976295..fed37fc 100644 --- a/src/codegen/strangelove_ventures/client.ts +++ b/src/codegen/strangelove_ventures/client.ts @@ -9,8 +9,6 @@ export const strangeloveVenturesAminoConverters = { export const strangeloveVenturesProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...strangeloveVenturesPoaV1TxRegistry.registry]; export const getSigningStrangeloveVenturesClientOptions = ({ defaultTypes = defaultRegistryTypes -}: { - defaultTypes?: ReadonlyArray<[string, GeneratedType]>; } = {}): { registry: Registry; aminoTypes: AminoTypes; @@ -40,7 +38,7 @@ export const getSigningStrangeloveVenturesClient = async ({ defaultTypes }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { - registry: (registry as any), + registry: registry as any, aminoTypes }); return client; diff --git a/src/codegen/strangelove_ventures/poa/v1/tx.ts b/src/codegen/strangelove_ventures/poa/v1/tx.ts index d431a0a..bcaf62b 100644 --- a/src/codegen/strangelove_ventures/poa/v1/tx.ts +++ b/src/codegen/strangelove_ventures/poa/v1/tx.ts @@ -834,7 +834,7 @@ export const MsgCreateValidator = { writer.uint32(42).string(message.validatorAddress); } if (message.pubkey !== undefined) { - Any.encode((message.pubkey as Any), writer.uint32(50).fork()).ldelim(); + Any.encode(message.pubkey as Any, writer.uint32(50).fork()).ldelim(); } return writer; }, @@ -861,7 +861,7 @@ export const MsgCreateValidator = { message.validatorAddress = reader.string(); break; case 6: - message.pubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.pubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; break; default: reader.skipType(tag & 7); diff --git a/src/codegen/strangelove_ventures/poa/v1/validator.ts b/src/codegen/strangelove_ventures/poa/v1/validator.ts index 562d8e8..f4e5025 100644 --- a/src/codegen/strangelove_ventures/poa/v1/validator.ts +++ b/src/codegen/strangelove_ventures/poa/v1/validator.ts @@ -741,7 +741,7 @@ export const Validator = { writer.uint32(10).string(message.operatorAddress); } if (message.consensusPubkey !== undefined) { - Any.encode((message.consensusPubkey as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(message.consensusPubkey as Any, writer.uint32(18).fork()).ldelim(); } if (message.jailed === true) { writer.uint32(24).bool(message.jailed); @@ -791,13 +791,13 @@ export const Validator = { message.operatorAddress = reader.string(); break; case 2: - message.consensusPubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.consensusPubkey = Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any; break; case 3: message.jailed = reader.bool(); break; case 4: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; case 5: message.tokens = reader.string(); diff --git a/src/codegen/tendermint/abci/types.ts b/src/codegen/tendermint/abci/types.ts index 303ccc4..d2d0134 100644 --- a/src/codegen/tendermint/abci/types.ts +++ b/src/codegen/tendermint/abci/types.ts @@ -2378,7 +2378,7 @@ export const RequestCheckTx = { message.tx = reader.bytes(); break; case 2: - message.type = (reader.int32() as any); + message.type = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -4565,7 +4565,7 @@ export const ResponseOfferSnapshot = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.result = (reader.int32() as any); + message.result = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -4701,7 +4701,7 @@ export const ResponseApplySnapshotChunk = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.result = (reader.int32() as any); + message.result = reader.int32() as any; break; case 2: if ((tag & 7) === 2) { @@ -4856,7 +4856,7 @@ export const ResponseProcessProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -4982,7 +4982,7 @@ export const ResponseVerifyVoteExtension = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.status = (reader.int32() as any); + message.status = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -5885,7 +5885,7 @@ export const VoteInfo = { message.validator = Validator.decode(reader, reader.uint32()); break; case 3: - message.blockIdFlag = (reader.int32() as any); + message.blockIdFlag = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -5974,7 +5974,7 @@ export const ExtendedVoteInfo = { message.extensionSignature = reader.bytes(); break; case 5: - message.blockIdFlag = (reader.int32() as any); + message.blockIdFlag = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -6068,7 +6068,7 @@ export const Misbehavior = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = (reader.int32() as any); + message.type = reader.int32() as any; break; case 2: message.validator = Validator.decode(reader, reader.uint32()); diff --git a/src/codegen/tendermint/bundle.ts b/src/codegen/tendermint/bundle.ts index 8d8606c..2878f9b 100644 --- a/src/codegen/tendermint/bundle.ts +++ b/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _147 from "./abci/types"; -import * as _148 from "./crypto/keys"; -import * as _149 from "./crypto/proof"; -import * as _150 from "./libs/bits/types"; -import * as _151 from "./p2p/types"; -import * as _152 from "./types/block"; -import * as _153 from "./types/evidence"; -import * as _154 from "./types/params"; -import * as _155 from "./types/types"; -import * as _156 from "./types/validator"; -import * as _157 from "./version/types"; +import * as _126 from "./abci/types"; +import * as _127 from "./crypto/keys"; +import * as _128 from "./crypto/proof"; +import * as _129 from "./libs/bits/types"; +import * as _130 from "./p2p/types"; +import * as _131 from "./types/block"; +import * as _132 from "./types/evidence"; +import * as _133 from "./types/params"; +import * as _134 from "./types/types"; +import * as _135 from "./types/validator"; +import * as _136 from "./version/types"; export namespace tendermint { export const abci = { - ..._147 + ..._126 }; export const crypto = { - ..._148, - ..._149 + ..._127, + ..._128 }; export namespace libs { export const bits = { - ..._150 + ..._129 }; } export const p2p = { - ..._151 + ..._130 }; export const types = { - ..._152, - ..._153, - ..._154, - ..._155, - ..._156 + ..._131, + ..._132, + ..._133, + ..._134, + ..._135 }; export const version = { - ..._157 + ..._136 }; } \ No newline at end of file diff --git a/src/codegen/tendermint/types/types.ts b/src/codegen/tendermint/types/types.ts index bbb74fa..20edec8 100644 --- a/src/codegen/tendermint/types/types.ts +++ b/src/codegen/tendermint/types/types.ts @@ -1155,7 +1155,7 @@ export const Vote = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = (reader.int32() as any); + message.type = reader.int32() as any; break; case 2: message.height = reader.int64(); @@ -1403,7 +1403,7 @@ export const CommitSig = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockIdFlag = (reader.int32() as any); + message.blockIdFlag = reader.int32() as any; break; case 2: message.validatorAddress = reader.bytes(); @@ -1611,7 +1611,7 @@ export const ExtendedCommitSig = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockIdFlag = (reader.int32() as any); + message.blockIdFlag = reader.int32() as any; break; case 2: message.validatorAddress = reader.bytes(); @@ -1738,7 +1738,7 @@ export const Proposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = (reader.int32() as any); + message.type = reader.int32() as any; break; case 2: message.height = reader.int64(); From 39c9b6601ad3107f5e9864af7acc6394e7c9dd33 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:38:55 -0400 Subject: [PATCH 11/13] fix: prettier --- starship/__tests__/manifest.test.ts | 37 ++++++++++++++++------------- starship/__tests__/token.test.ts | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/starship/__tests__/manifest.test.ts b/starship/__tests__/manifest.test.ts index 05b61d3..6dda798 100644 --- a/starship/__tests__/manifest.test.ts +++ b/starship/__tests__/manifest.test.ts @@ -1,15 +1,16 @@ import "./setup.test"; -import {generateMnemonic, useChain} from "starshipjs"; -import {DirectSecp256k1HdWallet} from "@cosmjs/proto-signing"; -import {assertIsDeliverTxSuccess} from "@cosmjs/stargate"; -import {MsgPayout} from "../../src/codegen/liftedinit/manifest/v1/tx"; -import {getSigningLiftedinitClient} from "../../src"; +import { generateMnemonic, useChain } from "starshipjs"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { assertIsDeliverTxSuccess } from "@cosmjs/stargate"; +import { MsgPayout } from "../../src/codegen/liftedinit/manifest/v1/tx"; +import { getSigningLiftedinitClient } from "../../src"; // This is the POA_ADMIN_ADDRESS mnemonic as defined in the config.yaml file -const poaAdminMnemonic = 'razor dog gown public private couple ecology paper flee connect local robot diamond stay rude join sound win ribbon soup kidney glass robot vehicle' +const poaAdminMnemonic = + "razor dog gown public private couple ecology paper flee connect local robot diamond stay rude join sound win ribbon soup kidney glass robot vehicle"; -describe('manifest module', () => { +describe("manifest module", () => { let wallet, denom, address; let chainInfo, getCoin, getRpcEndpoint, creditFromFaucet; @@ -26,9 +27,9 @@ describe('manifest module', () => { address = (await wallet.getAccounts())[0].address; await creditFromFaucet(address); - }) + }); - test('mint tokens', async () => { + test("mint tokens", async () => { const wallet2 = await DirectSecp256k1HdWallet.fromMnemonic( generateMnemonic(), { prefix: chainInfo.chain.bech32_prefix } @@ -58,7 +59,7 @@ describe('manifest module', () => { await signingClient.sendTokens( address, address2, - [{amount: initialAmount.toString(), denom}], + [{ amount: initialAmount.toString(), denom }], fee, "send 1 token to address2" ); @@ -69,21 +70,25 @@ describe('manifest module', () => { expect(balance.denom).toEqual(denom); // Mint tokens - const payoutMsg = { + const payoutMsg = { typeUrl: MsgPayout.typeUrl, value: MsgPayout.fromPartial({ authority: address, payoutPairs: [ - {address: address2, coin: {denom, amount: mintAmount.toString()}}, + { address: address2, coin: { denom, amount: mintAmount.toString() } }, ], - }) - } - const resp = await signingClient.signAndBroadcast(address, [payoutMsg], fee); + }), + }; + const resp = await signingClient.signAndBroadcast( + address, + [payoutMsg], + fee + ); assertIsDeliverTxSuccess(resp); const balance2 = await signingClient.getBalance(address2, denom); expect(balance2.amount).toBe(resultBalance.toString()); expect(balance2.denom).toBe(denom); - }) + }); }); diff --git a/starship/__tests__/token.test.ts b/starship/__tests__/token.test.ts index fd59905..5d1e758 100644 --- a/starship/__tests__/token.test.ts +++ b/starship/__tests__/token.test.ts @@ -5,7 +5,7 @@ import { assertIsDeliverTxSuccess, StargateClient } from "@cosmjs/stargate"; import { generateMnemonic, useChain } from "starshipjs"; import { MsgTransfer } from "../../src/codegen/ibc/applications/transfer/v1/tx"; -import {getSigningLiftedinitClient, ibc} from "../../src"; +import { getSigningLiftedinitClient, ibc } from "../../src"; describe("Token transfers", () => { let wallet, denom, address; From 03e8d9fc5489054dbb356fd8899b288c2a8d4b59 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:06:41 -0400 Subject: [PATCH 12/13] test: finish manifest module tests --- starship/__tests__/manifest.test.ts | 98 ++++++++++++++++++----------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/starship/__tests__/manifest.test.ts b/starship/__tests__/manifest.test.ts index 6dda798..9891d77 100644 --- a/starship/__tests__/manifest.test.ts +++ b/starship/__tests__/manifest.test.ts @@ -2,8 +2,14 @@ import "./setup.test"; import { generateMnemonic, useChain } from "starshipjs"; import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { assertIsDeliverTxSuccess } from "@cosmjs/stargate"; -import { MsgPayout } from "../../src/codegen/liftedinit/manifest/v1/tx"; +import { + assertIsDeliverTxSuccess, + SigningStargateClient, +} from "@cosmjs/stargate"; +import { + MsgBurnHeldBalance, + MsgPayout, +} from "../../src/codegen/liftedinit/manifest/v1/tx"; import { getSigningLiftedinitClient } from "../../src"; // This is the POA_ADMIN_ADDRESS mnemonic as defined in the config.yaml file @@ -11,7 +17,7 @@ const poaAdminMnemonic = "razor dog gown public private couple ecology paper flee connect local robot diamond stay rude join sound win ribbon soup kidney glass robot vehicle"; describe("manifest module", () => { - let wallet, denom, address; + let wallet, denom, address, address2; let chainInfo, getCoin, getRpcEndpoint, creditFromFaucet; beforeAll(async () => { @@ -26,50 +32,47 @@ describe("manifest module", () => { }); address = (await wallet.getAccounts())[0].address; - await creditFromFaucet(address); - }); - - test("mint tokens", async () => { const wallet2 = await DirectSecp256k1HdWallet.fromMnemonic( generateMnemonic(), { prefix: chainInfo.chain.bech32_prefix } ); - const address2 = (await wallet2.getAccounts())[0].address; + address2 = (await wallet2.getAccounts())[0].address; + + await creditFromFaucet(address); + await creditFromFaucet(address2); + }); - const signingClient = await getSigningLiftedinitClient({ + const getFee = () => ({ + amount: [{ denom, amount: "100000" }], + gas: "550000", + }); + + const getSigningClient = async () => { + return await getSigningLiftedinitClient({ rpcEndpoint: await getRpcEndpoint(), signer: wallet, }); + }; - const fee = { - amount: [ - { - denom, - amount: "100000", - }, - ], - gas: "550000", - }; + const checkBalance = async ( + client: SigningStargateClient, + addr: string, + expectedAmount: number | bigint + ) => { + const balance = await client.getBalance(addr, denom); + expect(balance.amount).toEqual(expectedAmount.toString()); + expect(balance.denom).toEqual(denom); + }; - const initialAmount = 1; + test("mint tokens to destination", async () => { + const signingClient = await getSigningClient(); + const fee = getFee(); + const initialAmount = 1000000000000; const mintAmount = 1000000; const resultBalance = initialAmount + mintAmount; - // Send tokens to address2 so it exists in the ledger - await signingClient.sendTokens( - address, - address2, - [{ amount: initialAmount.toString(), denom }], - fee, - "send 1 token to address2" - ); - - // Get the current balance - const balance = await signingClient.getBalance(address2, denom); - expect(balance.amount).toEqual(initialAmount.toString()); - expect(balance.denom).toEqual(denom); + await checkBalance(signingClient, address2, initialAmount); - // Mint tokens const payoutMsg = { typeUrl: MsgPayout.typeUrl, value: MsgPayout.fromPartial({ @@ -86,9 +89,32 @@ describe("manifest module", () => { ); assertIsDeliverTxSuccess(resp); + await checkBalance(signingClient, address2, resultBalance); + }); + + test("burn tokens from self", async () => { + const signingClient = await getSigningClient(); + const fee = getFee(); + const burnAmount = 1000000; + + const balance = await signingClient.getBalance(address, denom); + expect(balance.denom).toEqual(denom); - const balance2 = await signingClient.getBalance(address2, denom); - expect(balance2.amount).toBe(resultBalance.toString()); - expect(balance2.denom).toBe(denom); + const resultBalance = + BigInt(balance.amount) - + BigInt(burnAmount) - + BigInt(fee.amount[0].amount); + + const burnMsg = { + typeUrl: MsgBurnHeldBalance.typeUrl, + value: MsgBurnHeldBalance.fromPartial({ + authority: address, + burnCoins: [{ denom, amount: burnAmount.toString() }], + }), + }; + const resp = await signingClient.signAndBroadcast(address, [burnMsg], fee); + + assertIsDeliverTxSuccess(resp); + await checkBalance(signingClient, address, resultBalance); }); }); From af4679b14e7dc8611f8ab513c1ddbe761d56fabe Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:13:39 -0400 Subject: [PATCH 13/13] chore: bump to alpha.13 --- starship/docker/Dockerfile | 4 ++-- starship/docker/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/starship/docker/Dockerfile b/starship/docker/Dockerfile index cf28e8f..5ac72ce 100644 --- a/starship/docker/Dockerfile +++ b/starship/docker/Dockerfile @@ -2,7 +2,7 @@ # ARG VERSION # FROM ${BASE_IMAGE}:${VERSION} AS source -FROM ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.12 as source +FROM ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.13 as source FROM alpine:3.16 @@ -17,4 +17,4 @@ ENV PACKAGES curl make bash jq sed # Install minimum necessary dependencies RUN apk add --no-cache $PACKAGES -WORKDIR /opt \ No newline at end of file +WORKDIR /opt diff --git a/starship/docker/Makefile b/starship/docker/Makefile index 1adca07..aa102aa 100644 --- a/starship/docker/Makefile +++ b/starship/docker/Makefile @@ -1,7 +1,7 @@ .PHONY: setup -setup: +setup: docker buildx create --use .PHONY: build build: - docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.12 . \ No newline at end of file + docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/liftedinit/manifest-ledger:v0.0.1-alpha.13 .