diff --git a/ts-client/arkeo.arkeo/module.ts b/ts-client/arkeo.arkeo/module.ts index 6c26b0e1..70a8d153 100755 --- a/ts-client/arkeo.arkeo/module.ts +++ b/ts-client/arkeo.arkeo/module.ts @@ -7,12 +7,12 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgModProvider } from "./types/arkeo/arkeo/tx"; import { MsgBondProvider } from "./types/arkeo/arkeo/tx"; +import { MsgSetVersion } from "./types/arkeo/arkeo/tx"; +import { MsgClaimContractIncome } from "./types/arkeo/arkeo/tx"; +import { MsgModProvider } from "./types/arkeo/arkeo/tx"; import { MsgOpenContract } from "./types/arkeo/arkeo/tx"; import { MsgCloseContract } from "./types/arkeo/arkeo/tx"; -import { MsgClaimContractIncome } from "./types/arkeo/arkeo/tx"; -import { MsgSetVersion } from "./types/arkeo/arkeo/tx"; import { EventBondProvider as typeEventBondProvider} from "./types" import { EventModProvider as typeEventModProvider} from "./types" @@ -32,16 +32,28 @@ import { ProtoStrings as typeProtoStrings} from "./types" import { ProtoBools as typeProtoBools} from "./types" import { Params as typeParams} from "./types" -export { MsgModProvider, MsgBondProvider, MsgOpenContract, MsgCloseContract, MsgClaimContractIncome, MsgSetVersion }; +export { MsgBondProvider, MsgSetVersion, MsgClaimContractIncome, MsgModProvider, MsgOpenContract, MsgCloseContract }; -type sendMsgModProviderParams = { - value: MsgModProvider, +type sendMsgBondProviderParams = { + value: MsgBondProvider, fee?: StdFee, memo?: string }; -type sendMsgBondProviderParams = { - value: MsgBondProvider, +type sendMsgSetVersionParams = { + value: MsgSetVersion, + fee?: StdFee, + memo?: string +}; + +type sendMsgClaimContractIncomeParams = { + value: MsgClaimContractIncome, + fee?: StdFee, + memo?: string +}; + +type sendMsgModProviderParams = { + value: MsgModProvider, fee?: StdFee, memo?: string }; @@ -58,27 +70,23 @@ type sendMsgCloseContractParams = { memo?: string }; -type sendMsgClaimContractIncomeParams = { - value: MsgClaimContractIncome, - fee?: StdFee, - memo?: string + +type msgBondProviderParams = { + value: MsgBondProvider, }; -type sendMsgSetVersionParams = { +type msgSetVersionParams = { value: MsgSetVersion, - fee?: StdFee, - memo?: string }; +type msgClaimContractIncomeParams = { + value: MsgClaimContractIncome, +}; type msgModProviderParams = { value: MsgModProvider, }; -type msgBondProviderParams = { - value: MsgBondProvider, -}; - type msgOpenContractParams = { value: MsgOpenContract, }; @@ -87,14 +95,6 @@ type msgCloseContractParams = { value: MsgCloseContract, }; -type msgClaimContractIncomeParams = { - value: MsgClaimContractIncome, -}; - -type msgSetVersionParams = { - value: MsgSetVersion, -}; - export const registry = new Registry(msgTypes); @@ -125,136 +125,136 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgModProvider({ value, fee, memo }: sendMsgModProviderParams): Promise { + async sendMsgBondProvider({ value, fee, memo }: sendMsgBondProviderParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgModProvider: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgBondProvider: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgModProvider({ value: MsgModProvider.fromPartial(value) }) + let msg = this.msgBondProvider({ value: MsgBondProvider.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgModProvider: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgBondProvider: Could not broadcast Tx: '+ e.message) } }, - async sendMsgBondProvider({ value, fee, memo }: sendMsgBondProviderParams): Promise { + async sendMsgSetVersion({ value, fee, memo }: sendMsgSetVersionParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgBondProvider: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSetVersion: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgBondProvider({ value: MsgBondProvider.fromPartial(value) }) + let msg = this.msgSetVersion({ value: MsgSetVersion.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgBondProvider: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSetVersion: Could not broadcast Tx: '+ e.message) } }, - async sendMsgOpenContract({ value, fee, memo }: sendMsgOpenContractParams): Promise { + async sendMsgClaimContractIncome({ value, fee, memo }: sendMsgClaimContractIncomeParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgOpenContract: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgClaimContractIncome: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgOpenContract({ value: MsgOpenContract.fromPartial(value) }) + let msg = this.msgClaimContractIncome({ value: MsgClaimContractIncome.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgOpenContract: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgClaimContractIncome: Could not broadcast Tx: '+ e.message) } }, - async sendMsgCloseContract({ value, fee, memo }: sendMsgCloseContractParams): Promise { + async sendMsgModProvider({ value, fee, memo }: sendMsgModProviderParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCloseContract: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgModProvider: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCloseContract({ value: MsgCloseContract.fromPartial(value) }) + let msg = this.msgModProvider({ value: MsgModProvider.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCloseContract: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgModProvider: Could not broadcast Tx: '+ e.message) } }, - async sendMsgClaimContractIncome({ value, fee, memo }: sendMsgClaimContractIncomeParams): Promise { + async sendMsgOpenContract({ value, fee, memo }: sendMsgOpenContractParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgClaimContractIncome: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgOpenContract: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgClaimContractIncome({ value: MsgClaimContractIncome.fromPartial(value) }) + let msg = this.msgOpenContract({ value: MsgOpenContract.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgClaimContractIncome: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgOpenContract: Could not broadcast Tx: '+ e.message) } }, - async sendMsgSetVersion({ value, fee, memo }: sendMsgSetVersionParams): Promise { + async sendMsgCloseContract({ value, fee, memo }: sendMsgCloseContractParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSetVersion: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCloseContract: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSetVersion({ value: MsgSetVersion.fromPartial(value) }) + let msg = this.msgCloseContract({ value: MsgCloseContract.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSetVersion: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCloseContract: Could not broadcast Tx: '+ e.message) } }, - msgModProvider({ value }: msgModProviderParams): EncodeObject { + msgBondProvider({ value }: msgBondProviderParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgModProvider", value: MsgModProvider.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgBondProvider", value: MsgBondProvider.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgModProvider: Could not create message: ' + e.message) + throw new Error('TxClient:MsgBondProvider: Could not create message: ' + e.message) } }, - msgBondProvider({ value }: msgBondProviderParams): EncodeObject { + msgSetVersion({ value }: msgSetVersionParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgBondProvider", value: MsgBondProvider.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgSetVersion", value: MsgSetVersion.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgBondProvider: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSetVersion: Could not create message: ' + e.message) } }, - msgOpenContract({ value }: msgOpenContractParams): EncodeObject { + msgClaimContractIncome({ value }: msgClaimContractIncomeParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgOpenContract", value: MsgOpenContract.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgClaimContractIncome", value: MsgClaimContractIncome.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgOpenContract: Could not create message: ' + e.message) + throw new Error('TxClient:MsgClaimContractIncome: Could not create message: ' + e.message) } }, - msgCloseContract({ value }: msgCloseContractParams): EncodeObject { + msgModProvider({ value }: msgModProviderParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgCloseContract", value: MsgCloseContract.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgModProvider", value: MsgModProvider.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCloseContract: Could not create message: ' + e.message) + throw new Error('TxClient:MsgModProvider: Could not create message: ' + e.message) } }, - msgClaimContractIncome({ value }: msgClaimContractIncomeParams): EncodeObject { + msgOpenContract({ value }: msgOpenContractParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgClaimContractIncome", value: MsgClaimContractIncome.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgOpenContract", value: MsgOpenContract.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgClaimContractIncome: Could not create message: ' + e.message) + throw new Error('TxClient:MsgOpenContract: Could not create message: ' + e.message) } }, - msgSetVersion({ value }: msgSetVersionParams): EncodeObject { + msgCloseContract({ value }: msgCloseContractParams): EncodeObject { try { - return { typeUrl: "/arkeo.arkeo.MsgSetVersion", value: MsgSetVersion.fromPartial( value ) } + return { typeUrl: "/arkeo.arkeo.MsgCloseContract", value: MsgCloseContract.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSetVersion: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCloseContract: Could not create message: ' + e.message) } }, diff --git a/ts-client/arkeo.arkeo/registry.ts b/ts-client/arkeo.arkeo/registry.ts index f25c328a..5fe1b116 100755 --- a/ts-client/arkeo.arkeo/registry.ts +++ b/ts-client/arkeo.arkeo/registry.ts @@ -1,18 +1,18 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgModProvider } from "./types/arkeo/arkeo/tx"; import { MsgBondProvider } from "./types/arkeo/arkeo/tx"; +import { MsgSetVersion } from "./types/arkeo/arkeo/tx"; +import { MsgClaimContractIncome } from "./types/arkeo/arkeo/tx"; +import { MsgModProvider } from "./types/arkeo/arkeo/tx"; import { MsgOpenContract } from "./types/arkeo/arkeo/tx"; import { MsgCloseContract } from "./types/arkeo/arkeo/tx"; -import { MsgClaimContractIncome } from "./types/arkeo/arkeo/tx"; -import { MsgSetVersion } from "./types/arkeo/arkeo/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/arkeo.arkeo.MsgModProvider", MsgModProvider], ["/arkeo.arkeo.MsgBondProvider", MsgBondProvider], + ["/arkeo.arkeo.MsgSetVersion", MsgSetVersion], + ["/arkeo.arkeo.MsgClaimContractIncome", MsgClaimContractIncome], + ["/arkeo.arkeo.MsgModProvider", MsgModProvider], ["/arkeo.arkeo.MsgOpenContract", MsgOpenContract], ["/arkeo.arkeo.MsgCloseContract", MsgCloseContract], - ["/arkeo.arkeo.MsgClaimContractIncome", MsgClaimContractIncome], - ["/arkeo.arkeo.MsgSetVersion", MsgSetVersion], ]; diff --git a/ts-client/arkeo.arkeo/rest.ts b/ts-client/arkeo.arkeo/rest.ts index 97cd2ce1..451545e3 100644 --- a/ts-client/arkeo.arkeo/rest.ts +++ b/ts-client/arkeo.arkeo/rest.ts @@ -78,6 +78,11 @@ export type ArkeoMsgOpenContractResponse = object; export type ArkeoMsgSetVersionResponse = object; +/** + * Params defines the parameters for the module. + */ +export type ArkeoParams = object; + export interface ArkeoProvider { /** @format byte */ pub_key?: string; @@ -158,14 +163,9 @@ export interface ArkeoQueryFetchProviderResponse { */ export interface ArkeoQueryParamsResponse { /** params holds all the parameters of this module. */ - params?: ArkeoarkeoParams; + params?: ArkeoParams; } -/** - * Params defines the parameters for the module. - */ -export type ArkeoarkeoParams = object; - export interface ProtobufAny { "@type"?: string; } diff --git a/ts-client/arkeo.arkeo/types/arkeo/arkeo/genesis.ts b/ts-client/arkeo.arkeo/types/arkeo/arkeo/genesis.ts index 00731e1a..fd85c80d 100644 --- a/ts-client/arkeo.arkeo/types/arkeo/arkeo/genesis.ts +++ b/ts-client/arkeo.arkeo/types/arkeo/arkeo/genesis.ts @@ -13,9 +13,8 @@ export interface GenesisState { contracts: Contract[]; nextContractId: number; contractExpirationSets: ContractExpirationSet[]; - userContractSets: UserContractSet[]; /** this line is used by starport scaffolding # genesis/proto/state */ - version: number; + userContractSets: UserContractSet[]; } function createBaseGenesisState(): GenesisState { @@ -26,7 +25,6 @@ function createBaseGenesisState(): GenesisState { nextContractId: 0, contractExpirationSets: [], userContractSets: [], - version: 0, }; } @@ -50,9 +48,6 @@ export const GenesisState = { for (const v of message.userContractSets) { UserContractSet.encode(v!, writer.uint32(50).fork()).ldelim(); } - if (message.version !== 0) { - writer.uint32(56).int64(message.version); - } return writer; }, @@ -81,9 +76,6 @@ export const GenesisState = { case 6: message.userContractSets.push(UserContractSet.decode(reader, reader.uint32())); break; - case 7: - message.version = longToNumber(reader.int64() as Long); - break; default: reader.skipType(tag & 7); break; @@ -104,7 +96,6 @@ export const GenesisState = { userContractSets: Array.isArray(object?.userContractSets) ? object.userContractSets.map((e: any) => UserContractSet.fromJSON(e)) : [], - version: isSet(object.version) ? Number(object.version) : 0, }; }, @@ -134,7 +125,6 @@ export const GenesisState = { } else { obj.userContractSets = []; } - message.version !== undefined && (obj.version = Math.round(message.version)); return obj; }, @@ -149,7 +139,6 @@ export const GenesisState = { message.contractExpirationSets = object.contractExpirationSets?.map((e) => ContractExpirationSet.fromPartial(e)) || []; message.userContractSets = object.userContractSets?.map((e) => UserContractSet.fromPartial(e)) || []; - message.version = object.version ?? 0; return message; }, }; diff --git a/ts-client/arkeo.arkeo/types/arkeo/arkeo/tx.ts b/ts-client/arkeo.arkeo/types/arkeo/arkeo/tx.ts index 2ada6e10..1eb99fb5 100644 --- a/ts-client/arkeo.arkeo/types/arkeo/arkeo/tx.ts +++ b/ts-client/arkeo.arkeo/types/arkeo/arkeo/tx.ts @@ -81,7 +81,7 @@ export interface MsgClaimContractIncomeResponse { /** this line is used by starport scaffolding # proto/tx/message */ export interface MsgSetVersion { - creator: Uint8Array; + creator: string; version: number; } @@ -829,16 +829,16 @@ export const MsgClaimContractIncomeResponse = { }; function createBaseMsgSetVersion(): MsgSetVersion { - return { creator: new Uint8Array(), version: 0 }; + return { creator: "", version: 0 }; } export const MsgSetVersion = { encode(message: MsgSetVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.creator.length !== 0) { - writer.uint32(10).bytes(message.creator); + if (message.creator !== "") { + writer.uint32(10).string(message.creator); } if (message.version !== 0) { - writer.uint32(16).int64(message.version); + writer.uint32(16).int32(message.version); } return writer; }, @@ -851,10 +851,10 @@ export const MsgSetVersion = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creator = reader.bytes(); + message.creator = reader.string(); break; case 2: - message.version = longToNumber(reader.int64() as Long); + message.version = reader.int32(); break; default: reader.skipType(tag & 7); @@ -866,22 +866,21 @@ export const MsgSetVersion = { fromJSON(object: any): MsgSetVersion { return { - creator: isSet(object.creator) ? bytesFromBase64(object.creator) : new Uint8Array(), + creator: isSet(object.creator) ? String(object.creator) : "", version: isSet(object.version) ? Number(object.version) : 0, }; }, toJSON(message: MsgSetVersion): unknown { const obj: any = {}; - message.creator !== undefined - && (obj.creator = base64FromBytes(message.creator !== undefined ? message.creator : new Uint8Array())); + message.creator !== undefined && (obj.creator = message.creator); message.version !== undefined && (obj.version = Math.round(message.version)); return obj; }, fromPartial, I>>(object: I): MsgSetVersion { const message = createBaseMsgSetVersion(); - message.creator = object.creator ?? new Uint8Array(); + message.creator = object.creator ?? ""; message.version = object.version ?? 0; return message; }, diff --git a/ts-client/arkeo.claim/module.ts b/ts-client/arkeo.claim/module.ts index e123948f..d00c725d 100755 --- a/ts-client/arkeo.claim/module.ts +++ b/ts-client/arkeo.claim/module.ts @@ -7,15 +7,21 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; +import { MsgTransferClaim } from "./types/arkeo/claim/tx"; import { MsgAddClaim } from "./types/arkeo/claim/tx"; import { MsgClaimArkeo } from "./types/arkeo/claim/tx"; import { MsgClaimEth } from "./types/arkeo/claim/tx"; -import { MsgTransferClaim } from "./types/arkeo/claim/tx"; import { ClaimRecord as typeClaimRecord} from "./types" import { Params as typeParams} from "./types" -export { MsgAddClaim, MsgClaimArkeo, MsgClaimEth, MsgTransferClaim }; +export { MsgTransferClaim, MsgAddClaim, MsgClaimArkeo, MsgClaimEth }; + +type sendMsgTransferClaimParams = { + value: MsgTransferClaim, + fee?: StdFee, + memo?: string +}; type sendMsgAddClaimParams = { value: MsgAddClaim, @@ -35,13 +41,11 @@ type sendMsgClaimEthParams = { memo?: string }; -type sendMsgTransferClaimParams = { + +type msgTransferClaimParams = { value: MsgTransferClaim, - fee?: StdFee, - memo?: string }; - type msgAddClaimParams = { value: MsgAddClaim, }; @@ -54,10 +58,6 @@ type msgClaimEthParams = { value: MsgClaimEth, }; -type msgTransferClaimParams = { - value: MsgTransferClaim, -}; - export const registry = new Registry(msgTypes); @@ -88,6 +88,20 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { + async sendMsgTransferClaim({ value, fee, memo }: sendMsgTransferClaimParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgTransferClaim: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgTransferClaim({ value: MsgTransferClaim.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgTransferClaim: Could not broadcast Tx: '+ e.message) + } + }, + async sendMsgAddClaim({ value, fee, memo }: sendMsgAddClaimParams): Promise { if (!signer) { throw new Error('TxClient:sendMsgAddClaim: Unable to sign Tx. Signer is not present.') @@ -130,21 +144,15 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgTransferClaim({ value, fee, memo }: sendMsgTransferClaimParams): Promise { - if (!signer) { - throw new Error('TxClient:sendMsgTransferClaim: Unable to sign Tx. Signer is not present.') - } - try { - const { address } = (await signer.getAccounts())[0]; - const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgTransferClaim({ value: MsgTransferClaim.fromPartial(value) }) - return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + + msgTransferClaim({ value }: msgTransferClaimParams): EncodeObject { + try { + return { typeUrl: "/arkeo.claim.MsgTransferClaim", value: MsgTransferClaim.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:sendMsgTransferClaim: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgTransferClaim: Could not create message: ' + e.message) } }, - msgAddClaim({ value }: msgAddClaimParams): EncodeObject { try { return { typeUrl: "/arkeo.claim.MsgAddClaim", value: MsgAddClaim.fromPartial( value ) } @@ -169,14 +177,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgTransferClaim({ value }: msgTransferClaimParams): EncodeObject { - try { - return { typeUrl: "/arkeo.claim.MsgTransferClaim", value: MsgTransferClaim.fromPartial( value ) } - } catch (e: any) { - throw new Error('TxClient:MsgTransferClaim: Could not create message: ' + e.message) - } - }, - } }; diff --git a/ts-client/arkeo.claim/registry.ts b/ts-client/arkeo.claim/registry.ts index 804e67f2..54f19882 100755 --- a/ts-client/arkeo.claim/registry.ts +++ b/ts-client/arkeo.claim/registry.ts @@ -1,14 +1,14 @@ import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgTransferClaim } from "./types/arkeo/claim/tx"; import { MsgAddClaim } from "./types/arkeo/claim/tx"; import { MsgClaimArkeo } from "./types/arkeo/claim/tx"; import { MsgClaimEth } from "./types/arkeo/claim/tx"; -import { MsgTransferClaim } from "./types/arkeo/claim/tx"; const msgTypes: Array<[string, GeneratedType]> = [ + ["/arkeo.claim.MsgTransferClaim", MsgTransferClaim], ["/arkeo.claim.MsgAddClaim", MsgAddClaim], ["/arkeo.claim.MsgClaimArkeo", MsgClaimArkeo], ["/arkeo.claim.MsgClaimEth", MsgClaimEth], - ["/arkeo.claim.MsgTransferClaim", MsgTransferClaim], ]; diff --git a/ts-client/arkeo.claim/rest.ts b/ts-client/arkeo.claim/rest.ts index 368f6156..913abb99 100644 --- a/ts-client/arkeo.claim/rest.ts +++ b/ts-client/arkeo.claim/rest.ts @@ -9,7 +9,12 @@ * --------------------------------------------------------------- */ -export interface ArkeoclaimClaimRecord { +export enum ClaimChain { + ARKEO = "ARKEO", + ETHEREUM = "ETHEREUM", +} + +export interface ClaimClaimRecord { chain?: ClaimChain; /** arkeo address of claim user */ @@ -43,10 +48,18 @@ export interface ArkeoclaimClaimRecord { is_transferable?: boolean; } +export type ClaimMsgAddClaimResponse = object; + +export type ClaimMsgClaimArkeoResponse = object; + +export type ClaimMsgClaimEthResponse = object; + +export type ClaimMsgTransferClaimResponse = object; + /** * Params defines the parameters for the module. */ -export interface ArkeoclaimParams { +export interface ClaimParams { /** @format date-time */ airdrop_start_time?: string; duration_until_decay?: string; @@ -65,21 +78,8 @@ export interface ArkeoclaimParams { initial_gas_amount?: V1Beta1Coin; } -export enum ClaimChain { - ARKEO = "ARKEO", - ETHEREUM = "ETHEREUM", -} - -export type ClaimMsgAddClaimResponse = object; - -export type ClaimMsgClaimArkeoResponse = object; - -export type ClaimMsgClaimEthResponse = object; - -export type ClaimMsgTransferClaimResponse = object; - export interface ClaimQueryClaimRecordResponse { - claim_record?: ArkeoclaimClaimRecord; + claim_record?: ClaimClaimRecord; } /** @@ -87,7 +87,7 @@ export interface ClaimQueryClaimRecordResponse { */ export interface ClaimQueryParamsResponse { /** params holds all the parameters of this module. */ - params?: ArkeoclaimParams; + params?: ClaimParams; } export interface ProtobufAny { diff --git a/ts-client/arkeo.claim/types/arkeo/claim/tx.ts b/ts-client/arkeo.claim/types/arkeo/claim/tx.ts index 4f43decb..8056b9de 100644 --- a/ts-client/arkeo.claim/types/arkeo/claim/tx.ts +++ b/ts-client/arkeo.claim/types/arkeo/claim/tx.ts @@ -11,8 +11,6 @@ export interface MsgClaimEth { ethAddress: string; /** EIP712 signature that has to be signed by ethAddress */ signature: string; - /** the tx hash of the thorchain tx that delegates the arkeo claim */ - thorTx: string; } export interface MsgClaimEthResponse { @@ -20,8 +18,6 @@ export interface MsgClaimEthResponse { export interface MsgClaimArkeo { creator: Uint8Array; - /** the tx hash of the thorchain tx that delegates the arkeo claim */ - thorTx: string; } export interface MsgClaimArkeoResponse { @@ -46,7 +42,7 @@ export interface MsgAddClaimResponse { } function createBaseMsgClaimEth(): MsgClaimEth { - return { creator: new Uint8Array(), ethAddress: "", signature: "", thorTx: "" }; + return { creator: new Uint8Array(), ethAddress: "", signature: "" }; } export const MsgClaimEth = { @@ -60,9 +56,6 @@ export const MsgClaimEth = { if (message.signature !== "") { writer.uint32(26).string(message.signature); } - if (message.thorTx !== "") { - writer.uint32(34).string(message.thorTx); - } return writer; }, @@ -82,9 +75,6 @@ export const MsgClaimEth = { case 3: message.signature = reader.string(); break; - case 4: - message.thorTx = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -98,7 +88,6 @@ export const MsgClaimEth = { creator: isSet(object.creator) ? bytesFromBase64(object.creator) : new Uint8Array(), ethAddress: isSet(object.ethAddress) ? String(object.ethAddress) : "", signature: isSet(object.signature) ? String(object.signature) : "", - thorTx: isSet(object.thorTx) ? String(object.thorTx) : "", }; }, @@ -108,7 +97,6 @@ export const MsgClaimEth = { && (obj.creator = base64FromBytes(message.creator !== undefined ? message.creator : new Uint8Array())); message.ethAddress !== undefined && (obj.ethAddress = message.ethAddress); message.signature !== undefined && (obj.signature = message.signature); - message.thorTx !== undefined && (obj.thorTx = message.thorTx); return obj; }, @@ -117,7 +105,6 @@ export const MsgClaimEth = { message.creator = object.creator ?? new Uint8Array(); message.ethAddress = object.ethAddress ?? ""; message.signature = object.signature ?? ""; - message.thorTx = object.thorTx ?? ""; return message; }, }; @@ -162,7 +149,7 @@ export const MsgClaimEthResponse = { }; function createBaseMsgClaimArkeo(): MsgClaimArkeo { - return { creator: new Uint8Array(), thorTx: "" }; + return { creator: new Uint8Array() }; } export const MsgClaimArkeo = { @@ -170,9 +157,6 @@ export const MsgClaimArkeo = { if (message.creator.length !== 0) { writer.uint32(10).bytes(message.creator); } - if (message.thorTx !== "") { - writer.uint32(18).string(message.thorTx); - } return writer; }, @@ -186,9 +170,6 @@ export const MsgClaimArkeo = { case 1: message.creator = reader.bytes(); break; - case 2: - message.thorTx = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -198,24 +179,19 @@ export const MsgClaimArkeo = { }, fromJSON(object: any): MsgClaimArkeo { - return { - creator: isSet(object.creator) ? bytesFromBase64(object.creator) : new Uint8Array(), - thorTx: isSet(object.thorTx) ? String(object.thorTx) : "", - }; + return { creator: isSet(object.creator) ? bytesFromBase64(object.creator) : new Uint8Array() }; }, toJSON(message: MsgClaimArkeo): unknown { const obj: any = {}; message.creator !== undefined && (obj.creator = base64FromBytes(message.creator !== undefined ? message.creator : new Uint8Array())); - message.thorTx !== undefined && (obj.thorTx = message.thorTx); return obj; }, fromPartial, I>>(object: I): MsgClaimArkeo { const message = createBaseMsgClaimArkeo(); message.creator = object.creator ?? new Uint8Array(); - message.thorTx = object.thorTx ?? ""; return message; }, }; diff --git a/ts-client/cosmos.auth.v1beta1/rest.ts b/ts-client/cosmos.auth.v1beta1/rest.ts index 7926d9d9..697ebc57 100644 --- a/ts-client/cosmos.auth.v1beta1/rest.ts +++ b/ts-client/cosmos.auth.v1beta1/rest.ts @@ -9,26 +9,6 @@ * --------------------------------------------------------------- */ -/** - * Params defines the parameters for the auth module. - */ -export interface Authv1Beta1Params { - /** @format uint64 */ - max_memo_characters?: string; - - /** @format uint64 */ - tx_sig_limit?: string; - - /** @format uint64 */ - tx_size_cost_per_byte?: string; - - /** @format uint64 */ - sig_verify_cost_ed25519?: string; - - /** @format uint64 */ - sig_verify_cost_secp256k1?: string; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -250,6 +230,26 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Params defines the parameters for the auth module. + */ +export interface V1Beta1Params { + /** @format uint64 */ + max_memo_characters?: string; + + /** @format uint64 */ + tx_sig_limit?: string; + + /** @format uint64 */ + tx_size_cost_per_byte?: string; + + /** @format uint64 */ + sig_verify_cost_ed25519?: string; + + /** @format uint64 */ + sig_verify_cost_secp256k1?: string; +} + /** * Since: cosmos-sdk 0.46.2 */ @@ -357,7 +357,7 @@ export interface V1Beta1QueryModuleAccountsResponse { */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Authv1Beta1Params; + params?: V1Beta1Params; } import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; diff --git a/ts-client/cosmos.authz.v1beta1/module.ts b/ts-client/cosmos.authz.v1beta1/module.ts index 184f2fa6..d8789044 100755 --- a/ts-client/cosmos.authz.v1beta1/module.ts +++ b/ts-client/cosmos.authz.v1beta1/module.ts @@ -7,9 +7,9 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx"; -import { MsgExec } from "./types/cosmos/authz/v1beta1/tx"; import { MsgGrant } from "./types/cosmos/authz/v1beta1/tx"; +import { MsgExec } from "./types/cosmos/authz/v1beta1/tx"; +import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx"; import { GenericAuthorization as typeGenericAuthorization} from "./types" import { Grant as typeGrant} from "./types" @@ -18,10 +18,10 @@ import { GrantQueueItem as typeGrantQueueItem} from "./types" import { EventGrant as typeEventGrant} from "./types" import { EventRevoke as typeEventRevoke} from "./types" -export { MsgRevoke, MsgExec, MsgGrant }; +export { MsgGrant, MsgExec, MsgRevoke }; -type sendMsgRevokeParams = { - value: MsgRevoke, +type sendMsgGrantParams = { + value: MsgGrant, fee?: StdFee, memo?: string }; @@ -32,23 +32,23 @@ type sendMsgExecParams = { memo?: string }; -type sendMsgGrantParams = { - value: MsgGrant, +type sendMsgRevokeParams = { + value: MsgRevoke, fee?: StdFee, memo?: string }; -type msgRevokeParams = { - value: MsgRevoke, +type msgGrantParams = { + value: MsgGrant, }; type msgExecParams = { value: MsgExec, }; -type msgGrantParams = { - value: MsgGrant, +type msgRevokeParams = { + value: MsgRevoke, }; @@ -81,17 +81,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgRevoke({ value, fee, memo }: sendMsgRevokeParams): Promise { + async sendMsgGrant({ value, fee, memo }: sendMsgGrantParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRevoke({ value: MsgRevoke.fromPartial(value) }) + let msg = this.msgGrant({ value: MsgGrant.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRevoke: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgGrant: Could not broadcast Tx: '+ e.message) } }, @@ -109,26 +109,26 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgGrant({ value, fee, memo }: sendMsgGrantParams): Promise { + async sendMsgRevoke({ value, fee, memo }: sendMsgRevokeParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgGrant({ value: MsgGrant.fromPartial(value) }) + let msg = this.msgRevoke({ value: MsgRevoke.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgGrant: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRevoke: Could not broadcast Tx: '+ e.message) } }, - msgRevoke({ value }: msgRevokeParams): EncodeObject { + msgGrant({ value }: msgGrantParams): EncodeObject { try { - return { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", value: MsgRevoke.fromPartial( value ) } + return { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", value: MsgGrant.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRevoke: Could not create message: ' + e.message) + throw new Error('TxClient:MsgGrant: Could not create message: ' + e.message) } }, @@ -140,11 +140,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgGrant({ value }: msgGrantParams): EncodeObject { + msgRevoke({ value }: msgRevokeParams): EncodeObject { try { - return { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", value: MsgGrant.fromPartial( value ) } + return { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", value: MsgRevoke.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgGrant: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevoke: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.authz.v1beta1/registry.ts b/ts-client/cosmos.authz.v1beta1/registry.ts index 16f71067..fe0fcc0c 100755 --- a/ts-client/cosmos.authz.v1beta1/registry.ts +++ b/ts-client/cosmos.authz.v1beta1/registry.ts @@ -1,12 +1,12 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx"; -import { MsgExec } from "./types/cosmos/authz/v1beta1/tx"; import { MsgGrant } from "./types/cosmos/authz/v1beta1/tx"; +import { MsgExec } from "./types/cosmos/authz/v1beta1/tx"; +import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], - ["/cosmos.authz.v1beta1.MsgExec", MsgExec], ["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], + ["/cosmos.authz.v1beta1.MsgExec", MsgExec], + ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], ]; diff --git a/ts-client/cosmos.authz.v1beta1/rest.ts b/ts-client/cosmos.authz.v1beta1/rest.ts index 7abd1001..635ed44e 100644 --- a/ts-client/cosmos.authz.v1beta1/rest.ts +++ b/ts-client/cosmos.authz.v1beta1/rest.ts @@ -9,80 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Grant gives permissions to execute -the provide method with expiration time. -*/ -export interface Authzv1Beta1Grant { - /** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * Example 1: Pack and unpack a message in C++. - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * Example 2: Pack and unpack a message in Java. - * Any any = Any.pack(foo); - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * Example 3: Pack and unpack a message in Python. - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * Example 4: Pack and unpack a message in Go - * foo := &pb.Foo{...} - * any, err := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(foo); err != nil { - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - */ - authorization?: ProtobufAny; - - /** - * time when the grant will expire and will be pruned. If null, then the grant - * doesn't have a time expiration (other conditions in `authorization` - * may apply to invalidate the grant) - * @format date-time - */ - expiration?: string; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -204,6 +130,80 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Grant gives permissions to execute +the provide method with expiration time. +*/ +export interface V1Beta1Grant { + /** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + authorization?: ProtobufAny; + + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + * @format date-time + */ + expiration?: string; +} + export interface V1Beta1GrantAuthorization { granter?: string; grantee?: string; @@ -388,7 +388,7 @@ export interface V1Beta1QueryGranterGrantsResponse { */ export interface V1Beta1QueryGrantsResponse { /** authorizations is a list of grants granted for grantee by granter. */ - grants?: Authzv1Beta1Grant[]; + grants?: V1Beta1Grant[]; /** pagination defines an pagination for the response. */ pagination?: V1Beta1PageResponse; diff --git a/ts-client/cosmos.bank.v1beta1/module.ts b/ts-client/cosmos.bank.v1beta1/module.ts index cb014a42..7c1021c2 100755 --- a/ts-client/cosmos.bank.v1beta1/module.ts +++ b/ts-client/cosmos.bank.v1beta1/module.ts @@ -7,8 +7,8 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; +import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; import { SendAuthorization as typeSendAuthorization} from "./types" import { Params as typeParams} from "./types" @@ -21,13 +21,7 @@ import { Metadata as typeMetadata} from "./types" import { Balance as typeBalance} from "./types" import { DenomOwner as typeDenomOwner} from "./types" -export { MsgSend, MsgMultiSend }; - -type sendMsgSendParams = { - value: MsgSend, - fee?: StdFee, - memo?: string -}; +export { MsgMultiSend, MsgSend }; type sendMsgMultiSendParams = { value: MsgMultiSend, @@ -35,15 +29,21 @@ type sendMsgMultiSendParams = { memo?: string }; - -type msgSendParams = { +type sendMsgSendParams = { value: MsgSend, + fee?: StdFee, + memo?: string }; + type msgMultiSendParams = { value: MsgMultiSend, }; +type msgSendParams = { + value: MsgSend, +}; + export const registry = new Registry(msgTypes); @@ -74,48 +74,48 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise { + async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSend({ value: MsgSend.fromPartial(value) }) + let msg = this.msgMultiSend({ value: MsgMultiSend.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSend: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgMultiSend: Could not broadcast Tx: '+ e.message) } }, - async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise { + async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgMultiSend({ value: MsgMultiSend.fromPartial(value) }) + let msg = this.msgSend({ value: MsgSend.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgMultiSend: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSend: Could not broadcast Tx: '+ e.message) } }, - msgSend({ value }: msgSendParams): EncodeObject { + msgMultiSend({ value }: msgMultiSendParams): EncodeObject { try { - return { typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( value ) } + return { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSend: Could not create message: ' + e.message) + throw new Error('TxClient:MsgMultiSend: Could not create message: ' + e.message) } }, - msgMultiSend({ value }: msgMultiSendParams): EncodeObject { + msgSend({ value }: msgSendParams): EncodeObject { try { - return { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( value ) } + return { typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgMultiSend: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSend: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.bank.v1beta1/registry.ts b/ts-client/cosmos.bank.v1beta1/registry.ts index 89314a0a..3a77952c 100755 --- a/ts-client/cosmos.bank.v1beta1/registry.ts +++ b/ts-client/cosmos.bank.v1beta1/registry.ts @@ -1,10 +1,10 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx"; +import { MsgSend } from "./types/cosmos/bank/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], + ["/cosmos.bank.v1beta1.MsgSend", MsgSend], ]; diff --git a/ts-client/cosmos.bank.v1beta1/rest.ts b/ts-client/cosmos.bank.v1beta1/rest.ts index a707d76d..caf37229 100644 --- a/ts-client/cosmos.bank.v1beta1/rest.ts +++ b/ts-client/cosmos.bank.v1beta1/rest.ts @@ -9,14 +9,6 @@ * --------------------------------------------------------------- */ -/** - * Params defines the parameters for the bank module. - */ -export interface Bankv1Beta1Params { - send_enabled?: V1Beta1SendEnabled[]; - default_send_enabled?: boolean; -} - export interface ProtobufAny { "@type"?: string; } @@ -223,6 +215,14 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Params defines the parameters for the bank module. + */ +export interface V1Beta1Params { + send_enabled?: V1Beta1SendEnabled[]; + default_send_enabled?: boolean; +} + /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method. @@ -281,7 +281,7 @@ export interface V1Beta1QueryDenomsMetadataResponse { */ export interface V1Beta1QueryParamsResponse { /** Params defines the parameters for the bank module. */ - params?: Bankv1Beta1Params; + params?: V1Beta1Params; } /** diff --git a/ts-client/cosmos.base.tendermint.v1beta1/rest.ts b/ts-client/cosmos.base.tendermint.v1beta1/rest.ts index 00f06831..f4e40ff6 100644 --- a/ts-client/cosmos.base.tendermint.v1beta1/rest.ts +++ b/ts-client/cosmos.base.tendermint.v1beta1/rest.ts @@ -168,7 +168,7 @@ export interface RpcStatus { } export interface TenderminttypesBlock { - /** Header defines the structure of a block header. */ + /** Header defines the structure of a Tendermint block header. */ header?: TenderminttypesHeader; data?: TypesData; evidence?: TypesEvidenceList; @@ -178,7 +178,7 @@ export interface TenderminttypesBlock { } /** - * Header defines the structure of a block header. + * Header defines the structure of a Tendermint block header. */ export interface TenderminttypesHeader { /** @@ -587,7 +587,7 @@ export interface TypesPartSetHeader { } export interface TypesSignedHeader { - /** Header defines the structure of a block header. */ + /** Header defines the structure of a Tendermint block header. */ header?: TenderminttypesHeader; /** Commit contains the evidence that a block was committed by a set of validators. */ diff --git a/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts b/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts index 82d64fdf..7f957ad4 100644 --- a/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts +++ b/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts @@ -3,7 +3,7 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Validators */ +/** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; diff --git a/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts b/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts index 93cdfab9..6a4293b8 100644 --- a/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts +++ b/ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts @@ -120,7 +120,7 @@ export interface BlockID { partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a block header. */ +/** Header defines the structure of a Tendermint block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; diff --git a/ts-client/cosmos.distribution.v1beta1/module.ts b/ts-client/cosmos.distribution.v1beta1/module.ts index 5ae4d7c5..cb263297 100755 --- a/ts-client/cosmos.distribution.v1beta1/module.ts +++ b/ts-client/cosmos.distribution.v1beta1/module.ts @@ -7,9 +7,9 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; import { Params as typeParams} from "./types" @@ -32,10 +32,10 @@ import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord} fro import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord} from "./types" import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord} from "./types" -export { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgFundCommunityPool, MsgWithdrawValidatorCommission }; +export { MsgFundCommunityPool, MsgWithdrawDelegatorReward, MsgSetWithdrawAddress, MsgWithdrawValidatorCommission }; -type sendMsgSetWithdrawAddressParams = { - value: MsgSetWithdrawAddress, +type sendMsgFundCommunityPoolParams = { + value: MsgFundCommunityPool, fee?: StdFee, memo?: string }; @@ -46,8 +46,8 @@ type sendMsgWithdrawDelegatorRewardParams = { memo?: string }; -type sendMsgFundCommunityPoolParams = { - value: MsgFundCommunityPool, +type sendMsgSetWithdrawAddressParams = { + value: MsgSetWithdrawAddress, fee?: StdFee, memo?: string }; @@ -59,16 +59,16 @@ type sendMsgWithdrawValidatorCommissionParams = { }; -type msgSetWithdrawAddressParams = { - value: MsgSetWithdrawAddress, +type msgFundCommunityPoolParams = { + value: MsgFundCommunityPool, }; type msgWithdrawDelegatorRewardParams = { value: MsgWithdrawDelegatorReward, }; -type msgFundCommunityPoolParams = { - value: MsgFundCommunityPool, +type msgSetWithdrawAddressParams = { + value: MsgSetWithdrawAddress, }; type msgWithdrawValidatorCommissionParams = { @@ -105,17 +105,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise { + async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) }) + let msg = this.msgFundCommunityPool({ value: MsgFundCommunityPool.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: '+ e.message) } }, @@ -133,17 +133,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise { + async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgFundCommunityPool({ value: MsgFundCommunityPool.fromPartial(value) }) + let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message) } }, @@ -162,11 +162,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht }, - msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject { + msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject { try { - return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) } + return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message) + throw new Error('TxClient:MsgFundCommunityPool: Could not create message: ' + e.message) } }, @@ -178,11 +178,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject { + msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject { try { - return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( value ) } + return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgFundCommunityPool: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.distribution.v1beta1/registry.ts b/ts-client/cosmos.distribution.v1beta1/registry.ts index 92c340f1..d2b3b85b 100755 --- a/ts-client/cosmos.distribution.v1beta1/registry.ts +++ b/ts-client/cosmos.distribution.v1beta1/registry.ts @@ -1,13 +1,13 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; -import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx"; +import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx"; import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], - ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], + ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], + ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ]; diff --git a/ts-client/cosmos.distribution.v1beta1/rest.ts b/ts-client/cosmos.distribution.v1beta1/rest.ts index 147399f9..a57423b6 100644 --- a/ts-client/cosmos.distribution.v1beta1/rest.ts +++ b/ts-client/cosmos.distribution.v1beta1/rest.ts @@ -9,24 +9,6 @@ * --------------------------------------------------------------- */ -/** - * Params defines the set of params for the distribution module. - */ -export interface Distributionv1Beta1Params { - community_tax?: string; - base_proposer_reward?: string; - bonus_proposer_reward?: string; - withdraw_addr_enabled?: boolean; -} - -/** -* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -for a validator inexpensive to track, allows simple sanity checks. -*/ -export interface Distributionv1Beta1ValidatorOutstandingRewards { - rewards?: V1Beta1DecCoin[]; -} - export interface ProtobufAny { "@type"?: string; } @@ -167,6 +149,16 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Params defines the set of params for the distribution module. + */ +export interface V1Beta1Params { + community_tax?: string; + base_proposer_reward?: string; + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; +} + /** * QueryCommunityPoolResponse is the response type for the Query/CommunityPool RPC method. @@ -220,7 +212,7 @@ export interface V1Beta1QueryDelegatorWithdrawAddressResponse { */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Distributionv1Beta1Params; + params?: V1Beta1Params; } export interface V1Beta1QueryValidatorCommissionResponse { @@ -237,7 +229,7 @@ export interface V1Beta1QueryValidatorOutstandingRewardsResponse { * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards * for a validator inexpensive to track, allows simple sanity checks. */ - rewards?: Distributionv1Beta1ValidatorOutstandingRewards; + rewards?: V1Beta1ValidatorOutstandingRewards; } /** @@ -260,6 +252,14 @@ export interface V1Beta1ValidatorAccumulatedCommission { commission?: V1Beta1DecCoin[]; } +/** +* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +for a validator inexpensive to track, allows simple sanity checks. +*/ +export interface V1Beta1ValidatorOutstandingRewards { + rewards?: V1Beta1DecCoin[]; +} + /** * ValidatorSlashEvent represents a validator slash event. Height is implicit within the store key. diff --git a/ts-client/cosmos.gov.v1/module.ts b/ts-client/cosmos.gov.v1/module.ts index 264e96d0..fe0033a3 100755 --- a/ts-client/cosmos.gov.v1/module.ts +++ b/ts-client/cosmos.gov.v1/module.ts @@ -8,9 +8,9 @@ import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx"; -import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; import { MsgVote } from "./types/cosmos/gov/v1/tx"; import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; import { WeightedVoteOption as typeWeightedVoteOption} from "./types" import { Deposit as typeDeposit} from "./types" @@ -21,7 +21,7 @@ import { DepositParams as typeDepositParams} from "./types" import { VotingParams as typeVotingParams} from "./types" import { TallyParams as typeTallyParams} from "./types" -export { MsgVoteWeighted, MsgDeposit, MsgVote, MsgSubmitProposal }; +export { MsgVoteWeighted, MsgVote, MsgSubmitProposal, MsgDeposit }; type sendMsgVoteWeightedParams = { value: MsgVoteWeighted, @@ -29,12 +29,6 @@ type sendMsgVoteWeightedParams = { memo?: string }; -type sendMsgDepositParams = { - value: MsgDeposit, - fee?: StdFee, - memo?: string -}; - type sendMsgVoteParams = { value: MsgVote, fee?: StdFee, @@ -47,15 +41,17 @@ type sendMsgSubmitProposalParams = { memo?: string }; +type sendMsgDepositParams = { + value: MsgDeposit, + fee?: StdFee, + memo?: string +}; + type msgVoteWeightedParams = { value: MsgVoteWeighted, }; -type msgDepositParams = { - value: MsgDeposit, -}; - type msgVoteParams = { value: MsgVote, }; @@ -64,6 +60,10 @@ type msgSubmitProposalParams = { value: MsgSubmitProposal, }; +type msgDepositParams = { + value: MsgDeposit, +}; + export const registry = new Registry(msgTypes); @@ -108,45 +108,45 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { + async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) + let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) } }, - async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { + async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) + let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) } }, - async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { + async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) + let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) } }, @@ -159,14 +159,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgDeposit({ value }: msgDepositParams): EncodeObject { - try { - return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } - } catch (e: any) { - throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) - } - }, - msgVote({ value }: msgVoteParams): EncodeObject { try { return { typeUrl: "/cosmos.gov.v1.MsgVote", value: MsgVote.fromPartial( value ) } @@ -183,6 +175,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, + msgDeposit({ value }: msgDepositParams): EncodeObject { + try { + return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) + } + }, + } }; diff --git a/ts-client/cosmos.gov.v1/registry.ts b/ts-client/cosmos.gov.v1/registry.ts index 9455651b..51d3c102 100755 --- a/ts-client/cosmos.gov.v1/registry.ts +++ b/ts-client/cosmos.gov.v1/registry.ts @@ -1,14 +1,14 @@ import { GeneratedType } from "@cosmjs/proto-signing"; import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx"; -import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; import { MsgVote } from "./types/cosmos/gov/v1/tx"; import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ ["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted], - ["/cosmos.gov.v1.MsgDeposit", MsgDeposit], ["/cosmos.gov.v1.MsgVote", MsgVote], ["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.gov.v1.MsgDeposit", MsgDeposit], ]; diff --git a/ts-client/cosmos.gov.v1/rest.ts b/ts-client/cosmos.gov.v1/rest.ts index 68fbcd6d..63ec0bb6 100644 --- a/ts-client/cosmos.gov.v1/rest.ts +++ b/ts-client/cosmos.gov.v1/rest.ts @@ -9,89 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Deposit defines an amount deposited by an account address to an active -proposal. -*/ -export interface Govv1Deposit { - /** @format uint64 */ - proposal_id?: string; - depositor?: string; - amount?: V1Beta1Coin[]; -} - -/** - * Proposal defines the core field members of a governance proposal. - */ -export interface Govv1Proposal { - /** @format uint64 */ - id?: string; - messages?: ProtobufAny[]; - - /** - * ProposalStatus enumerates the valid statuses of a proposal. - * - * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - * period. - * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - * passed. - * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - * been rejected. - * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - * failed. - */ - status?: V1ProposalStatus; - - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ - final_tally_result?: Govv1TallyResult; - - /** @format date-time */ - submit_time?: string; - - /** @format date-time */ - deposit_end_time?: string; - total_deposit?: V1Beta1Coin[]; - - /** @format date-time */ - voting_start_time?: string; - - /** @format date-time */ - voting_end_time?: string; - - /** metadata is any arbitrary metadata attached to the proposal. */ - metadata?: string; -} - -/** - * TallyResult defines a standard tally for a governance proposal. - */ -export interface Govv1TallyResult { - yes_count?: string; - abstain_count?: string; - no_count?: string; - no_with_veto_count?: string; -} - -/** -* Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. -*/ -export interface Govv1Vote { - /** @format uint64 */ - proposal_id?: string; - voter?: string; - options?: V1WeightedVoteOption[]; - - /** metadata is any arbitrary metadata to attached to the vote. */ - metadata?: string; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -213,6 +130,17 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Deposit defines an amount deposited by an account address to an active +proposal. +*/ +export interface V1Deposit { + /** @format uint64 */ + proposal_id?: string; + depositor?: string; + amount?: V1Beta1Coin[]; +} + /** * DepositParams defines the params for deposits on governance proposals. */ @@ -255,6 +183,54 @@ export type V1MsgVoteResponse = object; */ export type V1MsgVoteWeightedResponse = object; +/** + * Proposal defines the core field members of a governance proposal. + */ +export interface V1Proposal { + /** @format uint64 */ + id?: string; + messages?: ProtobufAny[]; + + /** + * ProposalStatus enumerates the valid statuses of a proposal. + * + * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + status?: V1ProposalStatus; + + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: V1TallyResult; + + /** @format date-time */ + submit_time?: string; + + /** @format date-time */ + deposit_end_time?: string; + total_deposit?: V1Beta1Coin[]; + + /** @format date-time */ + voting_start_time?: string; + + /** @format date-time */ + voting_end_time?: string; + + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; +} + /** * ProposalStatus enumerates the valid statuses of a proposal. @@ -284,14 +260,14 @@ export enum V1ProposalStatus { */ export interface V1QueryDepositResponse { /** deposit defines the requested deposit. */ - deposit?: Govv1Deposit; + deposit?: V1Deposit; } /** * QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface V1QueryDepositsResponse { - deposits?: Govv1Deposit[]; + deposits?: V1Deposit[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -316,7 +292,7 @@ export interface V1QueryParamsResponse { */ export interface V1QueryProposalResponse { /** Proposal defines the core field members of a governance proposal. */ - proposal?: Govv1Proposal; + proposal?: V1Proposal; } /** @@ -324,7 +300,7 @@ export interface V1QueryProposalResponse { method. */ export interface V1QueryProposalsResponse { - proposals?: Govv1Proposal[]; + proposals?: V1Proposal[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -335,7 +311,7 @@ export interface V1QueryProposalsResponse { */ export interface V1QueryTallyResultResponse { /** tally defines the requested tally. */ - tally?: Govv1TallyResult; + tally?: V1TallyResult; } /** @@ -343,7 +319,7 @@ export interface V1QueryTallyResultResponse { */ export interface V1QueryVoteResponse { /** vote defined the queried vote. */ - vote?: Govv1Vote; + vote?: V1Vote; } /** @@ -351,7 +327,7 @@ export interface V1QueryVoteResponse { */ export interface V1QueryVotesResponse { /** votes defined the queried votes. */ - votes?: Govv1Vote[]; + votes?: V1Vote[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -377,6 +353,30 @@ export interface V1TallyParams { veto_threshold?: string; } +/** + * TallyResult defines a standard tally for a governance proposal. + */ +export interface V1TallyResult { + yes_count?: string; + abstain_count?: string; + no_count?: string; + no_with_veto_count?: string; +} + +/** +* Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. +*/ +export interface V1Vote { + /** @format uint64 */ + proposal_id?: string; + voter?: string; + options?: V1WeightedVoteOption[]; + + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; +} + /** * VoteOption enumerates the valid vote options for a given governance proposal. diff --git a/ts-client/cosmos.gov.v1beta1/module.ts b/ts-client/cosmos.gov.v1beta1/module.ts index 22e1ef78..8cd38a39 100755 --- a/ts-client/cosmos.gov.v1beta1/module.ts +++ b/ts-client/cosmos.gov.v1beta1/module.ts @@ -7,10 +7,10 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; import { WeightedVoteOption as typeWeightedVoteOption} from "./types" import { TextProposal as typeTextProposal} from "./types" @@ -22,19 +22,7 @@ import { DepositParams as typeDepositParams} from "./types" import { VotingParams as typeVotingParams} from "./types" import { TallyParams as typeTallyParams} from "./types" -export { MsgDeposit, MsgSubmitProposal, MsgVote, MsgVoteWeighted }; - -type sendMsgDepositParams = { - value: MsgDeposit, - fee?: StdFee, - memo?: string -}; - -type sendMsgSubmitProposalParams = { - value: MsgSubmitProposal, - fee?: StdFee, - memo?: string -}; +export { MsgVote, MsgVoteWeighted, MsgDeposit, MsgSubmitProposal }; type sendMsgVoteParams = { value: MsgVote, @@ -48,15 +36,19 @@ type sendMsgVoteWeightedParams = { memo?: string }; - -type msgDepositParams = { +type sendMsgDepositParams = { value: MsgDeposit, + fee?: StdFee, + memo?: string }; -type msgSubmitProposalParams = { +type sendMsgSubmitProposalParams = { value: MsgSubmitProposal, + fee?: StdFee, + memo?: string }; + type msgVoteParams = { value: MsgVote, }; @@ -65,6 +57,14 @@ type msgVoteWeightedParams = { value: MsgVoteWeighted, }; +type msgDepositParams = { + value: MsgDeposit, +}; + +type msgSubmitProposalParams = { + value: MsgSubmitProposal, +}; + export const registry = new Registry(msgTypes); @@ -95,92 +95,92 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { + async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) + let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) } }, - async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { + async sendMsgVoteWeighted({ value, fee, memo }: sendMsgVoteWeightedParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) + let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: '+ e.message) } }, - async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise { + async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgVote({ value: MsgVote.fromPartial(value) }) + let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message) } }, - async sendMsgVoteWeighted({ value, fee, memo }: sendMsgVoteWeightedParams): Promise { + async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) }) + let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) } }, - msgDeposit({ value }: msgDepositParams): EncodeObject { + msgVote({ value }: msgVoteParams): EncodeObject { try { - return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } + return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) + throw new Error('TxClient:MsgVote: Could not create message: ' + e.message) } }, - msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { + msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject { try { - return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } + return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) + throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message) } }, - msgVote({ value }: msgVoteParams): EncodeObject { + msgDeposit({ value }: msgDepositParams): EncodeObject { try { - return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( value ) } + return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgVote: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message) } }, - msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject { + msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { try { - return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( value ) } + return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.gov.v1beta1/registry.ts b/ts-client/cosmos.gov.v1beta1/registry.ts index fcb54851..e8493fa8 100755 --- a/ts-client/cosmos.gov.v1beta1/registry.ts +++ b/ts-client/cosmos.gov.v1beta1/registry.ts @@ -1,14 +1,14 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; -import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; import { MsgVote } from "./types/cosmos/gov/v1beta1/tx"; import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx"; +import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], - ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.gov.v1beta1.MsgVote", MsgVote], ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], + ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], + ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], ]; diff --git a/ts-client/cosmos.gov.v1beta1/rest.ts b/ts-client/cosmos.gov.v1beta1/rest.ts index 69249429..6d0f37e4 100644 --- a/ts-client/cosmos.gov.v1beta1/rest.ts +++ b/ts-client/cosmos.gov.v1beta1/rest.ts @@ -9,151 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Deposit defines an amount deposited by an account address to an active -proposal. -*/ -export interface Govv1Beta1Deposit { - /** @format uint64 */ - proposal_id?: string; - depositor?: string; - amount?: V1Beta1Coin[]; -} - -/** - * Proposal defines the core field members of a governance proposal. - */ -export interface Govv1Beta1Proposal { - /** @format uint64 */ - proposal_id?: string; - - /** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * Example 1: Pack and unpack a message in C++. - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * Example 2: Pack and unpack a message in Java. - * Any any = Any.pack(foo); - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * Example 3: Pack and unpack a message in Python. - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * Example 4: Pack and unpack a message in Go - * foo := &pb.Foo{...} - * any, err := anypb.New(foo) - * if err != nil { - * ... - * } - * ... - * foo := &pb.Foo{} - * if err := any.UnmarshalTo(foo); err != nil { - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * JSON - * ==== - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message [google.protobuf.Duration][]): - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - */ - content?: ProtobufAny; - - /** - * ProposalStatus enumerates the valid statuses of a proposal. - * - * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - * period. - * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - * passed. - * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - * been rejected. - * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - * failed. - */ - status?: V1Beta1ProposalStatus; - - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ - final_tally_result?: Govv1Beta1TallyResult; - - /** @format date-time */ - submit_time?: string; - - /** @format date-time */ - deposit_end_time?: string; - total_deposit?: V1Beta1Coin[]; - - /** @format date-time */ - voting_start_time?: string; - - /** @format date-time */ - voting_end_time?: string; -} - -/** - * TallyResult defines a standard tally for a governance proposal. - */ -export interface Govv1Beta1TallyResult { - yes?: string; - abstain?: string; - no?: string; - no_with_veto?: string; -} - -/** -* Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. -*/ -export interface Govv1Beta1Vote { - /** @format uint64 */ - proposal_id?: string; - voter?: string; - - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - */ - option?: V1Beta1VoteOption; - - /** Since: cosmos-sdk 0.43 */ - options?: V1Beta1WeightedVoteOption[]; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -286,6 +141,17 @@ export interface V1Beta1Coin { amount?: string; } +/** +* Deposit defines an amount deposited by an account address to an active +proposal. +*/ +export interface V1Beta1Deposit { + /** @format uint64 */ + proposal_id?: string; + depositor?: string; + amount?: V1Beta1Coin[]; +} + /** * DepositParams defines the params for deposits on governance proposals. */ @@ -397,6 +263,110 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Proposal defines the core field members of a governance proposal. + */ +export interface V1Beta1Proposal { + /** @format uint64 */ + proposal_id?: string; + + /** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * Example 1: Pack and unpack a message in C++. + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * Example 2: Pack and unpack a message in Java. + * Any any = Any.pack(foo); + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * Example 3: Pack and unpack a message in Python. + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * Example 4: Pack and unpack a message in Go + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + */ + content?: ProtobufAny; + + /** + * ProposalStatus enumerates the valid statuses of a proposal. + * + * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + status?: V1Beta1ProposalStatus; + + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: V1Beta1TallyResult; + + /** @format date-time */ + submit_time?: string; + + /** @format date-time */ + deposit_end_time?: string; + total_deposit?: V1Beta1Coin[]; + + /** @format date-time */ + voting_start_time?: string; + + /** @format date-time */ + voting_end_time?: string; +} + /** * ProposalStatus enumerates the valid statuses of a proposal. @@ -426,14 +396,14 @@ export enum V1Beta1ProposalStatus { */ export interface V1Beta1QueryDepositResponse { /** deposit defines the requested deposit. */ - deposit?: Govv1Beta1Deposit; + deposit?: V1Beta1Deposit; } /** * QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface V1Beta1QueryDepositsResponse { - deposits?: Govv1Beta1Deposit[]; + deposits?: V1Beta1Deposit[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -458,7 +428,7 @@ export interface V1Beta1QueryParamsResponse { */ export interface V1Beta1QueryProposalResponse { /** Proposal defines the core field members of a governance proposal. */ - proposal?: Govv1Beta1Proposal; + proposal?: V1Beta1Proposal; } /** @@ -466,7 +436,7 @@ export interface V1Beta1QueryProposalResponse { method. */ export interface V1Beta1QueryProposalsResponse { - proposals?: Govv1Beta1Proposal[]; + proposals?: V1Beta1Proposal[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -477,7 +447,7 @@ export interface V1Beta1QueryProposalsResponse { */ export interface V1Beta1QueryTallyResultResponse { /** tally defines the requested tally. */ - tally?: Govv1Beta1TallyResult; + tally?: V1Beta1TallyResult; } /** @@ -485,7 +455,7 @@ export interface V1Beta1QueryTallyResultResponse { */ export interface V1Beta1QueryVoteResponse { /** vote defined the queried vote. */ - vote?: Govv1Beta1Vote; + vote?: V1Beta1Vote; } /** @@ -493,7 +463,7 @@ export interface V1Beta1QueryVoteResponse { */ export interface V1Beta1QueryVotesResponse { /** votes defined the queried votes. */ - votes?: Govv1Beta1Vote[]; + votes?: V1Beta1Vote[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -524,6 +494,36 @@ export interface V1Beta1TallyParams { veto_threshold?: string; } +/** + * TallyResult defines a standard tally for a governance proposal. + */ +export interface V1Beta1TallyResult { + yes?: string; + abstain?: string; + no?: string; + no_with_veto?: string; +} + +/** +* Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. +*/ +export interface V1Beta1Vote { + /** @format uint64 */ + proposal_id?: string; + voter?: string; + + /** + * Deprecated: Prefer to use `options` instead. This field is set in queries + * if and only if `len(options) == 1` and that option has weight 1. In all + * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + */ + option?: V1Beta1VoteOption; + + /** Since: cosmos-sdk 0.43 */ + options?: V1Beta1WeightedVoteOption[]; +} + /** * VoteOption enumerates the valid vote options for a given governance proposal. diff --git a/ts-client/cosmos.group.v1/module.ts b/ts-client/cosmos.group.v1/module.ts index d536eb8a..64042c12 100755 --- a/ts-client/cosmos.group.v1/module.ts +++ b/ts-client/cosmos.group.v1/module.ts @@ -7,20 +7,20 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgExec } from "./types/cosmos/group/v1/tx"; -import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx"; -import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx"; -import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx"; -import { MsgVote } from "./types/cosmos/group/v1/tx"; +import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx"; import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx"; +import { MsgVote } from "./types/cosmos/group/v1/tx"; +import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx"; import { MsgCreateGroup } from "./types/cosmos/group/v1/tx"; +import { MsgExec } from "./types/cosmos/group/v1/tx"; +import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx"; +import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx"; import { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx"; import { MsgUpdateGroupPolicyDecisionPolicy } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx"; -import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx"; import { EventCreateGroup as typeEventCreateGroup} from "./types" import { EventUpdateGroup as typeEventUpdateGroup} from "./types" @@ -31,7 +31,6 @@ import { EventWithdrawProposal as typeEventWithdrawProposal} from "./types" import { EventVote as typeEventVote} from "./types" import { EventExec as typeEventExec} from "./types" import { EventLeaveGroup as typeEventLeaveGroup} from "./types" -import { EventProposalPruned as typeEventProposalPruned} from "./types" import { Member as typeMember} from "./types" import { MemberRequest as typeMemberRequest} from "./types" import { ThresholdDecisionPolicy as typeThresholdDecisionPolicy} from "./types" @@ -44,28 +43,28 @@ import { Proposal as typeProposal} from "./types" import { TallyResult as typeTallyResult} from "./types" import { Vote as typeVote} from "./types" -export { MsgExec, MsgLeaveGroup, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgCreateGroupPolicy, MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupAdmin, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupMetadata }; +export { MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupAdmin, MsgCreateGroupPolicy, MsgVote, MsgWithdrawProposal, MsgUpdateGroupMetadata, MsgUpdateGroupPolicyMetadata, MsgCreateGroup, MsgExec, MsgSubmitProposal, MsgLeaveGroup, MsgUpdateGroupMembers, MsgUpdateGroupPolicyDecisionPolicy }; -type sendMsgExecParams = { - value: MsgExec, +type sendMsgCreateGroupWithPolicyParams = { + value: MsgCreateGroupWithPolicy, fee?: StdFee, memo?: string }; -type sendMsgLeaveGroupParams = { - value: MsgLeaveGroup, +type sendMsgUpdateGroupPolicyAdminParams = { + value: MsgUpdateGroupPolicyAdmin, fee?: StdFee, memo?: string }; -type sendMsgSubmitProposalParams = { - value: MsgSubmitProposal, +type sendMsgUpdateGroupAdminParams = { + value: MsgUpdateGroupAdmin, fee?: StdFee, memo?: string }; -type sendMsgWithdrawProposalParams = { - value: MsgWithdrawProposal, +type sendMsgCreateGroupPolicyParams = { + value: MsgCreateGroupPolicy, fee?: StdFee, memo?: string }; @@ -76,115 +75,115 @@ type sendMsgVoteParams = { memo?: string }; -type sendMsgCreateGroupPolicyParams = { - value: MsgCreateGroupPolicy, +type sendMsgWithdrawProposalParams = { + value: MsgWithdrawProposal, fee?: StdFee, memo?: string }; -type sendMsgCreateGroupParams = { - value: MsgCreateGroup, +type sendMsgUpdateGroupMetadataParams = { + value: MsgUpdateGroupMetadata, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupMembersParams = { - value: MsgUpdateGroupMembers, +type sendMsgUpdateGroupPolicyMetadataParams = { + value: MsgUpdateGroupPolicyMetadata, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupPolicyDecisionPolicyParams = { - value: MsgUpdateGroupPolicyDecisionPolicy, +type sendMsgCreateGroupParams = { + value: MsgCreateGroup, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupAdminParams = { - value: MsgUpdateGroupAdmin, +type sendMsgExecParams = { + value: MsgExec, fee?: StdFee, memo?: string }; -type sendMsgCreateGroupWithPolicyParams = { - value: MsgCreateGroupWithPolicy, +type sendMsgSubmitProposalParams = { + value: MsgSubmitProposal, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupPolicyAdminParams = { - value: MsgUpdateGroupPolicyAdmin, +type sendMsgLeaveGroupParams = { + value: MsgLeaveGroup, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupPolicyMetadataParams = { - value: MsgUpdateGroupPolicyMetadata, +type sendMsgUpdateGroupMembersParams = { + value: MsgUpdateGroupMembers, fee?: StdFee, memo?: string }; -type sendMsgUpdateGroupMetadataParams = { - value: MsgUpdateGroupMetadata, +type sendMsgUpdateGroupPolicyDecisionPolicyParams = { + value: MsgUpdateGroupPolicyDecisionPolicy, fee?: StdFee, memo?: string }; -type msgExecParams = { - value: MsgExec, +type msgCreateGroupWithPolicyParams = { + value: MsgCreateGroupWithPolicy, }; -type msgLeaveGroupParams = { - value: MsgLeaveGroup, +type msgUpdateGroupPolicyAdminParams = { + value: MsgUpdateGroupPolicyAdmin, }; -type msgSubmitProposalParams = { - value: MsgSubmitProposal, +type msgUpdateGroupAdminParams = { + value: MsgUpdateGroupAdmin, }; -type msgWithdrawProposalParams = { - value: MsgWithdrawProposal, +type msgCreateGroupPolicyParams = { + value: MsgCreateGroupPolicy, }; type msgVoteParams = { value: MsgVote, }; -type msgCreateGroupPolicyParams = { - value: MsgCreateGroupPolicy, +type msgWithdrawProposalParams = { + value: MsgWithdrawProposal, }; -type msgCreateGroupParams = { - value: MsgCreateGroup, +type msgUpdateGroupMetadataParams = { + value: MsgUpdateGroupMetadata, }; -type msgUpdateGroupMembersParams = { - value: MsgUpdateGroupMembers, +type msgUpdateGroupPolicyMetadataParams = { + value: MsgUpdateGroupPolicyMetadata, }; -type msgUpdateGroupPolicyDecisionPolicyParams = { - value: MsgUpdateGroupPolicyDecisionPolicy, +type msgCreateGroupParams = { + value: MsgCreateGroup, }; -type msgUpdateGroupAdminParams = { - value: MsgUpdateGroupAdmin, +type msgExecParams = { + value: MsgExec, }; -type msgCreateGroupWithPolicyParams = { - value: MsgCreateGroupWithPolicy, +type msgSubmitProposalParams = { + value: MsgSubmitProposal, }; -type msgUpdateGroupPolicyAdminParams = { - value: MsgUpdateGroupPolicyAdmin, +type msgLeaveGroupParams = { + value: MsgLeaveGroup, }; -type msgUpdateGroupPolicyMetadataParams = { - value: MsgUpdateGroupPolicyMetadata, +type msgUpdateGroupMembersParams = { + value: MsgUpdateGroupMembers, }; -type msgUpdateGroupMetadataParams = { - value: MsgUpdateGroupMetadata, +type msgUpdateGroupPolicyDecisionPolicyParams = { + value: MsgUpdateGroupPolicyDecisionPolicy, }; @@ -217,59 +216,59 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgExec({ value, fee, memo }: sendMsgExecParams): Promise { + async sendMsgCreateGroupWithPolicy({ value, fee, memo }: sendMsgCreateGroupWithPolicyParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCreateGroupWithPolicy: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgExec({ value: MsgExec.fromPartial(value) }) + let msg = this.msgCreateGroupWithPolicy({ value: MsgCreateGroupWithPolicy.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgExec: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCreateGroupWithPolicy: Could not broadcast Tx: '+ e.message) } }, - async sendMsgLeaveGroup({ value, fee, memo }: sendMsgLeaveGroupParams): Promise { + async sendMsgUpdateGroupPolicyAdmin({ value, fee, memo }: sendMsgUpdateGroupPolicyAdminParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgLeaveGroup: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgLeaveGroup({ value: MsgLeaveGroup.fromPartial(value) }) + let msg = this.msgUpdateGroupPolicyAdmin({ value: MsgUpdateGroupPolicyAdmin.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgLeaveGroup: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Could not broadcast Tx: '+ e.message) } }, - async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { + async sendMsgUpdateGroupAdmin({ value, fee, memo }: sendMsgUpdateGroupAdminParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupAdmin: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) + let msg = this.msgUpdateGroupAdmin({ value: MsgUpdateGroupAdmin.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupAdmin: Could not broadcast Tx: '+ e.message) } }, - async sendMsgWithdrawProposal({ value, fee, memo }: sendMsgWithdrawProposalParams): Promise { + async sendMsgCreateGroupPolicy({ value, fee, memo }: sendMsgCreateGroupPolicyParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgWithdrawProposal: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCreateGroupPolicy: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgWithdrawProposal({ value: MsgWithdrawProposal.fromPartial(value) }) + let msg = this.msgCreateGroupPolicy({ value: MsgCreateGroupPolicy.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgWithdrawProposal: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCreateGroupPolicy: Could not broadcast Tx: '+ e.message) } }, @@ -287,162 +286,162 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgCreateGroupPolicy({ value, fee, memo }: sendMsgCreateGroupPolicyParams): Promise { + async sendMsgWithdrawProposal({ value, fee, memo }: sendMsgWithdrawProposalParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCreateGroupPolicy: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgWithdrawProposal: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCreateGroupPolicy({ value: MsgCreateGroupPolicy.fromPartial(value) }) + let msg = this.msgWithdrawProposal({ value: MsgWithdrawProposal.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCreateGroupPolicy: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgWithdrawProposal: Could not broadcast Tx: '+ e.message) } }, - async sendMsgCreateGroup({ value, fee, memo }: sendMsgCreateGroupParams): Promise { + async sendMsgUpdateGroupMetadata({ value, fee, memo }: sendMsgUpdateGroupMetadataParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCreateGroup: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupMetadata: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCreateGroup({ value: MsgCreateGroup.fromPartial(value) }) + let msg = this.msgUpdateGroupMetadata({ value: MsgUpdateGroupMetadata.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCreateGroup: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupMetadata: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupMembers({ value, fee, memo }: sendMsgUpdateGroupMembersParams): Promise { + async sendMsgUpdateGroupPolicyMetadata({ value, fee, memo }: sendMsgUpdateGroupPolicyMetadataParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupMembers: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupMembers({ value: MsgUpdateGroupMembers.fromPartial(value) }) + let msg = this.msgUpdateGroupPolicyMetadata({ value: MsgUpdateGroupPolicyMetadata.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupMembers: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupPolicyDecisionPolicy({ value, fee, memo }: sendMsgUpdateGroupPolicyDecisionPolicyParams): Promise { + async sendMsgCreateGroup({ value, fee, memo }: sendMsgCreateGroupParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCreateGroup: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupPolicyDecisionPolicy({ value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value) }) + let msg = this.msgCreateGroup({ value: MsgCreateGroup.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCreateGroup: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupAdmin({ value, fee, memo }: sendMsgUpdateGroupAdminParams): Promise { + async sendMsgExec({ value, fee, memo }: sendMsgExecParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupAdmin: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupAdmin({ value: MsgUpdateGroupAdmin.fromPartial(value) }) + let msg = this.msgExec({ value: MsgExec.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupAdmin: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgExec: Could not broadcast Tx: '+ e.message) } }, - async sendMsgCreateGroupWithPolicy({ value, fee, memo }: sendMsgCreateGroupWithPolicyParams): Promise { + async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCreateGroupWithPolicy: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCreateGroupWithPolicy({ value: MsgCreateGroupWithPolicy.fromPartial(value) }) + let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCreateGroupWithPolicy: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupPolicyAdmin({ value, fee, memo }: sendMsgUpdateGroupPolicyAdminParams): Promise { + async sendMsgLeaveGroup({ value, fee, memo }: sendMsgLeaveGroupParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgLeaveGroup: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupPolicyAdmin({ value: MsgUpdateGroupPolicyAdmin.fromPartial(value) }) + let msg = this.msgLeaveGroup({ value: MsgLeaveGroup.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgLeaveGroup: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupPolicyMetadata({ value, fee, memo }: sendMsgUpdateGroupPolicyMetadataParams): Promise { + async sendMsgUpdateGroupMembers({ value, fee, memo }: sendMsgUpdateGroupMembersParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupMembers: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupPolicyMetadata({ value: MsgUpdateGroupPolicyMetadata.fromPartial(value) }) + let msg = this.msgUpdateGroupMembers({ value: MsgUpdateGroupMembers.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupMembers: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateGroupMetadata({ value, fee, memo }: sendMsgUpdateGroupMetadataParams): Promise { + async sendMsgUpdateGroupPolicyDecisionPolicy({ value, fee, memo }: sendMsgUpdateGroupPolicyDecisionPolicyParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateGroupMetadata: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateGroupMetadata({ value: MsgUpdateGroupMetadata.fromPartial(value) }) + let msg = this.msgUpdateGroupPolicyDecisionPolicy({ value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateGroupMetadata: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Could not broadcast Tx: '+ e.message) } }, - msgExec({ value }: msgExecParams): EncodeObject { + msgCreateGroupWithPolicy({ value }: msgCreateGroupWithPolicyParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgExec", value: MsgExec.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", value: MsgCreateGroupWithPolicy.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgExec: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateGroupWithPolicy: Could not create message: ' + e.message) } }, - msgLeaveGroup({ value }: msgLeaveGroupParams): EncodeObject { + msgUpdateGroupPolicyAdmin({ value }: msgUpdateGroupPolicyAdminParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgLeaveGroup", value: MsgLeaveGroup.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", value: MsgUpdateGroupPolicyAdmin.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgLeaveGroup: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupPolicyAdmin: Could not create message: ' + e.message) } }, - msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { + msgUpdateGroupAdmin({ value }: msgUpdateGroupAdminParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", value: MsgUpdateGroupAdmin.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupAdmin: Could not create message: ' + e.message) } }, - msgWithdrawProposal({ value }: msgWithdrawProposalParams): EncodeObject { + msgCreateGroupPolicy({ value }: msgCreateGroupPolicyParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", value: MsgWithdrawProposal.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", value: MsgCreateGroupPolicy.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgWithdrawProposal: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateGroupPolicy: Could not create message: ' + e.message) } }, @@ -454,75 +453,75 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgCreateGroupPolicy({ value }: msgCreateGroupPolicyParams): EncodeObject { + msgWithdrawProposal({ value }: msgWithdrawProposalParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", value: MsgCreateGroupPolicy.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", value: MsgWithdrawProposal.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCreateGroupPolicy: Could not create message: ' + e.message) + throw new Error('TxClient:MsgWithdrawProposal: Could not create message: ' + e.message) } }, - msgCreateGroup({ value }: msgCreateGroupParams): EncodeObject { + msgUpdateGroupMetadata({ value }: msgUpdateGroupMetadataParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgCreateGroup", value: MsgCreateGroup.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", value: MsgUpdateGroupMetadata.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCreateGroup: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupMetadata: Could not create message: ' + e.message) } }, - msgUpdateGroupMembers({ value }: msgUpdateGroupMembersParams): EncodeObject { + msgUpdateGroupPolicyMetadata({ value }: msgUpdateGroupPolicyMetadataParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", value: MsgUpdateGroupMembers.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", value: MsgUpdateGroupPolicyMetadata.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupMembers: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: ' + e.message) } }, - msgUpdateGroupPolicyDecisionPolicy({ value }: msgUpdateGroupPolicyDecisionPolicyParams): EncodeObject { + msgCreateGroup({ value }: msgCreateGroupParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgCreateGroup", value: MsgCreateGroup.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateGroup: Could not create message: ' + e.message) } }, - msgUpdateGroupAdmin({ value }: msgUpdateGroupAdminParams): EncodeObject { + msgExec({ value }: msgExecParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", value: MsgUpdateGroupAdmin.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgExec", value: MsgExec.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupAdmin: Could not create message: ' + e.message) + throw new Error('TxClient:MsgExec: Could not create message: ' + e.message) } }, - msgCreateGroupWithPolicy({ value }: msgCreateGroupWithPolicyParams): EncodeObject { + msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", value: MsgCreateGroupWithPolicy.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCreateGroupWithPolicy: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message) } }, - msgUpdateGroupPolicyAdmin({ value }: msgUpdateGroupPolicyAdminParams): EncodeObject { + msgLeaveGroup({ value }: msgLeaveGroupParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", value: MsgUpdateGroupPolicyAdmin.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgLeaveGroup", value: MsgLeaveGroup.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupPolicyAdmin: Could not create message: ' + e.message) + throw new Error('TxClient:MsgLeaveGroup: Could not create message: ' + e.message) } }, - msgUpdateGroupPolicyMetadata({ value }: msgUpdateGroupPolicyMetadataParams): EncodeObject { + msgUpdateGroupMembers({ value }: msgUpdateGroupMembersParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", value: MsgUpdateGroupPolicyMetadata.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", value: MsgUpdateGroupMembers.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupMembers: Could not create message: ' + e.message) } }, - msgUpdateGroupMetadata({ value }: msgUpdateGroupMetadataParams): EncodeObject { + msgUpdateGroupPolicyDecisionPolicy({ value }: msgUpdateGroupPolicyDecisionPolicyParams): EncodeObject { try { - return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", value: MsgUpdateGroupMetadata.fromPartial( value ) } + return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateGroupMetadata: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy: Could not create message: ' + e.message) } }, @@ -557,7 +556,6 @@ class SDKModule { EventVote: getStructure(typeEventVote.fromPartial({})), EventExec: getStructure(typeEventExec.fromPartial({})), EventLeaveGroup: getStructure(typeEventLeaveGroup.fromPartial({})), - EventProposalPruned: getStructure(typeEventProposalPruned.fromPartial({})), Member: getStructure(typeMember.fromPartial({})), MemberRequest: getStructure(typeMemberRequest.fromPartial({})), ThresholdDecisionPolicy: getStructure(typeThresholdDecisionPolicy.fromPartial({})), diff --git a/ts-client/cosmos.group.v1/registry.ts b/ts-client/cosmos.group.v1/registry.ts index a67732a5..40f859c0 100755 --- a/ts-client/cosmos.group.v1/registry.ts +++ b/ts-client/cosmos.group.v1/registry.ts @@ -1,34 +1,34 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgExec } from "./types/cosmos/group/v1/tx"; -import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx"; -import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx"; -import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx"; -import { MsgVote } from "./types/cosmos/group/v1/tx"; +import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx"; import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx"; +import { MsgVote } from "./types/cosmos/group/v1/tx"; +import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx"; +import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx"; import { MsgCreateGroup } from "./types/cosmos/group/v1/tx"; +import { MsgExec } from "./types/cosmos/group/v1/tx"; +import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx"; +import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx"; import { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx"; import { MsgUpdateGroupPolicyDecisionPolicy } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx"; -import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx"; -import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.group.v1.MsgExec", MsgExec], - ["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup], - ["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal], - ["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal], - ["/cosmos.group.v1.MsgVote", MsgVote], + ["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy], + ["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin], + ["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin], ["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy], + ["/cosmos.group.v1.MsgVote", MsgVote], + ["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal], + ["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata], + ["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata], ["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup], + ["/cosmos.group.v1.MsgExec", MsgExec], + ["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup], ["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers], ["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", MsgUpdateGroupPolicyDecisionPolicy], - ["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin], - ["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy], - ["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin], - ["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata], - ["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata], ]; diff --git a/ts-client/cosmos.group.v1/rest.ts b/ts-client/cosmos.group.v1/rest.ts index b06995c9..cb7fc2b6 100644 --- a/ts-client/cosmos.group.v1/rest.ts +++ b/ts-client/cosmos.group.v1/rest.ts @@ -9,207 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Exec defines modes of execution of a proposal on creation or on new vote. - - - EXEC_UNSPECIFIED: An empty value means that there should be a separate -MsgExec request for the proposal to execute. - - EXEC_TRY: Try to execute the proposal immediately. -If the proposal is not allowed per the DecisionPolicy, -the proposal will still be open and could -be executed at a later point. -*/ -export enum Groupv1Exec { - EXEC_UNSPECIFIED = "EXEC_UNSPECIFIED", - EXEC_TRY = "EXEC_TRY", -} - -/** - * GroupInfo represents the high-level on-chain information for a group. - */ -export interface Groupv1GroupInfo { - /** - * id is the unique ID of the group. - * @format uint64 - */ - id?: string; - - /** admin is the account address of the group's admin. */ - admin?: string; - - /** metadata is any arbitrary metadata to attached to the group. */ - metadata?: string; - - /** - * version is used to track changes to a group's membership structure that - * would break existing proposals. Whenever any members weight is changed, - * or any member is added or removed this version is incremented and will - * cause proposals based on older versions of this group to fail - * @format uint64 - */ - version?: string; - - /** total_weight is the sum of the group members' weights. */ - total_weight?: string; - - /** - * created_at is a timestamp specifying when a group was created. - * @format date-time - */ - created_at?: string; -} - -/** - * GroupPolicyInfo represents the high-level on-chain information for a group policy. - */ -export interface Groupv1GroupPolicyInfo { - /** address is the account address of group policy. */ - address?: string; - - /** - * group_id is the unique ID of the group. - * @format uint64 - */ - group_id?: string; - - /** admin is the account address of the group admin. */ - admin?: string; - - /** metadata is any arbitrary metadata to attached to the group policy. */ - metadata?: string; - - /** - * version is used to track changes to a group's GroupPolicyInfo structure that - * would create a different result on a running proposal. - * @format uint64 - */ - version?: string; - - /** decision_policy specifies the group policy's decision policy. */ - decision_policy?: ProtobufAny; - - /** - * created_at is a timestamp specifying when a group policy was created. - * @format date-time - */ - created_at?: string; -} - -/** -* Proposal defines a group proposal. Any member of a group can submit a proposal -for a group policy to decide upon. -A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal -passes as well as some optional metadata associated with the proposal. -*/ -export interface Groupv1Proposal { - /** - * id is the unique id of the proposal. - * @format uint64 - */ - id?: string; - - /** group_policy_address is the account address of group policy. */ - group_policy_address?: string; - - /** metadata is any arbitrary metadata to attached to the proposal. */ - metadata?: string; - - /** proposers are the account addresses of the proposers. */ - proposers?: string[]; - - /** - * submit_time is a timestamp specifying when a proposal was submitted. - * @format date-time - */ - submit_time?: string; - - /** - * group_version tracks the version of the group at proposal submission. - * This field is here for informational purposes only. - * @format uint64 - */ - group_version?: string; - - /** - * group_policy_version tracks the version of the group policy at proposal submission. - * When a decision policy is changed, existing proposals from previous policy - * versions will become invalid with the `ABORTED` status. - * This field is here for informational purposes only. - * @format uint64 - */ - group_policy_version?: string; - - /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ - status?: V1ProposalStatus; - - /** - * final_tally_result contains the sums of all weighted votes for this - * proposal for each vote option. It is empty at submission, and only - * populated after tallying, at voting period end or at proposal execution, - * whichever happens first. - */ - final_tally_result?: Groupv1TallyResult; - - /** - * voting_period_end is the timestamp before which voting must be done. - * Unless a successfull MsgExec is called before (to execute a proposal whose - * tally is successful before the voting period ends), tallying will be done - * at this point, and the `final_tally_result`and `status` fields will be - * accordingly updated. - * @format date-time - */ - voting_period_end?: string; - - /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ - executor_result?: V1ProposalExecutorResult; - - /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ - messages?: ProtobufAny[]; -} - -/** - * TallyResult represents the sum of weighted votes for each vote option. - */ -export interface Groupv1TallyResult { - /** yes_count is the weighted sum of yes votes. */ - yes_count?: string; - - /** abstain_count is the weighted sum of abstainers. */ - abstain_count?: string; - - /** no_count is the weighted sum of no votes. */ - no_count?: string; - - /** no_with_veto_count is the weighted sum of veto. */ - no_with_veto_count?: string; -} - -/** - * Vote represents a vote for a proposal. - */ -export interface Groupv1Vote { - /** - * proposal is the unique ID of the proposal. - * @format uint64 - */ - proposal_id?: string; - - /** voter is the account address of the voter. */ - voter?: string; - - /** option is the voter's choice on the proposal. */ - option?: V1VoteOption; - - /** metadata is any arbitrary metadata to attached to the vote. */ - metadata?: string; - - /** - * submit_time is the timestamp when the vote was submitted. - * @format date-time - */ - submit_time?: string; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -331,6 +130,56 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Exec defines modes of execution of a proposal on creation or on new vote. + + - EXEC_UNSPECIFIED: An empty value means that there should be a separate +MsgExec request for the proposal to execute. + - EXEC_TRY: Try to execute the proposal immediately. +If the proposal is not allowed per the DecisionPolicy, +the proposal will still be open and could +be executed at a later point. +*/ +export enum V1Exec { + EXEC_UNSPECIFIED = "EXEC_UNSPECIFIED", + EXEC_TRY = "EXEC_TRY", +} + +/** + * GroupInfo represents the high-level on-chain information for a group. + */ +export interface V1GroupInfo { + /** + * id is the unique ID of the group. + * @format uint64 + */ + id?: string; + + /** admin is the account address of the group's admin. */ + admin?: string; + + /** metadata is any arbitrary metadata to attached to the group. */ + metadata?: string; + + /** + * version is used to track changes to a group's membership structure that + * would break existing proposals. Whenever any members weight is changed, + * or any member is added or removed this version is incremented and will + * cause proposals based on older versions of this group to fail + * @format uint64 + */ + version?: string; + + /** total_weight is the sum of the group members' weights. */ + total_weight?: string; + + /** + * created_at is a timestamp specifying when a group was created. + * @format date-time + */ + created_at?: string; +} + /** * GroupMember represents the relationship between a group and a member. */ @@ -345,6 +194,42 @@ export interface V1GroupMember { member?: V1Member; } +/** + * GroupPolicyInfo represents the high-level on-chain information for a group policy. + */ +export interface V1GroupPolicyInfo { + /** address is the account address of group policy. */ + address?: string; + + /** + * group_id is the unique ID of the group. + * @format uint64 + */ + group_id?: string; + + /** admin is the account address of the group admin. */ + admin?: string; + + /** metadata is any arbitrary metadata to attached to the group policy. */ + metadata?: string; + + /** + * version is used to track changes to a group's GroupPolicyInfo structure that + * would create a different result on a running proposal. + * @format uint64 + */ + version?: string; + + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: ProtobufAny; + + /** + * created_at is a timestamp specifying when a group policy was created. + * @format date-time + */ + created_at?: string; +} + /** * Member represents a group member with an account address, non-zero weight, metadata and added_at timestamp. @@ -479,6 +364,78 @@ export type V1MsgVoteResponse = object; */ export type V1MsgWithdrawProposalResponse = object; +/** +* Proposal defines a group proposal. Any member of a group can submit a proposal +for a group policy to decide upon. +A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +passes as well as some optional metadata associated with the proposal. +*/ +export interface V1Proposal { + /** + * id is the unique id of the proposal. + * @format uint64 + */ + id?: string; + + /** group_policy_address is the account address of group policy. */ + group_policy_address?: string; + + /** metadata is any arbitrary metadata to attached to the proposal. */ + metadata?: string; + + /** proposers are the account addresses of the proposers. */ + proposers?: string[]; + + /** + * submit_time is a timestamp specifying when a proposal was submitted. + * @format date-time + */ + submit_time?: string; + + /** + * group_version tracks the version of the group at proposal submission. + * This field is here for informational purposes only. + * @format uint64 + */ + group_version?: string; + + /** + * group_policy_version tracks the version of the group policy at proposal submission. + * When a decision policy is changed, existing proposals from previous policy + * versions will become invalid with the `ABORTED` status. + * This field is here for informational purposes only. + * @format uint64 + */ + group_policy_version?: string; + + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status?: V1ProposalStatus; + + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option. It is empty at submission, and only + * populated after tallying, at voting period end or at proposal execution, + * whichever happens first. + */ + final_tally_result?: V1TallyResult; + + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successfull MsgExec is called before (to execute a proposal whose + * tally is successful before the voting period ends), tallying will be done + * at this point, and the `final_tally_result`and `status` fields will be + * accordingly updated. + * @format date-time + */ + voting_period_end?: string; + + /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ + executor_result?: V1ProposalExecutorResult; + + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages?: ProtobufAny[]; +} + /** * ProposalExecutorResult defines types of proposal executor results. @@ -522,7 +479,7 @@ export enum V1ProposalStatus { */ export interface V1QueryGroupInfoResponse { /** info is the GroupInfo for the group. */ - info?: Groupv1GroupInfo; + info?: V1GroupInfo; } /** @@ -541,7 +498,7 @@ export interface V1QueryGroupMembersResponse { */ export interface V1QueryGroupPoliciesByAdminResponse { /** group_policies are the group policies info with provided admin. */ - group_policies?: Groupv1GroupPolicyInfo[]; + group_policies?: V1GroupPolicyInfo[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -552,7 +509,7 @@ export interface V1QueryGroupPoliciesByAdminResponse { */ export interface V1QueryGroupPoliciesByGroupResponse { /** group_policies are the group policies info associated with the provided group. */ - group_policies?: Groupv1GroupPolicyInfo[]; + group_policies?: V1GroupPolicyInfo[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -563,7 +520,7 @@ export interface V1QueryGroupPoliciesByGroupResponse { */ export interface V1QueryGroupPolicyInfoResponse { /** info is the GroupPolicyInfo for the group policy. */ - info?: Groupv1GroupPolicyInfo; + info?: V1GroupPolicyInfo; } /** @@ -571,7 +528,7 @@ export interface V1QueryGroupPolicyInfoResponse { */ export interface V1QueryGroupsByAdminResponse { /** groups are the groups info with the provided admin. */ - groups?: Groupv1GroupInfo[]; + groups?: V1GroupInfo[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -582,20 +539,7 @@ export interface V1QueryGroupsByAdminResponse { */ export interface V1QueryGroupsByMemberResponse { /** groups are the groups info with the provided group member. */ - groups?: Groupv1GroupInfo[]; - - /** pagination defines the pagination in the response. */ - pagination?: V1Beta1PageResponse; -} - -/** -* QueryGroupsResponse is the Query/Groups response type. - -Since: cosmos-sdk 0.47.1 -*/ -export interface V1QueryGroupsResponse { - /** `groups` is all the groups present in state. */ - groups?: Groupv1GroupInfo[]; + groups?: V1GroupInfo[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -606,7 +550,7 @@ export interface V1QueryGroupsResponse { */ export interface V1QueryProposalResponse { /** proposal is the proposal info. */ - proposal?: Groupv1Proposal; + proposal?: V1Proposal; } /** @@ -614,7 +558,7 @@ export interface V1QueryProposalResponse { */ export interface V1QueryProposalsByGroupPolicyResponse { /** proposals are the proposals with given group policy. */ - proposals?: Groupv1Proposal[]; + proposals?: V1Proposal[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -625,7 +569,7 @@ export interface V1QueryProposalsByGroupPolicyResponse { */ export interface V1QueryTallyResultResponse { /** tally defines the requested tally. */ - tally?: Groupv1TallyResult; + tally?: V1TallyResult; } /** @@ -633,7 +577,7 @@ export interface V1QueryTallyResultResponse { */ export interface V1QueryVoteByProposalVoterResponse { /** vote is the vote with given proposal_id and voter. */ - vote?: Groupv1Vote; + vote?: V1Vote; } /** @@ -641,7 +585,7 @@ export interface V1QueryVoteByProposalVoterResponse { */ export interface V1QueryVotesByProposalResponse { /** votes are the list of votes for given proposal_id. */ - votes?: Groupv1Vote[]; + votes?: V1Vote[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -652,12 +596,55 @@ export interface V1QueryVotesByProposalResponse { */ export interface V1QueryVotesByVoterResponse { /** votes are the list of votes by given voter. */ - votes?: Groupv1Vote[]; + votes?: V1Vote[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; } +/** + * TallyResult represents the sum of weighted votes for each vote option. + */ +export interface V1TallyResult { + /** yes_count is the weighted sum of yes votes. */ + yes_count?: string; + + /** abstain_count is the weighted sum of abstainers. */ + abstain_count?: string; + + /** no_count is the weighted sum of no votes. */ + no_count?: string; + + /** no_with_veto_count is the weighted sum of veto. */ + no_with_veto_count?: string; +} + +/** + * Vote represents a vote for a proposal. + */ +export interface V1Vote { + /** + * proposal is the unique ID of the proposal. + * @format uint64 + */ + proposal_id?: string; + + /** voter is the account address of the voter. */ + voter?: string; + + /** option is the voter's choice on the proposal. */ + option?: V1VoteOption; + + /** metadata is any arbitrary metadata to attached to the vote. */ + metadata?: string; + + /** + * submit_time is the timestamp when the vote was submitted. + * @format date-time + */ + submit_time?: string; +} + /** * VoteOption enumerates the valid vote options for a given proposal. @@ -986,32 +973,6 @@ export class Api extends HttpClient - this.request({ - path: `/cosmos/group/v1/groups`, - method: "GET", - query: query, - format: "json", - ...params, - }); - /** * No description * diff --git a/ts-client/cosmos.group.v1/types.ts b/ts-client/cosmos.group.v1/types.ts index b28b2940..0f021b3b 100755 --- a/ts-client/cosmos.group.v1/types.ts +++ b/ts-client/cosmos.group.v1/types.ts @@ -7,7 +7,6 @@ import { EventWithdrawProposal } from "./types/cosmos/group/v1/events" import { EventVote } from "./types/cosmos/group/v1/events" import { EventExec } from "./types/cosmos/group/v1/events" import { EventLeaveGroup } from "./types/cosmos/group/v1/events" -import { EventProposalPruned } from "./types/cosmos/group/v1/events" import { Member } from "./types/cosmos/group/v1/types" import { MemberRequest } from "./types/cosmos/group/v1/types" import { ThresholdDecisionPolicy } from "./types/cosmos/group/v1/types" @@ -31,7 +30,6 @@ export { EventVote, EventExec, EventLeaveGroup, - EventProposalPruned, Member, MemberRequest, ThresholdDecisionPolicy, diff --git a/ts-client/cosmos.group.v1/types/cosmos/group/v1/events.ts b/ts-client/cosmos.group.v1/types/cosmos/group/v1/events.ts index 752eb194..9405b8ab 100644 --- a/ts-client/cosmos.group.v1/types/cosmos/group/v1/events.ts +++ b/ts-client/cosmos.group.v1/types/cosmos/group/v1/events.ts @@ -1,15 +1,7 @@ /* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal"; -import { - ProposalExecutorResult, - proposalExecutorResultFromJSON, - proposalExecutorResultToJSON, - ProposalStatus, - proposalStatusFromJSON, - proposalStatusToJSON, - TallyResult, -} from "./types"; +import { ProposalExecutorResult, proposalExecutorResultFromJSON, proposalExecutorResultToJSON } from "./types"; export const protobufPackage = "cosmos.group.v1"; @@ -75,16 +67,6 @@ export interface EventLeaveGroup { address: string; } -/** EventProposalPruned is an event emitted when a proposal is pruned. */ -export interface EventProposalPruned { - /** proposal_id is the unique ID of the proposal. */ - proposalId: number; - /** status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). */ - status: ProposalStatus; - /** tally_result is the proposal tally result (when applicable). */ - tallyResult: TallyResult | undefined; -} - function createBaseEventCreateGroup(): EventCreateGroup { return { groupId: 0 }; } @@ -539,76 +521,6 @@ export const EventLeaveGroup = { }, }; -function createBaseEventProposalPruned(): EventProposalPruned { - return { proposalId: 0, status: 0, tallyResult: undefined }; -} - -export const EventProposalPruned = { - encode(message: EventProposalPruned, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.proposalId !== 0) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.status !== 0) { - writer.uint32(16).int32(message.status); - } - if (message.tallyResult !== undefined) { - TallyResult.encode(message.tallyResult, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventProposalPruned { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventProposalPruned(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = longToNumber(reader.uint64() as Long); - break; - case 2: - message.status = reader.int32() as any; - break; - case 3: - message.tallyResult = TallyResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EventProposalPruned { - return { - proposalId: isSet(object.proposalId) ? Number(object.proposalId) : 0, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : 0, - tallyResult: isSet(object.tallyResult) ? TallyResult.fromJSON(object.tallyResult) : undefined, - }; - }, - - toJSON(message: EventProposalPruned): unknown { - const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = Math.round(message.proposalId)); - message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); - message.tallyResult !== undefined - && (obj.tallyResult = message.tallyResult ? TallyResult.toJSON(message.tallyResult) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): EventProposalPruned { - const message = createBaseEventProposalPruned(); - message.proposalId = object.proposalId ?? 0; - message.status = object.status ?? 0; - message.tallyResult = (object.tallyResult !== undefined && object.tallyResult !== null) - ? TallyResult.fromPartial(object.tallyResult) - : undefined; - return message; - }, -}; - declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/ts-client/cosmos.group.v1/types/cosmos/group/v1/query.ts b/ts-client/cosmos.group.v1/types/cosmos/group/v1/query.ts index d79c8a34..6a818d5f 100644 --- a/ts-client/cosmos.group.v1/types/cosmos/group/v1/query.ts +++ b/ts-client/cosmos.group.v1/types/cosmos/group/v1/query.ts @@ -198,28 +198,6 @@ export interface QueryTallyResultResponse { tally: TallyResult | undefined; } -/** - * QueryGroupsRequest is the Query/Groups request type. - * - * Since: cosmos-sdk 0.47.1 - */ -export interface QueryGroupsRequest { - /** pagination defines an optional pagination for the request. */ - pagination: PageRequest | undefined; -} - -/** - * QueryGroupsResponse is the Query/Groups response type. - * - * Since: cosmos-sdk 0.47.1 - */ -export interface QueryGroupsResponse { - /** `groups` is all the groups present in state. */ - groups: GroupInfo[]; - /** pagination defines the pagination in the response. */ - pagination: PageResponse | undefined; -} - function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { return { groupId: 0 }; } @@ -1735,121 +1713,6 @@ export const QueryTallyResultResponse = { }, }; -function createBaseQueryGroupsRequest(): QueryGroupsRequest { - return { pagination: undefined }; -} - -export const QueryGroupsRequest = { - encode(message: QueryGroupsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGroupsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGroupsRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; - }, - - toJSON(message: QueryGroupsRequest): unknown { - const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryGroupsRequest { - const message = createBaseQueryGroupsRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - return message; - }, -}; - -function createBaseQueryGroupsResponse(): QueryGroupsResponse { - return { groups: [], pagination: undefined }; -} - -export const QueryGroupsResponse = { - encode(message: QueryGroupsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.groups) { - GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGroupsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groups.push(GroupInfo.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryGroupsResponse { - return { - groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => GroupInfo.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, - }; - }, - - toJSON(message: QueryGroupsResponse): unknown { - const obj: any = {}; - if (message.groups) { - obj.groups = message.groups.map((e) => e ? GroupInfo.toJSON(e) : undefined); - } else { - obj.groups = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial, I>>(object: I): QueryGroupsResponse { - const message = createBaseQueryGroupsResponse(); - message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; - return message; - }, -}; - /** Query is the cosmos.group.v1 Query service. */ export interface Query { /** GroupInfo queries group info based on group id. */ @@ -1884,12 +1747,6 @@ export interface Query { * proposal itself. */ TallyResult(request: QueryTallyResultRequest): Promise; - /** - * Groups queries all groups in state. - * - * Since: cosmos-sdk 0.47.1 - */ - Groups(request: QueryGroupsRequest): Promise; } export class QueryClientImpl implements Query { @@ -1909,7 +1766,6 @@ export class QueryClientImpl implements Query { this.VotesByVoter = this.VotesByVoter.bind(this); this.GroupsByMember = this.GroupsByMember.bind(this); this.TallyResult = this.TallyResult.bind(this); - this.Groups = this.Groups.bind(this); } GroupInfo(request: QueryGroupInfoRequest): Promise { const data = QueryGroupInfoRequest.encode(request).finish(); @@ -1988,12 +1844,6 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); } - - Groups(request: QueryGroupsRequest): Promise { - const data = QueryGroupsRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.group.v1.Query", "Groups", data); - return promise.then((data) => QueryGroupsResponse.decode(new _m0.Reader(data))); - } } interface Rpc { diff --git a/ts-client/cosmos.mint.v1beta1/rest.ts b/ts-client/cosmos.mint.v1beta1/rest.ts index 415abcb9..bb343cbf 100644 --- a/ts-client/cosmos.mint.v1beta1/rest.ts +++ b/ts-client/cosmos.mint.v1beta1/rest.ts @@ -9,10 +9,21 @@ * --------------------------------------------------------------- */ +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + /** * Params holds parameters for the mint module. */ -export interface Mintv1Beta1Params { +export interface V1Beta1Params { /** type of coin to mint */ mint_denom?: string; @@ -35,17 +46,6 @@ export interface Mintv1Beta1Params { blocks_per_year?: string; } -export interface ProtobufAny { - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - /** * QueryAnnualProvisionsResponse is the response type for the Query/AnnualProvisions RPC method. @@ -75,7 +75,7 @@ export interface V1Beta1QueryInflationResponse { */ export interface V1Beta1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Mintv1Beta1Params; + params?: V1Beta1Params; } import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; diff --git a/ts-client/cosmos.nft.v1beta1/rest.ts b/ts-client/cosmos.nft.v1beta1/rest.ts index 56288b04..4da5ee05 100644 --- a/ts-client/cosmos.nft.v1beta1/rest.ts +++ b/ts-client/cosmos.nft.v1beta1/rest.ts @@ -9,10 +9,131 @@ * --------------------------------------------------------------- */ +/** +* `Any` contains an arbitrary serialized protocol buffer message along with a +URL that describes the type of the serialized message. + +Protobuf library provides support to pack/unpack Any values in the form +of utility functions or additional generated methods of the Any type. + +Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + +Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + +The pack methods provided by protobuf library will by default use +'type.googleapis.com/full.type.name' as the type URL and the unpack +methods only use the fully qualified type name after the last '/' +in the type URL, for example "foo.bar.com/x/y.z" will yield type +name "y.z". + + +JSON +==== +The JSON representation of an `Any` value uses the regular +representation of the deserialized, embedded message, with an +additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + +If the embedded message type is well-known and has a custom JSON +representation, that representation will be embedded adding a field +`value` which holds the custom JSON in addition to the `@type` +field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } +*/ +export interface ProtobufAny { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + /** * Class defines the class of the nft type. */ -export interface Nftv1Beta1Class { +export interface V1Beta1Class { /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ id?: string; @@ -93,10 +214,15 @@ export interface Nftv1Beta1Class { data?: ProtobufAny; } +/** + * MsgSendResponse defines the Msg/Send response type. + */ +export type V1Beta1MsgSendResponse = object; + /** * NFT defines the NFT. */ -export interface Nftv1Beta1NFT { +export interface V1Beta1NFT { /** class_id associated with the NFT, similar to the contract address of ERC721 */ class_id?: string; @@ -171,132 +297,6 @@ export interface Nftv1Beta1NFT { data?: ProtobufAny; } -/** -* `Any` contains an arbitrary serialized protocol buffer message along with a -URL that describes the type of the serialized message. - -Protobuf library provides support to pack/unpack Any values in the form -of utility functions or additional generated methods of the Any type. - -Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - -Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - -The pack methods provided by protobuf library will by default use -'type.googleapis.com/full.type.name' as the type URL and the unpack -methods only use the fully qualified type name after the last '/' -in the type URL, for example "foo.bar.com/x/y.z" will yield type -name "y.z". - - -JSON -==== -The JSON representation of an `Any` value uses the regular -representation of the deserialized, embedded message, with an -additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - -If the embedded message type is well-known and has a custom JSON -representation, that representation will be embedded adding a field -`value` which holds the custom JSON in addition to the `@type` -field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } -*/ -export interface ProtobufAny { - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - */ - "@type"?: string; -} - -export interface RpcStatus { - /** @format int32 */ - code?: number; - message?: string; - details?: ProtobufAny[]; -} - -/** - * MsgSendResponse defines the Msg/Send response type. - */ -export type V1Beta1MsgSendResponse = object; - /** * message SomeRequest { Foo some_parameter = 1; @@ -376,11 +376,11 @@ export interface V1Beta1QueryBalanceResponse { export interface V1Beta1QueryClassResponse { /** Class defines the class of the nft type. */ - class?: Nftv1Beta1Class; + class?: V1Beta1Class; } export interface V1Beta1QueryClassesResponse { - classes?: Nftv1Beta1Class[]; + classes?: V1Beta1Class[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -396,11 +396,11 @@ export interface V1Beta1QueryClassesResponse { export interface V1Beta1QueryNFTResponse { /** NFT defines the NFT. */ - nft?: Nftv1Beta1NFT; + nft?: V1Beta1NFT; } export interface V1Beta1QueryNFTsResponse { - nfts?: Nftv1Beta1NFT[]; + nfts?: V1Beta1NFT[]; /** * PageResponse is to be embedded in gRPC response messages where the diff --git a/ts-client/cosmos.slashing.v1beta1/rest.ts b/ts-client/cosmos.slashing.v1beta1/rest.ts index c7f2dca2..38ae833f 100644 --- a/ts-client/cosmos.slashing.v1beta1/rest.ts +++ b/ts-client/cosmos.slashing.v1beta1/rest.ts @@ -20,24 +20,6 @@ export interface RpcStatus { details?: ProtobufAny[]; } -/** - * Params represents the parameters used for by the slashing module. - */ -export interface Slashingv1Beta1Params { - /** @format int64 */ - signed_blocks_window?: string; - - /** @format byte */ - min_signed_per_window?: string; - downtime_jail_duration?: string; - - /** @format byte */ - slash_fraction_double_sign?: string; - - /** @format byte */ - slash_fraction_downtime?: string; -} - export type V1Beta1MsgUnjailResponse = object; /** @@ -112,9 +94,27 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Params represents the parameters used for by the slashing module. + */ +export interface V1Beta1Params { + /** @format int64 */ + signed_blocks_window?: string; + + /** @format byte */ + min_signed_per_window?: string; + downtime_jail_duration?: string; + + /** @format byte */ + slash_fraction_double_sign?: string; + + /** @format byte */ + slash_fraction_downtime?: string; +} + export interface V1Beta1QueryParamsResponse { /** Params represents the parameters used for by the slashing module. */ - params?: Slashingv1Beta1Params; + params?: V1Beta1Params; } export interface V1Beta1QuerySigningInfoResponse { diff --git a/ts-client/cosmos.staking.v1beta1/module.ts b/ts-client/cosmos.staking.v1beta1/module.ts index a75ebb7c..9ba52d31 100755 --- a/ts-client/cosmos.staking.v1beta1/module.ts +++ b/ts-client/cosmos.staking.v1beta1/module.ts @@ -7,12 +7,12 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; import { MsgCancelUnbondingDelegation } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; import { StakeAuthorization as typeStakeAuthorization} from "./types" import { StakeAuthorization_Validators as typeStakeAuthorization_Validators} from "./types" @@ -38,28 +38,28 @@ import { RedelegationEntryResponse as typeRedelegationEntryResponse} from "./typ import { RedelegationResponse as typeRedelegationResponse} from "./types" import { Pool as typePool} from "./types" -export { MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgEditValidator, MsgCreateValidator }; +export { MsgUndelegate, MsgCancelUnbondingDelegation, MsgCreateValidator, MsgBeginRedelegate, MsgEditValidator, MsgDelegate }; -type sendMsgDelegateParams = { - value: MsgDelegate, +type sendMsgUndelegateParams = { + value: MsgUndelegate, fee?: StdFee, memo?: string }; -type sendMsgBeginRedelegateParams = { - value: MsgBeginRedelegate, +type sendMsgCancelUnbondingDelegationParams = { + value: MsgCancelUnbondingDelegation, fee?: StdFee, memo?: string }; -type sendMsgUndelegateParams = { - value: MsgUndelegate, +type sendMsgCreateValidatorParams = { + value: MsgCreateValidator, fee?: StdFee, memo?: string }; -type sendMsgCancelUnbondingDelegationParams = { - value: MsgCancelUnbondingDelegation, +type sendMsgBeginRedelegateParams = { + value: MsgBeginRedelegate, fee?: StdFee, memo?: string }; @@ -70,21 +70,13 @@ type sendMsgEditValidatorParams = { memo?: string }; -type sendMsgCreateValidatorParams = { - value: MsgCreateValidator, +type sendMsgDelegateParams = { + value: MsgDelegate, fee?: StdFee, memo?: string }; -type msgDelegateParams = { - value: MsgDelegate, -}; - -type msgBeginRedelegateParams = { - value: MsgBeginRedelegate, -}; - type msgUndelegateParams = { value: MsgUndelegate, }; @@ -93,12 +85,20 @@ type msgCancelUnbondingDelegationParams = { value: MsgCancelUnbondingDelegation, }; +type msgCreateValidatorParams = { + value: MsgCreateValidator, +}; + +type msgBeginRedelegateParams = { + value: MsgBeginRedelegate, +}; + type msgEditValidatorParams = { value: MsgEditValidator, }; -type msgCreateValidatorParams = { - value: MsgCreateValidator, +type msgDelegateParams = { + value: MsgDelegate, }; @@ -131,59 +131,59 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgDelegate({ value, fee, memo }: sendMsgDelegateParams): Promise { + async sendMsgUndelegate({ value, fee, memo }: sendMsgUndelegateParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDelegate: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUndelegate: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDelegate({ value: MsgDelegate.fromPartial(value) }) + let msg = this.msgUndelegate({ value: MsgUndelegate.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDelegate: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUndelegate: Could not broadcast Tx: '+ e.message) } }, - async sendMsgBeginRedelegate({ value, fee, memo }: sendMsgBeginRedelegateParams): Promise { + async sendMsgCancelUnbondingDelegation({ value, fee, memo }: sendMsgCancelUnbondingDelegationParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgBeginRedelegate: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgBeginRedelegate({ value: MsgBeginRedelegate.fromPartial(value) }) + let msg = this.msgCancelUnbondingDelegation({ value: MsgCancelUnbondingDelegation.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgBeginRedelegate: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUndelegate({ value, fee, memo }: sendMsgUndelegateParams): Promise { + async sendMsgCreateValidator({ value, fee, memo }: sendMsgCreateValidatorParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUndelegate: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUndelegate({ value: MsgUndelegate.fromPartial(value) }) + let msg = this.msgCreateValidator({ value: MsgCreateValidator.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUndelegate: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCreateValidator: Could not broadcast Tx: '+ e.message) } }, - async sendMsgCancelUnbondingDelegation({ value, fee, memo }: sendMsgCancelUnbondingDelegationParams): Promise { + async sendMsgBeginRedelegate({ value, fee, memo }: sendMsgBeginRedelegateParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgBeginRedelegate: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCancelUnbondingDelegation({ value: MsgCancelUnbondingDelegation.fromPartial(value) }) + let msg = this.msgBeginRedelegate({ value: MsgBeginRedelegate.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCancelUnbondingDelegation: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgBeginRedelegate: Could not broadcast Tx: '+ e.message) } }, @@ -201,50 +201,50 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgCreateValidator({ value, fee, memo }: sendMsgCreateValidatorParams): Promise { + async sendMsgDelegate({ value, fee, memo }: sendMsgDelegateParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDelegate: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCreateValidator({ value: MsgCreateValidator.fromPartial(value) }) + let msg = this.msgDelegate({ value: MsgDelegate.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCreateValidator: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDelegate: Could not broadcast Tx: '+ e.message) } }, - msgDelegate({ value }: msgDelegateParams): EncodeObject { + msgUndelegate({ value }: msgUndelegateParams): EncodeObject { try { - return { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: MsgDelegate.fromPartial( value ) } + return { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgDelegate: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUndelegate: Could not create message: ' + e.message) } }, - msgBeginRedelegate({ value }: msgBeginRedelegateParams): EncodeObject { + msgCancelUnbondingDelegation({ value }: msgCancelUnbondingDelegationParams): EncodeObject { try { - return { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: MsgBeginRedelegate.fromPartial( value ) } + return { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", value: MsgCancelUnbondingDelegation.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgBeginRedelegate: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCancelUnbondingDelegation: Could not create message: ' + e.message) } }, - msgUndelegate({ value }: msgUndelegateParams): EncodeObject { + msgCreateValidator({ value }: msgCreateValidatorParams): EncodeObject { try { - return { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial( value ) } + return { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: MsgCreateValidator.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUndelegate: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateValidator: Could not create message: ' + e.message) } }, - msgCancelUnbondingDelegation({ value }: msgCancelUnbondingDelegationParams): EncodeObject { + msgBeginRedelegate({ value }: msgBeginRedelegateParams): EncodeObject { try { - return { typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", value: MsgCancelUnbondingDelegation.fromPartial( value ) } + return { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: MsgBeginRedelegate.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCancelUnbondingDelegation: Could not create message: ' + e.message) + throw new Error('TxClient:MsgBeginRedelegate: Could not create message: ' + e.message) } }, @@ -256,11 +256,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgCreateValidator({ value }: msgCreateValidatorParams): EncodeObject { + msgDelegate({ value }: msgDelegateParams): EncodeObject { try { - return { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: MsgCreateValidator.fromPartial( value ) } + return { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: MsgDelegate.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCreateValidator: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDelegate: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.staking.v1beta1/registry.ts b/ts-client/cosmos.staking.v1beta1/registry.ts index bebdd2eb..24d26010 100755 --- a/ts-client/cosmos.staking.v1beta1/registry.ts +++ b/ts-client/cosmos.staking.v1beta1/registry.ts @@ -1,18 +1,18 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; import { MsgUndelegate } from "./types/cosmos/staking/v1beta1/tx"; import { MsgCancelUnbondingDelegation } from "./types/cosmos/staking/v1beta1/tx"; -import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; import { MsgCreateValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgBeginRedelegate } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgEditValidator } from "./types/cosmos/staking/v1beta1/tx"; +import { MsgDelegate } from "./types/cosmos/staking/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], - ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], - ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], + ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], + ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], + ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ]; diff --git a/ts-client/cosmos.staking.v1beta1/rest.ts b/ts-client/cosmos.staking.v1beta1/rest.ts index 74c1ad5d..2f38b924 100644 --- a/ts-client/cosmos.staking.v1beta1/rest.ts +++ b/ts-client/cosmos.staking.v1beta1/rest.ts @@ -130,94 +130,6 @@ export interface RpcStatus { details?: ProtobufAny[]; } -/** -* Delegation represents the bond with tokens held by an account. It is -owned by one delegator, and is associated with the voting power of one -validator. -*/ -export interface Stakingv1Beta1Delegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** shares define the delegation shares received. */ - shares?: string; -} - -/** -* HistoricalInfo contains header and validator information for a given block. -It is stored as part of staking module's state, which persists the `n` most -recent HistoricalInfo -(`n` is set by the staking module's `historical_entries` parameter). -*/ -export interface Stakingv1Beta1HistoricalInfo { - /** Header defines the structure of a block header. */ - header?: TypesHeader; - valset?: Stakingv1Beta1Validator[]; -} - -/** - * Params defines the parameters for the staking module. - */ -export interface Stakingv1Beta1Params { - /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: string; - - /** - * max_validators is the maximum number of validators. - * @format int64 - */ - max_validators?: number; - - /** - * max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - * @format int64 - */ - max_entries?: number; - - /** - * historical_entries is the number of historical entries to persist. - * @format int64 - */ - historical_entries?: number; - - /** bond_denom defines the bondable coin denomination. */ - bond_denom?: string; - - /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ - min_commission_rate?: string; -} - -/** -* Pool is used for tracking bonded and not-bonded token supply of the bond -denomination. -*/ -export interface Stakingv1Beta1Pool { - not_bonded_tokens?: string; - bonded_tokens?: string; -} - -/** -* UnbondingDelegation stores all of a single delegator's unbonding bonds -for a single validator in an time-ordered list. -*/ -export interface Stakingv1Beta1UnbondingDelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address?: string; - - /** validator_address is the bech32-encoded address of the validator. */ - validator_address?: string; - - /** - * entries are the unbonding delegation entries. - * - * unbonding delegation entries - */ - entries?: V1Beta1UnbondingDelegationEntry[]; -} - /** * Validator defines a validator, together with the total amount of the Validator's bond shares and their exchange rate to coins. Slashing results in @@ -280,7 +192,7 @@ export interface TypesBlockID { } /** - * Header defines the structure of a block header. + * Header defines the structure of a Tendermint block header. */ export interface TypesHeader { /** @@ -422,6 +334,22 @@ export interface V1Beta1CommissionRates { max_change_rate?: string; } +/** +* Delegation represents the bond with tokens held by an account. It is +owned by one delegator, and is associated with the voting power of one +validator. +*/ +export interface V1Beta1Delegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + + /** shares define the delegation shares received. */ + shares?: string; +} + /** * DelegationResponse is equivalent to Delegation except that it contains a balance in addition to shares which is more suitable for client responses. @@ -432,7 +360,7 @@ export interface V1Beta1DelegationResponse { * owned by one delegator, and is associated with the voting power of one * validator. */ - delegation?: Stakingv1Beta1Delegation; + delegation?: V1Beta1Delegation; /** * Coin defines a token with a denomination and an amount. @@ -463,6 +391,18 @@ export interface V1Beta1Description { details?: string; } +/** +* HistoricalInfo contains header and validator information for a given block. +It is stored as part of staking module's state, which persists the `n` most +recent HistoricalInfo +(`n` is set by the staking module's `historical_entries` parameter). +*/ +export interface V1Beta1HistoricalInfo { + /** Header defines the structure of a Tendermint block header. */ + header?: TypesHeader; + valset?: Stakingv1Beta1Validator[]; +} + /** * MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ @@ -571,6 +511,47 @@ export interface V1Beta1PageResponse { total?: string; } +/** + * Params defines the parameters for the staking module. + */ +export interface V1Beta1Params { + /** unbonding_time is the time duration of unbonding. */ + unbonding_time?: string; + + /** + * max_validators is the maximum number of validators. + * @format int64 + */ + max_validators?: number; + + /** + * max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + * @format int64 + */ + max_entries?: number; + + /** + * historical_entries is the number of historical entries to persist. + * @format int64 + */ + historical_entries?: number; + + /** bond_denom defines the bondable coin denomination. */ + bond_denom?: string; + + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + min_commission_rate?: string; +} + +/** +* Pool is used for tracking bonded and not-bonded token supply of the bond +denomination. +*/ +export interface V1Beta1Pool { + not_bonded_tokens?: string; + bonded_tokens?: string; +} + /** * QueryDelegationResponse is response type for the Query/Delegation RPC method. */ @@ -596,7 +577,7 @@ export interface V1Beta1QueryDelegatorDelegationsResponse { Query/UnbondingDelegatorDelegations RPC method. */ export interface V1Beta1QueryDelegatorUnbondingDelegationsResponse { - unbonding_responses?: Stakingv1Beta1UnbondingDelegation[]; + unbonding_responses?: V1Beta1UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -629,7 +610,7 @@ method. */ export interface V1Beta1QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist?: Stakingv1Beta1HistoricalInfo; + hist?: V1Beta1HistoricalInfo; } /** @@ -637,7 +618,7 @@ export interface V1Beta1QueryHistoricalInfoResponse { */ export interface V1Beta1QueryParamsResponse { /** params holds all the parameters of this module. */ - params?: Stakingv1Beta1Params; + params?: V1Beta1Params; } /** @@ -645,7 +626,7 @@ export interface V1Beta1QueryParamsResponse { */ export interface V1Beta1QueryPoolResponse { /** pool defines the pool info. */ - pool?: Stakingv1Beta1Pool; + pool?: V1Beta1Pool; } /** @@ -665,7 +646,7 @@ RPC method. */ export interface V1Beta1QueryUnbondingDelegationResponse { /** unbond defines the unbonding information of a delegation. */ - unbond?: Stakingv1Beta1UnbondingDelegation; + unbond?: V1Beta1UnbondingDelegation; } export interface V1Beta1QueryValidatorDelegationsResponse { @@ -685,7 +666,7 @@ export interface V1Beta1QueryValidatorResponse { Query/ValidatorUnbondingDelegations RPC method. */ export interface V1Beta1QueryValidatorUnbondingDelegationsResponse { - unbonding_responses?: Stakingv1Beta1UnbondingDelegation[]; + unbonding_responses?: V1Beta1UnbondingDelegation[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; @@ -769,6 +750,25 @@ export interface V1Beta1RedelegationResponse { entries?: V1Beta1RedelegationEntryResponse[]; } +/** +* UnbondingDelegation stores all of a single delegator's unbonding bonds +for a single validator in an time-ordered list. +*/ +export interface V1Beta1UnbondingDelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegator_address?: string; + + /** validator_address is the bech32-encoded address of the validator. */ + validator_address?: string; + + /** + * entries are the unbonding delegation entries. + * + * unbonding delegation entries + */ + entries?: V1Beta1UnbondingDelegationEntry[]; +} + /** * UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ diff --git a/ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts b/ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts index 82d64fdf..7f957ad4 100644 --- a/ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts +++ b/ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts @@ -3,7 +3,7 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Validators */ +/** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; diff --git a/ts-client/cosmos.staking.v1beta1/types/tendermint/types/types.ts b/ts-client/cosmos.staking.v1beta1/types/tendermint/types/types.ts index 93cdfab9..6a4293b8 100644 --- a/ts-client/cosmos.staking.v1beta1/types/tendermint/types/types.ts +++ b/ts-client/cosmos.staking.v1beta1/types/tendermint/types/types.ts @@ -120,7 +120,7 @@ export interface BlockID { partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a block header. */ +/** Header defines the structure of a Tendermint block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; diff --git a/ts-client/cosmos.tx.v1beta1/rest.ts b/ts-client/cosmos.tx.v1beta1/rest.ts index bbcfd01b..dd8ac356 100644 --- a/ts-client/cosmos.tx.v1beta1/rest.ts +++ b/ts-client/cosmos.tx.v1beta1/rest.ts @@ -222,7 +222,7 @@ export interface TenderminttypesValidator { } export interface TypesBlock { - /** Header defines the structure of a block header. */ + /** Header defines the structure of a Tendermint block header. */ header?: TypesHeader; data?: TenderminttypesData; evidence?: TypesEvidenceList; @@ -304,7 +304,7 @@ export interface TypesEvidenceList { } /** - * Header defines the structure of a block header. + * Header defines the structure of a Tendermint block header. */ export interface TypesHeader { /** @@ -414,7 +414,7 @@ export interface TypesPartSetHeader { } export interface TypesSignedHeader { - /** Header defines the structure of a block header. */ + /** Header defines the structure of a Tendermint block header. */ header?: TypesHeader; /** Commit contains the evidence that a block was committed by a set of validators. */ diff --git a/ts-client/cosmos.tx.v1beta1/types/tendermint/abci/types.ts b/ts-client/cosmos.tx.v1beta1/types/tendermint/abci/types.ts index 291903c4..2d33ce1c 100644 --- a/ts-client/cosmos.tx.v1beta1/types/tendermint/abci/types.ts +++ b/ts-client/cosmos.tx.v1beta1/types/tendermint/abci/types.ts @@ -270,7 +270,7 @@ export interface ResponseCheckTx { sender: string; priority: number; /** - * mempool_error is set by CometBFT. + * mempool_error is set by Tendermint. * ABCI applictions creating a ResponseCheckTX should not set mempool_error. */ mempoolError: string; diff --git a/ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts b/ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts index 82d64fdf..7f957ad4 100644 --- a/ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts +++ b/ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts @@ -3,7 +3,7 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.crypto"; -/** PublicKey defines the keys available for use with Validators */ +/** PublicKey defines the keys available for use with Tendermint Validators */ export interface PublicKey { ed25519: Uint8Array | undefined; secp256k1: Uint8Array | undefined; diff --git a/ts-client/cosmos.tx.v1beta1/types/tendermint/types/types.ts b/ts-client/cosmos.tx.v1beta1/types/tendermint/types/types.ts index 93cdfab9..6a4293b8 100644 --- a/ts-client/cosmos.tx.v1beta1/types/tendermint/types/types.ts +++ b/ts-client/cosmos.tx.v1beta1/types/tendermint/types/types.ts @@ -120,7 +120,7 @@ export interface BlockID { partSetHeader: PartSetHeader | undefined; } -/** Header defines the structure of a block header. */ +/** Header defines the structure of a Tendermint block header. */ export interface Header { /** basic block info */ version: Consensus | undefined; diff --git a/ts-client/cosmos.upgrade.v1beta1/module.ts b/ts-client/cosmos.upgrade.v1beta1/module.ts index 69b71474..22466f80 100755 --- a/ts-client/cosmos.upgrade.v1beta1/module.ts +++ b/ts-client/cosmos.upgrade.v1beta1/module.ts @@ -7,21 +7,15 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; import { MsgSoftwareUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; +import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; import { Plan as typePlan} from "./types" import { SoftwareUpgradeProposal as typeSoftwareUpgradeProposal} from "./types" import { CancelSoftwareUpgradeProposal as typeCancelSoftwareUpgradeProposal} from "./types" import { ModuleVersion as typeModuleVersion} from "./types" -export { MsgCancelUpgrade, MsgSoftwareUpgrade }; - -type sendMsgCancelUpgradeParams = { - value: MsgCancelUpgrade, - fee?: StdFee, - memo?: string -}; +export { MsgSoftwareUpgrade, MsgCancelUpgrade }; type sendMsgSoftwareUpgradeParams = { value: MsgSoftwareUpgrade, @@ -29,15 +23,21 @@ type sendMsgSoftwareUpgradeParams = { memo?: string }; - -type msgCancelUpgradeParams = { +type sendMsgCancelUpgradeParams = { value: MsgCancelUpgrade, + fee?: StdFee, + memo?: string }; + type msgSoftwareUpgradeParams = { value: MsgSoftwareUpgrade, }; +type msgCancelUpgradeParams = { + value: MsgCancelUpgrade, +}; + export const registry = new Registry(msgTypes); @@ -68,48 +68,48 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgCancelUpgrade({ value, fee, memo }: sendMsgCancelUpgradeParams): Promise { + async sendMsgSoftwareUpgrade({ value, fee, memo }: sendMsgSoftwareUpgradeParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCancelUpgrade: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgSoftwareUpgrade: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCancelUpgrade({ value: MsgCancelUpgrade.fromPartial(value) }) + let msg = this.msgSoftwareUpgrade({ value: MsgSoftwareUpgrade.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCancelUpgrade: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgSoftwareUpgrade: Could not broadcast Tx: '+ e.message) } }, - async sendMsgSoftwareUpgrade({ value, fee, memo }: sendMsgSoftwareUpgradeParams): Promise { + async sendMsgCancelUpgrade({ value, fee, memo }: sendMsgCancelUpgradeParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgSoftwareUpgrade: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCancelUpgrade: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgSoftwareUpgrade({ value: MsgSoftwareUpgrade.fromPartial(value) }) + let msg = this.msgCancelUpgrade({ value: MsgCancelUpgrade.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgSoftwareUpgrade: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCancelUpgrade: Could not broadcast Tx: '+ e.message) } }, - msgCancelUpgrade({ value }: msgCancelUpgradeParams): EncodeObject { + msgSoftwareUpgrade({ value }: msgSoftwareUpgradeParams): EncodeObject { try { - return { typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", value: MsgCancelUpgrade.fromPartial( value ) } + return { typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", value: MsgSoftwareUpgrade.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCancelUpgrade: Could not create message: ' + e.message) + throw new Error('TxClient:MsgSoftwareUpgrade: Could not create message: ' + e.message) } }, - msgSoftwareUpgrade({ value }: msgSoftwareUpgradeParams): EncodeObject { + msgCancelUpgrade({ value }: msgCancelUpgradeParams): EncodeObject { try { - return { typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", value: MsgSoftwareUpgrade.fromPartial( value ) } + return { typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", value: MsgCancelUpgrade.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgSoftwareUpgrade: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCancelUpgrade: Could not create message: ' + e.message) } }, diff --git a/ts-client/cosmos.upgrade.v1beta1/registry.ts b/ts-client/cosmos.upgrade.v1beta1/registry.ts index 98553bee..5e341994 100755 --- a/ts-client/cosmos.upgrade.v1beta1/registry.ts +++ b/ts-client/cosmos.upgrade.v1beta1/registry.ts @@ -1,10 +1,10 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; import { MsgSoftwareUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; +import { MsgCancelUpgrade } from "./types/cosmos/upgrade/v1beta1/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade], ["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], + ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade], ]; diff --git a/ts-client/cosmos.vesting.v1beta1/rest.ts b/ts-client/cosmos.vesting.v1beta1/rest.ts index ef66f59d..2556ea91 100644 --- a/ts-client/cosmos.vesting.v1beta1/rest.ts +++ b/ts-client/cosmos.vesting.v1beta1/rest.ts @@ -165,10 +165,7 @@ export type V1Beta1MsgCreateVestingAccountResponse = object; * Period defines a length of time and amount of coins that will vest. */ export interface V1Beta1Period { - /** - * Period duration in seconds. - * @format int64 - */ + /** @format int64 */ length?: string; amount?: V1Beta1Coin[]; } diff --git a/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts b/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts index c58f3604..ae655274 100644 --- a/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts +++ b/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts @@ -14,7 +14,6 @@ export interface MsgCreateVestingAccount { fromAddress: string; toAddress: string; amount: Coin[]; - /** end of vesting as unix time (in seconds). */ endTime: number; delayed: boolean; } @@ -52,7 +51,6 @@ export interface MsgCreatePermanentLockedAccountResponse { export interface MsgCreatePeriodicVestingAccount { fromAddress: string; toAddress: string; - /** start of vesting as unix time (in seconds). */ startTime: number; vestingPeriods: Period[]; } diff --git a/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts b/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts index 77b7bcc1..178dc45f 100644 --- a/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts +++ b/ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts @@ -15,7 +15,6 @@ export interface BaseVestingAccount { originalVesting: Coin[]; delegatedFree: Coin[]; delegatedVesting: Coin[]; - /** Vesting end time, as unix timestamp (in seconds). */ endTime: number; } @@ -24,10 +23,7 @@ export interface BaseVestingAccount { * continuously vests by unlocking coins linearly with respect to time. */ export interface ContinuousVestingAccount { - baseVestingAccount: - | BaseVestingAccount - | undefined; - /** Vesting start time, as unix timestamp (in seconds). */ + baseVestingAccount: BaseVestingAccount | undefined; startTime: number; } @@ -42,7 +38,6 @@ export interface DelayedVestingAccount { /** Period defines a length of time and amount of coins that will vest. */ export interface Period { - /** Period duration in seconds. */ length: number; amount: Coin[]; } diff --git a/ts-client/ibc.applications.interchain_accounts.controller.v1/rest.ts b/ts-client/ibc.applications.interchain_accounts.controller.v1/rest.ts index f2f505d8..528cfaa9 100644 --- a/ts-client/ibc.applications.interchain_accounts.controller.v1/rest.ts +++ b/ts-client/ibc.applications.interchain_accounts.controller.v1/rest.ts @@ -9,15 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Params defines the set of on-chain interchain accounts parameters. -The following parameters may be used to disable the controller submodule. -*/ -export interface Controllerv1Params { - /** controller_enabled enables or disables the controller submodule. */ - controller_enabled?: boolean; -} - export interface ProtobufAny { "@type"?: string; } @@ -29,12 +20,21 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Params defines the set of on-chain interchain accounts parameters. +The following parameters may be used to disable the controller submodule. +*/ +export interface V1Params { + /** controller_enabled enables or disables the controller submodule. */ + controller_enabled?: boolean; +} + /** * QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface V1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Controllerv1Params; + params?: V1Params; } import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; diff --git a/ts-client/ibc.applications.interchain_accounts.host.v1/rest.ts b/ts-client/ibc.applications.interchain_accounts.host.v1/rest.ts index 6eb6d058..c5f0afd9 100644 --- a/ts-client/ibc.applications.interchain_accounts.host.v1/rest.ts +++ b/ts-client/ibc.applications.interchain_accounts.host.v1/rest.ts @@ -9,18 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Params defines the set of on-chain interchain accounts parameters. -The following parameters may be used to disable the host submodule. -*/ -export interface Hostv1Params { - /** host_enabled enables or disables the host submodule. */ - host_enabled?: boolean; - - /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ - allow_messages?: string[]; -} - export interface ProtobufAny { "@type"?: string; } @@ -32,12 +20,24 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Params defines the set of on-chain interchain accounts parameters. +The following parameters may be used to disable the host submodule. +*/ +export interface V1Params { + /** host_enabled enables or disables the host submodule. */ + host_enabled?: boolean; + + /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ + allow_messages?: string[]; +} + /** * QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface V1QueryParamsResponse { /** params defines the parameters of the module. */ - params?: Hostv1Params; + params?: V1Params; } import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios"; diff --git a/ts-client/ibc.applications.transfer.v1/rest.ts b/ts-client/ibc.applications.transfer.v1/rest.ts index 5e8751d4..a58f2653 100644 --- a/ts-client/ibc.applications.transfer.v1/rest.ts +++ b/ts-client/ibc.applications.transfer.v1/rest.ts @@ -154,7 +154,7 @@ export interface RpcStatus { * DenomTrace contains the base denomination for ICS20 fungible tokens and the source tracing information path. */ -export interface Transferv1DenomTrace { +export interface V1DenomTrace { /** * path defines the chain of port/channel identifiers used for tracing the * source of the fungible token. @@ -207,7 +207,7 @@ method. */ export interface V1QueryDenomTraceResponse { /** denom_trace returns the requested denomination trace information. */ - denom_trace?: Transferv1DenomTrace; + denom_trace?: V1DenomTrace; } /** @@ -216,7 +216,7 @@ method. */ export interface V1QueryDenomTracesResponse { /** denom_traces returns all denominations trace information. */ - denom_traces?: Transferv1DenomTrace[]; + denom_traces?: V1DenomTrace[]; /** pagination defines the pagination in the response. */ pagination?: V1Beta1PageResponse; diff --git a/ts-client/ibc.core.channel.v1/rest.ts b/ts-client/ibc.core.channel.v1/rest.ts index 85b88798..cf8631fd 100644 --- a/ts-client/ibc.core.channel.v1/rest.ts +++ b/ts-client/ibc.core.channel.v1/rest.ts @@ -9,49 +9,6 @@ * --------------------------------------------------------------- */ -/** -* Channel defines pipeline for exactly-once packet delivery between specific -modules on separate blockchains, which has at least one end capable of -sending packets and one end capable of receiving packets. -*/ -export interface Channelv1Channel { - /** - * current state of the channel end - * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - * - * - STATE_UNINITIALIZED_UNSPECIFIED: Default State - * - STATE_INIT: A channel has just started the opening handshake. - * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - * - STATE_OPEN: A channel has completed the handshake. Open channels are - * ready to send and receive packets. - * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - * packets. - */ - state?: V1State; - - /** - * whether the channel is ordered or unordered - * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - * which they were sent. - * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - */ - ordering?: V1Order; - - /** counterparty channel end */ - counterparty?: V1Counterparty; - - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ - connection_hops?: string[]; - - /** opaque channel version, which is agreed upon during the handshake */ - version?: string; -} - /** * `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -173,6 +130,49 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* Channel defines pipeline for exactly-once packet delivery between specific +modules on separate blockchains, which has at least one end capable of +sending packets and one end capable of receiving packets. +*/ +export interface V1Channel { + /** + * current state of the channel end + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * + * - STATE_UNINITIALIZED_UNSPECIFIED: Default State + * - STATE_INIT: A channel has just started the opening handshake. + * - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. + * - STATE_OPEN: A channel has completed the handshake. Open channels are + * ready to send and receive packets. + * - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive + * packets. + */ + state?: V1State; + + /** + * whether the channel is ordered or unordered + * - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering + * - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in + * which they were sent. + * - ORDER_ORDERED: packets are delivered exactly in the order which they were sent + */ + ordering?: V1Order; + + /** counterparty channel end */ + counterparty?: V1Counterparty; + + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; +} + export interface V1Counterparty { /** port on the counterparty chain which owns the other end of the channel. */ port_id?: string; @@ -610,7 +610,7 @@ export interface V1QueryChannelResponse { * modules on separate blockchains, which has at least one end capable of * sending packets and one end capable of receiving packets. */ - channel?: Channelv1Channel; + channel?: V1Channel; /** * merkle proof of existence