Skip to content

Commit

Permalink
Re-gen TS Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsmith-2019 committed Sep 24, 2024
1 parent 341dc34 commit 20a1987
Show file tree
Hide file tree
Showing 22 changed files with 710 additions and 710 deletions.
48 changes: 24 additions & 24 deletions wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { msgTypes } from './registry';
import { IgniteClient } from "../client"
import { MissingWalletError } from "../helpers"
import { Api } from "./rest";
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
import { MsgSend } from "./types/cosmos/bank/v1beta1/tx";
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";

import { SendAuthorization as typeSendAuthorization} from "./types"
import { Params as typeParams} from "./types"
Expand All @@ -22,29 +22,29 @@ import { Metadata as typeMetadata} from "./types"
import { Balance as typeBalance} from "./types"
import { DenomOwner as typeDenomOwner} from "./types"

export { MsgMultiSend, MsgSend };

type sendMsgMultiSendParams = {
value: MsgMultiSend,
fee?: StdFee,
memo?: string
};
export { MsgSend, MsgMultiSend };

type sendMsgSendParams = {
value: MsgSend,
fee?: StdFee,
memo?: string
};


type msgMultiSendParams = {
type sendMsgMultiSendParams = {
value: MsgMultiSend,
fee?: StdFee,
memo?: string
};


type msgSendParams = {
value: MsgSend,
};

type msgMultiSendParams = {
value: MsgMultiSend,
};


export const registry = new Registry(msgTypes);

Expand Down Expand Up @@ -75,48 +75,48 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht

return {

async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise<DeliverTxResponse> {
async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise<DeliverTxResponse> {
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)
}
},

async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise<DeliverTxResponse> {
async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise<DeliverTxResponse> {
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)
}
},


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)
}
},

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)
}
},

Expand Down
4 changes: 2 additions & 2 deletions wormchain/ts-sdk/src/modules/cosmos.bank.v1beta1/registry.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//@ts-nocheck
import { GeneratedType } from "@cosmjs/proto-signing";
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
import { MsgSend } from "./types/cosmos/bank/v1beta1/tx";
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";

const msgTypes: Array<[string, GeneratedType]> = [
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],
["/cosmos.bank.v1beta1.MsgSend", MsgSend],
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],

];

Expand Down
120 changes: 60 additions & 60 deletions wormchain/ts-sdk/src/modules/cosmos.distribution.v1beta1/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { msgTypes } from './registry';
import { IgniteClient } from "../client"
import { MissingWalletError } from "../helpers"
import { Api } from "./rest";
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgUpdateParams } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgCommunityPoolSpend } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";

import { Params as typeParams} from "./types"
import { ValidatorHistoricalRewards as typeValidatorHistoricalRewards} from "./types"
Expand All @@ -35,7 +35,19 @@ import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord} fro
import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord} from "./types"
import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord} from "./types"

export { MsgUpdateParams, MsgWithdrawDelegatorReward, MsgCommunityPoolSpend, MsgSetWithdrawAddress, MsgFundCommunityPool, MsgWithdrawValidatorCommission };
export { MsgWithdrawValidatorCommission, MsgSetWithdrawAddress, MsgUpdateParams, MsgWithdrawDelegatorReward, MsgCommunityPoolSpend, MsgFundCommunityPool };

type sendMsgWithdrawValidatorCommissionParams = {
value: MsgWithdrawValidatorCommission,
fee?: StdFee,
memo?: string
};

type sendMsgSetWithdrawAddressParams = {
value: MsgSetWithdrawAddress,
fee?: StdFee,
memo?: string
};

type sendMsgUpdateParamsParams = {
value: MsgUpdateParams,
Expand All @@ -55,24 +67,20 @@ type sendMsgCommunityPoolSpendParams = {
memo?: string
};

type sendMsgSetWithdrawAddressParams = {
value: MsgSetWithdrawAddress,
fee?: StdFee,
memo?: string
};

type sendMsgFundCommunityPoolParams = {
value: MsgFundCommunityPool,
fee?: StdFee,
memo?: string
};

type sendMsgWithdrawValidatorCommissionParams = {

type msgWithdrawValidatorCommissionParams = {
value: MsgWithdrawValidatorCommission,
fee?: StdFee,
memo?: string
};

type msgSetWithdrawAddressParams = {
value: MsgSetWithdrawAddress,
};

type msgUpdateParamsParams = {
value: MsgUpdateParams,
Expand All @@ -86,18 +94,10 @@ type msgCommunityPoolSpendParams = {
value: MsgCommunityPoolSpend,
};

type msgSetWithdrawAddressParams = {
value: MsgSetWithdrawAddress,
};

type msgFundCommunityPoolParams = {
value: MsgFundCommunityPool,
};

type msgWithdrawValidatorCommissionParams = {
value: MsgWithdrawValidatorCommission,
};


export const registry = new Registry(msgTypes);

Expand Down Expand Up @@ -128,91 +128,107 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht

return {

async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise<DeliverTxResponse> {
async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.')
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: 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.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) })
let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) })
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
} catch (e: any) {
throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message)
}
},

async sendMsgWithdrawDelegatorReward({ value, fee, memo }: sendMsgWithdrawDelegatorRewardParams): Promise<DeliverTxResponse> {
async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgWithdrawDelegatorReward: 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.msgWithdrawDelegatorReward({ value: MsgWithdrawDelegatorReward.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:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message)
}
},

async sendMsgCommunityPoolSpend({ value, fee, memo }: sendMsgCommunityPoolSpendParams): Promise<DeliverTxResponse> {
async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgCommunityPoolSpend: Unable to sign Tx. Signer is not present.')
throw new Error('TxClient:sendMsgUpdateParams: 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.msgCommunityPoolSpend({ value: MsgCommunityPoolSpend.fromPartial(value) })
let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) })
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
} catch (e: any) {
throw new Error('TxClient:sendMsgCommunityPoolSpend: Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message)
}
},

async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise<DeliverTxResponse> {
async sendMsgWithdrawDelegatorReward({ value, fee, memo }: sendMsgWithdrawDelegatorRewardParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.')
throw new Error('TxClient:sendMsgWithdrawDelegatorReward: 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.msgWithdrawDelegatorReward({ value: MsgWithdrawDelegatorReward.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:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: '+ e.message)
}
},

async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise<DeliverTxResponse> {
async sendMsgCommunityPoolSpend({ value, fee, memo }: sendMsgCommunityPoolSpendParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.')
throw new Error('TxClient:sendMsgCommunityPoolSpend: 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.msgCommunityPoolSpend({ value: MsgCommunityPoolSpend.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:sendMsgCommunityPoolSpend: Could not broadcast Tx: '+ e.message)
}
},

async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise<DeliverTxResponse> {
if (!signer) {
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: 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.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.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:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: '+ e.message)
}
},


msgWithdrawValidatorCommission({ value }: msgWithdrawValidatorCommissionParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( value ) }
} catch (e: any) {
throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message)
}
},

msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) }
} catch (e: any) {
throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message)
}
},

msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) }
Expand All @@ -237,14 +253,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
}
},

msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) }
} catch (e: any) {
throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message)
}
},

msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( value ) }
Expand All @@ -253,14 +261,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
}
},

msgWithdrawValidatorCommission({ value }: msgWithdrawValidatorCommissionParams): EncodeObject {
try {
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( value ) }
} catch (e: any) {
throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message)
}
},

}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//@ts-nocheck
import { GeneratedType } from "@cosmjs/proto-signing";
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgUpdateParams } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgCommunityPoolSpend } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";

const msgTypes: Array<[string, GeneratedType]> = [
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],
["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams],
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward],
["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend],
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool],
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],

];

Expand Down
Loading

0 comments on commit 20a1987

Please sign in to comment.