diff --git a/ts/script/fix-ts-proto-generated-types.ts b/ts/script/fix-ts-proto-generated-types.ts index affb5b05..d87d6305 100644 --- a/ts/script/fix-ts-proto-generated-types.ts +++ b/ts/script/fix-ts-proto-generated-types.ts @@ -15,6 +15,13 @@ const helperTypeRegex = new RegExp( ); const ROOT_DIR = resolvePath(import.meta.dirname, "..", "src"); + +const typesToPatch = new Set(); +for await (const patchFile of fs.glob(`${ROOT_DIR}/generated/patches/*CustomTypePatches.ts`)) { + const { patches } = await import(patchFile); + Object.keys(patches).forEach((key) => typesToPatch.add(key)); +} + for await (const path of fs.glob(`${ROOT_DIR}/generated/protos/**/*.ts`)) { const source = await fs.readFile(path, "utf8"); let newSource = source; @@ -23,6 +30,8 @@ for await (const path of fs.glob(`${ROOT_DIR}/generated/protos/**/*.ts`)) { newSource = newSource.replace(/^\s*create\(base\?:\s*DeepPartial<\w+>\):\s*\w+\s*\{\s*return\s*\w+\.fromPartial\(base \?\? \{\}\);\s*\},?\n?/gm, ""); newSource = injectOwnHelpers(newSource, path); + newSource = applyPatching(newSource, path, typesToPatch); + if (newSource !== source) { await fs.writeFile(path, newSource); } @@ -50,3 +59,27 @@ function injectOwnHelpers(source: string, path: string) { return importHelpers + importTypeHelpers + source; } + +function applyPatching(source: string, filePath: string, typesToPatch: Set) { + const imports = new Set(); + const exports: string[] = []; + + const newSource = source.replace( + /^export const (\w+)(:\s*MessageFns<[^>]+,\s*["']([^"']+)["']>\s*=)/gm, + (match, symbolName, typeAnnotation, fullName) => { + if (!typesToPatch.has(fullName)) return match; + + const namespace = fullName.split(".")[0]; + const prefix = namespace === "akash" ? "node" : namespace; + const importPath = relativePath(filePath, `${ROOT_DIR}/generated/protos/patches/${prefix}PatchMessage.ts`); + imports.add(`import { patched } from "${importPath}";`); + exports.push(`export const ${symbolName} = patched(_${symbolName});`); + + return `const _${symbolName}${typeAnnotation}`; + }, + ); + + if (!exports.length) return source; + + return Array.from(imports).join("\n") + "\n" + newSource + "\n" + exports.join("\n") + "\n"; +} diff --git a/ts/script/protoc-gen-customtype-patches.ts b/ts/script/protoc-gen-customtype-patches.ts index bcaac668..b6939879 100755 --- a/ts/script/protoc-gen-customtype-patches.ts +++ b/ts/script/protoc-gen-customtype-patches.ts @@ -12,22 +12,48 @@ import { basename, normalize as normalizePath } from "path"; import { findPathsToCustomField, getCustomType } from "../src/encoding/customTypes/utils.ts"; -runNodeJs( - createEcmaScriptPlugin({ - name: "protoc-gen-customtype-patches", - version: "v1", - generateTs, - }), -); +export interface PluginOptions { + /** + * if true, we will patch the whole tree of the message type, starting from the custom field type and up to the root + * in case of patching ts-proto generated types which has self-references, we need to patch only leaf level + * @default false + */ + patchWholeTree: boolean; +} + +runNodeJs(createEcmaScriptPlugin({ name: "protoc-gen-customtype-patches", version: "v1", parseOptions, generateTs })); const PROTO_PATH = "../protos"; -function generateTs(schema: Schema): void { + +function parseOptions(rawOptions: Array<{ + key: string; + value: string; +}>): PluginOptions { + const options: PluginOptions = { + patchWholeTree: false, + }; + + for (const { key, value } of rawOptions) { + if (key === "patch_whole_tree") { + options.patchWholeTree = value === "true"; + } + } + + return options; +} + +function generateTs(schema: Schema): void { const allPaths: DescField[][] = []; schema.files.forEach((file) => { file.messages.forEach((message) => { const paths = findPathsToCustomField(message, () => true); - allPaths.push(...paths); + if (schema.options.patchWholeTree) { + allPaths.push(...paths); + } else { + const leaves = paths.map((path) => path.slice(-1)); + allPaths.push(...leaves); + } }); }); if (!allPaths.length) { @@ -100,6 +126,24 @@ function generateTs(schema: Schema): void { patchesFile.print(`const p = {\n${indent(patches.join(",\n"))}\n};\n`); patchesFile.print(`export const patches = p;`); + const patchesTypeFileName = fileName.replace("CustomTypePatches", "PatchMessage"); + const patchTypeFile = schema.generateFile(patchesTypeFileName); + patchTypeFile.print(`import { patches } from "./${fileName}";`); + patchTypeFile.print(`import type { MessageDesc } from "../../sdk/client/types.ts";`); + patchTypeFile.print(`export const patched = (messageDesc: T): T => {`); + patchTypeFile.print(` const patchMessage = patches[messageDesc.$type as keyof typeof patches] as any;`); + patchTypeFile.print(` if (!patchMessage) return messageDesc;`); + patchTypeFile.print(` return {`); + patchTypeFile.print(` ...messageDesc,`); + patchTypeFile.print(` encode(message, writer) {`); + patchTypeFile.print(` return messageDesc.encode(patchMessage(message, 'encode'), writer);`); + patchTypeFile.print(` },`); + patchTypeFile.print(` decode(input, length) {`); + patchTypeFile.print(` return patchMessage(messageDesc.decode(input, length), 'decode');`); + patchTypeFile.print(` },`); + patchTypeFile.print(` };`); + patchTypeFile.print(`};`); + const testsFile = schema.generateFile(fileName.replace(/\.ts$/, ".spec.ts")); generateTests(basename(fileName), testsFile, messageToCustomFields); } @@ -185,13 +229,13 @@ function generateTests(fileName: string, testsFile: GeneratedFile, messageToCust testsFile.print(`import { expect, describe, it } from "@jest/globals";`); testsFile.print(`import { patches } from "./${basename(fileName)}";`); testsFile.print(`import { generateMessage, type MessageSchema } from "@test/helpers/generateMessage";`); - testsFile.print(`import type { TypePatches } from "../../sdk/client/applyPatches.ts";`); + testsFile.print(`import type { TypePatches } from "../../sdk/client/types.ts";`); testsFile.print(""); testsFile.print(`const messageTypes: Record = {`); for (const [message, fields] of messageToCustomFields.entries()) { testsFile.print(` "${message.typeName}": {`); testsFile.print(` type: `, testsFile.import(message.name, `${PROTO_PATH}/${message.file.name}.ts`), `,`); - testsFile.print(` fields: [`, ...Array.from(fields, f => serializeField(f, testsFile)), `],`); + testsFile.print(` fields: [`, ...Array.from(fields, (f) => serializeField(f, testsFile)), `],`); testsFile.print(` },`); } testsFile.print(`};`); @@ -236,7 +280,7 @@ function serializeField(f: DescField, file: GeneratedFile): Printable { field.push(`scalarType: ${f.scalar},`); } if (f.fieldKind === "enum") { - field.push(`enum: `, JSON.stringify(f.enum.values.map(v => v.localName)), `,`); + field.push(`enum: `, JSON.stringify(f.enum.values.map((v) => v.localName)), `,`); } if (getCustomType(f)) { field.push(`customType: "${getCustomType(f)!.shortName}",`); @@ -246,10 +290,10 @@ function serializeField(f: DescField, file: GeneratedFile): Printable { } if (f.message) { field.push(`message: {fields: [`, - ...f.message.fields.map(nf => serializeField(nf, file)), + ...f.message.fields.map((nf) => serializeField(nf, file)), `],`, `type: `, file.import(f.message.name, `${PROTO_PATH}/${f.message.file.name}.ts`), - `},` + `},`, ); } field.push(`},`); diff --git a/ts/script/protoc-gen-sdk-object.ts b/ts/script/protoc-gen-sdk-object.ts index 07696af7..8df78f83 100755 --- a/ts/script/protoc-gen-sdk-object.ts +++ b/ts/script/protoc-gen-sdk-object.ts @@ -90,7 +90,7 @@ function generateTs(schema: Schema): void { f.export("const", "serviceLoader"), `= `, f.import("createServiceLoader", `../sdk/client/createServiceLoader${importExtension}`), - `([\n${indent(servicesLoaderDefs.join(",\n"))}\n] as const);` + `([\n${indent(servicesLoaderDefs.join(",\n"))}\n] as const);`, ); const factoryArgs = hasMsgService @@ -98,9 +98,9 @@ function generateTs(schema: Schema): void { : `transport: Transport`; f.print( f.export("function", "createSDK"), - `(${factoryArgs}, options?: `, f.import("SDKOptions", `../sdk/types${importExtension}`), `) {\n`, - ` const getClient = createClientFactory(${hasMsgService ? "queryTransport" : "transport"}, options?.clientOptions);\n`, - (hasMsgService ? ` const getMsgClient = createClientFactory(txTransport, options?.clientOptions);\n` : ""), + `(${factoryArgs}) {\n`, + ` const getClient = createClientFactory(${hasMsgService ? "queryTransport" : "transport"});\n`, + (hasMsgService ? ` const getMsgClient = createClientFactory(txTransport);\n` : ""), ` return ${indent(stringifyObject(sdkDefs)).trim()};\n`, `}`, ); @@ -227,7 +227,7 @@ function findExtension(schema: Schema, typeName: string) { return extensionsCache[typeName]; } -const serviceFiles: Record = {}; +const serviceFiles: Record = {}; function generateServiceDefs(service: DescService, schema: Schema) { const importExtension = schema.options.importExtension ? `.${schema.options.importExtension}` : ""; const serviceFilePath = `${service.file.name}_akash.ts`; @@ -243,10 +243,10 @@ function generateServiceDefs(service: DescService, schema: Schema) { service.methods.forEach((method) => { file.print(` ${method.localName}: {`); file.print(` name: "${method.name}",`); - if (method.methodKind !== "unary") file.print(` kind: "${method.methodKind}",`); + if (method.methodKind !== "unary") file.print(` kind: "${method.methodKind}",`); if (httpExtension && hasOption(method, httpExtension)) { const httpOption = getOption(method, httpExtension) as { - pattern: { case: string, value: string }; + pattern: { case: string; value: string }; }; if (httpOption.pattern.case !== "get") file.print(` httpMethod: "${httpOption.pattern.case}",`); diff --git a/ts/script/protoc-gen-type-index-files.ts b/ts/script/protoc-gen-type-index-files.ts index cd9bebdc..724164a3 100755 --- a/ts/script/protoc-gen-type-index-files.ts +++ b/ts/script/protoc-gen-type-index-files.ts @@ -1,13 +1,12 @@ #!/usr/bin/env -S node --experimental-strip-types --no-warnings -import { type DescEnum, type DescField, type DescMessage } from "@bufbuild/protobuf"; +import { type DescEnum, type DescMessage } from "@bufbuild/protobuf"; import { createEcmaScriptPlugin, type GeneratedFile, runNodeJs, - type Schema + type Schema, } from "@bufbuild/protoplugin"; -import { findPathsToCustomField } from "../src/encoding/customTypes/utils.ts"; runNodeJs( createEcmaScriptPlugin({ @@ -18,53 +17,18 @@ runNodeJs( ); function generateTs(schema: Schema): void { - const allCustomTypeFieldPaths: DescField[][] = []; - - schema.files.forEach((file) => { - file.messages.forEach((message) => { - const paths = findPathsToCustomField(message, () => true); - allCustomTypeFieldPaths.push(...paths); - }); - }); - - const typesNamesToPatch = new Set(); - allCustomTypeFieldPaths.forEach((path) => { - path.forEach((field) => { - typesNamesToPatch.add(field.parent.typeName); - }); - }); const protoSource = process.env.PROTO_SOURCE; if (!protoSource) { throw new Error("PROTO_SOURCE is required and should be set to 'node', 'provider', or 'cosmos'"); } - const patchesFileName = `${protoSource}PatchMessage.ts`; - - if (typesNamesToPatch.size > 0) { - const patchesFile = schema.generateFile(patchesFileName); - patchesFile.print(`import { patches } from "../patches/${process.env.PROTO_SOURCE}CustomTypePatches.ts";`); - patchesFile.print(`import type { MessageDesc } from "../../sdk/client/types.ts";`); - patchesFile.print(`export const patched = (messageDesc: T): T => {`); - patchesFile.print(` const patchMessage = patches[messageDesc.$type as keyof typeof patches] as any;`); - patchesFile.print(` if (!patchMessage) return messageDesc;`); - patchesFile.print(` return {`); - patchesFile.print(` ...messageDesc,`); - patchesFile.print(` encode(message, writer) {`); - patchesFile.print(` return messageDesc.encode(patchMessage(message, 'encode'), writer);`); - patchesFile.print(` },`); - patchesFile.print(` decode(input, length) {`); - patchesFile.print(` return patchMessage(messageDesc.decode(input, length), 'decode');`); - patchesFile.print(` },`); - patchesFile.print(` };`); - patchesFile.print(`};`); - } const indexFiles: Record; }> = {}; - const namespacePrefix = protoSource === 'provider' ? 'provider.' : ''; + const namespacePrefix = protoSource === "provider" ? "provider." : ""; schema.files.forEach((file) => { - const packageParts = file.proto.package.split('.'); + const packageParts = file.proto.package.split("."); const namespace = namespacePrefix + packageParts[0]; const version = packageParts.at(-1); const path = `index.${namespace}.${version}.ts`; @@ -72,38 +36,22 @@ function generateTs(schema: Schema): void { file: schema.generateFile(path), symbols: new Set(), }; - const {file: indexFile, symbols: fileSymbols} = indexFiles[path]; + const { file: indexFile, symbols: fileSymbols } = indexFiles[path]; - const typesToPatch: Array<{ exportedName: string; name: string }> = []; const typesToExport: Array<{ exportedName: string; name: string }> = []; for (const type of schema.typesInFile(file)) { - if (type.kind === 'service' || type.kind === 'extension') continue; + if (type.kind === "service" || type.kind === "extension") continue; const name = genName(type); const exportedName = fileSymbols.has(name) ? genUniqueName(type, fileSymbols) : name; fileSymbols.add(exportedName); - - if (type.kind === "message" && typesNamesToPatch.has(type.typeName)) { - typesToPatch.push({ exportedName, name }); - } else { - typesToExport.push({ exportedName, name }); - } + typesToExport.push({ exportedName, name }); } if (typesToExport.length > 0) { - const symbolsToExport = typesToExport.map(type => type.exportedName === type.name ? type.exportedName : `${type.name} as ${type.exportedName}`).join(", "); + const symbolsToExport = typesToExport.map((type) => type.exportedName === type.name ? type.exportedName : `${type.name} as ${type.exportedName}`).join(", "); indexFile.print(`export { ${symbolsToExport} } from "./${file.name}.ts";`); } - - if (typesToPatch.length > 0) { - const symbolsToPatch = typesToPatch.map((type) => `${type.name} as _${type.exportedName}`).join(", "); - indexFile.print(''); - indexFile.print(`import { ${symbolsToPatch} } from "./${file.name}.ts";`); - for (const type of typesToPatch) { - indexFile.print(`export const ${type.exportedName} = `, indexFile.import('patched', `./${patchesFileName}`),`(_${type.exportedName});`); - indexFile.print(`export type ${type.exportedName} = _${type.exportedName}`); - } - } }); } @@ -115,8 +63,8 @@ let uniqueNameCounter = 0; function genUniqueName(type: DescMessage | DescEnum, allSymbols: Set, attempt = 0): string { const name = genName(type); if (allSymbols.has(name)) { - const packageParts = type.file.proto.package.split('.'); - const prefix = packageParts.slice(-2 - attempt, -1).map(capitalize).join('_'); + const packageParts = type.file.proto.package.split("."); + const prefix = packageParts.slice(-2 - attempt, -1).map(capitalize).join("_"); let newName = `${prefix}_${name}`; if (newName === name) { newName = `${prefix}_${name}_${uniqueNameCounter++}`; diff --git a/ts/src/generated/createCosmosSDK.ts b/ts/src/generated/createCosmosSDK.ts index 4dc5d657..a3d55b08 100644 --- a/ts/src/generated/createCosmosSDK.ts +++ b/ts/src/generated/createCosmosSDK.ts @@ -1,5 +1,4 @@ import { createServiceLoader } from "../sdk/client/createServiceLoader.ts"; -import { SDKOptions } from "../sdk/types.ts"; import type * as cosmos_app_v1alpha1_query from "./protos/cosmos/app/v1alpha1/query.ts"; import type * as cosmos_auth_v1beta1_query from "./protos/cosmos/auth/v1beta1/query.ts"; @@ -111,9 +110,9 @@ export const serviceLoader= createServiceLoader([ () => import("./protos/cosmos/upgrade/v1beta1/tx_akash.ts").then(m => m.Msg), () => import("./protos/cosmos/vesting/v1beta1/tx_akash.ts").then(m => m.Msg) ] as const); -export function createSDK(queryTransport: Transport, txTransport: Transport, options?: SDKOptions) { - const getClient = createClientFactory(queryTransport, options?.clientOptions); - const getMsgClient = createClientFactory(txTransport, options?.clientOptions); +export function createSDK(queryTransport: Transport, txTransport: Transport) { + const getClient = createClientFactory(queryTransport); + const getMsgClient = createClientFactory(txTransport); return { cosmos: { app: { diff --git a/ts/src/generated/createIbc-goSDK.ts b/ts/src/generated/createIbc-goSDK.ts index 123d1a0e..e644628c 100644 --- a/ts/src/generated/createIbc-goSDK.ts +++ b/ts/src/generated/createIbc-goSDK.ts @@ -1,5 +1,4 @@ import { createServiceLoader } from "../sdk/client/createServiceLoader.ts"; -import { SDKOptions } from "../sdk/types.ts"; import type * as ibc_applications_interchain_accounts_controller_v1_query from "./protos/ibc/applications/interchain_accounts/controller/v1/query.ts"; import type * as ibc_applications_interchain_accounts_controller_v1_tx from "./protos/ibc/applications/interchain_accounts/controller/v1/tx.ts"; @@ -45,9 +44,9 @@ export const serviceLoader= createServiceLoader([ () => import("./protos/ibc/lightclients/wasm/v1/query_akash.ts").then(m => m.Query), () => import("./protos/ibc/lightclients/wasm/v1/tx_akash.ts").then(m => m.Msg) ] as const); -export function createSDK(queryTransport: Transport, txTransport: Transport, options?: SDKOptions) { - const getClient = createClientFactory(queryTransport, options?.clientOptions); - const getMsgClient = createClientFactory(txTransport, options?.clientOptions); +export function createSDK(queryTransport: Transport, txTransport: Transport) { + const getClient = createClientFactory(queryTransport); + const getMsgClient = createClientFactory(txTransport); return { ibc: { applications: { diff --git a/ts/src/generated/createNodeSDK.ts b/ts/src/generated/createNodeSDK.ts index 18479bd7..2f0df6ec 100644 --- a/ts/src/generated/createNodeSDK.ts +++ b/ts/src/generated/createNodeSDK.ts @@ -1,5 +1,4 @@ import { createServiceLoader } from "../sdk/client/createServiceLoader.ts"; -import { SDKOptions } from "../sdk/types.ts"; import type * as akash_audit_v1_query from "./protos/akash/audit/v1/query.ts"; import type * as akash_audit_v1_msg from "./protos/akash/audit/v1/msg.ts"; @@ -58,9 +57,9 @@ export const serviceLoader= createServiceLoader([ () => import("./protos/akash/wasm/v1/query_akash.ts").then(m => m.Query), () => import("./protos/akash/wasm/v1/service_akash.ts").then(m => m.Msg) ] as const); -export function createSDK(queryTransport: Transport, txTransport: Transport, options?: SDKOptions) { - const getClient = createClientFactory(queryTransport, options?.clientOptions); - const getMsgClient = createClientFactory(txTransport, options?.clientOptions); +export function createSDK(queryTransport: Transport, txTransport: Transport) { + const getClient = createClientFactory(queryTransport); + const getMsgClient = createClientFactory(txTransport); return { akash: { audit: { diff --git a/ts/src/generated/createProviderSDK.ts b/ts/src/generated/createProviderSDK.ts index dcf5ce37..b25c7939 100644 --- a/ts/src/generated/createProviderSDK.ts +++ b/ts/src/generated/createProviderSDK.ts @@ -1,5 +1,4 @@ import { createServiceLoader } from "../sdk/client/createServiceLoader.ts"; -import { SDKOptions } from "../sdk/types.ts"; import type * as google_protobuf_empty from "./protos/google/protobuf/empty.ts"; import type * as akash_provider_lease_v1_service from "./protos/akash/provider/lease/v1/service.ts"; @@ -15,8 +14,8 @@ export const serviceLoader= createServiceLoader([ () => import("./protos/akash/provider/lease/v1/service_akash.ts").then(m => m.LeaseRPC), () => import("./protos/akash/provider/v1/service_akash.ts").then(m => m.ProviderRPC) ] as const); -export function createSDK(transport: Transport, options?: SDKOptions) { - const getClient = createClientFactory(transport, options?.clientOptions); +export function createSDK(transport: Transport) { + const getClient = createClientFactory(transport); return { akash: { inventory: { diff --git a/ts/src/generated/patches/cosmosCustomTypePatches.spec.ts b/ts/src/generated/patches/cosmosCustomTypePatches.spec.ts index 217aefb1..d3d3b04a 100644 --- a/ts/src/generated/patches/cosmosCustomTypePatches.spec.ts +++ b/ts/src/generated/patches/cosmosCustomTypePatches.spec.ts @@ -1,38 +1,18 @@ -import { Coin, DecCoin, DecProto } from "../protos/cosmos/base/v1beta1/coin.ts"; -import { DelegationDelegatorReward, DelegatorStartingInfo, FeePool, Params, ValidatorAccumulatedCommission, ValidatorCurrentRewards, ValidatorHistoricalRewards, ValidatorOutstandingRewards, ValidatorSlashEvent, ValidatorSlashEvents } from "../protos/cosmos/distribution/v1beta1/distribution.ts"; -import { DelegatorStartingInfoRecord, GenesisState, ValidatorAccumulatedCommissionRecord, ValidatorCurrentRewardsRecord, ValidatorHistoricalRewardsRecord, ValidatorOutstandingRewardsRecord, ValidatorSlashEventRecord } from "../protos/cosmos/distribution/v1beta1/genesis.ts"; -import { QueryCommunityPoolResponse, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsResponse, QueryParamsResponse, QueryValidatorCommissionResponse, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsResponse, QueryValidatorSlashesResponse } from "../protos/cosmos/distribution/v1beta1/query.ts"; -import { MsgUpdateParams } from "../protos/cosmos/distribution/v1beta1/tx.ts"; -import { TallyParams, Vote, WeightedVoteOption } from "../protos/cosmos/gov/v1beta1/gov.ts"; -import { GenesisState as GenesisState$1 } from "../protos/cosmos/gov/v1beta1/genesis.ts"; -import { QueryParamsResponse as QueryParamsResponse$1, QueryVoteResponse, QueryVotesResponse } from "../protos/cosmos/gov/v1beta1/query.ts"; -import { MsgVoteWeighted } from "../protos/cosmos/gov/v1beta1/tx.ts"; +import { DecCoin, DecProto } from "../protos/cosmos/base/v1beta1/coin.ts"; +import { DelegatorStartingInfo, Params, ValidatorSlashEvent } from "../protos/cosmos/distribution/v1beta1/distribution.ts"; +import { TallyParams, WeightedVoteOption } from "../protos/cosmos/gov/v1beta1/gov.ts"; import { Minter, Params as Params$1 } from "../protos/cosmos/mint/v1beta1/mint.ts"; -import { GenesisState as GenesisState$2 } from "../protos/cosmos/mint/v1beta1/genesis.ts"; -import { QueryAnnualProvisionsResponse, QueryInflationResponse, QueryParamsResponse as QueryParamsResponse$2 } from "../protos/cosmos/mint/v1beta1/query.ts"; -import { MsgUpdateParams as MsgUpdateParams$1 } from "../protos/cosmos/mint/v1beta1/tx.ts"; +import { QueryAnnualProvisionsResponse, QueryInflationResponse } from "../protos/cosmos/mint/v1beta1/query.ts"; import { ContinuousFund } from "../protos/cosmos/protocolpool/v1/types.ts"; -import { GenesisState as GenesisState$3 } from "../protos/cosmos/protocolpool/v1/genesis.ts"; -import { Timestamp } from "../protos/google/protobuf/timestamp.ts"; -import { QueryContinuousFundResponse, QueryContinuousFundsResponse } from "../protos/cosmos/protocolpool/v1/query.ts"; import { MsgCreateContinuousFund } from "../protos/cosmos/protocolpool/v1/tx.ts"; import { Params as Params$2 } from "../protos/cosmos/slashing/v1beta1/slashing.ts"; -import { GenesisState as GenesisState$4 } from "../protos/cosmos/slashing/v1beta1/genesis.ts"; -import { Duration } from "../protos/google/protobuf/duration.ts"; -import { QueryParamsResponse as QueryParamsResponse$3 } from "../protos/cosmos/slashing/v1beta1/query.ts"; -import { MsgUpdateParams as MsgUpdateParams$2 } from "../protos/cosmos/slashing/v1beta1/tx.ts"; -import { Commission, CommissionRates, Delegation, DelegationResponse, Description, HistoricalInfo, Params as Params$3, Redelegation, RedelegationEntry, RedelegationEntryResponse, RedelegationResponse, Validator } from "../protos/cosmos/staking/v1beta1/staking.ts"; -import { Any } from "../protos/google/protobuf/any.ts"; -import { GenesisState as GenesisState$5 } from "../protos/cosmos/staking/v1beta1/genesis.ts"; -import { QueryDelegationResponse, QueryDelegatorDelegationsResponse, QueryDelegatorValidatorResponse, QueryDelegatorValidatorsResponse, QueryHistoricalInfoResponse, QueryParamsResponse as QueryParamsResponse$4, QueryRedelegationsResponse, QueryValidatorDelegationsResponse, QueryValidatorResponse, QueryValidatorsResponse } from "../protos/cosmos/staking/v1beta1/query.ts"; -import { Consensus } from "../protos/tendermint/version/types.ts"; -import { BlockID, Header, PartSetHeader } from "../protos/tendermint/types/types.ts"; -import { MsgCreateValidator, MsgEditValidator, MsgUpdateParams as MsgUpdateParams$3 } from "../protos/cosmos/staking/v1beta1/tx.ts"; +import { CommissionRates, Delegation, Params as Params$3, RedelegationEntry, Validator } from "../protos/cosmos/staking/v1beta1/staking.ts"; +import { MsgEditValidator } from "../protos/cosmos/staking/v1beta1/tx.ts"; import { expect, describe, it } from "@jest/globals"; import { patches } from "./cosmosCustomTypePatches.ts"; import { generateMessage, type MessageSchema } from "@test/helpers/generateMessage"; -import type { TypePatches } from "../../sdk/client/applyPatches.ts"; +import type { TypePatches } from "../../sdk/client/types.ts"; const messageTypes: Record = { "cosmos.base.v1beta1.DecCoin": { @@ -47,138 +27,22 @@ const messageTypes: Record = { type: Params, fields: [{name: "communityTax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "baseProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "bonusProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.distribution.v1beta1.ValidatorHistoricalRewards": { - type: ValidatorHistoricalRewards, - fields: [{name: "cumulativeRewardRatio",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.ValidatorCurrentRewards": { - type: ValidatorCurrentRewards, - fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission": { - type: ValidatorAccumulatedCommission, - fields: [{name: "commission",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.ValidatorOutstandingRewards": { - type: ValidatorOutstandingRewards, - fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, "cosmos.distribution.v1beta1.ValidatorSlashEvent": { type: ValidatorSlashEvent, fields: [{name: "fraction",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.distribution.v1beta1.ValidatorSlashEvents": { - type: ValidatorSlashEvents, - fields: [{name: "validatorSlashEvents",kind: "list",message: {fields: [{name: "validatorPeriod",kind: "scalar",scalarType: 4,},{name: "fraction",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: ValidatorSlashEvent},},], - }, - "cosmos.distribution.v1beta1.FeePool": { - type: FeePool, - fields: [{name: "communityPool",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, "cosmos.distribution.v1beta1.DelegatorStartingInfo": { type: DelegatorStartingInfo, fields: [{name: "stake",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.distribution.v1beta1.DelegationDelegatorReward": { - type: DelegationDelegatorReward, - fields: [{name: "reward",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord": { - type: ValidatorOutstandingRewardsRecord, - fields: [{name: "outstandingRewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord": { - type: ValidatorAccumulatedCommissionRecord, - fields: [{name: "accumulated",kind: "message",message: {fields: [{name: "commission",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ValidatorAccumulatedCommission},},], - }, - "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord": { - type: ValidatorHistoricalRewardsRecord, - fields: [{name: "rewards",kind: "message",message: {fields: [{name: "cumulativeRewardRatio",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "referenceCount",kind: "scalar",scalarType: 13,},],type: ValidatorHistoricalRewards},},], - }, - "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord": { - type: ValidatorCurrentRewardsRecord, - fields: [{name: "rewards",kind: "message",message: {fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "period",kind: "scalar",scalarType: 4,},],type: ValidatorCurrentRewards},},], - }, - "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord": { - type: DelegatorStartingInfoRecord, - fields: [{name: "startingInfo",kind: "message",message: {fields: [{name: "previousPeriod",kind: "scalar",scalarType: 4,},{name: "stake",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "height",kind: "scalar",scalarType: 4,},],type: DelegatorStartingInfo},},], - }, - "cosmos.distribution.v1beta1.ValidatorSlashEventRecord": { - type: ValidatorSlashEventRecord, - fields: [{name: "validatorSlashEvent",kind: "message",message: {fields: [{name: "validatorPeriod",kind: "scalar",scalarType: 4,},{name: "fraction",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: ValidatorSlashEvent},},], - }, - "cosmos.distribution.v1beta1.GenesisState": { - type: GenesisState, - fields: [{name: "params",kind: "message",message: {fields: [{name: "communityTax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "baseProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "bonusProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "withdrawAddrEnabled",kind: "scalar",scalarType: 8,},],type: Params},},{name: "feePool",kind: "message",message: {fields: [{name: "communityPool",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: FeePool},},{name: "outstandingRewards",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "outstandingRewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ValidatorOutstandingRewardsRecord},},{name: "validatorAccumulatedCommissions",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "accumulated",kind: "message",message: {fields: [{name: "commission",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ValidatorAccumulatedCommission},},],type: ValidatorAccumulatedCommissionRecord},},{name: "validatorHistoricalRewards",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "period",kind: "scalar",scalarType: 4,},{name: "rewards",kind: "message",message: {fields: [{name: "cumulativeRewardRatio",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "referenceCount",kind: "scalar",scalarType: 13,},],type: ValidatorHistoricalRewards},},],type: ValidatorHistoricalRewardsRecord},},{name: "validatorCurrentRewards",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "rewards",kind: "message",message: {fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "period",kind: "scalar",scalarType: 4,},],type: ValidatorCurrentRewards},},],type: ValidatorCurrentRewardsRecord},},{name: "delegatorStartingInfos",kind: "list",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "startingInfo",kind: "message",message: {fields: [{name: "previousPeriod",kind: "scalar",scalarType: 4,},{name: "stake",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "height",kind: "scalar",scalarType: 4,},],type: DelegatorStartingInfo},},],type: DelegatorStartingInfoRecord},},{name: "validatorSlashEvents",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 4,},{name: "period",kind: "scalar",scalarType: 4,},{name: "validatorSlashEvent",kind: "message",message: {fields: [{name: "validatorPeriod",kind: "scalar",scalarType: 4,},{name: "fraction",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: ValidatorSlashEvent},},],type: ValidatorSlashEventRecord},},], - }, - "cosmos.distribution.v1beta1.QueryParamsResponse": { - type: QueryParamsResponse, - fields: [{name: "params",kind: "message",message: {fields: [{name: "communityTax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "baseProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "bonusProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "withdrawAddrEnabled",kind: "scalar",scalarType: 8,},],type: Params},},], - }, - "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse": { - type: QueryValidatorDistributionInfoResponse, - fields: [{name: "selfBondRewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "commission",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse": { - type: QueryValidatorOutstandingRewardsResponse, - fields: [{name: "rewards",kind: "message",message: {fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ValidatorOutstandingRewards},},], - }, - "cosmos.distribution.v1beta1.QueryValidatorCommissionResponse": { - type: QueryValidatorCommissionResponse, - fields: [{name: "commission",kind: "message",message: {fields: [{name: "commission",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ValidatorAccumulatedCommission},},], - }, - "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse": { - type: QueryValidatorSlashesResponse, - fields: [{name: "slashes",kind: "list",message: {fields: [{name: "validatorPeriod",kind: "scalar",scalarType: 4,},{name: "fraction",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: ValidatorSlashEvent},},], - }, - "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse": { - type: QueryDelegationRewardsResponse, - fields: [{name: "rewards",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse": { - type: QueryDelegationTotalRewardsResponse, - fields: [{name: "rewards",kind: "list",message: {fields: [{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "reward",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: DelegationDelegatorReward},},{name: "total",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.QueryCommunityPoolResponse": { - type: QueryCommunityPoolResponse, - fields: [{name: "pool",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "cosmos.distribution.v1beta1.MsgUpdateParams": { - type: MsgUpdateParams, - fields: [{name: "params",kind: "message",message: {fields: [{name: "communityTax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "baseProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "bonusProposerReward",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "withdrawAddrEnabled",kind: "scalar",scalarType: 8,},],type: Params},},], - }, "cosmos.gov.v1beta1.WeightedVoteOption": { type: WeightedVoteOption, fields: [{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.gov.v1beta1.Vote": { - type: Vote, - fields: [{name: "options",kind: "list",message: {fields: [{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: WeightedVoteOption},},], - }, "cosmos.gov.v1beta1.TallyParams": { type: TallyParams, fields: [{name: "quorum",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "threshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "vetoThreshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},], }, - "cosmos.gov.v1beta1.GenesisState": { - type: GenesisState$1, - fields: [{name: "votes",kind: "list",message: {fields: [{name: "proposalId",kind: "scalar",scalarType: 4,},{name: "voter",kind: "scalar",scalarType: 9,},{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "options",kind: "list",message: {fields: [{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: WeightedVoteOption},},],type: Vote},},{name: "tallyParams",kind: "message",message: {fields: [{name: "quorum",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "threshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "vetoThreshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},],type: TallyParams},},], - }, - "cosmos.gov.v1beta1.QueryVoteResponse": { - type: QueryVoteResponse, - fields: [{name: "vote",kind: "message",message: {fields: [{name: "proposalId",kind: "scalar",scalarType: 4,},{name: "voter",kind: "scalar",scalarType: 9,},{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "options",kind: "list",message: {fields: [{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: WeightedVoteOption},},],type: Vote},},], - }, - "cosmos.gov.v1beta1.QueryVotesResponse": { - type: QueryVotesResponse, - fields: [{name: "votes",kind: "list",message: {fields: [{name: "proposalId",kind: "scalar",scalarType: 4,},{name: "voter",kind: "scalar",scalarType: 9,},{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "options",kind: "list",message: {fields: [{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: WeightedVoteOption},},],type: Vote},},], - }, - "cosmos.gov.v1beta1.QueryParamsResponse": { - type: QueryParamsResponse$1, - fields: [{name: "tallyParams",kind: "message",message: {fields: [{name: "quorum",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "threshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "vetoThreshold",kind: "scalar",scalarType: 12,customType: "LegacyDec",},],type: TallyParams},},], - }, - "cosmos.gov.v1beta1.MsgVoteWeighted": { - type: MsgVoteWeighted, - fields: [{name: "options",kind: "list",message: {fields: [{name: "option",kind: "enum",enum: ["UNSPECIFIED","YES","ABSTAIN","NO","NO_WITH_VETO"],},{name: "weight",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: WeightedVoteOption},},], - }, "cosmos.mint.v1beta1.Minter": { type: Minter, fields: [{name: "inflation",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "annualProvisions",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], @@ -187,14 +51,6 @@ const messageTypes: Record = { type: Params$1, fields: [{name: "inflationRateChange",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMin",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "goalBonded",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.mint.v1beta1.GenesisState": { - type: GenesisState$2, - fields: [{name: "minter",kind: "message",message: {fields: [{name: "inflation",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "annualProvisions",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Minter},},{name: "params",kind: "message",message: {fields: [{name: "mintDenom",kind: "scalar",scalarType: 9,},{name: "inflationRateChange",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMin",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "goalBonded",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "blocksPerYear",kind: "scalar",scalarType: 4,},],type: Params$1},},], - }, - "cosmos.mint.v1beta1.QueryParamsResponse": { - type: QueryParamsResponse$2, - fields: [{name: "params",kind: "message",message: {fields: [{name: "mintDenom",kind: "scalar",scalarType: 9,},{name: "inflationRateChange",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMin",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "goalBonded",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "blocksPerYear",kind: "scalar",scalarType: 4,},],type: Params$1},},], - }, "cosmos.mint.v1beta1.QueryInflationResponse": { type: QueryInflationResponse, fields: [{name: "inflation",kind: "scalar",scalarType: 12,customType: "LegacyDec",},], @@ -203,26 +59,10 @@ const messageTypes: Record = { type: QueryAnnualProvisionsResponse, fields: [{name: "annualProvisions",kind: "scalar",scalarType: 12,customType: "LegacyDec",},], }, - "cosmos.mint.v1beta1.MsgUpdateParams": { - type: MsgUpdateParams$1, - fields: [{name: "params",kind: "message",message: {fields: [{name: "mintDenom",kind: "scalar",scalarType: 9,},{name: "inflationRateChange",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMax",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "inflationMin",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "goalBonded",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "blocksPerYear",kind: "scalar",scalarType: 4,},],type: Params$1},},], - }, "cosmos.protocolpool.v1.ContinuousFund": { type: ContinuousFund, fields: [{name: "percentage",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.protocolpool.v1.GenesisState": { - type: GenesisState$3, - fields: [{name: "continuousFunds",kind: "list",message: {fields: [{name: "recipient",kind: "scalar",scalarType: 9,},{name: "percentage",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "expiry",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: ContinuousFund},},], - }, - "cosmos.protocolpool.v1.QueryContinuousFundResponse": { - type: QueryContinuousFundResponse, - fields: [{name: "continuousFund",kind: "message",message: {fields: [{name: "recipient",kind: "scalar",scalarType: 9,},{name: "percentage",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "expiry",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: ContinuousFund},},], - }, - "cosmos.protocolpool.v1.QueryContinuousFundsResponse": { - type: QueryContinuousFundsResponse, - fields: [{name: "continuousFunds",kind: "list",message: {fields: [{name: "recipient",kind: "scalar",scalarType: 9,},{name: "percentage",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "expiry",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: ContinuousFund},},], - }, "cosmos.protocolpool.v1.MsgCreateContinuousFund": { type: MsgCreateContinuousFund, fields: [{name: "percentage",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], @@ -231,29 +71,9 @@ const messageTypes: Record = { type: Params$2, fields: [{name: "minSignedPerWindow",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "slashFractionDoubleSign",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "slashFractionDowntime",kind: "scalar",scalarType: 12,customType: "LegacyDec",},], }, - "cosmos.slashing.v1beta1.GenesisState": { - type: GenesisState$4, - fields: [{name: "params",kind: "message",message: {fields: [{name: "signedBlocksWindow",kind: "scalar",scalarType: 3,},{name: "minSignedPerWindow",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "downtimeJailDuration",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "slashFractionDoubleSign",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "slashFractionDowntime",kind: "scalar",scalarType: 12,customType: "LegacyDec",},],type: Params$2},},], - }, - "cosmos.slashing.v1beta1.QueryParamsResponse": { - type: QueryParamsResponse$3, - fields: [{name: "params",kind: "message",message: {fields: [{name: "signedBlocksWindow",kind: "scalar",scalarType: 3,},{name: "minSignedPerWindow",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "downtimeJailDuration",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "slashFractionDoubleSign",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "slashFractionDowntime",kind: "scalar",scalarType: 12,customType: "LegacyDec",},],type: Params$2},},], - }, - "cosmos.slashing.v1beta1.MsgUpdateParams": { - type: MsgUpdateParams$2, - fields: [{name: "params",kind: "message",message: {fields: [{name: "signedBlocksWindow",kind: "scalar",scalarType: 3,},{name: "minSignedPerWindow",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "downtimeJailDuration",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "slashFractionDoubleSign",kind: "scalar",scalarType: 12,customType: "LegacyDec",},{name: "slashFractionDowntime",kind: "scalar",scalarType: 12,customType: "LegacyDec",},],type: Params$2},},], - }, - "cosmos.staking.v1beta1.HistoricalInfo": { - type: HistoricalInfo, - fields: [{name: "valset",kind: "list",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},], - }, "cosmos.staking.v1beta1.Validator": { type: Validator, - fields: [{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},], - }, - "cosmos.staking.v1beta1.Commission": { - type: Commission, - fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},], + fields: [{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, "cosmos.staking.v1beta1.CommissionRates": { type: CommissionRates, @@ -267,82 +87,14 @@ const messageTypes: Record = { type: RedelegationEntry, fields: [{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.staking.v1beta1.Redelegation": { - type: Redelegation, - fields: [{name: "entries",kind: "list",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},], - }, "cosmos.staking.v1beta1.Params": { type: Params$3, fields: [{name: "minCommissionRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.staking.v1beta1.DelegationResponse": { - type: DelegationResponse, - fields: [{name: "delegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "shares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Delegation},},], - }, - "cosmos.staking.v1beta1.RedelegationEntryResponse": { - type: RedelegationEntryResponse, - fields: [{name: "redelegationEntry",kind: "message",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},], - }, - "cosmos.staking.v1beta1.RedelegationResponse": { - type: RedelegationResponse, - fields: [{name: "redelegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorSrcAddress",kind: "scalar",scalarType: 9,},{name: "validatorDstAddress",kind: "scalar",scalarType: 9,},{name: "entries",kind: "list",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},],type: Redelegation},},{name: "entries",kind: "list",message: {fields: [{name: "redelegationEntry",kind: "message",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},{name: "balance",kind: "scalar",scalarType: 9,},],type: RedelegationEntryResponse},},], - }, - "cosmos.staking.v1beta1.GenesisState": { - type: GenesisState$5, - fields: [{name: "params",kind: "message",message: {fields: [{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "maxValidators",kind: "scalar",scalarType: 13,},{name: "maxEntries",kind: "scalar",scalarType: 13,},{name: "historicalEntries",kind: "scalar",scalarType: 13,},{name: "bondDenom",kind: "scalar",scalarType: 9,},{name: "minCommissionRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Params$3},},{name: "validators",kind: "list",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},{name: "delegations",kind: "list",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "shares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Delegation},},{name: "redelegations",kind: "list",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorSrcAddress",kind: "scalar",scalarType: 9,},{name: "validatorDstAddress",kind: "scalar",scalarType: 9,},{name: "entries",kind: "list",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},],type: Redelegation},},], - }, - "cosmos.staking.v1beta1.QueryValidatorsResponse": { - type: QueryValidatorsResponse, - fields: [{name: "validators",kind: "list",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},], - }, - "cosmos.staking.v1beta1.QueryValidatorResponse": { - type: QueryValidatorResponse, - fields: [{name: "validator",kind: "message",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},], - }, - "cosmos.staking.v1beta1.QueryValidatorDelegationsResponse": { - type: QueryValidatorDelegationsResponse, - fields: [{name: "delegationResponses",kind: "list",message: {fields: [{name: "delegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "shares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Delegation},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: DelegationResponse},},], - }, - "cosmos.staking.v1beta1.QueryDelegationResponse": { - type: QueryDelegationResponse, - fields: [{name: "delegationResponse",kind: "message",message: {fields: [{name: "delegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "shares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Delegation},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: DelegationResponse},},], - }, - "cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse": { - type: QueryDelegatorDelegationsResponse, - fields: [{name: "delegationResponses",kind: "list",message: {fields: [{name: "delegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorAddress",kind: "scalar",scalarType: 9,},{name: "shares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Delegation},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: DelegationResponse},},], - }, - "cosmos.staking.v1beta1.QueryRedelegationsResponse": { - type: QueryRedelegationsResponse, - fields: [{name: "redelegationResponses",kind: "list",message: {fields: [{name: "redelegation",kind: "message",message: {fields: [{name: "delegatorAddress",kind: "scalar",scalarType: 9,},{name: "validatorSrcAddress",kind: "scalar",scalarType: 9,},{name: "validatorDstAddress",kind: "scalar",scalarType: 9,},{name: "entries",kind: "list",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},],type: Redelegation},},{name: "entries",kind: "list",message: {fields: [{name: "redelegationEntry",kind: "message",message: {fields: [{name: "creationHeight",kind: "scalar",scalarType: 3,},{name: "completionTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "initialBalance",kind: "scalar",scalarType: 9,},{name: "sharesDst",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "unbondingId",kind: "scalar",scalarType: 4,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},],type: RedelegationEntry},},{name: "balance",kind: "scalar",scalarType: 9,},],type: RedelegationEntryResponse},},],type: RedelegationResponse},},], - }, - "cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse": { - type: QueryDelegatorValidatorsResponse, - fields: [{name: "validators",kind: "list",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},], - }, - "cosmos.staking.v1beta1.QueryDelegatorValidatorResponse": { - type: QueryDelegatorValidatorResponse, - fields: [{name: "validator",kind: "message",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},], - }, - "cosmos.staking.v1beta1.QueryHistoricalInfoResponse": { - type: QueryHistoricalInfoResponse, - fields: [{name: "hist",kind: "message",message: {fields: [{name: "header",kind: "message",message: {fields: [{name: "version",kind: "message",message: {fields: [{name: "block",kind: "scalar",scalarType: 4,},{name: "app",kind: "scalar",scalarType: 4,},],type: Consensus},},{name: "chainId",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "time",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "lastBlockId",kind: "message",message: {fields: [{name: "hash",kind: "scalar",scalarType: 12,},{name: "partSetHeader",kind: "message",message: {fields: [{name: "total",kind: "scalar",scalarType: 13,},{name: "hash",kind: "scalar",scalarType: 12,},],type: PartSetHeader},},],type: BlockID},},{name: "lastCommitHash",kind: "scalar",scalarType: 12,},{name: "dataHash",kind: "scalar",scalarType: 12,},{name: "validatorsHash",kind: "scalar",scalarType: 12,},{name: "nextValidatorsHash",kind: "scalar",scalarType: 12,},{name: "consensusHash",kind: "scalar",scalarType: 12,},{name: "appHash",kind: "scalar",scalarType: 12,},{name: "lastResultsHash",kind: "scalar",scalarType: 12,},{name: "evidenceHash",kind: "scalar",scalarType: 12,},{name: "proposerAddress",kind: "scalar",scalarType: 12,},],type: Header},},{name: "valset",kind: "list",message: {fields: [{name: "operatorAddress",kind: "scalar",scalarType: 9,},{name: "consensusPubkey",kind: "message",message: {fields: [{name: "typeUrl",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 12,},],type: Any},},{name: "jailed",kind: "scalar",scalarType: 8,},{name: "status",kind: "enum",enum: ["UNSPECIFIED","UNBONDED","UNBONDING","BONDED"],},{name: "tokens",kind: "scalar",scalarType: 9,},{name: "delegatorShares",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "description",kind: "message",message: {fields: [{name: "moniker",kind: "scalar",scalarType: 9,},{name: "identity",kind: "scalar",scalarType: 9,},{name: "website",kind: "scalar",scalarType: 9,},{name: "securityContact",kind: "scalar",scalarType: 9,},{name: "details",kind: "scalar",scalarType: 9,},],type: Description},},{name: "unbondingHeight",kind: "scalar",scalarType: 3,},{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "commission",kind: "message",message: {fields: [{name: "commissionRates",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},{name: "updateTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: Commission},},{name: "minSelfDelegation",kind: "scalar",scalarType: 9,},{name: "unbondingOnHoldRefCount",kind: "scalar",scalarType: 3,},{name: "unbondingIds",kind: "list",},],type: Validator},},],type: HistoricalInfo},},], - }, - "cosmos.staking.v1beta1.QueryParamsResponse": { - type: QueryParamsResponse$4, - fields: [{name: "params",kind: "message",message: {fields: [{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "maxValidators",kind: "scalar",scalarType: 13,},{name: "maxEntries",kind: "scalar",scalarType: 13,},{name: "historicalEntries",kind: "scalar",scalarType: 13,},{name: "bondDenom",kind: "scalar",scalarType: 9,},{name: "minCommissionRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Params$3},},], - }, - "cosmos.staking.v1beta1.MsgCreateValidator": { - type: MsgCreateValidator, - fields: [{name: "commission",kind: "message",message: {fields: [{name: "rate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxChangeRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CommissionRates},},], - }, "cosmos.staking.v1beta1.MsgEditValidator": { type: MsgEditValidator, fields: [{name: "commissionRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "cosmos.staking.v1beta1.MsgUpdateParams": { - type: MsgUpdateParams$3, - fields: [{name: "params",kind: "message",message: {fields: [{name: "unbondingTime",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Duration},},{name: "maxValidators",kind: "scalar",scalarType: 13,},{name: "maxEntries",kind: "scalar",scalarType: 13,},{name: "historicalEntries",kind: "scalar",scalarType: 13,},{name: "bondDenom",kind: "scalar",scalarType: 9,},{name: "minCommissionRate",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Params$3},},], - }, }; describe("cosmosCustomTypePatches.ts", () => { describe.each(Object.entries(patches))('patch %s', (typeName, patch: TypePatches[keyof TypePatches]) => { diff --git a/ts/src/generated/patches/cosmosCustomTypePatches.ts b/ts/src/generated/patches/cosmosCustomTypePatches.ts index b56d9353..18a4828f 100644 --- a/ts/src/generated/patches/cosmosCustomTypePatches.ts +++ b/ts/src/generated/patches/cosmosCustomTypePatches.ts @@ -1,29 +1,14 @@ import { LegacyDec } from "../../encoding/customTypes/LegacyDec.ts"; import type * as _protos_cosmos_base_v1beta1_coin from "../protos/cosmos/base/v1beta1/coin.ts"; import type * as _protos_cosmos_distribution_v1beta1_distribution from "../protos/cosmos/distribution/v1beta1/distribution.ts"; -import type * as _protos_cosmos_distribution_v1beta1_genesis from "../protos/cosmos/distribution/v1beta1/genesis.ts"; -import type * as _protos_cosmos_distribution_v1beta1_query from "../protos/cosmos/distribution/v1beta1/query.ts"; -import type * as _protos_cosmos_distribution_v1beta1_tx from "../protos/cosmos/distribution/v1beta1/tx.ts"; import type * as _protos_cosmos_gov_v1beta1_gov from "../protos/cosmos/gov/v1beta1/gov.ts"; import { encodeBinary, decodeBinary } from "../../encoding/binaryEncoding.ts"; -import type * as _protos_cosmos_gov_v1beta1_genesis from "../protos/cosmos/gov/v1beta1/genesis.ts"; -import type * as _protos_cosmos_gov_v1beta1_query from "../protos/cosmos/gov/v1beta1/query.ts"; -import type * as _protos_cosmos_gov_v1beta1_tx from "../protos/cosmos/gov/v1beta1/tx.ts"; import type * as _protos_cosmos_mint_v1beta1_mint from "../protos/cosmos/mint/v1beta1/mint.ts"; -import type * as _protos_cosmos_mint_v1beta1_genesis from "../protos/cosmos/mint/v1beta1/genesis.ts"; import type * as _protos_cosmos_mint_v1beta1_query from "../protos/cosmos/mint/v1beta1/query.ts"; -import type * as _protos_cosmos_mint_v1beta1_tx from "../protos/cosmos/mint/v1beta1/tx.ts"; import type * as _protos_cosmos_protocolpool_v1_types from "../protos/cosmos/protocolpool/v1/types.ts"; -import type * as _protos_cosmos_protocolpool_v1_genesis from "../protos/cosmos/protocolpool/v1/genesis.ts"; -import type * as _protos_cosmos_protocolpool_v1_query from "../protos/cosmos/protocolpool/v1/query.ts"; import type * as _protos_cosmos_protocolpool_v1_tx from "../protos/cosmos/protocolpool/v1/tx.ts"; import type * as _protos_cosmos_slashing_v1beta1_slashing from "../protos/cosmos/slashing/v1beta1/slashing.ts"; -import type * as _protos_cosmos_slashing_v1beta1_genesis from "../protos/cosmos/slashing/v1beta1/genesis.ts"; -import type * as _protos_cosmos_slashing_v1beta1_query from "../protos/cosmos/slashing/v1beta1/query.ts"; -import type * as _protos_cosmos_slashing_v1beta1_tx from "../protos/cosmos/slashing/v1beta1/tx.ts"; import type * as _protos_cosmos_staking_v1beta1_staking from "../protos/cosmos/staking/v1beta1/staking.ts"; -import type * as _protos_cosmos_staking_v1beta1_genesis from "../protos/cosmos/staking/v1beta1/genesis.ts"; -import type * as _protos_cosmos_staking_v1beta1_query from "../protos/cosmos/staking/v1beta1/query.ts"; import type * as _protos_cosmos_staking_v1beta1_tx from "../protos/cosmos/staking/v1beta1/tx.ts"; const p = { @@ -47,177 +32,24 @@ const p = { if (value.bonusProposerReward != null) newValue.bonusProposerReward = LegacyDec[transformType](value.bonusProposerReward); return newValue; }, - "cosmos.distribution.v1beta1.ValidatorHistoricalRewards"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorHistoricalRewards | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.cumulativeRewardRatio) newValue.cumulativeRewardRatio = value.cumulativeRewardRatio.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorCurrentRewards"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorCurrentRewards | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards) newValue.rewards = value.rewards.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorAccumulatedCommission | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.commission) newValue.commission = value.commission.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorOutstandingRewards"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorOutstandingRewards | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards) newValue.rewards = value.rewards.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, "cosmos.distribution.v1beta1.ValidatorSlashEvent"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorSlashEvent | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.fraction != null) newValue.fraction = LegacyDec[transformType](value.fraction); return newValue; }, - "cosmos.distribution.v1beta1.ValidatorSlashEvents"(value: _protos_cosmos_distribution_v1beta1_distribution.ValidatorSlashEvents | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validatorSlashEvents) newValue.validatorSlashEvents = value.validatorSlashEvents.map((item) => p["cosmos.distribution.v1beta1.ValidatorSlashEvent"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.FeePool"(value: _protos_cosmos_distribution_v1beta1_distribution.FeePool | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.communityPool) newValue.communityPool = value.communityPool.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, "cosmos.distribution.v1beta1.DelegatorStartingInfo"(value: _protos_cosmos_distribution_v1beta1_distribution.DelegatorStartingInfo | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.stake != null) newValue.stake = LegacyDec[transformType](value.stake); return newValue; }, - "cosmos.distribution.v1beta1.DelegationDelegatorReward"(value: _protos_cosmos_distribution_v1beta1_distribution.DelegationDelegatorReward | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.reward) newValue.reward = value.reward.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.ValidatorOutstandingRewardsRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.outstandingRewards) newValue.outstandingRewards = value.outstandingRewards.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.ValidatorAccumulatedCommissionRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.accumulated != null) newValue.accumulated = p["cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"](value.accumulated, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.ValidatorHistoricalRewardsRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards != null) newValue.rewards = p["cosmos.distribution.v1beta1.ValidatorHistoricalRewards"](value.rewards, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.ValidatorCurrentRewardsRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards != null) newValue.rewards = p["cosmos.distribution.v1beta1.ValidatorCurrentRewards"](value.rewards, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.DelegatorStartingInfoRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.startingInfo != null) newValue.startingInfo = p["cosmos.distribution.v1beta1.DelegatorStartingInfo"](value.startingInfo, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.ValidatorSlashEventRecord"(value: _protos_cosmos_distribution_v1beta1_genesis.ValidatorSlashEventRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validatorSlashEvent != null) newValue.validatorSlashEvent = p["cosmos.distribution.v1beta1.ValidatorSlashEvent"](value.validatorSlashEvent, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.GenesisState"(value: _protos_cosmos_distribution_v1beta1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.distribution.v1beta1.Params"](value.params, transformType); - if (value.feePool != null) newValue.feePool = p["cosmos.distribution.v1beta1.FeePool"](value.feePool, transformType); - if (value.outstandingRewards) newValue.outstandingRewards = value.outstandingRewards.map((item) => p["cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord"](item, transformType)!); - if (value.validatorAccumulatedCommissions) newValue.validatorAccumulatedCommissions = value.validatorAccumulatedCommissions.map((item) => p["cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord"](item, transformType)!); - if (value.validatorHistoricalRewards) newValue.validatorHistoricalRewards = value.validatorHistoricalRewards.map((item) => p["cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord"](item, transformType)!); - if (value.validatorCurrentRewards) newValue.validatorCurrentRewards = value.validatorCurrentRewards.map((item) => p["cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord"](item, transformType)!); - if (value.delegatorStartingInfos) newValue.delegatorStartingInfos = value.delegatorStartingInfos.map((item) => p["cosmos.distribution.v1beta1.DelegatorStartingInfoRecord"](item, transformType)!); - if (value.validatorSlashEvents) newValue.validatorSlashEvents = value.validatorSlashEvents.map((item) => p["cosmos.distribution.v1beta1.ValidatorSlashEventRecord"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryParamsResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryParamsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.distribution.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryValidatorDistributionInfoResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.selfBondRewards) newValue.selfBondRewards = value.selfBondRewards.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - if (value.commission) newValue.commission = value.commission.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryValidatorOutstandingRewardsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards != null) newValue.rewards = p["cosmos.distribution.v1beta1.ValidatorOutstandingRewards"](value.rewards, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryValidatorCommissionResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryValidatorCommissionResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.commission != null) newValue.commission = p["cosmos.distribution.v1beta1.ValidatorAccumulatedCommission"](value.commission, transformType); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryValidatorSlashesResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.slashes) newValue.slashes = value.slashes.map((item) => p["cosmos.distribution.v1beta1.ValidatorSlashEvent"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryDelegationRewardsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards) newValue.rewards = value.rewards.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryDelegationTotalRewardsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rewards) newValue.rewards = value.rewards.map((item) => p["cosmos.distribution.v1beta1.DelegationDelegatorReward"](item, transformType)!); - if (value.total) newValue.total = value.total.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.QueryCommunityPoolResponse"(value: _protos_cosmos_distribution_v1beta1_query.QueryCommunityPoolResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.pool) newValue.pool = value.pool.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - return newValue; - }, - "cosmos.distribution.v1beta1.MsgUpdateParams"(value: _protos_cosmos_distribution_v1beta1_tx.MsgUpdateParams | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.distribution.v1beta1.Params"](value.params, transformType); - return newValue; - }, "cosmos.gov.v1beta1.WeightedVoteOption"(value: _protos_cosmos_gov_v1beta1_gov.WeightedVoteOption | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.weight != null) newValue.weight = LegacyDec[transformType](value.weight); return newValue; }, - "cosmos.gov.v1beta1.Vote"(value: _protos_cosmos_gov_v1beta1_gov.Vote | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.options) newValue.options = value.options.map((item) => p["cosmos.gov.v1beta1.WeightedVoteOption"](item, transformType)!); - return newValue; - }, "cosmos.gov.v1beta1.TallyParams"(value: _protos_cosmos_gov_v1beta1_gov.TallyParams | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; @@ -226,37 +58,6 @@ const p = { if (value.vetoThreshold != null) newValue.vetoThreshold = encodeBinary(LegacyDec[transformType](decodeBinary(value.vetoThreshold))); return newValue; }, - "cosmos.gov.v1beta1.GenesisState"(value: _protos_cosmos_gov_v1beta1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.votes) newValue.votes = value.votes.map((item) => p["cosmos.gov.v1beta1.Vote"](item, transformType)!); - if (value.tallyParams != null) newValue.tallyParams = p["cosmos.gov.v1beta1.TallyParams"](value.tallyParams, transformType); - return newValue; - }, - "cosmos.gov.v1beta1.QueryVoteResponse"(value: _protos_cosmos_gov_v1beta1_query.QueryVoteResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.vote != null) newValue.vote = p["cosmos.gov.v1beta1.Vote"](value.vote, transformType); - return newValue; - }, - "cosmos.gov.v1beta1.QueryVotesResponse"(value: _protos_cosmos_gov_v1beta1_query.QueryVotesResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.votes) newValue.votes = value.votes.map((item) => p["cosmos.gov.v1beta1.Vote"](item, transformType)!); - return newValue; - }, - "cosmos.gov.v1beta1.QueryParamsResponse"(value: _protos_cosmos_gov_v1beta1_query.QueryParamsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.tallyParams != null) newValue.tallyParams = p["cosmos.gov.v1beta1.TallyParams"](value.tallyParams, transformType); - return newValue; - }, - "cosmos.gov.v1beta1.MsgVoteWeighted"(value: _protos_cosmos_gov_v1beta1_tx.MsgVoteWeighted | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.options) newValue.options = value.options.map((item) => p["cosmos.gov.v1beta1.WeightedVoteOption"](item, transformType)!); - return newValue; - }, "cosmos.mint.v1beta1.Minter"(value: _protos_cosmos_mint_v1beta1_mint.Minter | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; @@ -273,19 +74,6 @@ const p = { if (value.goalBonded != null) newValue.goalBonded = LegacyDec[transformType](value.goalBonded); return newValue; }, - "cosmos.mint.v1beta1.GenesisState"(value: _protos_cosmos_mint_v1beta1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.minter != null) newValue.minter = p["cosmos.mint.v1beta1.Minter"](value.minter, transformType); - if (value.params != null) newValue.params = p["cosmos.mint.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.mint.v1beta1.QueryParamsResponse"(value: _protos_cosmos_mint_v1beta1_query.QueryParamsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.mint.v1beta1.Params"](value.params, transformType); - return newValue; - }, "cosmos.mint.v1beta1.QueryInflationResponse"(value: _protos_cosmos_mint_v1beta1_query.QueryInflationResponse | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; @@ -298,36 +86,12 @@ const p = { if (value.annualProvisions != null) newValue.annualProvisions = encodeBinary(LegacyDec[transformType](decodeBinary(value.annualProvisions))); return newValue; }, - "cosmos.mint.v1beta1.MsgUpdateParams"(value: _protos_cosmos_mint_v1beta1_tx.MsgUpdateParams | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.mint.v1beta1.Params"](value.params, transformType); - return newValue; - }, "cosmos.protocolpool.v1.ContinuousFund"(value: _protos_cosmos_protocolpool_v1_types.ContinuousFund | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.percentage != null) newValue.percentage = LegacyDec[transformType](value.percentage); return newValue; }, - "cosmos.protocolpool.v1.GenesisState"(value: _protos_cosmos_protocolpool_v1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.continuousFunds) newValue.continuousFunds = value.continuousFunds.map((item) => p["cosmos.protocolpool.v1.ContinuousFund"](item, transformType)!); - return newValue; - }, - "cosmos.protocolpool.v1.QueryContinuousFundResponse"(value: _protos_cosmos_protocolpool_v1_query.QueryContinuousFundResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.continuousFund != null) newValue.continuousFund = p["cosmos.protocolpool.v1.ContinuousFund"](value.continuousFund, transformType); - return newValue; - }, - "cosmos.protocolpool.v1.QueryContinuousFundsResponse"(value: _protos_cosmos_protocolpool_v1_query.QueryContinuousFundsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.continuousFunds) newValue.continuousFunds = value.continuousFunds.map((item) => p["cosmos.protocolpool.v1.ContinuousFund"](item, transformType)!); - return newValue; - }, "cosmos.protocolpool.v1.MsgCreateContinuousFund"(value: _protos_cosmos_protocolpool_v1_tx.MsgCreateContinuousFund | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; @@ -342,41 +106,10 @@ const p = { if (value.slashFractionDowntime != null) newValue.slashFractionDowntime = encodeBinary(LegacyDec[transformType](decodeBinary(value.slashFractionDowntime))); return newValue; }, - "cosmos.slashing.v1beta1.GenesisState"(value: _protos_cosmos_slashing_v1beta1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.slashing.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.slashing.v1beta1.QueryParamsResponse"(value: _protos_cosmos_slashing_v1beta1_query.QueryParamsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.slashing.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.slashing.v1beta1.MsgUpdateParams"(value: _protos_cosmos_slashing_v1beta1_tx.MsgUpdateParams | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.slashing.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.HistoricalInfo"(value: _protos_cosmos_staking_v1beta1_staking.HistoricalInfo | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.valset) newValue.valset = value.valset.map((item) => p["cosmos.staking.v1beta1.Validator"](item, transformType)!); - return newValue; - }, "cosmos.staking.v1beta1.Validator"(value: _protos_cosmos_staking_v1beta1_staking.Validator | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.delegatorShares != null) newValue.delegatorShares = LegacyDec[transformType](value.delegatorShares); - if (value.commission != null) newValue.commission = p["cosmos.staking.v1beta1.Commission"](value.commission, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.Commission"(value: _protos_cosmos_staking_v1beta1_staking.Commission | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.commissionRates != null) newValue.commissionRates = p["cosmos.staking.v1beta1.CommissionRates"](value.commissionRates, transformType); return newValue; }, "cosmos.staking.v1beta1.CommissionRates"(value: _protos_cosmos_staking_v1beta1_staking.CommissionRates | undefined | null, transformType: 'encode' | 'decode') { @@ -399,123 +132,17 @@ const p = { if (value.sharesDst != null) newValue.sharesDst = LegacyDec[transformType](value.sharesDst); return newValue; }, - "cosmos.staking.v1beta1.Redelegation"(value: _protos_cosmos_staking_v1beta1_staking.Redelegation | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.entries) newValue.entries = value.entries.map((item) => p["cosmos.staking.v1beta1.RedelegationEntry"](item, transformType)!); - return newValue; - }, "cosmos.staking.v1beta1.Params"(value: _protos_cosmos_staking_v1beta1_staking.Params | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.minCommissionRate != null) newValue.minCommissionRate = LegacyDec[transformType](value.minCommissionRate); return newValue; }, - "cosmos.staking.v1beta1.DelegationResponse"(value: _protos_cosmos_staking_v1beta1_staking.DelegationResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.delegation != null) newValue.delegation = p["cosmos.staking.v1beta1.Delegation"](value.delegation, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.RedelegationEntryResponse"(value: _protos_cosmos_staking_v1beta1_staking.RedelegationEntryResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.redelegationEntry != null) newValue.redelegationEntry = p["cosmos.staking.v1beta1.RedelegationEntry"](value.redelegationEntry, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.RedelegationResponse"(value: _protos_cosmos_staking_v1beta1_staking.RedelegationResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.redelegation != null) newValue.redelegation = p["cosmos.staking.v1beta1.Redelegation"](value.redelegation, transformType); - if (value.entries) newValue.entries = value.entries.map((item) => p["cosmos.staking.v1beta1.RedelegationEntryResponse"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.GenesisState"(value: _protos_cosmos_staking_v1beta1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.staking.v1beta1.Params"](value.params, transformType); - if (value.validators) newValue.validators = value.validators.map((item) => p["cosmos.staking.v1beta1.Validator"](item, transformType)!); - if (value.delegations) newValue.delegations = value.delegations.map((item) => p["cosmos.staking.v1beta1.Delegation"](item, transformType)!); - if (value.redelegations) newValue.redelegations = value.redelegations.map((item) => p["cosmos.staking.v1beta1.Redelegation"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryValidatorsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryValidatorsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validators) newValue.validators = value.validators.map((item) => p["cosmos.staking.v1beta1.Validator"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryValidatorResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryValidatorResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validator != null) newValue.validator = p["cosmos.staking.v1beta1.Validator"](value.validator, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryValidatorDelegationsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.delegationResponses) newValue.delegationResponses = value.delegationResponses.map((item) => p["cosmos.staking.v1beta1.DelegationResponse"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryDelegationResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryDelegationResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.delegationResponse != null) newValue.delegationResponse = p["cosmos.staking.v1beta1.DelegationResponse"](value.delegationResponse, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryDelegatorDelegationsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.delegationResponses) newValue.delegationResponses = value.delegationResponses.map((item) => p["cosmos.staking.v1beta1.DelegationResponse"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryRedelegationsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryRedelegationsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.redelegationResponses) newValue.redelegationResponses = value.redelegationResponses.map((item) => p["cosmos.staking.v1beta1.RedelegationResponse"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryDelegatorValidatorsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validators) newValue.validators = value.validators.map((item) => p["cosmos.staking.v1beta1.Validator"](item, transformType)!); - return newValue; - }, - "cosmos.staking.v1beta1.QueryDelegatorValidatorResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryDelegatorValidatorResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.validator != null) newValue.validator = p["cosmos.staking.v1beta1.Validator"](value.validator, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.QueryHistoricalInfoResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryHistoricalInfoResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.hist != null) newValue.hist = p["cosmos.staking.v1beta1.HistoricalInfo"](value.hist, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.QueryParamsResponse"(value: _protos_cosmos_staking_v1beta1_query.QueryParamsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.staking.v1beta1.Params"](value.params, transformType); - return newValue; - }, - "cosmos.staking.v1beta1.MsgCreateValidator"(value: _protos_cosmos_staking_v1beta1_tx.MsgCreateValidator | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.commission != null) newValue.commission = p["cosmos.staking.v1beta1.CommissionRates"](value.commission, transformType); - return newValue; - }, "cosmos.staking.v1beta1.MsgEditValidator"(value: _protos_cosmos_staking_v1beta1_tx.MsgEditValidator | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.commissionRate != null) newValue.commissionRate = LegacyDec[transformType](value.commissionRate); return newValue; - }, - "cosmos.staking.v1beta1.MsgUpdateParams"(value: _protos_cosmos_staking_v1beta1_tx.MsgUpdateParams | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.params != null) newValue.params = p["cosmos.staking.v1beta1.Params"](value.params, transformType); - return newValue; } }; diff --git a/ts/src/generated/protos/cosmosPatchMessage.ts b/ts/src/generated/patches/cosmosPatchMessage.ts similarity index 88% rename from ts/src/generated/protos/cosmosPatchMessage.ts rename to ts/src/generated/patches/cosmosPatchMessage.ts index 41c6198f..550b507f 100644 --- a/ts/src/generated/protos/cosmosPatchMessage.ts +++ b/ts/src/generated/patches/cosmosPatchMessage.ts @@ -1,4 +1,4 @@ -import { patches } from "../patches/cosmosCustomTypePatches.ts"; +import { patches } from "./cosmosCustomTypePatches.ts"; import type { MessageDesc } from "../../sdk/client/types.ts"; export const patched = (messageDesc: T): T => { const patchMessage = patches[messageDesc.$type as keyof typeof patches] as any; diff --git a/ts/src/generated/patches/nodeCustomTypePatches.spec.ts b/ts/src/generated/patches/nodeCustomTypePatches.spec.ts index e3fba2e0..b47cae40 100644 --- a/ts/src/generated/patches/nodeCustomTypePatches.spec.ts +++ b/ts/src/generated/patches/nodeCustomTypePatches.spec.ts @@ -1,250 +1,20 @@ -import { BurnMintPair, CoinPrice, CollateralRatio, LedgerPendingRecord, LedgerRecord, LedgerRecordID } from "../protos/akash/bme/v1/types.ts"; -import { Coin, DecCoin } from "../protos/cosmos/base/v1beta1/coin.ts"; -import { EventMintStatusChange } from "../protos/akash/bme/v1/events.ts"; -import { GenesisLedgerPendingRecord, GenesisLedgerRecord, GenesisLedgerState, GenesisState } from "../protos/akash/bme/v1/genesis.ts"; -import { QueryStatusResponse } from "../protos/akash/bme/v1/query.ts"; -import { ResourceUnit } from "../protos/akash/deployment/v1beta4/resourceunit.ts"; -import { GroupSpec } from "../protos/akash/deployment/v1beta4/groupspec.ts"; -import { ResourceValue } from "../protos/akash/base/resources/v1beta4/resourcevalue.ts"; -import { Attribute, PlacementRequirements, SignedBy } from "../protos/akash/base/attributes/v1/attribute.ts"; -import { CPU } from "../protos/akash/base/resources/v1beta4/cpu.ts"; -import { Memory } from "../protos/akash/base/resources/v1beta4/memory.ts"; -import { Storage } from "../protos/akash/base/resources/v1beta4/storage.ts"; -import { GPU } from "../protos/akash/base/resources/v1beta4/gpu.ts"; -import { Endpoint } from "../protos/akash/base/resources/v1beta4/endpoint.ts"; -import { Resources } from "../protos/akash/base/resources/v1beta4/resources.ts"; -import { MsgCreateDeployment } from "../protos/akash/deployment/v1beta4/deploymentmsg.ts"; -import { Group } from "../protos/akash/deployment/v1beta4/group.ts"; -import { GenesisDeployment, GenesisState as GenesisState$1 } from "../protos/akash/deployment/v1beta4/genesis.ts"; -import { GroupID } from "../protos/akash/deployment/v1/group.ts"; -import { Deployment, DeploymentID } from "../protos/akash/deployment/v1/deployment.ts"; +import { DecCoin } from "../protos/cosmos/base/v1beta1/coin.ts"; import { Balance } from "../protos/akash/escrow/types/v1/balance.ts"; -import { Depositor } from "../protos/akash/escrow/types/v1/deposit.ts"; -import { Account, AccountState } from "../protos/akash/escrow/types/v1/account.ts"; -import { QueryDeploymentResponse, QueryDeploymentsResponse, QueryGroupResponse } from "../protos/akash/deployment/v1beta4/query.ts"; -import { Account as Account$1, Payment as Payment$1 } from "../protos/akash/escrow/id/v1/id.ts"; -import { Payment, PaymentState } from "../protos/akash/escrow/types/v1/payment.ts"; -import { GenesisState as GenesisState$2 } from "../protos/akash/escrow/v1/genesis.ts"; -import { QueryAccountsResponse, QueryPaymentsResponse } from "../protos/akash/escrow/v1/query.ts"; -import { Lease, LeaseID } from "../protos/akash/market/v1/lease.ts"; -import { EventBidCreated, EventLeaseCreated } from "../protos/akash/market/v1/event.ts"; -import { Bid } from "../protos/akash/market/v1beta5/bid.ts"; -import { MsgCreateBid } from "../protos/akash/market/v1beta5/bidmsg.ts"; -import { Order } from "../protos/akash/market/v1beta5/order.ts"; -import { GenesisState as GenesisState$3 } from "../protos/akash/market/v1beta5/genesis.ts"; -import { OrderID } from "../protos/akash/market/v1/order.ts"; -import { BidID } from "../protos/akash/market/v1/bid.ts"; -import { ResourceOffer } from "../protos/akash/market/v1beta5/resourcesoffer.ts"; -import { QueryBidResponse, QueryBidsResponse, QueryLeaseResponse, QueryLeasesResponse, QueryOrderResponse, QueryOrdersResponse } from "../protos/akash/market/v1beta5/query.ts"; -import { AggregatedPrice, PriceData, PriceDataRecordID, PriceDataState, QueryPricesResponse } from "../protos/akash/oracle/v1/prices.ts"; -import { Timestamp } from "../protos/google/protobuf/timestamp.ts"; -import { EventPriceData } from "../protos/akash/oracle/v1/events.ts"; -import { GenesisState as GenesisState$4 } from "../protos/akash/oracle/v1/genesis.ts"; -import { MsgAddPriceEntry } from "../protos/akash/oracle/v1/msgs.ts"; -import { QueryAggregatedPriceResponse } from "../protos/akash/oracle/v1/query.ts"; import { expect, describe, it } from "@jest/globals"; import { patches } from "./nodeCustomTypePatches.ts"; import { generateMessage, type MessageSchema } from "@test/helpers/generateMessage"; -import type { TypePatches } from "../../sdk/client/applyPatches.ts"; +import type { TypePatches } from "../../sdk/client/types.ts"; const messageTypes: Record = { - "akash.bme.v1.CollateralRatio": { - type: CollateralRatio, - fields: [{name: "ratio",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "referencePrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.bme.v1.CoinPrice": { - type: CoinPrice, - fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.bme.v1.BurnMintPair": { - type: BurnMintPair, - fields: [{name: "burned",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "minted",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},], - }, - "akash.bme.v1.LedgerRecord": { - type: LedgerRecord, - fields: [{name: "burned",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "minted",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditIssued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditAccrued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},], - }, - "akash.bme.v1.EventMintStatusChange": { - type: EventMintStatusChange, - fields: [{name: "collateralRatio",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.bme.v1.GenesisLedgerRecord": { - type: GenesisLedgerRecord, - fields: [{name: "record",kind: "message",message: {fields: [{name: "burnedFrom",kind: "scalar",scalarType: 9,},{name: "mintedTo",kind: "scalar",scalarType: 9,},{name: "burner",kind: "scalar",scalarType: 9,},{name: "minter",kind: "scalar",scalarType: 9,},{name: "burned",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "minted",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditIssued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditAccrued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},],type: LedgerRecord},},], - }, - "akash.bme.v1.GenesisLedgerState": { - type: GenesisLedgerState, - fields: [{name: "records",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "toDenom",kind: "scalar",scalarType: 9,},{name: "source",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "sequence",kind: "scalar",scalarType: 3,},],type: LedgerRecordID},},{name: "record",kind: "message",message: {fields: [{name: "burnedFrom",kind: "scalar",scalarType: 9,},{name: "mintedTo",kind: "scalar",scalarType: 9,},{name: "burner",kind: "scalar",scalarType: 9,},{name: "minter",kind: "scalar",scalarType: 9,},{name: "burned",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "minted",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditIssued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditAccrued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},],type: LedgerRecord},},],type: GenesisLedgerRecord},},], - }, - "akash.bme.v1.GenesisState": { - type: GenesisState, - fields: [{name: "ledger",kind: "message",message: {fields: [{name: "records",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "toDenom",kind: "scalar",scalarType: 9,},{name: "source",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "sequence",kind: "scalar",scalarType: 3,},],type: LedgerRecordID},},{name: "record",kind: "message",message: {fields: [{name: "burnedFrom",kind: "scalar",scalarType: 9,},{name: "mintedTo",kind: "scalar",scalarType: 9,},{name: "burner",kind: "scalar",scalarType: 9,},{name: "minter",kind: "scalar",scalarType: 9,},{name: "burned",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "minted",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditIssued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},{name: "remintCreditAccrued",kind: "message",message: {fields: [{name: "coin",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: CoinPrice},},],type: LedgerRecord},},],type: GenesisLedgerRecord},},{name: "pendingRecords",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "toDenom",kind: "scalar",scalarType: 9,},{name: "source",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "sequence",kind: "scalar",scalarType: 3,},],type: LedgerRecordID},},{name: "record",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "to",kind: "scalar",scalarType: 9,},{name: "coinsToBurn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},{name: "denomToMint",kind: "scalar",scalarType: 9,},],type: LedgerPendingRecord},},],type: GenesisLedgerPendingRecord},},],type: GenesisLedgerState},},], - }, - "akash.bme.v1.QueryStatusResponse": { - type: QueryStatusResponse, - fields: [{name: "collateralRatio",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "warnThreshold",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "haltThreshold",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.deployment.v1beta4.ResourceUnit": { - type: ResourceUnit, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, "cosmos.base.v1beta1.DecCoin": { type: DecCoin, fields: [{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "akash.deployment.v1beta4.GroupSpec": { - type: GroupSpec, - fields: [{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},], - }, - "akash.deployment.v1beta4.MsgCreateDeployment": { - type: MsgCreateDeployment, - fields: [{name: "groups",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},], - }, - "akash.deployment.v1beta4.Group": { - type: Group, - fields: [{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},], - }, - "akash.deployment.v1beta4.GenesisDeployment": { - type: GenesisDeployment, - fields: [{name: "groups",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},],type: GroupID},},{name: "state",kind: "enum",enum: ["invalid","open","paused","insufficient_funds","closed"],},{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Group},},], - }, - "akash.deployment.v1beta4.GenesisState": { - type: GenesisState$1, - fields: [{name: "deployments",kind: "list",message: {fields: [{name: "deployment",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},],type: DeploymentID},},{name: "state",kind: "enum",enum: ["invalid","active","closed"],},{name: "hash",kind: "scalar",scalarType: 12,},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Deployment},},{name: "groups",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},],type: GroupID},},{name: "state",kind: "enum",enum: ["invalid","open","paused","insufficient_funds","closed"],},{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Group},},],type: GenesisDeployment},},], - }, "akash.escrow.types.v1.Balance": { type: Balance, fields: [{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], }, - "akash.escrow.types.v1.Depositor": { - type: Depositor, - fields: [{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.escrow.types.v1.AccountState": { - type: AccountState, - fields: [{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},], - }, - "akash.escrow.types.v1.Account": { - type: Account, - fields: [{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},], - }, - "akash.deployment.v1beta4.QueryDeploymentsResponse": { - type: QueryDeploymentsResponse, - fields: [{name: "deployments",kind: "list",message: {fields: [{name: "deployment",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},],type: DeploymentID},},{name: "state",kind: "enum",enum: ["invalid","active","closed"],},{name: "hash",kind: "scalar",scalarType: 12,},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Deployment},},{name: "groups",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},],type: GroupID},},{name: "state",kind: "enum",enum: ["invalid","open","paused","insufficient_funds","closed"],},{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Group},},{name: "escrowAccount",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},],type: QueryDeploymentResponse},},], - }, - "akash.deployment.v1beta4.QueryDeploymentResponse": { - type: QueryDeploymentResponse, - fields: [{name: "groups",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},],type: GroupID},},{name: "state",kind: "enum",enum: ["invalid","open","paused","insufficient_funds","closed"],},{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Group},},{name: "escrowAccount",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},], - }, - "akash.deployment.v1beta4.QueryGroupResponse": { - type: QueryGroupResponse, - fields: [{name: "group",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},],type: GroupID},},{name: "state",kind: "enum",enum: ["invalid","open","paused","insufficient_funds","closed"],},{name: "groupSpec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Group},},], - }, - "akash.escrow.types.v1.PaymentState": { - type: PaymentState, - fields: [{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.escrow.types.v1.Payment": { - type: Payment, - fields: [{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "withdrawn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: PaymentState},},], - }, - "akash.escrow.v1.GenesisState": { - type: GenesisState$2, - fields: [{name: "accounts",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},{name: "payments",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "aid",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "xid",kind: "scalar",scalarType: 9,},],type: Payment$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "withdrawn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: PaymentState},},],type: Payment},},], - }, - "akash.escrow.v1.QueryAccountsResponse": { - type: QueryAccountsResponse, - fields: [{name: "accounts",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},], - }, - "akash.escrow.v1.QueryPaymentsResponse": { - type: QueryPaymentsResponse, - fields: [{name: "payments",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "aid",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "xid",kind: "scalar",scalarType: 9,},],type: Payment$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "withdrawn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: PaymentState},},],type: Payment},},], - }, - "akash.market.v1.Lease": { - type: Lease, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.market.v1.EventBidCreated": { - type: EventBidCreated, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.market.v1.EventLeaseCreated": { - type: EventLeaseCreated, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.market.v1beta5.Bid": { - type: Bid, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.market.v1beta5.MsgCreateBid": { - type: MsgCreateBid, - fields: [{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},], - }, - "akash.market.v1beta5.Order": { - type: Order, - fields: [{name: "spec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},], - }, - "akash.market.v1beta5.GenesisState": { - type: GenesisState$3, - fields: [{name: "orders",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},],type: OrderID},},{name: "state",kind: "enum",enum: ["invalid","open","active","closed"],},{name: "spec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Order},},{name: "leases",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: LeaseID},},{name: "state",kind: "enum",enum: ["invalid","active","insufficient_funds","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "closedOn",kind: "scalar",scalarType: 3,},{name: "reason",kind: "enum",enum: ["lease_closed_invalid","lease_closed_owner","lease_closed_reason_unstable","lease_closed_reason_decommission","lease_closed_reason_unspecified","lease_closed_reason_manifest_timeout","lease_closed_reason_insufficient_funds"],},],type: Lease},},{name: "bids",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: BidID},},{name: "state",kind: "enum",enum: ["invalid","open","active","lost","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "resourcesOffer",kind: "list",message: {fields: [{name: "resources",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},],type: ResourceOffer},},],type: Bid},},], - }, - "akash.market.v1beta5.QueryOrdersResponse": { - type: QueryOrdersResponse, - fields: [{name: "orders",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},],type: OrderID},},{name: "state",kind: "enum",enum: ["invalid","open","active","closed"],},{name: "spec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Order},},], - }, - "akash.market.v1beta5.QueryOrderResponse": { - type: QueryOrderResponse, - fields: [{name: "order",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},],type: OrderID},},{name: "state",kind: "enum",enum: ["invalid","open","active","closed"],},{name: "spec",kind: "message",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "requirements",kind: "message",message: {fields: [{name: "signedBy",kind: "message",message: {fields: [{name: "allOf",kind: "list",},{name: "anyOf",kind: "list",},],type: SignedBy},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: PlacementRequirements},},{name: "resources",kind: "list",message: {fields: [{name: "resource",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},],type: ResourceUnit},},],type: GroupSpec},},{name: "createdAt",kind: "scalar",scalarType: 3,},],type: Order},},], - }, - "akash.market.v1beta5.QueryBidsResponse": { - type: QueryBidsResponse, - fields: [{name: "bids",kind: "list",message: {fields: [{name: "bid",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: BidID},},{name: "state",kind: "enum",enum: ["invalid","open","active","lost","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "resourcesOffer",kind: "list",message: {fields: [{name: "resources",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},],type: ResourceOffer},},],type: Bid},},{name: "escrowAccount",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},],type: QueryBidResponse},},], - }, - "akash.market.v1beta5.QueryBidResponse": { - type: QueryBidResponse, - fields: [{name: "bid",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: BidID},},{name: "state",kind: "enum",enum: ["invalid","open","active","lost","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "resourcesOffer",kind: "list",message: {fields: [{name: "resources",kind: "message",message: {fields: [{name: "id",kind: "scalar",scalarType: 13,},{name: "cpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: CPU},},{name: "memory",kind: "message",message: {fields: [{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Memory},},{name: "storage",kind: "list",message: {fields: [{name: "name",kind: "scalar",scalarType: 9,},{name: "quantity",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: Storage},},{name: "gpu",kind: "message",message: {fields: [{name: "units",kind: "message",message: {fields: [{name: "val",kind: "scalar",scalarType: 12,},],type: ResourceValue},},{name: "attributes",kind: "list",message: {fields: [{name: "key",kind: "scalar",scalarType: 9,},{name: "value",kind: "scalar",scalarType: 9,},],type: Attribute},},],type: GPU},},{name: "endpoints",kind: "list",message: {fields: [{name: "kind",kind: "enum",enum: ["SHARED_HTTP","RANDOM_PORT","LEASED_IP"],},{name: "sequenceNumber",kind: "scalar",scalarType: 13,},],type: Endpoint},},],type: Resources},},{name: "count",kind: "scalar",scalarType: 13,},],type: ResourceOffer},},],type: Bid},},{name: "escrowAccount",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "transferred",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "settledAt",kind: "scalar",scalarType: 3,},{name: "funds",kind: "list",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: Balance},},{name: "deposits",kind: "list",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},{name: "source",kind: "enum",enum: ["invalid","balance","grant"],},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "direct",kind: "scalar",scalarType: 8,},],type: Depositor},},],type: AccountState},},],type: Account},},], - }, - "akash.market.v1beta5.QueryLeasesResponse": { - type: QueryLeasesResponse, - fields: [{name: "leases",kind: "list",message: {fields: [{name: "lease",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: LeaseID},},{name: "state",kind: "enum",enum: ["invalid","active","insufficient_funds","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "closedOn",kind: "scalar",scalarType: 3,},{name: "reason",kind: "enum",enum: ["lease_closed_invalid","lease_closed_owner","lease_closed_reason_unstable","lease_closed_reason_decommission","lease_closed_reason_unspecified","lease_closed_reason_manifest_timeout","lease_closed_reason_insufficient_funds"],},],type: Lease},},{name: "escrowPayment",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "aid",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "xid",kind: "scalar",scalarType: 9,},],type: Payment$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "withdrawn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: PaymentState},},],type: Payment},},],type: QueryLeaseResponse},},], - }, - "akash.market.v1beta5.QueryLeaseResponse": { - type: QueryLeaseResponse, - fields: [{name: "lease",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "dseq",kind: "scalar",scalarType: 4,},{name: "gseq",kind: "scalar",scalarType: 13,},{name: "oseq",kind: "scalar",scalarType: 13,},{name: "provider",kind: "scalar",scalarType: 9,},{name: "bseq",kind: "scalar",scalarType: 13,},],type: LeaseID},},{name: "state",kind: "enum",enum: ["invalid","active","insufficient_funds","closed"],},{name: "price",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "createdAt",kind: "scalar",scalarType: 3,},{name: "closedOn",kind: "scalar",scalarType: 3,},{name: "reason",kind: "enum",enum: ["lease_closed_invalid","lease_closed_owner","lease_closed_reason_unstable","lease_closed_reason_decommission","lease_closed_reason_unspecified","lease_closed_reason_manifest_timeout","lease_closed_reason_insufficient_funds"],},],type: Lease},},{name: "escrowPayment",kind: "message",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "aid",kind: "message",message: {fields: [{name: "scope",kind: "enum",enum: ["invalid","deployment","bid"],},{name: "xid",kind: "scalar",scalarType: 9,},],type: Account$1},},{name: "xid",kind: "scalar",scalarType: 9,},],type: Payment$1},},{name: "state",kind: "message",message: {fields: [{name: "owner",kind: "scalar",scalarType: 9,},{name: "state",kind: "enum",enum: ["invalid","open","closed","overdrawn"],},{name: "rate",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "balance",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "unsettled",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,customType: "LegacyDec",},],type: DecCoin},},{name: "withdrawn",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "amount",kind: "scalar",scalarType: 9,},],type: Coin},},],type: PaymentState},},],type: Payment},},], - }, - "akash.oracle.v1.PriceDataState": { - type: PriceDataState, - fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.oracle.v1.PriceData": { - type: PriceData, - fields: [{name: "state",kind: "message",message: {fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: PriceDataState},},], - }, - "akash.oracle.v1.AggregatedPrice": { - type: AggregatedPrice, - fields: [{name: "twap",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "medianPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "minPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},], - }, - "akash.oracle.v1.QueryPricesResponse": { - type: QueryPricesResponse, - fields: [{name: "prices",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "source",kind: "scalar",scalarType: 13,},{name: "denom",kind: "scalar",scalarType: 9,},{name: "baseDenom",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},],type: PriceDataRecordID},},{name: "state",kind: "message",message: {fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: PriceDataState},},],type: PriceData},},], - }, - "akash.oracle.v1.EventPriceData": { - type: EventPriceData, - fields: [{name: "data",kind: "message",message: {fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: PriceDataState},},], - }, - "akash.oracle.v1.GenesisState": { - type: GenesisState$4, - fields: [{name: "prices",kind: "list",message: {fields: [{name: "id",kind: "message",message: {fields: [{name: "source",kind: "scalar",scalarType: 13,},{name: "denom",kind: "scalar",scalarType: 9,},{name: "baseDenom",kind: "scalar",scalarType: 9,},{name: "height",kind: "scalar",scalarType: 3,},],type: PriceDataRecordID},},{name: "state",kind: "message",message: {fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: PriceDataState},},],type: PriceData},},], - }, - "akash.oracle.v1.MsgAddPriceEntry": { - type: MsgAddPriceEntry, - fields: [{name: "price",kind: "message",message: {fields: [{name: "price",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},],type: PriceDataState},},], - }, - "akash.oracle.v1.QueryAggregatedPriceResponse": { - type: QueryAggregatedPriceResponse, - fields: [{name: "aggregatedPrice",kind: "message",message: {fields: [{name: "denom",kind: "scalar",scalarType: 9,},{name: "twap",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "medianPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "minPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "maxPrice",kind: "scalar",scalarType: 9,customType: "LegacyDec",},{name: "timestamp",kind: "message",message: {fields: [{name: "seconds",kind: "scalar",scalarType: 3,},{name: "nanos",kind: "scalar",scalarType: 5,},],type: Timestamp},},{name: "numSources",kind: "scalar",scalarType: 13,},{name: "deviationBps",kind: "scalar",scalarType: 4,},],type: AggregatedPrice},},], - }, }; describe("nodeCustomTypePatches.ts", () => { describe.each(Object.entries(patches))('patch %s', (typeName, patch: TypePatches[keyof TypePatches]) => { diff --git a/ts/src/generated/patches/nodeCustomTypePatches.ts b/ts/src/generated/patches/nodeCustomTypePatches.ts index 33d276b3..61f90eb8 100644 --- a/ts/src/generated/patches/nodeCustomTypePatches.ts +++ b/ts/src/generated/patches/nodeCustomTypePatches.ts @@ -5,344 +5,20 @@ import type * as _protos_akash_bme_v1_genesis from "../protos/akash/bme/v1/genes import type * as _protos_akash_bme_v1_query from "../protos/akash/bme/v1/query.ts"; import type * as _protos_akash_deployment_v1beta4_resourceunit from "../protos/akash/deployment/v1beta4/resourceunit.ts"; import type * as _protos_cosmos_base_v1beta1_coin from "../protos/cosmos/base/v1beta1/coin.ts"; -import type * as _protos_akash_deployment_v1beta4_groupspec from "../protos/akash/deployment/v1beta4/groupspec.ts"; -import type * as _protos_akash_deployment_v1beta4_deploymentmsg from "../protos/akash/deployment/v1beta4/deploymentmsg.ts"; -import type * as _protos_akash_deployment_v1beta4_group from "../protos/akash/deployment/v1beta4/group.ts"; -import type * as _protos_akash_deployment_v1beta4_genesis from "../protos/akash/deployment/v1beta4/genesis.ts"; import type * as _protos_akash_escrow_types_v1_balance from "../protos/akash/escrow/types/v1/balance.ts"; -import type * as _protos_akash_escrow_types_v1_deposit from "../protos/akash/escrow/types/v1/deposit.ts"; -import type * as _protos_akash_escrow_types_v1_account from "../protos/akash/escrow/types/v1/account.ts"; -import type * as _protos_akash_deployment_v1beta4_query from "../protos/akash/deployment/v1beta4/query.ts"; -import type * as _protos_akash_escrow_types_v1_payment from "../protos/akash/escrow/types/v1/payment.ts"; -import type * as _protos_akash_escrow_v1_genesis from "../protos/akash/escrow/v1/genesis.ts"; -import type * as _protos_akash_escrow_v1_query from "../protos/akash/escrow/v1/query.ts"; -import type * as _protos_akash_market_v1_lease from "../protos/akash/market/v1/lease.ts"; -import type * as _protos_akash_market_v1_event from "../protos/akash/market/v1/event.ts"; -import type * as _protos_akash_market_v1beta5_bid from "../protos/akash/market/v1beta5/bid.ts"; -import type * as _protos_akash_market_v1beta5_bidmsg from "../protos/akash/market/v1beta5/bidmsg.ts"; -import type * as _protos_akash_market_v1beta5_order from "../protos/akash/market/v1beta5/order.ts"; -import type * as _protos_akash_market_v1beta5_genesis from "../protos/akash/market/v1beta5/genesis.ts"; -import type * as _protos_akash_market_v1beta5_query from "../protos/akash/market/v1beta5/query.ts"; -import type * as _protos_akash_oracle_v1_prices from "../protos/akash/oracle/v1/prices.ts"; -import type * as _protos_akash_oracle_v1_events from "../protos/akash/oracle/v1/events.ts"; -import type * as _protos_akash_oracle_v1_genesis from "../protos/akash/oracle/v1/genesis.ts"; -import type * as _protos_akash_oracle_v1_msgs from "../protos/akash/oracle/v1/msgs.ts"; -import type * as _protos_akash_oracle_v1_query from "../protos/akash/oracle/v1/query.ts"; const p = { - "akash.bme.v1.CollateralRatio"(value: _protos_akash_bme_v1_types.CollateralRatio | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.ratio != null) newValue.ratio = LegacyDec[transformType](value.ratio); - if (value.referencePrice != null) newValue.referencePrice = LegacyDec[transformType](value.referencePrice); - return newValue; - }, - "akash.bme.v1.CoinPrice"(value: _protos_akash_bme_v1_types.CoinPrice | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = LegacyDec[transformType](value.price); - return newValue; - }, - "akash.bme.v1.BurnMintPair"(value: _protos_akash_bme_v1_types.BurnMintPair | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.burned != null) newValue.burned = p["akash.bme.v1.CoinPrice"](value.burned, transformType); - if (value.minted != null) newValue.minted = p["akash.bme.v1.CoinPrice"](value.minted, transformType); - return newValue; - }, - "akash.bme.v1.LedgerRecord"(value: _protos_akash_bme_v1_types.LedgerRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.burned != null) newValue.burned = p["akash.bme.v1.CoinPrice"](value.burned, transformType); - if (value.minted != null) newValue.minted = p["akash.bme.v1.CoinPrice"](value.minted, transformType); - if (value.remintCreditIssued != null) newValue.remintCreditIssued = p["akash.bme.v1.CoinPrice"](value.remintCreditIssued, transformType); - if (value.remintCreditAccrued != null) newValue.remintCreditAccrued = p["akash.bme.v1.CoinPrice"](value.remintCreditAccrued, transformType); - return newValue; - }, - "akash.bme.v1.EventMintStatusChange"(value: _protos_akash_bme_v1_events.EventMintStatusChange | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.collateralRatio != null) newValue.collateralRatio = LegacyDec[transformType](value.collateralRatio); - return newValue; - }, - "akash.bme.v1.GenesisLedgerRecord"(value: _protos_akash_bme_v1_genesis.GenesisLedgerRecord | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.record != null) newValue.record = p["akash.bme.v1.LedgerRecord"](value.record, transformType); - return newValue; - }, - "akash.bme.v1.GenesisLedgerState"(value: _protos_akash_bme_v1_genesis.GenesisLedgerState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.records) newValue.records = value.records.map((item) => p["akash.bme.v1.GenesisLedgerRecord"](item, transformType)!); - return newValue; - }, - "akash.bme.v1.GenesisState"(value: _protos_akash_bme_v1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.ledger != null) newValue.ledger = p["akash.bme.v1.GenesisLedgerState"](value.ledger, transformType); - return newValue; - }, - "akash.bme.v1.QueryStatusResponse"(value: _protos_akash_bme_v1_query.QueryStatusResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.collateralRatio != null) newValue.collateralRatio = LegacyDec[transformType](value.collateralRatio); - if (value.warnThreshold != null) newValue.warnThreshold = LegacyDec[transformType](value.warnThreshold); - if (value.haltThreshold != null) newValue.haltThreshold = LegacyDec[transformType](value.haltThreshold); - return newValue; - }, - "akash.deployment.v1beta4.ResourceUnit"(value: _protos_akash_deployment_v1beta4_resourceunit.ResourceUnit | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, "cosmos.base.v1beta1.DecCoin"(value: _protos_cosmos_base_v1beta1_coin.DecCoin | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.amount != null) newValue.amount = LegacyDec[transformType](value.amount); return newValue; }, - "akash.deployment.v1beta4.GroupSpec"(value: _protos_akash_deployment_v1beta4_groupspec.GroupSpec | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.resources) newValue.resources = value.resources.map((item) => p["akash.deployment.v1beta4.ResourceUnit"](item, transformType)!); - return newValue; - }, - "akash.deployment.v1beta4.MsgCreateDeployment"(value: _protos_akash_deployment_v1beta4_deploymentmsg.MsgCreateDeployment | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.groups) newValue.groups = value.groups.map((item) => p["akash.deployment.v1beta4.GroupSpec"](item, transformType)!); - return newValue; - }, - "akash.deployment.v1beta4.Group"(value: _protos_akash_deployment_v1beta4_group.Group | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.groupSpec != null) newValue.groupSpec = p["akash.deployment.v1beta4.GroupSpec"](value.groupSpec, transformType); - return newValue; - }, - "akash.deployment.v1beta4.GenesisDeployment"(value: _protos_akash_deployment_v1beta4_genesis.GenesisDeployment | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.groups) newValue.groups = value.groups.map((item) => p["akash.deployment.v1beta4.Group"](item, transformType)!); - return newValue; - }, - "akash.deployment.v1beta4.GenesisState"(value: _protos_akash_deployment_v1beta4_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.deployments) newValue.deployments = value.deployments.map((item) => p["akash.deployment.v1beta4.GenesisDeployment"](item, transformType)!); - return newValue; - }, "akash.escrow.types.v1.Balance"(value: _protos_akash_escrow_types_v1_balance.Balance | undefined | null, transformType: 'encode' | 'decode') { if (value == null) return; const newValue = { ...value }; if (value.amount != null) newValue.amount = LegacyDec[transformType](value.amount); return newValue; - }, - "akash.escrow.types.v1.Depositor"(value: _protos_akash_escrow_types_v1_deposit.Depositor | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.balance != null) newValue.balance = p["cosmos.base.v1beta1.DecCoin"](value.balance, transformType); - return newValue; - }, - "akash.escrow.types.v1.AccountState"(value: _protos_akash_escrow_types_v1_account.AccountState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.transferred) newValue.transferred = value.transferred.map((item) => p["cosmos.base.v1beta1.DecCoin"](item, transformType)!); - if (value.funds) newValue.funds = value.funds.map((item) => p["akash.escrow.types.v1.Balance"](item, transformType)!); - if (value.deposits) newValue.deposits = value.deposits.map((item) => p["akash.escrow.types.v1.Depositor"](item, transformType)!); - return newValue; - }, - "akash.escrow.types.v1.Account"(value: _protos_akash_escrow_types_v1_account.Account | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.state != null) newValue.state = p["akash.escrow.types.v1.AccountState"](value.state, transformType); - return newValue; - }, - "akash.deployment.v1beta4.QueryDeploymentsResponse"(value: _protos_akash_deployment_v1beta4_query.QueryDeploymentsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.deployments) newValue.deployments = value.deployments.map((item) => p["akash.deployment.v1beta4.QueryDeploymentResponse"](item, transformType)!); - return newValue; - }, - "akash.deployment.v1beta4.QueryDeploymentResponse"(value: _protos_akash_deployment_v1beta4_query.QueryDeploymentResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.groups) newValue.groups = value.groups.map((item) => p["akash.deployment.v1beta4.Group"](item, transformType)!); - if (value.escrowAccount != null) newValue.escrowAccount = p["akash.escrow.types.v1.Account"](value.escrowAccount, transformType); - return newValue; - }, - "akash.deployment.v1beta4.QueryGroupResponse"(value: _protos_akash_deployment_v1beta4_query.QueryGroupResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.group != null) newValue.group = p["akash.deployment.v1beta4.Group"](value.group, transformType); - return newValue; - }, - "akash.escrow.types.v1.PaymentState"(value: _protos_akash_escrow_types_v1_payment.PaymentState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.rate != null) newValue.rate = p["cosmos.base.v1beta1.DecCoin"](value.rate, transformType); - if (value.balance != null) newValue.balance = p["cosmos.base.v1beta1.DecCoin"](value.balance, transformType); - if (value.unsettled != null) newValue.unsettled = p["cosmos.base.v1beta1.DecCoin"](value.unsettled, transformType); - return newValue; - }, - "akash.escrow.types.v1.Payment"(value: _protos_akash_escrow_types_v1_payment.Payment | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.state != null) newValue.state = p["akash.escrow.types.v1.PaymentState"](value.state, transformType); - return newValue; - }, - "akash.escrow.v1.GenesisState"(value: _protos_akash_escrow_v1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.accounts) newValue.accounts = value.accounts.map((item) => p["akash.escrow.types.v1.Account"](item, transformType)!); - if (value.payments) newValue.payments = value.payments.map((item) => p["akash.escrow.types.v1.Payment"](item, transformType)!); - return newValue; - }, - "akash.escrow.v1.QueryAccountsResponse"(value: _protos_akash_escrow_v1_query.QueryAccountsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.accounts) newValue.accounts = value.accounts.map((item) => p["akash.escrow.types.v1.Account"](item, transformType)!); - return newValue; - }, - "akash.escrow.v1.QueryPaymentsResponse"(value: _protos_akash_escrow_v1_query.QueryPaymentsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.payments) newValue.payments = value.payments.map((item) => p["akash.escrow.types.v1.Payment"](item, transformType)!); - return newValue; - }, - "akash.market.v1.Lease"(value: _protos_akash_market_v1_lease.Lease | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, - "akash.market.v1.EventBidCreated"(value: _protos_akash_market_v1_event.EventBidCreated | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, - "akash.market.v1.EventLeaseCreated"(value: _protos_akash_market_v1_event.EventLeaseCreated | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, - "akash.market.v1beta5.Bid"(value: _protos_akash_market_v1beta5_bid.Bid | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, - "akash.market.v1beta5.MsgCreateBid"(value: _protos_akash_market_v1beta5_bidmsg.MsgCreateBid | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["cosmos.base.v1beta1.DecCoin"](value.price, transformType); - return newValue; - }, - "akash.market.v1beta5.Order"(value: _protos_akash_market_v1beta5_order.Order | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.spec != null) newValue.spec = p["akash.deployment.v1beta4.GroupSpec"](value.spec, transformType); - return newValue; - }, - "akash.market.v1beta5.GenesisState"(value: _protos_akash_market_v1beta5_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.orders) newValue.orders = value.orders.map((item) => p["akash.market.v1beta5.Order"](item, transformType)!); - if (value.leases) newValue.leases = value.leases.map((item) => p["akash.market.v1.Lease"](item, transformType)!); - if (value.bids) newValue.bids = value.bids.map((item) => p["akash.market.v1beta5.Bid"](item, transformType)!); - return newValue; - }, - "akash.market.v1beta5.QueryOrdersResponse"(value: _protos_akash_market_v1beta5_query.QueryOrdersResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.orders) newValue.orders = value.orders.map((item) => p["akash.market.v1beta5.Order"](item, transformType)!); - return newValue; - }, - "akash.market.v1beta5.QueryOrderResponse"(value: _protos_akash_market_v1beta5_query.QueryOrderResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.order != null) newValue.order = p["akash.market.v1beta5.Order"](value.order, transformType); - return newValue; - }, - "akash.market.v1beta5.QueryBidsResponse"(value: _protos_akash_market_v1beta5_query.QueryBidsResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.bids) newValue.bids = value.bids.map((item) => p["akash.market.v1beta5.QueryBidResponse"](item, transformType)!); - return newValue; - }, - "akash.market.v1beta5.QueryBidResponse"(value: _protos_akash_market_v1beta5_query.QueryBidResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.bid != null) newValue.bid = p["akash.market.v1beta5.Bid"](value.bid, transformType); - if (value.escrowAccount != null) newValue.escrowAccount = p["akash.escrow.types.v1.Account"](value.escrowAccount, transformType); - return newValue; - }, - "akash.market.v1beta5.QueryLeasesResponse"(value: _protos_akash_market_v1beta5_query.QueryLeasesResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.leases) newValue.leases = value.leases.map((item) => p["akash.market.v1beta5.QueryLeaseResponse"](item, transformType)!); - return newValue; - }, - "akash.market.v1beta5.QueryLeaseResponse"(value: _protos_akash_market_v1beta5_query.QueryLeaseResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.lease != null) newValue.lease = p["akash.market.v1.Lease"](value.lease, transformType); - if (value.escrowPayment != null) newValue.escrowPayment = p["akash.escrow.types.v1.Payment"](value.escrowPayment, transformType); - return newValue; - }, - "akash.oracle.v1.PriceDataState"(value: _protos_akash_oracle_v1_prices.PriceDataState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = LegacyDec[transformType](value.price); - return newValue; - }, - "akash.oracle.v1.PriceData"(value: _protos_akash_oracle_v1_prices.PriceData | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.state != null) newValue.state = p["akash.oracle.v1.PriceDataState"](value.state, transformType); - return newValue; - }, - "akash.oracle.v1.AggregatedPrice"(value: _protos_akash_oracle_v1_prices.AggregatedPrice | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.twap != null) newValue.twap = LegacyDec[transformType](value.twap); - if (value.medianPrice != null) newValue.medianPrice = LegacyDec[transformType](value.medianPrice); - if (value.minPrice != null) newValue.minPrice = LegacyDec[transformType](value.minPrice); - if (value.maxPrice != null) newValue.maxPrice = LegacyDec[transformType](value.maxPrice); - return newValue; - }, - "akash.oracle.v1.QueryPricesResponse"(value: _protos_akash_oracle_v1_prices.QueryPricesResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.prices) newValue.prices = value.prices.map((item) => p["akash.oracle.v1.PriceData"](item, transformType)!); - return newValue; - }, - "akash.oracle.v1.EventPriceData"(value: _protos_akash_oracle_v1_events.EventPriceData | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.data != null) newValue.data = p["akash.oracle.v1.PriceDataState"](value.data, transformType); - return newValue; - }, - "akash.oracle.v1.GenesisState"(value: _protos_akash_oracle_v1_genesis.GenesisState | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.prices) newValue.prices = value.prices.map((item) => p["akash.oracle.v1.PriceData"](item, transformType)!); - return newValue; - }, - "akash.oracle.v1.MsgAddPriceEntry"(value: _protos_akash_oracle_v1_msgs.MsgAddPriceEntry | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.price != null) newValue.price = p["akash.oracle.v1.PriceDataState"](value.price, transformType); - return newValue; - }, - "akash.oracle.v1.QueryAggregatedPriceResponse"(value: _protos_akash_oracle_v1_query.QueryAggregatedPriceResponse | undefined | null, transformType: 'encode' | 'decode') { - if (value == null) return; - const newValue = { ...value }; - if (value.aggregatedPrice != null) newValue.aggregatedPrice = p["akash.oracle.v1.AggregatedPrice"](value.aggregatedPrice, transformType); - return newValue; } }; diff --git a/ts/src/generated/protos/nodePatchMessage.ts b/ts/src/generated/patches/nodePatchMessage.ts similarity index 89% rename from ts/src/generated/protos/nodePatchMessage.ts rename to ts/src/generated/patches/nodePatchMessage.ts index afdaf41d..ffae6f59 100644 --- a/ts/src/generated/protos/nodePatchMessage.ts +++ b/ts/src/generated/patches/nodePatchMessage.ts @@ -1,4 +1,4 @@ -import { patches } from "../patches/nodeCustomTypePatches.ts"; +import { patches } from "./nodeCustomTypePatches.ts"; import type { MessageDesc } from "../../sdk/client/types.ts"; export const patched = (messageDesc: T): T => { const patchMessage = patches[messageDesc.$type as keyof typeof patches] as any; diff --git a/ts/src/generated/protos/akash/escrow/types/v1/balance.ts b/ts/src/generated/protos/akash/escrow/types/v1/balance.ts index d3eec38c..4e55d53c 100644 --- a/ts/src/generated/protos/akash/escrow/types/v1/balance.ts +++ b/ts/src/generated/protos/akash/escrow/types/v1/balance.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../../patches/nodePatchMessage.ts"; import { isSet } from "../../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -24,7 +25,7 @@ function createBaseBalance(): Balance { return { denom: "", amount: "" }; } -export const Balance: MessageFns = { +const _Balance: MessageFns = { $type: "akash.escrow.types.v1.Balance" as const, encode(message: Balance, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -115,3 +116,5 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const Balance = patched(_Balance); diff --git a/ts/src/generated/protos/cosmos/base/v1beta1/coin.ts b/ts/src/generated/protos/cosmos/base/v1beta1/coin.ts index f3a3070c..ac59c36f 100644 --- a/ts/src/generated/protos/cosmos/base/v1beta1/coin.ts +++ b/ts/src/generated/protos/cosmos/base/v1beta1/coin.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -126,7 +127,7 @@ function createBaseDecCoin(): DecCoin { return { denom: "", amount: "" }; } -export const DecCoin: MessageFns = { +const _DecCoin: MessageFns = { $type: "cosmos.base.v1beta1.DecCoin" as const, encode(message: DecCoin, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -256,7 +257,7 @@ function createBaseDecProto(): DecProto { return { dec: "" }; } -export const DecProto: MessageFns = { +const _DecProto: MessageFns = { $type: "cosmos.base.v1beta1.DecProto" as const, encode(message: DecProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -329,3 +330,6 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const DecCoin = patched(_DecCoin); +export const DecProto = patched(_DecProto); diff --git a/ts/src/generated/protos/cosmos/distribution/v1beta1/distribution.ts b/ts/src/generated/protos/cosmos/distribution/v1beta1/distribution.ts index 7d4fc462..24c9d1b7 100644 --- a/ts/src/generated/protos/cosmos/distribution/v1beta1/distribution.ts +++ b/ts/src/generated/protos/cosmos/distribution/v1beta1/distribution.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -155,7 +156,7 @@ function createBaseParams(): Params { return { communityTax: "", baseProposerReward: "", bonusProposerReward: "", withdrawAddrEnabled: false }; } -export const Params: MessageFns = { +const _Params: MessageFns = { $type: "cosmos.distribution.v1beta1.Params" as const, encode(message: Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -545,7 +546,7 @@ function createBaseValidatorSlashEvent(): ValidatorSlashEvent { return { validatorPeriod: Long.UZERO, fraction: "" }; } -export const ValidatorSlashEvent: MessageFns = { +const _ValidatorSlashEvent: MessageFns = { $type: "cosmos.distribution.v1beta1.ValidatorSlashEvent" as const, encode(message: ValidatorSlashEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1169,3 +1170,6 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const Params = patched(_Params); +export const ValidatorSlashEvent = patched(_ValidatorSlashEvent); diff --git a/ts/src/generated/protos/cosmos/gov/v1beta1/gov.ts b/ts/src/generated/protos/cosmos/gov/v1beta1/gov.ts index f1fc2d89..7103e80d 100644 --- a/ts/src/generated/protos/cosmos/gov/v1beta1/gov.ts +++ b/ts/src/generated/protos/cosmos/gov/v1beta1/gov.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, fromJsonTimestamp, numberToLong, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -288,7 +289,7 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { return { option: 0, weight: "" }; } -export const WeightedVoteOption: MessageFns = { +const _WeightedVoteOption: MessageFns = { $type: "cosmos.gov.v1beta1.WeightedVoteOption" as const, encode(message: WeightedVoteOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1084,7 +1085,7 @@ function createBaseTallyParams(): TallyParams { return { quorum: new Uint8Array(0), threshold: new Uint8Array(0), vetoThreshold: new Uint8Array(0) }; } -export const TallyParams: MessageFns = { +const _TallyParams: MessageFns = { $type: "cosmos.gov.v1beta1.TallyParams" as const, encode(message: TallyParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1242,3 +1243,6 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const WeightedVoteOption = patched(_WeightedVoteOption); +export const TallyParams = patched(_TallyParams); diff --git a/ts/src/generated/protos/cosmos/mint/v1beta1/mint.ts b/ts/src/generated/protos/cosmos/mint/v1beta1/mint.ts index 6ad19227..eb70e9de 100644 --- a/ts/src/generated/protos/cosmos/mint/v1beta1/mint.ts +++ b/ts/src/generated/protos/cosmos/mint/v1beta1/mint.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -38,7 +39,7 @@ function createBaseMinter(): Minter { return { inflation: "", annualProvisions: "" }; } -export const Minter: MessageFns = { +const _Minter: MessageFns = { $type: "cosmos.mint.v1beta1.Minter" as const, encode(message: Minter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -119,7 +120,7 @@ function createBaseParams(): Params { }; } -export const Params: MessageFns = { +const _Params: MessageFns = { $type: "cosmos.mint.v1beta1.Params" as const, encode(message: Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -276,3 +277,6 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const Minter = patched(_Minter); +export const Params = patched(_Params); diff --git a/ts/src/generated/protos/cosmos/mint/v1beta1/query.ts b/ts/src/generated/protos/cosmos/mint/v1beta1/query.ts index dc85a731..7fb67dcd 100644 --- a/ts/src/generated/protos/cosmos/mint/v1beta1/query.ts +++ b/ts/src/generated/protos/cosmos/mint/v1beta1/query.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { bytesFromBase64, base64FromBytes, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -194,7 +195,7 @@ function createBaseQueryInflationResponse(): QueryInflationResponse { return { inflation: new Uint8Array(0) }; } -export const QueryInflationResponse: MessageFns = +const _QueryInflationResponse: MessageFns = { $type: "cosmos.mint.v1beta1.QueryInflationResponse" as const, @@ -398,3 +399,5 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const QueryInflationResponse = patched(_QueryInflationResponse); diff --git a/ts/src/generated/protos/cosmos/protocolpool/v1/types.ts b/ts/src/generated/protos/cosmos/protocolpool/v1/types.ts index e95ea0f7..3f0d34b0 100644 --- a/ts/src/generated/protos/cosmos/protocolpool/v1/types.ts +++ b/ts/src/generated/protos/cosmos/protocolpool/v1/types.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { toTimestamp, fromTimestamp, fromJsonTimestamp, numberToLong, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -39,7 +40,7 @@ function createBaseContinuousFund(): ContinuousFund { return { recipient: "", percentage: "", expiry: undefined }; } -export const ContinuousFund: MessageFns = { +const _ContinuousFund: MessageFns = { $type: "cosmos.protocolpool.v1.ContinuousFund" as const, encode(message: ContinuousFund, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -253,3 +254,5 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const ContinuousFund = patched(_ContinuousFund); diff --git a/ts/src/generated/protos/cosmos/slashing/v1beta1/slashing.ts b/ts/src/generated/protos/cosmos/slashing/v1beta1/slashing.ts index 021d3b45..1d183f76 100644 --- a/ts/src/generated/protos/cosmos/slashing/v1beta1/slashing.ts +++ b/ts/src/generated/protos/cosmos/slashing/v1beta1/slashing.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp, fromJsonTimestamp, numberToLong, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -215,7 +216,7 @@ function createBaseParams(): Params { }; } -export const Params: MessageFns = { +const _Params: MessageFns = { $type: "cosmos.slashing.v1beta1.Params" as const, encode(message: Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -417,3 +418,5 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const Params = patched(_Params); diff --git a/ts/src/generated/protos/cosmos/staking/v1beta1/staking.ts b/ts/src/generated/protos/cosmos/staking/v1beta1/staking.ts index 7087a24f..b1dc58e1 100644 --- a/ts/src/generated/protos/cosmos/staking/v1beta1/staking.ts +++ b/ts/src/generated/protos/cosmos/staking/v1beta1/staking.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { toTimestamp, fromTimestamp, fromJsonTimestamp, numberToLong, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -463,7 +464,7 @@ function createBaseCommissionRates(): CommissionRates { return { rate: "", maxRate: "", maxChangeRate: "" }; } -export const CommissionRates: MessageFns = { +const _CommissionRates: MessageFns = { $type: "cosmos.staking.v1beta1.CommissionRates" as const, encode(message: CommissionRates, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -765,7 +766,7 @@ function createBaseValidator(): Validator { }; } -export const Validator: MessageFns = { +const _Validator: MessageFns = { $type: "cosmos.staking.v1beta1.Validator" as const, encode(message: Validator, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1382,7 +1383,7 @@ function createBaseDelegation(): Delegation { return { delegatorAddress: "", validatorAddress: "", shares: "" }; } -export const Delegation: MessageFns = { +const _Delegation: MessageFns = { $type: "cosmos.staking.v1beta1.Delegation" as const, encode(message: Delegation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1728,7 +1729,7 @@ function createBaseRedelegationEntry(): RedelegationEntry { }; } -export const RedelegationEntry: MessageFns = { +const _RedelegationEntry: MessageFns = { $type: "cosmos.staking.v1beta1.RedelegationEntry" as const, encode(message: RedelegationEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1990,7 +1991,7 @@ function createBaseParams(): Params { }; } -export const Params: MessageFns = { +const _Params: MessageFns = { $type: "cosmos.staking.v1beta1.Params" as const, encode(message: Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -2544,3 +2545,9 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const CommissionRates = patched(_CommissionRates); +export const Validator = patched(_Validator); +export const Delegation = patched(_Delegation); +export const RedelegationEntry = patched(_RedelegationEntry); +export const Params = patched(_Params); diff --git a/ts/src/generated/protos/cosmos/staking/v1beta1/tx.ts b/ts/src/generated/protos/cosmos/staking/v1beta1/tx.ts index ea9e1af9..6694d0bf 100644 --- a/ts/src/generated/protos/cosmos/staking/v1beta1/tx.ts +++ b/ts/src/generated/protos/cosmos/staking/v1beta1/tx.ts @@ -1,3 +1,4 @@ +import { patched } from "../../../../patches/cosmosPatchMessage.ts"; import { toTimestamp, fromTimestamp, fromJsonTimestamp, numberToLong, isSet } from "../../../../../encoding/typeEncodingHelpers.ts" import type { DeepPartial, MessageFns } from "../../../../../encoding/typeEncodingHelpers.ts" // Code generated by protoc-gen-ts_proto. DO NOT EDIT. @@ -354,7 +355,7 @@ function createBaseMsgEditValidator(): MsgEditValidator { return { description: undefined, validatorAddress: "", commissionRate: "", minSelfDelegation: "" }; } -export const MsgEditValidator: MessageFns = { +const _MsgEditValidator: MessageFns = { $type: "cosmos.staking.v1beta1.MsgEditValidator" as const, encode(message: MsgEditValidator, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { @@ -1295,3 +1296,5 @@ interface _unused_MessageFns { create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } + +export const MsgEditValidator = patched(_MsgEditValidator); diff --git a/ts/src/generated/protos/index.akash.v1.ts b/ts/src/generated/protos/index.akash.v1.ts index 3f7781a0..4201b66e 100644 --- a/ts/src/generated/protos/index.akash.v1.ts +++ b/ts/src/generated/protos/index.akash.v1.ts @@ -1,5 +1,3 @@ -import { patched } from "./nodePatchMessage.ts"; - export { Attribute, SignedBy, PlacementRequirements } from "./akash/base/attributes/v1/attribute.ts"; export { AuditedProvider, AuditedAttributesStore, AttributesFilters } from "./akash/audit/v1/audit.ts"; export { EventTrustedAuditorCreated, EventTrustedAuditorDeleted } from "./akash/audit/v1/event.ts"; @@ -49,57 +47,22 @@ export { DeploymentID, Deployment, Deployment_State } from "./akash/deployment/v export { GroupID } from "./akash/deployment/v1/group.ts"; export { EventDeploymentCreated, EventDeploymentUpdated, EventDeploymentClosed, EventGroupStarted, EventGroupPaused, EventGroupClosed } from "./akash/deployment/v1/event.ts"; export { Account, Payment, Scope } from "./akash/escrow/id/v1/id.ts"; - -import { Balance as _Balance } from "./akash/escrow/types/v1/balance.ts"; -export const Balance = patched(_Balance); -export type Balance = _Balance - -import { Depositor as _Depositor } from "./akash/escrow/types/v1/deposit.ts"; -export const Depositor = patched(_Depositor); -export type Depositor = _Depositor +export { Balance } from "./akash/escrow/types/v1/balance.ts"; +export { Depositor } from "./akash/escrow/types/v1/deposit.ts"; export { State as Types_State } from "./akash/escrow/types/v1/state.ts"; - -import { AccountState as _AccountState, Account as _Types_Account } from "./akash/escrow/types/v1/account.ts"; -export const AccountState = patched(_AccountState); -export type AccountState = _AccountState -export const Types_Account = patched(_Types_Account); -export type Types_Account = _Types_Account +export { AccountState, Account as Types_Account } from "./akash/escrow/types/v1/account.ts"; export { ClientInfo } from "./akash/discovery/v1/client_info.ts"; export { Akash } from "./akash/discovery/v1/akash.ts"; - -import { PaymentState as _PaymentState, Payment as _Types_Payment } from "./akash/escrow/types/v1/payment.ts"; -export const PaymentState = patched(_PaymentState); -export type PaymentState = _PaymentState -export const Types_Payment = patched(_Types_Payment); -export type Types_Payment = _Types_Payment +export { PaymentState, Payment as Types_Payment } from "./akash/escrow/types/v1/payment.ts"; export { DepositAuthorization, DepositAuthorization_Scope } from "./akash/escrow/v1/authz.ts"; - -import { GenesisState as _Escrow_GenesisState } from "./akash/escrow/v1/genesis.ts"; -export const Escrow_GenesisState = patched(_Escrow_GenesisState); -export type Escrow_GenesisState = _Escrow_GenesisState +export { GenesisState as Escrow_GenesisState } from "./akash/escrow/v1/genesis.ts"; export { MsgAccountDeposit, MsgAccountDepositResponse } from "./akash/escrow/v1/msg.ts"; -export { QueryAccountsRequest, QueryPaymentsRequest } from "./akash/escrow/v1/query.ts"; - -import { QueryAccountsResponse as _QueryAccountsResponse, QueryPaymentsResponse as _QueryPaymentsResponse } from "./akash/escrow/v1/query.ts"; -export const QueryAccountsResponse = patched(_QueryAccountsResponse); -export type QueryAccountsResponse = _QueryAccountsResponse -export const QueryPaymentsResponse = patched(_QueryPaymentsResponse); -export type QueryPaymentsResponse = _QueryPaymentsResponse +export { QueryAccountsRequest, QueryAccountsResponse, QueryPaymentsRequest, QueryPaymentsResponse } from "./akash/escrow/v1/query.ts"; export { BidID } from "./akash/market/v1/bid.ts"; export { OrderID } from "./akash/market/v1/order.ts"; export { LeaseClosedReason } from "./akash/market/v1/types.ts"; -export { LeaseID, Lease_State } from "./akash/market/v1/lease.ts"; - -import { Lease as _Lease } from "./akash/market/v1/lease.ts"; -export const Lease = patched(_Lease); -export type Lease = _Lease -export { EventOrderCreated, EventOrderClosed, EventBidClosed, EventLeaseClosed } from "./akash/market/v1/event.ts"; - -import { EventBidCreated as _EventBidCreated, EventLeaseCreated as _EventLeaseCreated } from "./akash/market/v1/event.ts"; -export const EventBidCreated = patched(_EventBidCreated); -export type EventBidCreated = _EventBidCreated -export const EventLeaseCreated = patched(_EventLeaseCreated); -export type EventLeaseCreated = _EventLeaseCreated +export { LeaseID, Lease, Lease_State } from "./akash/market/v1/lease.ts"; +export { EventOrderCreated, EventOrderClosed, EventBidCreated, EventBidClosed, EventLeaseCreated, EventLeaseClosed } from "./akash/market/v1/event.ts"; export { LeaseFilters } from "./akash/market/v1/filters.ts"; export { DataID, PriceDataID, PriceDataRecordID, PriceHealth, PricesFilter, QueryPricesRequest } from "./akash/oracle/v1/prices.ts"; diff --git a/ts/src/generated/protos/index.akash.v1beta4.ts b/ts/src/generated/protos/index.akash.v1beta4.ts index 0a752c5e..52c847d2 100644 --- a/ts/src/generated/protos/index.akash.v1beta4.ts +++ b/ts/src/generated/protos/index.akash.v1beta4.ts @@ -1,5 +1,3 @@ -import { patched } from "./nodePatchMessage.ts"; - export { ResourceValue } from "./akash/base/resources/v1beta4/resourcevalue.ts"; export { CPU } from "./akash/base/resources/v1beta4/cpu.ts"; export { Endpoint, Endpoint_Kind } from "./akash/base/resources/v1beta4/endpoint.ts"; @@ -7,43 +5,16 @@ export { GPU } from "./akash/base/resources/v1beta4/gpu.ts"; export { Memory } from "./akash/base/resources/v1beta4/memory.ts"; export { Storage } from "./akash/base/resources/v1beta4/storage.ts"; export { Resources } from "./akash/base/resources/v1beta4/resources.ts"; - -import { ResourceUnit as _ResourceUnit } from "./akash/deployment/v1beta4/resourceunit.ts"; -export const ResourceUnit = patched(_ResourceUnit); -export type ResourceUnit = _ResourceUnit - -import { GroupSpec as _GroupSpec } from "./akash/deployment/v1beta4/groupspec.ts"; -export const GroupSpec = patched(_GroupSpec); -export type GroupSpec = _GroupSpec -export { MsgCreateDeploymentResponse, MsgUpdateDeployment, MsgUpdateDeploymentResponse, MsgCloseDeployment, MsgCloseDeploymentResponse } from "./akash/deployment/v1beta4/deploymentmsg.ts"; - -import { MsgCreateDeployment as _MsgCreateDeployment } from "./akash/deployment/v1beta4/deploymentmsg.ts"; -export const MsgCreateDeployment = patched(_MsgCreateDeployment); -export type MsgCreateDeployment = _MsgCreateDeployment +export { ResourceUnit } from "./akash/deployment/v1beta4/resourceunit.ts"; +export { GroupSpec } from "./akash/deployment/v1beta4/groupspec.ts"; +export { MsgCreateDeployment, MsgCreateDeploymentResponse, MsgUpdateDeployment, MsgUpdateDeploymentResponse, MsgCloseDeployment, MsgCloseDeploymentResponse } from "./akash/deployment/v1beta4/deploymentmsg.ts"; export { DeploymentFilters, GroupFilters } from "./akash/deployment/v1beta4/filters.ts"; -export { Group_State } from "./akash/deployment/v1beta4/group.ts"; - -import { Group as _Group } from "./akash/deployment/v1beta4/group.ts"; -export const Group = patched(_Group); -export type Group = _Group +export { Group, Group_State } from "./akash/deployment/v1beta4/group.ts"; export { Params } from "./akash/deployment/v1beta4/params.ts"; - -import { GenesisDeployment as _GenesisDeployment, GenesisState as _GenesisState } from "./akash/deployment/v1beta4/genesis.ts"; -export const GenesisDeployment = patched(_GenesisDeployment); -export type GenesisDeployment = _GenesisDeployment -export const GenesisState = patched(_GenesisState); -export type GenesisState = _GenesisState +export { GenesisDeployment, GenesisState } from "./akash/deployment/v1beta4/genesis.ts"; export { MsgCloseGroup, MsgCloseGroupResponse, MsgPauseGroup, MsgPauseGroupResponse, MsgStartGroup, MsgStartGroupResponse } from "./akash/deployment/v1beta4/groupmsg.ts"; export { MsgUpdateParams, MsgUpdateParamsResponse } from "./akash/deployment/v1beta4/paramsmsg.ts"; -export { QueryDeploymentsRequest, QueryDeploymentRequest, QueryGroupRequest, QueryParamsRequest, QueryParamsResponse } from "./akash/deployment/v1beta4/query.ts"; - -import { QueryDeploymentsResponse as _QueryDeploymentsResponse, QueryDeploymentResponse as _QueryDeploymentResponse, QueryGroupResponse as _QueryGroupResponse } from "./akash/deployment/v1beta4/query.ts"; -export const QueryDeploymentsResponse = patched(_QueryDeploymentsResponse); -export type QueryDeploymentsResponse = _QueryDeploymentsResponse -export const QueryDeploymentResponse = patched(_QueryDeploymentResponse); -export type QueryDeploymentResponse = _QueryDeploymentResponse -export const QueryGroupResponse = patched(_QueryGroupResponse); -export type QueryGroupResponse = _QueryGroupResponse +export { QueryDeploymentsRequest, QueryDeploymentsResponse, QueryDeploymentRequest, QueryDeploymentResponse, QueryGroupRequest, QueryGroupResponse, QueryParamsRequest, QueryParamsResponse } from "./akash/deployment/v1beta4/query.ts"; export { EventProviderCreated, EventProviderUpdated, EventProviderDeleted } from "./akash/provider/v1beta4/event.ts"; export { Info, Provider } from "./akash/provider/v1beta4/provider.ts"; export { GenesisState as Provider_GenesisState } from "./akash/provider/v1beta4/genesis.ts"; diff --git a/ts/src/generated/protos/index.akash.v1beta5.ts b/ts/src/generated/protos/index.akash.v1beta5.ts index 8e18b51d..6ad0f5d6 100644 --- a/ts/src/generated/protos/index.akash.v1beta5.ts +++ b/ts/src/generated/protos/index.akash.v1beta5.ts @@ -1,41 +1,10 @@ -import { patched } from "./nodePatchMessage.ts"; - export { ResourceOffer } from "./akash/market/v1beta5/resourcesoffer.ts"; -export { Bid_State } from "./akash/market/v1beta5/bid.ts"; - -import { Bid as _Bid } from "./akash/market/v1beta5/bid.ts"; -export const Bid = patched(_Bid); -export type Bid = _Bid -export { MsgCreateBidResponse, MsgCloseBid, MsgCloseBidResponse } from "./akash/market/v1beta5/bidmsg.ts"; - -import { MsgCreateBid as _MsgCreateBid } from "./akash/market/v1beta5/bidmsg.ts"; -export const MsgCreateBid = patched(_MsgCreateBid); -export type MsgCreateBid = _MsgCreateBid +export { Bid, Bid_State } from "./akash/market/v1beta5/bid.ts"; +export { MsgCreateBid, MsgCreateBidResponse, MsgCloseBid, MsgCloseBidResponse } from "./akash/market/v1beta5/bidmsg.ts"; export { BidFilters, OrderFilters } from "./akash/market/v1beta5/filters.ts"; export { Params } from "./akash/market/v1beta5/params.ts"; -export { Order_State } from "./akash/market/v1beta5/order.ts"; - -import { Order as _Order } from "./akash/market/v1beta5/order.ts"; -export const Order = patched(_Order); -export type Order = _Order - -import { GenesisState as _GenesisState } from "./akash/market/v1beta5/genesis.ts"; -export const GenesisState = patched(_GenesisState); -export type GenesisState = _GenesisState +export { Order, Order_State } from "./akash/market/v1beta5/order.ts"; +export { GenesisState } from "./akash/market/v1beta5/genesis.ts"; export { MsgCreateLease, MsgCreateLeaseResponse, MsgWithdrawLease, MsgWithdrawLeaseResponse, MsgCloseLease, MsgCloseLeaseResponse } from "./akash/market/v1beta5/leasemsg.ts"; export { MsgUpdateParams, MsgUpdateParamsResponse } from "./akash/market/v1beta5/paramsmsg.ts"; -export { QueryOrdersRequest, QueryOrderRequest, QueryBidsRequest, QueryBidRequest, QueryLeasesRequest, QueryLeaseRequest, QueryParamsRequest, QueryParamsResponse } from "./akash/market/v1beta5/query.ts"; - -import { QueryOrdersResponse as _QueryOrdersResponse, QueryOrderResponse as _QueryOrderResponse, QueryBidsResponse as _QueryBidsResponse, QueryBidResponse as _QueryBidResponse, QueryLeasesResponse as _QueryLeasesResponse, QueryLeaseResponse as _QueryLeaseResponse } from "./akash/market/v1beta5/query.ts"; -export const QueryOrdersResponse = patched(_QueryOrdersResponse); -export type QueryOrdersResponse = _QueryOrdersResponse -export const QueryOrderResponse = patched(_QueryOrderResponse); -export type QueryOrderResponse = _QueryOrderResponse -export const QueryBidsResponse = patched(_QueryBidsResponse); -export type QueryBidsResponse = _QueryBidsResponse -export const QueryBidResponse = patched(_QueryBidResponse); -export type QueryBidResponse = _QueryBidResponse -export const QueryLeasesResponse = patched(_QueryLeasesResponse); -export type QueryLeasesResponse = _QueryLeasesResponse -export const QueryLeaseResponse = patched(_QueryLeaseResponse); -export type QueryLeaseResponse = _QueryLeaseResponse +export { QueryOrdersRequest, QueryOrdersResponse, QueryOrderRequest, QueryOrderResponse, QueryBidsRequest, QueryBidsResponse, QueryBidRequest, QueryBidResponse, QueryLeasesRequest, QueryLeasesResponse, QueryLeaseRequest, QueryLeaseResponse, QueryParamsRequest, QueryParamsResponse } from "./akash/market/v1beta5/query.ts"; diff --git a/ts/src/generated/protos/index.cosmos.v1.ts b/ts/src/generated/protos/index.cosmos.v1.ts index 12e48446..30b7fdc4 100644 --- a/ts/src/generated/protos/index.cosmos.v1.ts +++ b/ts/src/generated/protos/index.cosmos.v1.ts @@ -1,5 +1,3 @@ -import { patched } from "./cosmosPatchMessage.ts"; - export { Module, ModuleAccountPermission } from "./cosmos/auth/module/v1/module.ts"; export { Module as Module_Module } from "./cosmos/authz/module/v1/module.ts"; export { ModuleOptions, ServiceCommandDescriptor, RpcCommandOptions, FlagOptions, PositionalArgDescriptor } from "./cosmos/autocli/v1/options.ts"; @@ -41,27 +39,10 @@ export { Module as Mint_Module_Module } from "./cosmos/mint/module/v1/module.ts" export { Module as Nft_Module_Module } from "./cosmos/nft/module/v1/module.ts"; export { Module as Params_Module_Module } from "./cosmos/params/module/v1/module.ts"; export { Module as Protocolpool_Module_Module } from "./cosmos/protocolpool/module/v1/module.ts"; -export { Params as Protocolpool_Params } from "./cosmos/protocolpool/v1/types.ts"; - -import { ContinuousFund as _ContinuousFund } from "./cosmos/protocolpool/v1/types.ts"; -export const ContinuousFund = patched(_ContinuousFund); -export type ContinuousFund = _ContinuousFund - -import { GenesisState as _Protocolpool_GenesisState } from "./cosmos/protocolpool/v1/genesis.ts"; -export const Protocolpool_GenesisState = patched(_Protocolpool_GenesisState); -export type Protocolpool_GenesisState = _Protocolpool_GenesisState -export { QueryCommunityPoolRequest, QueryCommunityPoolResponse, QueryContinuousFundRequest, QueryContinuousFundsRequest, QueryParamsRequest as Protocolpool_QueryParamsRequest, QueryParamsResponse as Protocolpool_QueryParamsResponse } from "./cosmos/protocolpool/v1/query.ts"; - -import { QueryContinuousFundResponse as _QueryContinuousFundResponse, QueryContinuousFundsResponse as _QueryContinuousFundsResponse } from "./cosmos/protocolpool/v1/query.ts"; -export const QueryContinuousFundResponse = patched(_QueryContinuousFundResponse); -export type QueryContinuousFundResponse = _QueryContinuousFundResponse -export const QueryContinuousFundsResponse = patched(_QueryContinuousFundsResponse); -export type QueryContinuousFundsResponse = _QueryContinuousFundsResponse -export { MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgCreateContinuousFundResponse, MsgCancelContinuousFund, MsgCancelContinuousFundResponse, MsgUpdateParams as Protocolpool_MsgUpdateParams, MsgUpdateParamsResponse as Protocolpool_MsgUpdateParamsResponse } from "./cosmos/protocolpool/v1/tx.ts"; - -import { MsgCreateContinuousFund as _MsgCreateContinuousFund } from "./cosmos/protocolpool/v1/tx.ts"; -export const MsgCreateContinuousFund = patched(_MsgCreateContinuousFund); -export type MsgCreateContinuousFund = _MsgCreateContinuousFund +export { ContinuousFund, Params as Protocolpool_Params } from "./cosmos/protocolpool/v1/types.ts"; +export { GenesisState as Protocolpool_GenesisState } from "./cosmos/protocolpool/v1/genesis.ts"; +export { QueryCommunityPoolRequest, QueryCommunityPoolResponse, QueryContinuousFundRequest, QueryContinuousFundResponse, QueryContinuousFundsRequest, QueryContinuousFundsResponse, QueryParamsRequest as Protocolpool_QueryParamsRequest, QueryParamsResponse as Protocolpool_QueryParamsResponse } from "./cosmos/protocolpool/v1/query.ts"; +export { MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgCreateContinuousFund, MsgCreateContinuousFundResponse, MsgCancelContinuousFund, MsgCancelContinuousFundResponse, MsgUpdateParams as Protocolpool_MsgUpdateParams, MsgUpdateParamsResponse as Protocolpool_MsgUpdateParamsResponse } from "./cosmos/protocolpool/v1/tx.ts"; export { FileDescriptorsRequest, FileDescriptorsResponse } from "./cosmos/reflection/v1/reflection.ts"; export { Module as Slashing_Module_Module } from "./cosmos/slashing/module/v1/module.ts"; export { Module as Staking_Module_Module } from "./cosmos/staking/module/v1/module.ts"; diff --git a/ts/src/generated/protos/index.cosmos.v1beta1.ts b/ts/src/generated/protos/index.cosmos.v1beta1.ts index 96c60503..55725939 100644 --- a/ts/src/generated/protos/index.cosmos.v1beta1.ts +++ b/ts/src/generated/protos/index.cosmos.v1beta1.ts @@ -1,5 +1,3 @@ -import { patched } from "./cosmosPatchMessage.ts"; - export { BaseAccount, ModuleAccount, ModuleCredential, Params } from "./cosmos/auth/v1beta1/auth.ts"; export { GenesisState } from "./cosmos/auth/v1beta1/genesis.ts"; export { PageRequest, PageResponse } from "./cosmos/base/query/v1beta1/pagination.ts"; @@ -10,13 +8,7 @@ export { EventGrant, EventRevoke } from "./cosmos/authz/v1beta1/event.ts"; export { GenesisState as Authz_GenesisState } from "./cosmos/authz/v1beta1/genesis.ts"; export { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./cosmos/authz/v1beta1/query.ts"; export { MsgGrant, MsgGrantResponse, MsgExec, MsgExecResponse, MsgRevoke, MsgRevokeResponse } from "./cosmos/authz/v1beta1/tx.ts"; -export { Coin, IntProto } from "./cosmos/base/v1beta1/coin.ts"; - -import { DecCoin as _DecCoin, DecProto as _DecProto } from "./cosmos/base/v1beta1/coin.ts"; -export const DecCoin = patched(_DecCoin); -export type DecCoin = _DecCoin -export const DecProto = patched(_DecProto); -export type DecProto = _DecProto +export { Coin, DecCoin, IntProto, DecProto } from "./cosmos/base/v1beta1/coin.ts"; export { SendAuthorization } from "./cosmos/bank/v1beta1/authz.ts"; export { Params as Bank_Params, SendEnabled, Input, Output, Supply, DenomUnit, Metadata } from "./cosmos/bank/v1beta1/bank.ts"; export { GenesisState as Bank_GenesisState, Balance } from "./cosmos/bank/v1beta1/genesis.ts"; @@ -30,70 +22,10 @@ export { GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, GetLat export { GenesisState as Crisis_GenesisState } from "./cosmos/crisis/v1beta1/genesis.ts"; export { MsgVerifyInvariant, MsgVerifyInvariantResponse, MsgUpdateParams as Crisis_MsgUpdateParams, MsgUpdateParamsResponse as Crisis_MsgUpdateParamsResponse } from "./cosmos/crisis/v1beta1/tx.ts"; export { MultiSignature, CompactBitArray } from "./cosmos/crypto/multisig/v1beta1/multisig.ts"; -export { CommunityPoolSpendProposal, CommunityPoolSpendProposalWithDeposit } from "./cosmos/distribution/v1beta1/distribution.ts"; - -import { Params as _Distribution_Params, ValidatorHistoricalRewards as _ValidatorHistoricalRewards, ValidatorCurrentRewards as _ValidatorCurrentRewards, ValidatorAccumulatedCommission as _ValidatorAccumulatedCommission, ValidatorOutstandingRewards as _ValidatorOutstandingRewards, ValidatorSlashEvent as _ValidatorSlashEvent, ValidatorSlashEvents as _ValidatorSlashEvents, FeePool as _FeePool, DelegatorStartingInfo as _DelegatorStartingInfo, DelegationDelegatorReward as _DelegationDelegatorReward } from "./cosmos/distribution/v1beta1/distribution.ts"; -export const Distribution_Params = patched(_Distribution_Params); -export type Distribution_Params = _Distribution_Params -export const ValidatorHistoricalRewards = patched(_ValidatorHistoricalRewards); -export type ValidatorHistoricalRewards = _ValidatorHistoricalRewards -export const ValidatorCurrentRewards = patched(_ValidatorCurrentRewards); -export type ValidatorCurrentRewards = _ValidatorCurrentRewards -export const ValidatorAccumulatedCommission = patched(_ValidatorAccumulatedCommission); -export type ValidatorAccumulatedCommission = _ValidatorAccumulatedCommission -export const ValidatorOutstandingRewards = patched(_ValidatorOutstandingRewards); -export type ValidatorOutstandingRewards = _ValidatorOutstandingRewards -export const ValidatorSlashEvent = patched(_ValidatorSlashEvent); -export type ValidatorSlashEvent = _ValidatorSlashEvent -export const ValidatorSlashEvents = patched(_ValidatorSlashEvents); -export type ValidatorSlashEvents = _ValidatorSlashEvents -export const FeePool = patched(_FeePool); -export type FeePool = _FeePool -export const DelegatorStartingInfo = patched(_DelegatorStartingInfo); -export type DelegatorStartingInfo = _DelegatorStartingInfo -export const DelegationDelegatorReward = patched(_DelegationDelegatorReward); -export type DelegationDelegatorReward = _DelegationDelegatorReward -export { DelegatorWithdrawInfo } from "./cosmos/distribution/v1beta1/genesis.ts"; - -import { ValidatorOutstandingRewardsRecord as _ValidatorOutstandingRewardsRecord, ValidatorAccumulatedCommissionRecord as _ValidatorAccumulatedCommissionRecord, ValidatorHistoricalRewardsRecord as _ValidatorHistoricalRewardsRecord, ValidatorCurrentRewardsRecord as _ValidatorCurrentRewardsRecord, DelegatorStartingInfoRecord as _DelegatorStartingInfoRecord, ValidatorSlashEventRecord as _ValidatorSlashEventRecord, GenesisState as _Distribution_GenesisState } from "./cosmos/distribution/v1beta1/genesis.ts"; -export const ValidatorOutstandingRewardsRecord = patched(_ValidatorOutstandingRewardsRecord); -export type ValidatorOutstandingRewardsRecord = _ValidatorOutstandingRewardsRecord -export const ValidatorAccumulatedCommissionRecord = patched(_ValidatorAccumulatedCommissionRecord); -export type ValidatorAccumulatedCommissionRecord = _ValidatorAccumulatedCommissionRecord -export const ValidatorHistoricalRewardsRecord = patched(_ValidatorHistoricalRewardsRecord); -export type ValidatorHistoricalRewardsRecord = _ValidatorHistoricalRewardsRecord -export const ValidatorCurrentRewardsRecord = patched(_ValidatorCurrentRewardsRecord); -export type ValidatorCurrentRewardsRecord = _ValidatorCurrentRewardsRecord -export const DelegatorStartingInfoRecord = patched(_DelegatorStartingInfoRecord); -export type DelegatorStartingInfoRecord = _DelegatorStartingInfoRecord -export const ValidatorSlashEventRecord = patched(_ValidatorSlashEventRecord); -export type ValidatorSlashEventRecord = _ValidatorSlashEventRecord -export const Distribution_GenesisState = patched(_Distribution_GenesisState); -export type Distribution_GenesisState = _Distribution_GenesisState -export { QueryParamsRequest as Distribution_QueryParamsRequest, QueryValidatorDistributionInfoRequest, QueryValidatorOutstandingRewardsRequest, QueryValidatorCommissionRequest, QueryValidatorSlashesRequest, QueryDelegationRewardsRequest, QueryDelegationTotalRewardsRequest, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest } from "./cosmos/distribution/v1beta1/query.ts"; - -import { QueryParamsResponse as _Distribution_QueryParamsResponse, QueryValidatorDistributionInfoResponse as _QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsResponse as _QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionResponse as _QueryValidatorCommissionResponse, QueryValidatorSlashesResponse as _QueryValidatorSlashesResponse, QueryDelegationRewardsResponse as _QueryDelegationRewardsResponse, QueryDelegationTotalRewardsResponse as _QueryDelegationTotalRewardsResponse, QueryCommunityPoolResponse as _QueryCommunityPoolResponse } from "./cosmos/distribution/v1beta1/query.ts"; -export const Distribution_QueryParamsResponse = patched(_Distribution_QueryParamsResponse); -export type Distribution_QueryParamsResponse = _Distribution_QueryParamsResponse -export const QueryValidatorDistributionInfoResponse = patched(_QueryValidatorDistributionInfoResponse); -export type QueryValidatorDistributionInfoResponse = _QueryValidatorDistributionInfoResponse -export const QueryValidatorOutstandingRewardsResponse = patched(_QueryValidatorOutstandingRewardsResponse); -export type QueryValidatorOutstandingRewardsResponse = _QueryValidatorOutstandingRewardsResponse -export const QueryValidatorCommissionResponse = patched(_QueryValidatorCommissionResponse); -export type QueryValidatorCommissionResponse = _QueryValidatorCommissionResponse -export const QueryValidatorSlashesResponse = patched(_QueryValidatorSlashesResponse); -export type QueryValidatorSlashesResponse = _QueryValidatorSlashesResponse -export const QueryDelegationRewardsResponse = patched(_QueryDelegationRewardsResponse); -export type QueryDelegationRewardsResponse = _QueryDelegationRewardsResponse -export const QueryDelegationTotalRewardsResponse = patched(_QueryDelegationTotalRewardsResponse); -export type QueryDelegationTotalRewardsResponse = _QueryDelegationTotalRewardsResponse -export const QueryCommunityPoolResponse = patched(_QueryCommunityPoolResponse); -export type QueryCommunityPoolResponse = _QueryCommunityPoolResponse -export { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParamsResponse as Distribution_MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } from "./cosmos/distribution/v1beta1/tx.ts"; - -import { MsgUpdateParams as _Distribution_MsgUpdateParams } from "./cosmos/distribution/v1beta1/tx.ts"; -export const Distribution_MsgUpdateParams = patched(_Distribution_MsgUpdateParams); -export type Distribution_MsgUpdateParams = _Distribution_MsgUpdateParams +export { Params as Distribution_Params, ValidatorHistoricalRewards, ValidatorCurrentRewards, ValidatorAccumulatedCommission, ValidatorOutstandingRewards, ValidatorSlashEvent, ValidatorSlashEvents, FeePool, CommunityPoolSpendProposal, DelegatorStartingInfo, DelegationDelegatorReward, CommunityPoolSpendProposalWithDeposit } from "./cosmos/distribution/v1beta1/distribution.ts"; +export { DelegatorWithdrawInfo, ValidatorOutstandingRewardsRecord, ValidatorAccumulatedCommissionRecord, ValidatorHistoricalRewardsRecord, ValidatorCurrentRewardsRecord, DelegatorStartingInfoRecord, ValidatorSlashEventRecord, GenesisState as Distribution_GenesisState } from "./cosmos/distribution/v1beta1/genesis.ts"; +export { QueryParamsRequest as Distribution_QueryParamsRequest, QueryParamsResponse as Distribution_QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./cosmos/distribution/v1beta1/query.ts"; +export { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams as Distribution_MsgUpdateParams, MsgUpdateParamsResponse as Distribution_MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } from "./cosmos/distribution/v1beta1/tx.ts"; export { EventEpochEnd, EventEpochStart } from "./cosmos/epochs/v1beta1/events.ts"; export { EpochInfo, GenesisState as Epochs_GenesisState } from "./cosmos/epochs/v1beta1/genesis.ts"; export { QueryEpochInfosRequest, QueryEpochInfosResponse, QueryCurrentEpochRequest, QueryCurrentEpochResponse } from "./cosmos/epochs/v1beta1/query.ts"; @@ -106,57 +38,14 @@ export { GenesisState as Feegrant_GenesisState } from "./cosmos/feegrant/v1beta1 export { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./cosmos/feegrant/v1beta1/query.ts"; export { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse, MsgPruneAllowances, MsgPruneAllowancesResponse } from "./cosmos/feegrant/v1beta1/tx.ts"; export { GenesisState as Genutil_GenesisState } from "./cosmos/genutil/v1beta1/genesis.ts"; -export { TextProposal, Deposit, Proposal, TallyResult, DepositParams, VotingParams, VoteOption, ProposalStatus } from "./cosmos/gov/v1beta1/gov.ts"; - -import { WeightedVoteOption as _WeightedVoteOption, Vote as _Vote, TallyParams as _TallyParams } from "./cosmos/gov/v1beta1/gov.ts"; -export const WeightedVoteOption = patched(_WeightedVoteOption); -export type WeightedVoteOption = _WeightedVoteOption -export const Vote = patched(_Vote); -export type Vote = _Vote -export const TallyParams = patched(_TallyParams); -export type TallyParams = _TallyParams - -import { GenesisState as _Gov_GenesisState } from "./cosmos/gov/v1beta1/genesis.ts"; -export const Gov_GenesisState = patched(_Gov_GenesisState); -export type Gov_GenesisState = _Gov_GenesisState -export { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVotesRequest, QueryParamsRequest as Gov_QueryParamsRequest, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./cosmos/gov/v1beta1/query.ts"; - -import { QueryVoteResponse as _QueryVoteResponse, QueryVotesResponse as _QueryVotesResponse, QueryParamsResponse as _Gov_QueryParamsResponse } from "./cosmos/gov/v1beta1/query.ts"; -export const QueryVoteResponse = patched(_QueryVoteResponse); -export type QueryVoteResponse = _QueryVoteResponse -export const QueryVotesResponse = patched(_QueryVotesResponse); -export type QueryVotesResponse = _QueryVotesResponse -export const Gov_QueryParamsResponse = patched(_Gov_QueryParamsResponse); -export type Gov_QueryParamsResponse = _Gov_QueryParamsResponse -export { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./cosmos/gov/v1beta1/tx.ts"; - -import { MsgVoteWeighted as _MsgVoteWeighted } from "./cosmos/gov/v1beta1/tx.ts"; -export const MsgVoteWeighted = patched(_MsgVoteWeighted); -export type MsgVoteWeighted = _MsgVoteWeighted - -import { Minter as _Minter, Params as _Mint_Params } from "./cosmos/mint/v1beta1/mint.ts"; -export const Minter = patched(_Minter); -export type Minter = _Minter -export const Mint_Params = patched(_Mint_Params); -export type Mint_Params = _Mint_Params - -import { GenesisState as _Mint_GenesisState } from "./cosmos/mint/v1beta1/genesis.ts"; -export const Mint_GenesisState = patched(_Mint_GenesisState); -export type Mint_GenesisState = _Mint_GenesisState -export { QueryParamsRequest as Mint_QueryParamsRequest, QueryInflationRequest, QueryAnnualProvisionsRequest } from "./cosmos/mint/v1beta1/query.ts"; - -import { QueryParamsResponse as _Mint_QueryParamsResponse, QueryInflationResponse as _QueryInflationResponse, QueryAnnualProvisionsResponse as _QueryAnnualProvisionsResponse } from "./cosmos/mint/v1beta1/query.ts"; -export const Mint_QueryParamsResponse = patched(_Mint_QueryParamsResponse); -export type Mint_QueryParamsResponse = _Mint_QueryParamsResponse -export const QueryInflationResponse = patched(_QueryInflationResponse); -export type QueryInflationResponse = _QueryInflationResponse -export const QueryAnnualProvisionsResponse = patched(_QueryAnnualProvisionsResponse); -export type QueryAnnualProvisionsResponse = _QueryAnnualProvisionsResponse -export { MsgUpdateParamsResponse as Mint_MsgUpdateParamsResponse } from "./cosmos/mint/v1beta1/tx.ts"; - -import { MsgUpdateParams as _Mint_MsgUpdateParams } from "./cosmos/mint/v1beta1/tx.ts"; -export const Mint_MsgUpdateParams = patched(_Mint_MsgUpdateParams); -export type Mint_MsgUpdateParams = _Mint_MsgUpdateParams +export { WeightedVoteOption, TextProposal, Deposit, Proposal, TallyResult, Vote, DepositParams, VotingParams, TallyParams, VoteOption, ProposalStatus } from "./cosmos/gov/v1beta1/gov.ts"; +export { GenesisState as Gov_GenesisState } from "./cosmos/gov/v1beta1/genesis.ts"; +export { QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest as Gov_QueryParamsRequest, QueryParamsResponse as Gov_QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./cosmos/gov/v1beta1/query.ts"; +export { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./cosmos/gov/v1beta1/tx.ts"; +export { Minter, Params as Mint_Params } from "./cosmos/mint/v1beta1/mint.ts"; +export { GenesisState as Mint_GenesisState } from "./cosmos/mint/v1beta1/genesis.ts"; +export { QueryParamsRequest as Mint_QueryParamsRequest, QueryParamsResponse as Mint_QueryParamsResponse, QueryInflationRequest, QueryInflationResponse, QueryAnnualProvisionsRequest, QueryAnnualProvisionsResponse } from "./cosmos/mint/v1beta1/query.ts"; +export { MsgUpdateParams as Mint_MsgUpdateParams, MsgUpdateParamsResponse as Mint_MsgUpdateParamsResponse } from "./cosmos/mint/v1beta1/tx.ts"; export { EventSend, EventMint, EventBurn } from "./cosmos/nft/v1beta1/event.ts"; export { Class, NFT } from "./cosmos/nft/v1beta1/nft.ts"; export { GenesisState as Nft_GenesisState, Entry } from "./cosmos/nft/v1beta1/genesis.ts"; @@ -164,89 +53,15 @@ export { QueryBalanceRequest as Nft_QueryBalanceRequest, QueryBalanceResponse as export { MsgSend as Nft_MsgSend, MsgSendResponse as Nft_MsgSendResponse } from "./cosmos/nft/v1beta1/tx.ts"; export { ParameterChangeProposal, ParamChange } from "./cosmos/params/v1beta1/params.ts"; export { QueryParamsRequest as Params_QueryParamsRequest, QueryParamsResponse as Params_QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse, Subspace } from "./cosmos/params/v1beta1/query.ts"; -export { ValidatorSigningInfo } from "./cosmos/slashing/v1beta1/slashing.ts"; - -import { Params as _Slashing_Params } from "./cosmos/slashing/v1beta1/slashing.ts"; -export const Slashing_Params = patched(_Slashing_Params); -export type Slashing_Params = _Slashing_Params -export { SigningInfo, ValidatorMissedBlocks, MissedBlock } from "./cosmos/slashing/v1beta1/genesis.ts"; - -import { GenesisState as _Slashing_GenesisState } from "./cosmos/slashing/v1beta1/genesis.ts"; -export const Slashing_GenesisState = patched(_Slashing_GenesisState); -export type Slashing_GenesisState = _Slashing_GenesisState -export { QueryParamsRequest as Slashing_QueryParamsRequest, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./cosmos/slashing/v1beta1/query.ts"; - -import { QueryParamsResponse as _Slashing_QueryParamsResponse } from "./cosmos/slashing/v1beta1/query.ts"; -export const Slashing_QueryParamsResponse = patched(_Slashing_QueryParamsResponse); -export type Slashing_QueryParamsResponse = _Slashing_QueryParamsResponse -export { MsgUnjail, MsgUnjailResponse, MsgUpdateParamsResponse as Slashing_MsgUpdateParamsResponse } from "./cosmos/slashing/v1beta1/tx.ts"; - -import { MsgUpdateParams as _Slashing_MsgUpdateParams } from "./cosmos/slashing/v1beta1/tx.ts"; -export const Slashing_MsgUpdateParams = patched(_Slashing_MsgUpdateParams); -export type Slashing_MsgUpdateParams = _Slashing_MsgUpdateParams +export { ValidatorSigningInfo, Params as Slashing_Params } from "./cosmos/slashing/v1beta1/slashing.ts"; +export { GenesisState as Slashing_GenesisState, SigningInfo, ValidatorMissedBlocks, MissedBlock } from "./cosmos/slashing/v1beta1/genesis.ts"; +export { QueryParamsRequest as Slashing_QueryParamsRequest, QueryParamsResponse as Slashing_QueryParamsResponse, QuerySigningInfoRequest, QuerySigningInfoResponse, QuerySigningInfosRequest, QuerySigningInfosResponse } from "./cosmos/slashing/v1beta1/query.ts"; +export { MsgUnjail, MsgUnjailResponse, MsgUpdateParams as Slashing_MsgUpdateParams, MsgUpdateParamsResponse as Slashing_MsgUpdateParamsResponse } from "./cosmos/slashing/v1beta1/tx.ts"; export { StakeAuthorization, StakeAuthorization_Validators, AuthorizationType } from "./cosmos/staking/v1beta1/authz.ts"; -export { Description, ValAddresses, DVPair, DVPairs, DVVTriplet, DVVTriplets, UnbondingDelegation, UnbondingDelegationEntry, Pool, ValidatorUpdates, BondStatus, Infraction } from "./cosmos/staking/v1beta1/staking.ts"; - -import { HistoricalInfo as _HistoricalInfo, CommissionRates as _CommissionRates, Commission as _Commission, Validator as _Staking_Validator, Delegation as _Delegation, RedelegationEntry as _RedelegationEntry, Redelegation as _Redelegation, Params as _Staking_Params, DelegationResponse as _DelegationResponse, RedelegationEntryResponse as _RedelegationEntryResponse, RedelegationResponse as _RedelegationResponse } from "./cosmos/staking/v1beta1/staking.ts"; -export const HistoricalInfo = patched(_HistoricalInfo); -export type HistoricalInfo = _HistoricalInfo -export const CommissionRates = patched(_CommissionRates); -export type CommissionRates = _CommissionRates -export const Commission = patched(_Commission); -export type Commission = _Commission -export const Staking_Validator = patched(_Staking_Validator); -export type Staking_Validator = _Staking_Validator -export const Delegation = patched(_Delegation); -export type Delegation = _Delegation -export const RedelegationEntry = patched(_RedelegationEntry); -export type RedelegationEntry = _RedelegationEntry -export const Redelegation = patched(_Redelegation); -export type Redelegation = _Redelegation -export const Staking_Params = patched(_Staking_Params); -export type Staking_Params = _Staking_Params -export const DelegationResponse = patched(_DelegationResponse); -export type DelegationResponse = _DelegationResponse -export const RedelegationEntryResponse = patched(_RedelegationEntryResponse); -export type RedelegationEntryResponse = _RedelegationEntryResponse -export const RedelegationResponse = patched(_RedelegationResponse); -export type RedelegationResponse = _RedelegationResponse -export { LastValidatorPower } from "./cosmos/staking/v1beta1/genesis.ts"; - -import { GenesisState as _Staking_GenesisState } from "./cosmos/staking/v1beta1/genesis.ts"; -export const Staking_GenesisState = patched(_Staking_GenesisState); -export type Staking_GenesisState = _Staking_GenesisState -export { QueryValidatorsRequest, QueryValidatorRequest, QueryValidatorDelegationsRequest, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryDelegatorValidatorsRequest as Staking_QueryDelegatorValidatorsRequest, QueryDelegatorValidatorRequest, QueryHistoricalInfoRequest, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest as Staking_QueryParamsRequest } from "./cosmos/staking/v1beta1/query.ts"; - -import { QueryValidatorsResponse as _QueryValidatorsResponse, QueryValidatorResponse as _QueryValidatorResponse, QueryValidatorDelegationsResponse as _QueryValidatorDelegationsResponse, QueryDelegationResponse as _QueryDelegationResponse, QueryDelegatorDelegationsResponse as _QueryDelegatorDelegationsResponse, QueryRedelegationsResponse as _QueryRedelegationsResponse, QueryDelegatorValidatorsResponse as _Staking_QueryDelegatorValidatorsResponse, QueryDelegatorValidatorResponse as _QueryDelegatorValidatorResponse, QueryHistoricalInfoResponse as _QueryHistoricalInfoResponse, QueryParamsResponse as _Staking_QueryParamsResponse } from "./cosmos/staking/v1beta1/query.ts"; -export const QueryValidatorsResponse = patched(_QueryValidatorsResponse); -export type QueryValidatorsResponse = _QueryValidatorsResponse -export const QueryValidatorResponse = patched(_QueryValidatorResponse); -export type QueryValidatorResponse = _QueryValidatorResponse -export const QueryValidatorDelegationsResponse = patched(_QueryValidatorDelegationsResponse); -export type QueryValidatorDelegationsResponse = _QueryValidatorDelegationsResponse -export const QueryDelegationResponse = patched(_QueryDelegationResponse); -export type QueryDelegationResponse = _QueryDelegationResponse -export const QueryDelegatorDelegationsResponse = patched(_QueryDelegatorDelegationsResponse); -export type QueryDelegatorDelegationsResponse = _QueryDelegatorDelegationsResponse -export const QueryRedelegationsResponse = patched(_QueryRedelegationsResponse); -export type QueryRedelegationsResponse = _QueryRedelegationsResponse -export const Staking_QueryDelegatorValidatorsResponse = patched(_Staking_QueryDelegatorValidatorsResponse); -export type Staking_QueryDelegatorValidatorsResponse = _Staking_QueryDelegatorValidatorsResponse -export const QueryDelegatorValidatorResponse = patched(_QueryDelegatorValidatorResponse); -export type QueryDelegatorValidatorResponse = _QueryDelegatorValidatorResponse -export const QueryHistoricalInfoResponse = patched(_QueryHistoricalInfoResponse); -export type QueryHistoricalInfoResponse = _QueryHistoricalInfoResponse -export const Staking_QueryParamsResponse = patched(_Staking_QueryParamsResponse); -export type Staking_QueryParamsResponse = _Staking_QueryParamsResponse -export { MsgCreateValidatorResponse, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParamsResponse as Staking_MsgUpdateParamsResponse } from "./cosmos/staking/v1beta1/tx.ts"; - -import { MsgCreateValidator as _MsgCreateValidator, MsgEditValidator as _MsgEditValidator, MsgUpdateParams as _Staking_MsgUpdateParams } from "./cosmos/staking/v1beta1/tx.ts"; -export const MsgCreateValidator = patched(_MsgCreateValidator); -export type MsgCreateValidator = _MsgCreateValidator -export const MsgEditValidator = patched(_MsgEditValidator); -export type MsgEditValidator = _MsgEditValidator -export const Staking_MsgUpdateParams = patched(_Staking_MsgUpdateParams); -export type Staking_MsgUpdateParams = _Staking_MsgUpdateParams +export { HistoricalInfo, CommissionRates, Commission, Description, Validator as Staking_Validator, ValAddresses, DVPair, DVPairs, DVVTriplet, DVVTriplets, Delegation, UnbondingDelegation, UnbondingDelegationEntry, RedelegationEntry, Redelegation, Params as Staking_Params, DelegationResponse, RedelegationEntryResponse, RedelegationResponse, Pool, ValidatorUpdates, BondStatus, Infraction } from "./cosmos/staking/v1beta1/staking.ts"; +export { GenesisState as Staking_GenesisState, LastValidatorPower } from "./cosmos/staking/v1beta1/genesis.ts"; +export { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest as Staking_QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse as Staking_QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest as Staking_QueryParamsRequest, QueryParamsResponse as Staking_QueryParamsResponse } from "./cosmos/staking/v1beta1/query.ts"; +export { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams as Staking_MsgUpdateParams, MsgUpdateParamsResponse as Staking_MsgUpdateParamsResponse } from "./cosmos/staking/v1beta1/tx.ts"; export { Pairs, Pair } from "./cosmos/store/internal/kv/v1beta1/kv.ts"; export { StoreKVPair, BlockMetadata } from "./cosmos/store/v1beta1/listening.ts"; export { CommitInfo, StoreInfo, CommitID } from "./cosmos/store/v1beta1/commit_info.ts"; diff --git a/ts/src/sdk/chain/createChainNodeSDK.ts b/ts/src/sdk/chain/createChainNodeSDK.ts index 8514a844..f4878424 100644 --- a/ts/src/sdk/chain/createChainNodeSDK.ts +++ b/ts/src/sdk/chain/createChainNodeSDK.ts @@ -1,7 +1,5 @@ import { createSDK as createCosmosSDK } from "../../generated/createCosmosSDK.ts"; import { createSDK as createNodeSDK } from "../../generated/createNodeSDK.ts"; -import { patches as cosmosPatches } from "../../generated/patches/cosmosCustomTypePatches.ts"; -import { patches as nodePatches } from "../../generated/patches/nodeCustomTypePatches.ts"; import { getMessageType } from "../getMessageType.ts"; import { createNoopTransport } from "../transport/createNoopTransport.ts"; import type { GrpcTransportOptions } from "../transport/grpc/createGrpcTransport.ts"; @@ -33,12 +31,8 @@ export function createChainNodeSDK(options: ChainNodeSDKOptions) { unaryErrorMessage: `Unable to sign transaction. "tx" option is not provided during chain SDK creation`, }); } - const nodeSDK = createNodeSDK(queryTransport, txTransport, { - clientOptions: { typePatches: { ...cosmosPatches, ...nodePatches } }, - }); - const cosmosSDK = createCosmosSDK(queryTransport, txTransport, { - clientOptions: { typePatches: cosmosPatches }, - }); + const nodeSDK = createNodeSDK(queryTransport, txTransport); + const cosmosSDK = createCosmosSDK(queryTransport, txTransport); return { ...nodeSDK, ...cosmosSDK }; } diff --git a/ts/src/sdk/chain/createChainNodeWebSDK.ts b/ts/src/sdk/chain/createChainNodeWebSDK.ts index 7cf9ad95..3d6ad855 100644 --- a/ts/src/sdk/chain/createChainNodeWebSDK.ts +++ b/ts/src/sdk/chain/createChainNodeWebSDK.ts @@ -1,7 +1,5 @@ import { createSDK as createCosmosSDK } from "../../generated/createCosmosSDK.ts"; import { createSDK as createNodeSDK } from "../../generated/createNodeSDK.ts"; -import { patches as cosmosPatches } from "../../generated/patches/cosmosCustomTypePatches.ts"; -import { patches as nodePatches } from "../../generated/patches/nodeCustomTypePatches.ts"; import { getMessageType } from "../getMessageType.ts"; import { createNoopTransport } from "../transport/createNoopTransport.ts"; import { createGrpcGatewayTransport } from "../transport/grpc-gateway/createGrpcGatewayTransport.ts"; @@ -27,12 +25,8 @@ export function createChainNodeWebSDK(options: ChainNodeWebSDKOptions) { : createNoopTransport({ unaryErrorMessage: `Unable to sign transaction. "tx" option is not provided during chain SDK creation`, }); - const nodeSDK = createNodeSDK(queryTransport, txTransport, { - clientOptions: { typePatches: { ...cosmosPatches, ...nodePatches } }, - }); - const cosmosSDK = createCosmosSDK(queryTransport, txTransport, { - clientOptions: { typePatches: cosmosPatches }, - }); + const nodeSDK = createNodeSDK(queryTransport, txTransport); + const cosmosSDK = createCosmosSDK(queryTransport, txTransport); return { ...nodeSDK, ...cosmosSDK }; } diff --git a/ts/src/sdk/client/applyPatches.ts b/ts/src/sdk/client/applyPatches.ts deleted file mode 100644 index dbe6da99..00000000 --- a/ts/src/sdk/client/applyPatches.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { MessageDesc, MessageShape } from "./types.ts"; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type TypePatches = Record any>; - -export function applyPatches>(transform: "encode" | "decode", schema: T, message: MessageShape, patches: TypePatches): MessageShape { - if (Object.hasOwn(patches, schema.$type)) { - return patches[schema.$type](message, transform); - } - return message; -} diff --git a/ts/src/sdk/client/createClientFactory.ts b/ts/src/sdk/client/createClientFactory.ts index 0c88d5ec..b8f31b20 100644 --- a/ts/src/sdk/client/createClientFactory.ts +++ b/ts/src/sdk/client/createClientFactory.ts @@ -1,14 +1,14 @@ import type { Transport } from "../transport/types.ts"; -import type { Client, ServiceClientOptions } from "./createServiceClient.ts"; +import type { Client } from "./createServiceClient.ts"; import { createServiceClient } from "./createServiceClient.ts"; import type { ServiceDesc } from "./types.ts"; -export function createClientFactory(transport: Transport, options?: ServiceClientOptions): ClientFactory { +export function createClientFactory(transport: Transport): ClientFactory { const services: Record> = Object.create(null); return function getClient(service: T): Client { if (!services[service.typeName]) { - services[service.typeName] = createServiceClient(service, transport, options); + services[service.typeName] = createServiceClient(service, transport); } return services[service.typeName] as Client; }; diff --git a/ts/src/sdk/client/createServiceClient.spec.ts b/ts/src/sdk/client/createServiceClient.spec.ts index 6d99935e..90d6bcd5 100644 --- a/ts/src/sdk/client/createServiceClient.spec.ts +++ b/ts/src/sdk/client/createServiceClient.spec.ts @@ -5,7 +5,7 @@ import { proto } from "../../../test/helpers/proto.ts"; import type { StreamResponse, Transport, UnaryResponse } from "../transport/types.ts"; import { createServiceClient } from "./createServiceClient.ts"; import { createAsyncIterable } from "./stream.ts"; -import type { MessageDesc, MessageShape } from "./types.ts"; +import type { MessageDesc } from "./types.ts"; describe(createServiceClient.name, () => { describe("unary method", () => { @@ -50,56 +50,6 @@ describe(createServiceClient.name, () => { expect(onTrailer).toHaveBeenCalledWith(transportResult.trailer); }); - it("applies patches to types if provided", async () => { - const { TestServiceSchema } = await setup(); - const transport = createTransport("unary", () => ({ - message: { result: "result" }, - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const result = await client.testMethod({ test: "input" }); - - expect(transport.unary).toHaveBeenCalledWith( - TestServiceSchema.methods.testMethod, - { test: "encode-input" }, - undefined, - ); - expect(result).toEqual({ result: "decode-result" }); - }); - - it("returns object as is if its type does not require patching", async () => { - const { TestServiceSchema } = await setup(); - const transport = createTransport("unary", () => ({ - message: { result: "result" }, - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const result = await client.testMethod({ test: "input" }); - - expect(transport.unary).toHaveBeenCalledWith( - TestServiceSchema.methods.testMethod, - { test: "encode-input" }, - undefined, - ); - expect(result).toEqual({ result: "result" }); - }); - async function setup() { const def = await proto` service TestService { @@ -177,76 +127,6 @@ describe(createServiceClient.name, () => { expect(onTrailer).toHaveBeenCalledWith(transportResult.trailer); }); - it("applies patches to types if provided", async () => { - const { TestServiceSchema } = await setup(); - const results = Array.from({ length: 3 }, (_, i) => ({ result: `result${i + 1}` })); - - const transport = createTransport("stream", () => ({ - message: createAsyncIterable(results.map((result) => ({ - ...result, - }))), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const stream = client.testStreamMethod({ test: "input" }); - - expect(transport.stream).toHaveBeenCalledWith( - TestServiceSchema.methods.testStreamMethod, - expect.anything(), - undefined, - ); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual([{ - test: "encode-input", - }]); - expect(await Array.fromAsync(stream)).toEqual(results.map((result) => ({ - ...result, - result: `decode-${result.result}`, - }))); - }); - - it("returns object as is if its type does not require patching", async () => { - const { TestServiceSchema } = await setup(); - const results = Array.from({ length: 3 }, (_, i) => ({ result: `result${i + 1}` })); - - const transport = createTransport("stream", () => ({ - message: createAsyncIterable(results.map((result) => ({ - ...result, - }))), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - }, - }); - const stream = client.testStreamMethod({ test: "input" }); - - expect(transport.stream).toHaveBeenCalledWith( - TestServiceSchema.methods.testStreamMethod, - expect.anything(), - undefined, - ); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual([{ - test: "input", - }]); - expect(await Array.fromAsync(stream)).toEqual(results.map((result) => ({ - ...result, - result: `decode-${result.result}`, - }))); - }); - async function setup() { const def = await proto` service TestService { @@ -324,77 +204,6 @@ describe(createServiceClient.name, () => { expect(onTrailer).toHaveBeenCalledWith(transportResult.trailer); }); - it("applies patches to types if provided", async () => { - const { TestServiceSchema } = await setup(); - const input = Array.from({ length: 3 }, (_, i) => ({ test: `input${i + 1}` })); - - const transport = createTransport("stream", () => ({ - message: createAsyncIterable([ - { result: "result" }, - ]), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const result = await client.testClientStreamMethod(createAsyncIterable(input)); - - expect(result).toEqual({ result: "decode-result" }); - expect(transport.stream).toHaveBeenCalledWith( - TestServiceSchema.methods.testClientStreamMethod, - expect.anything(), - undefined, - ); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual( - input.map((item) => ({ - ...item, - - test: `encode-${item.test}`, - })), - ); - }); - - it("returns object as is if its type does not require patching", async () => { - const { TestServiceSchema } = await setup(); - const input = Array.from({ length: 3 }, (_, i) => ({ test: `input${i + 1}` })); - - const transport = createTransport("stream", () => ({ - message: createAsyncIterable([ - { result: "result" }, - ]), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - }, - }); - const result = await client.testClientStreamMethod(createAsyncIterable(input)); - - expect(result).toEqual({ result: "decode-result" }); - expect(transport.stream).toHaveBeenCalledWith( - TestServiceSchema.methods.testClientStreamMethod, - expect.anything(), - undefined, - ); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual( - input.map((item) => ({ - ...item, - - })), - ); - }); - async function setup() { const def = await proto` service TestService { @@ -476,77 +285,6 @@ describe(createServiceClient.name, () => { expect(onTrailer).toHaveBeenCalledWith(transportResult.trailer); }); - it("applies patches to types if provided", async () => { - const { TestServiceSchema } = await setup(); - const results = Array.from({ length: 3 }, (_, i) => ({ - result: `result${i + 1}`, - })); - const transport = createTransport("stream", () => ({ - message: createAsyncIterable(results.map((item) => ({ - ...item, - }))), - header: new Headers(), - trailer: new Headers(), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestOutput"(value: MessageShape, transform) { - value.result = `${transform}-${value.result}`; - return value; - }, - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const input = Array.from({ length: 3 }, (_, i) => ({ test: `input${i + 1}` })); - const methodsCallResult = client.testBiDiStreamMethod(createAsyncIterable(input)); - - expect(await Array.fromAsync(methodsCallResult)).toEqual(results.map((result) => ({ - ...result, - result: `decode-${result.result}`, - }))); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual( - input.map((item) => ({ - ...item, - test: `encode-${item.test}`, - })), - ); - }); - - it("returns object as is if its type does not require patching", async () => { - const { TestServiceSchema } = await setup(); - const results = Array.from({ length: 3 }, (_, i) => ({ - result: `result${i + 1}`, - })); - const transport = createTransport("stream", () => ({ - message: createAsyncIterable(results.map((item) => ({ - ...item, - }))), - header: new Headers(), - trailer: new Headers(), - })); - const client = createServiceClient(TestServiceSchema, transport, { - typePatches: { - "akash.test.unit.TestInput"(value: MessageShape, transform) { - value.test = `${transform}-${value.test}`; - return value; - }, - }, - }); - const input = Array.from({ length: 3 }, (_, i) => ({ test: `input${i + 1}` })); - const methodsCallResult = client.testBiDiStreamMethod(createAsyncIterable(input)); - - expect(await Array.fromAsync(methodsCallResult)).toEqual(results); - expect(await Array.fromAsync(transport.stream.mock.lastCall?.at(1) as AsyncIterable)).toEqual( - input.map((item) => ({ - ...item, - test: `encode-${item.test}`, - })), - ); - }); - async function setup() { const def = await proto` service TestService { diff --git a/ts/src/sdk/client/createServiceClient.ts b/ts/src/sdk/client/createServiceClient.ts index 74bd3ba3..0fa50ca1 100644 --- a/ts/src/sdk/client/createServiceClient.ts +++ b/ts/src/sdk/client/createServiceClient.ts @@ -1,7 +1,5 @@ import type { CallOptions, Transport } from "../transport/types.ts"; -import type { TypePatches } from "./applyPatches.ts"; -import { applyPatches } from "./applyPatches.ts"; -import { createAsyncIterable, handleStreamResponse, mapStream } from "./stream.ts"; +import { createAsyncIterable, handleStreamResponse } from "./stream.ts"; import type { MessageDesc, MessageInitShape, MessageShape, MethodDesc, ServiceDesc } from "./types.ts"; export type Client = { @@ -13,52 +11,33 @@ export type Client = { : never; }; -const defaultEncoder: MethodOptions = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - encode: (type: MessageDesc, value: unknown) => type.fromPartial(value as any), - decode: (_: MessageDesc, value: unknown) => value, -}; - export function createServiceClient( service: TSchema, transport: Transport, - options?: ServiceClientOptions, ): Client { - const methodOptions: MethodOptions = transport.requiresTypePatching && options?.typePatches - ? { encode: createEncodeWithPatches(options.typePatches), decode: createDecodeWithPatches(options.typePatches) } - : defaultEncoder; const client: Record> = {}; const methodNames = Object.keys(service.methods); for (let i = 0; i < methodNames.length; i++) { const methodDesc = service.methods[methodNames[i]]; - client[methodNames[i]] = createMethod(methodDesc as MethodDesc, transport, methodOptions); + client[methodNames[i]] = createMethod(methodDesc as MethodDesc, transport); } return client as Client; } -export interface ServiceClientOptions { - typePatches?: TypePatches; -} - -function createMethod(methodDesc: MethodDesc, transport: Transport, options: MethodOptions) { +function createMethod(methodDesc: MethodDesc, transport: Transport) { switch (methodDesc.kind) { case "server_streaming": - return createServerStreamingFn(transport, methodDesc as MethodDesc<"server_streaming", MessageDesc, MessageDesc>, options); + return createServerStreamingFn(transport, methodDesc as MethodDesc<"server_streaming", MessageDesc, MessageDesc>); case "client_streaming": - return createClientStreamingFn(transport, methodDesc as MethodDesc<"client_streaming", MessageDesc, MessageDesc>, options); + return createClientStreamingFn(transport, methodDesc as MethodDesc<"client_streaming", MessageDesc, MessageDesc>); case "bidi_streaming": - return createBiDiStreamingFn(transport, methodDesc as MethodDesc<"bidi_streaming", MessageDesc, MessageDesc>, options); + return createBiDiStreamingFn(transport, methodDesc as MethodDesc<"bidi_streaming", MessageDesc, MessageDesc>); default: - return createUnaryFn(transport, methodDesc as MethodDesc<"unary", MessageDesc, MessageDesc>, options); + return createUnaryFn(transport, methodDesc as MethodDesc<"unary", MessageDesc, MessageDesc>); } } -interface MethodOptions { - encode(schema: MessageDesc, value: unknown): unknown; - decode(schema: MessageDesc, value: unknown): unknown; -} - type UnaryFn, O extends MessageDesc> = ( input: MessageInitShape, options?: CallOptions, @@ -67,18 +46,17 @@ type UnaryFn, O extends MessageDesc> = ( function createUnaryFn, O extends MessageDesc>( transport: Transport, method: MethodDesc<"unary", I, O>, - methodOptions: MethodOptions, ): UnaryFn { return async (input, options) => { const response = await transport.unary( method, - methodOptions.encode(method.input, input) as MessageInitShape, + input, options, ); options?.onHeader?.(response.header); options?.onTrailer?.(response.trailer); - return methodOptions.decode(method.output, response.message) as MessageShape; + return response.message; }; } @@ -93,19 +71,16 @@ function createServerStreamingFn< >( transport: Transport, method: MethodDesc<"server_streaming", I, O>, - methodOptions: MethodOptions, ): ServerStreamingFn { return (input, options) => { return handleStreamResponse( method, transport.stream( method, - createAsyncIterable([methodOptions.encode(method.input, input) as MessageInitShape]), + createAsyncIterable([input]), options, ), options, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - methodOptions.decode as any, ); }; } @@ -121,12 +96,11 @@ function createClientStreamingFn< >( transport: Transport, method: MethodDesc<"client_streaming", I, O>, - methodOptions: MethodOptions, ): ClientStreamingFn { return async (input, options) => { const response = await transport.stream( method, - mapStream(input, (json) => methodOptions.encode(method.input, json) as MessageInitShape), + input, options, ); options?.onHeader?.(response.header); @@ -143,7 +117,7 @@ function createClientStreamingFn< throw new Error("akash sdk protocol error: received extra messages for client streaming method"); } options?.onTrailer?.(response.trailer); - return methodOptions.decode(method.output, singleMessage) as MessageShape; + return singleMessage; }; } @@ -158,42 +132,16 @@ function createBiDiStreamingFn< >( transport: Transport, method: MethodDesc<"bidi_streaming", I, O>, - methodOptions: MethodOptions, ): BiDiStreamingFn { return (input, options) => { return handleStreamResponse( method, transport.stream( method, - mapStream(input, (json) => methodOptions.encode(method.input, json) as MessageInitShape), + input, options, ), options, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - methodOptions.decode as any, ); }; } - -const PATCHED_FROM_JSON_CACHE = new Map(); -function createEncodeWithPatches(patches: TypePatches): MethodOptions["encode"] { - if (PATCHED_FROM_JSON_CACHE.has(patches)) return PATCHED_FROM_JSON_CACHE.get(patches)!; - - const encode: MethodOptions["encode"] = (messageDesc, value) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return applyPatches("encode", messageDesc, messageDesc.fromPartial(value as any), patches); - }; - PATCHED_FROM_JSON_CACHE.set(patches, encode); - return encode; -} - -const PATCHED_TO_JSON_CACHE = new Map(); -function createDecodeWithPatches(patches: TypePatches): MethodOptions["decode"] { - if (PATCHED_TO_JSON_CACHE.has(patches)) return PATCHED_TO_JSON_CACHE.get(patches)!; - - const decode: MethodOptions["decode"] = (schema, message) => { - return applyPatches("decode", schema, message, patches); - }; - PATCHED_TO_JSON_CACHE.set(patches, decode); - return decode; -} diff --git a/ts/src/sdk/client/stream.ts b/ts/src/sdk/client/stream.ts index b63b5ef4..999fc666 100644 --- a/ts/src/sdk/client/stream.ts +++ b/ts/src/sdk/client/stream.ts @@ -7,7 +7,7 @@ export function handleStreamResponse, stream: Promise>, options?: CallOptions, - transform: (schema: MessageDesc, value: MessageShape) => MessageShape = (_, value) => value as MessageShape, + transform?: (schema: MessageDesc, value: MessageShape) => MessageShape, ): AsyncIterable> { const it = (async function* () { const response = await stream; @@ -15,7 +15,8 @@ export function handleStreamResponse transform(method.output, value) as MessageShape); + + return transform ? mapStream(it, (value) => transform(method.output, value) as MessageShape) : it; } export function mapStream(stream: AsyncIterable, transform: (value: T) => U): AsyncIterable { diff --git a/ts/src/sdk/client/types.ts b/ts/src/sdk/client/types.ts index 8ba4b884..d199c87a 100644 --- a/ts/src/sdk/client/types.ts +++ b/ts/src/sdk/client/types.ts @@ -35,3 +35,6 @@ export interface MessageDesc { export type MessageShape = T extends Pick ? ReturnType : never; export type MessageInitShape = T extends Pick ? DeepPartial> : never; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type TypePatches = Record any>; diff --git a/ts/src/sdk/transport/grpc/createGrpcTransport.spec.ts b/ts/src/sdk/transport/grpc/createGrpcTransport.spec.ts index 92564ad1..bfe69f3b 100644 --- a/ts/src/sdk/transport/grpc/createGrpcTransport.spec.ts +++ b/ts/src/sdk/transport/grpc/createGrpcTransport.spec.ts @@ -10,11 +10,6 @@ import { TransportError } from "../TransportError.ts"; import { createGrpcTransport, type GrpcTransportOptions } from "./createGrpcTransport.ts"; describe(createGrpcTransport.name, () => { - it("has `requiresTypePatching` set to true", async () => { - const transport = createGrpcTransport({ baseUrl: "https://api.example.com" }); - expect(transport.requiresTypePatching).toBe(true); - }); - describe("unary method", () => { it("makes POST request to correct URL", async () => { const { transport, httpClient, TestMethodSchema } = await setup(); diff --git a/ts/src/sdk/transport/grpc/createGrpcTransport.ts b/ts/src/sdk/transport/grpc/createGrpcTransport.ts index 6773dca7..13574516 100644 --- a/ts/src/sdk/transport/grpc/createGrpcTransport.ts +++ b/ts/src/sdk/transport/grpc/createGrpcTransport.ts @@ -45,7 +45,6 @@ export function createGrpcTransport(options: GrpcTransportOptions): Transport( method: MethodDesc<"unary", I, O>, message: MessageInitShape, diff --git a/ts/src/sdk/transport/tx/createTxTransport.ts b/ts/src/sdk/transport/tx/createTxTransport.ts index 13f4cd51..d2096983 100644 --- a/ts/src/sdk/transport/tx/createTxTransport.ts +++ b/ts/src/sdk/transport/tx/createTxTransport.ts @@ -8,7 +8,6 @@ import { TxError } from "./TxError.ts"; export function createTxTransport(transportOptions: TransactionTransportOptions): Transport { return { - requiresTypePatching: true, async unary( method: MethodDesc<"unary", I, O>, input: MessageInitShape, diff --git a/ts/src/sdk/transport/types.ts b/ts/src/sdk/transport/types.ts index d583314c..a1a3bf09 100644 --- a/ts/src/sdk/transport/types.ts +++ b/ts/src/sdk/transport/types.ts @@ -15,7 +15,6 @@ export interface TxCallOptions { } export interface Transport { - requiresTypePatching?: boolean; /** * Call a unary RPC - a method that takes a single input message, and * responds with a single output message. diff --git a/ts/src/sdk/types.ts b/ts/src/sdk/types.ts index dfb2b4aa..5e7a63d8 100644 --- a/ts/src/sdk/types.ts +++ b/ts/src/sdk/types.ts @@ -1,10 +1,5 @@ -import type { ServiceClientOptions } from "./client/createServiceClient.ts"; import type { SDKMethod } from "./client/sdkMetadata.ts"; -export interface SDKOptions { - clientOptions?: ServiceClientOptions; -} - export type PayloadOf = Parameters[0]; export type ResponseOf = Awaited>; diff --git a/ts/test/functional/__snapshots__/protoc-gen-customtype-patches.spec.ts.snap b/ts/test/functional/__snapshots__/protoc-gen-customtype-patches.spec.ts.snap index 60f814f6..e144328a 100644 --- a/ts/test/functional/__snapshots__/protoc-gen-customtype-patches.spec.ts.snap +++ b/ts/test/functional/__snapshots__/protoc-gen-customtype-patches.spec.ts.snap @@ -1,6 +1,29 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`protoc-gen-customtype-patches plugin generates \`Set\` instance with all the types that have reference to fields with custom type option 1`] = ` +exports[`protoc-gen-customtype-patches plugin when patch_whole_tree is false generates \`Set\` instance with all the leaf types that have reference to fields with custom type option 1`] = ` +"import { LegacyDec } from "../../encoding/customTypes/LegacyDec.ts"; +import type * as _protos_customtype from "../protos/customtype.ts"; + +const p = { + "akash.test.functional.Dog"(value: _protos_customtype.Dog | undefined | null, transformType: 'encode' | 'decode') { + if (value == null) return; + const newValue = { ...value }; + if (value.name != null) newValue.name = LegacyDec[transformType](value.name); + return newValue; + }, + "akash.test.functional.Money"(value: _protos_customtype.Money | undefined | null, transformType: 'encode' | 'decode') { + if (value == null) return; + const newValue = { ...value }; + if (value.amount != null) newValue.amount = LegacyDec[transformType](value.amount); + return newValue; + } +}; + +export const patches = p; +" +`; + +exports[`protoc-gen-customtype-patches plugin when patch_whole_tree is true generates \`Set\` instance with all the types that have reference to fields with custom type option 1`] = ` "import type * as _protos_customtype from "../protos/customtype.ts"; import { LegacyDec } from "../../encoding/customTypes/LegacyDec.ts"; diff --git a/ts/test/functional/__snapshots__/protoc-gen-sdk-object.spec.ts.snap b/ts/test/functional/__snapshots__/protoc-gen-sdk-object.spec.ts.snap index 93066c38..b61db1dc 100644 --- a/ts/test/functional/__snapshots__/protoc-gen-sdk-object.spec.ts.snap +++ b/ts/test/functional/__snapshots__/protoc-gen-sdk-object.spec.ts.snap @@ -2,7 +2,6 @@ exports[`protoc-sdk-objec plugin generates SDK object from proto files 1`] = ` "import { createServiceLoader } from "../sdk/client/createServiceLoader.ts"; -import { SDKOptions } from "../sdk/types.ts"; import type * as msg from "./protos/msg.ts"; import type * as query from "./protos/query.ts"; @@ -16,9 +15,9 @@ export const serviceLoader= createServiceLoader([ () => import("./protos/msg_akash.ts").then(m => m.Msg), () => import("./protos/query_akash.ts").then(m => m.Query) ] as const); -export function createSDK(queryTransport: Transport, txTransport: Transport, options?: SDKOptions) { - const getClient = createClientFactory(queryTransport, options?.clientOptions); - const getMsgClient = createClientFactory(txTransport, options?.clientOptions); +export function createSDK(queryTransport: Transport, txTransport: Transport) { + const getClient = createClientFactory(queryTransport); + const getMsgClient = createClientFactory(txTransport); return { akash: { test: { diff --git a/ts/test/functional/protoc-gen-customtype-patches.spec.ts b/ts/test/functional/protoc-gen-customtype-patches.spec.ts index 596a7eb3..ab3053ed 100644 --- a/ts/test/functional/protoc-gen-customtype-patches.spec.ts +++ b/ts/test/functional/protoc-gen-customtype-patches.spec.ts @@ -1,48 +1,40 @@ -import { describe, expect, it } from "@jest/globals"; +import { afterEach, describe, expect, it } from "@jest/globals"; import { exec } from "child_process"; import { access, constants as fsConst, readFile, rmdir } from "fs/promises"; import { tmpdir } from "os"; import { join as joinPath } from "path"; +import type { PluginOptions } from "../../script/protoc-gen-customtype-patches.ts"; import { promisify } from "util"; const execAsync = promisify(exec); describe("protoc-gen-customtype-patches plugin", () => { - const config = { - version: "v2", - clean: true, - plugins: [ - { - local: "ts/script/protoc-gen-customtype-patches.ts", - strategy: "all", - out: ".", - opt: [ - "target=ts", - "import_extension=ts" - ], - }, - ], - }; - - it("generates `Set` instance with all the types that have reference to fields with custom type option", async () => { - const outputDir = joinPath(tmpdir(), `ts-bufplugin-${process.pid.toString()}`); - const protoDir = "./ts/test/functional/proto"; - const command = [ - `buf generate`, - `--config '${JSON.stringify({ - version: "v2", - modules: [ - { path: "go/vendor/github.com/cosmos/gogoproto" }, - { path: "./ts/test/functional/proto" }, - ], - })}'`, - `--template '${JSON.stringify(config)}'`, - `-o '${outputDir}'`, - `--path ${protoDir}/customtype.proto`, - protoDir, - ].join(" "); - - try { + const outputDir = joinPath(tmpdir(), `ts-bufplugin-${process.pid.toString()}`); + const protoDir = "./ts/test/functional/proto"; + + afterEach(async () => { + if (await access(outputDir, fsConst.W_OK).then(() => true, () => false)) { + await rmdir(outputDir, { recursive: true }); + } + }); + + describe('when patch_whole_tree is true', () => { + it("generates `Set` instance with all the types that have reference to fields with custom type option", async () => { + const command = [ + `buf generate`, + `--config '${JSON.stringify({ + version: "v2", + modules: [ + { path: "go/vendor/github.com/cosmos/gogoproto" }, + { path: "./ts/test/functional/proto" }, + ], + })}'`, + `--template '${JSON.stringify(createBufGenerateConfig({ patchWholeTree: true }))}'`, + `-o '${outputDir}'`, + `--path ${protoDir}/customtype.proto`, + protoDir, + ].join(" "); + await execAsync(command, { cwd: joinPath(__dirname, "..", "..", ".."), env: { @@ -52,10 +44,54 @@ describe("protoc-gen-customtype-patches plugin", () => { }); expect(await readFile(joinPath(outputDir, "customPatches.ts"), "utf-8")).toMatchSnapshot(); - } finally { - if (await access(outputDir, fsConst.W_OK).catch(() => false)) { - await rmdir(outputDir, { recursive: true }); - } - } + }); + }); + + describe('when patch_whole_tree is false', () => { + it("generates `Set` instance with all the leaf types that have reference to fields with custom type option", async () => { + const command = [ + `buf generate`, + `--config '${JSON.stringify({ + version: "v2", + modules: [ + { path: "go/vendor/github.com/cosmos/gogoproto" }, + { path: "./ts/test/functional/proto" }, + ], + })}'`, + `--template '${JSON.stringify(createBufGenerateConfig({ patchWholeTree: false }))}'`, + `-o '${outputDir}'`, + `--path ${protoDir}/customtype.proto`, + protoDir, + ].join(" "); + + await execAsync(command, { + cwd: joinPath(__dirname, "..", "..", ".."), + env: { + ...process.env, + BUF_PLUGIN_CUSTOMTYPE_TYPES_PATCHES_OUTPUT_FILE: "customPatches.ts", + }, + }); + + expect(await readFile(joinPath(outputDir, "customPatches.ts"), "utf-8")).toMatchSnapshot(); + }); }); + + function createBufGenerateConfig(options: PluginOptions) { + return { + version: "v2", + clean: true, + plugins: [ + { + local: "ts/script/protoc-gen-customtype-patches.ts", + strategy: "all", + out: ".", + opt: [ + "target=ts", + "import_extension=ts", + `patch_whole_tree=${options.patchWholeTree}`, + ], + }, + ], + }; + } });