decentralcardgame-cardchain-client-ts 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +420 -452
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +1495 -1570
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +78 -70
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +78 -70
  5. package/DecentralCardGame.cardchain.cardchain/rest.js +71 -0
  6. package/DecentralCardGame.cardchain.cardchain/rest.ts +132 -0
  7. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +6 -0
  8. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +6 -0
  9. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.js +81 -0
  10. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.ts +106 -0
  11. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.js +295 -0
  12. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.ts +354 -0
  13. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.js +16 -0
  14. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.ts +19 -1
  15. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +447 -0
  16. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +570 -0
  17. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +504 -0
  18. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +613 -0
  19. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +50 -0
  20. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +48 -0
  21. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.js +58 -0
  22. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.ts +82 -0
  23. package/DecentralCardGame.cardchain.cardchain/types.js +5 -1
  24. package/DecentralCardGame.cardchain.cardchain/types.ts +8 -0
  25. package/DecentralCardGame.cardchain.featureflag/module.js +9 -7
  26. package/DecentralCardGame.cardchain.featureflag/module.ts +69 -65
  27. package/client.js +2 -5
  28. package/client.ts +164 -162
  29. package/cosmos.authz.v1beta1/module.js +33 -22
  30. package/cosmos.authz.v1beta1/module.ts +220 -148
  31. package/cosmos.distribution.v1beta1/module.js +65 -35
  32. package/cosmos.distribution.v1beta1/module.ts +354 -200
  33. package/cosmos.evidence.v1beta1/module.js +21 -13
  34. package/cosmos.evidence.v1beta1/module.ts +115 -86
  35. package/cosmos.gov.v1/module.js +48 -29
  36. package/cosmos.gov.v1/module.ts +275 -178
  37. package/cosmos.mint.v1beta1/module.js +9 -7
  38. package/cosmos.mint.v1beta1/module.ts +67 -63
  39. package/cosmos.nft.v1beta1/module.js +9 -7
  40. package/cosmos.nft.v1beta1/module.ts +75 -71
  41. package/cosmos.tx.v1beta1/module.js +9 -7
  42. package/cosmos.tx.v1beta1/module.ts +89 -85
  43. package/cosmos.vesting.v1beta1/module.js +52 -29
  44. package/cosmos.vesting.v1beta1/module.ts +249 -149
  45. package/ibc.applications.interchain_accounts.controller.v1/module.js +9 -7
  46. package/ibc.applications.interchain_accounts.controller.v1/module.ts +65 -61
  47. package/ibc.applications.transfer.v1/module.js +17 -12
  48. package/ibc.applications.transfer.v1/module.ts +114 -88
  49. package/ibc.core.channel.v1/module.js +1 -4
  50. package/ibc.core.channel.v1/module.ts +79 -81
  51. package/ibc.core.client.v1/module.js +1 -4
  52. package/ibc.core.client.v1/module.ts +81 -83
  53. package/ibc.core.connection.v1/module.js +6 -7
  54. package/ibc.core.connection.v1/module.ts +88 -84
  55. package/package.json +1 -1
  56. package/tsconfig.json +1 -1
@@ -2,93 +2,101 @@
2
2
 
3
3
  import { StdFee } from "@cosmjs/amino";
4
4
  import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
5
- import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing";
6
- import { msgTypes } from './registry';
7
- import { IgniteClient } from "../client"
8
- import { MissingWalletError } from "../helpers"
5
+ import {
6
+ EncodeObject,
7
+ GeneratedType,
8
+ OfflineSigner,
9
+ Registry,
10
+ } from "@cosmjs/proto-signing";
11
+ import { msgTypes } from "./registry";
12
+ import { IgniteClient } from "../client";
13
+ import { MissingWalletError } from "../helpers";
9
14
  import { Api } from "./rest";
10
15
  import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
11
16
  import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
12
17
  import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
13
18
  import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
14
19
 
15
- import { Params as typeParams} from "./types"
16
- import { ValidatorHistoricalRewards as typeValidatorHistoricalRewards} from "./types"
17
- import { ValidatorCurrentRewards as typeValidatorCurrentRewards} from "./types"
18
- import { ValidatorAccumulatedCommission as typeValidatorAccumulatedCommission} from "./types"
19
- import { ValidatorOutstandingRewards as typeValidatorOutstandingRewards} from "./types"
20
- import { ValidatorSlashEvent as typeValidatorSlashEvent} from "./types"
21
- import { ValidatorSlashEvents as typeValidatorSlashEvents} from "./types"
22
- import { FeePool as typeFeePool} from "./types"
23
- import { CommunityPoolSpendProposal as typeCommunityPoolSpendProposal} from "./types"
24
- import { DelegatorStartingInfo as typeDelegatorStartingInfo} from "./types"
25
- import { DelegationDelegatorReward as typeDelegationDelegatorReward} from "./types"
26
- import { CommunityPoolSpendProposalWithDeposit as typeCommunityPoolSpendProposalWithDeposit} from "./types"
27
- import { DelegatorWithdrawInfo as typeDelegatorWithdrawInfo} from "./types"
28
- import { ValidatorOutstandingRewardsRecord as typeValidatorOutstandingRewardsRecord} from "./types"
29
- import { ValidatorAccumulatedCommissionRecord as typeValidatorAccumulatedCommissionRecord} from "./types"
30
- import { ValidatorHistoricalRewardsRecord as typeValidatorHistoricalRewardsRecord} from "./types"
31
- import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord} from "./types"
32
- import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord} from "./types"
33
- import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord} from "./types"
20
+ import { Params as typeParams } from "./types";
21
+ import { ValidatorHistoricalRewards as typeValidatorHistoricalRewards } from "./types";
22
+ import { ValidatorCurrentRewards as typeValidatorCurrentRewards } from "./types";
23
+ import { ValidatorAccumulatedCommission as typeValidatorAccumulatedCommission } from "./types";
24
+ import { ValidatorOutstandingRewards as typeValidatorOutstandingRewards } from "./types";
25
+ import { ValidatorSlashEvent as typeValidatorSlashEvent } from "./types";
26
+ import { ValidatorSlashEvents as typeValidatorSlashEvents } from "./types";
27
+ import { FeePool as typeFeePool } from "./types";
28
+ import { CommunityPoolSpendProposal as typeCommunityPoolSpendProposal } from "./types";
29
+ import { DelegatorStartingInfo as typeDelegatorStartingInfo } from "./types";
30
+ import { DelegationDelegatorReward as typeDelegationDelegatorReward } from "./types";
31
+ import { CommunityPoolSpendProposalWithDeposit as typeCommunityPoolSpendProposalWithDeposit } from "./types";
32
+ import { DelegatorWithdrawInfo as typeDelegatorWithdrawInfo } from "./types";
33
+ import { ValidatorOutstandingRewardsRecord as typeValidatorOutstandingRewardsRecord } from "./types";
34
+ import { ValidatorAccumulatedCommissionRecord as typeValidatorAccumulatedCommissionRecord } from "./types";
35
+ import { ValidatorHistoricalRewardsRecord as typeValidatorHistoricalRewardsRecord } from "./types";
36
+ import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord } from "./types";
37
+ import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord } from "./types";
38
+ import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord } from "./types";
34
39
 
35
- export { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgSetWithdrawAddress };
40
+ export {
41
+ MsgWithdrawDelegatorReward,
42
+ MsgWithdrawValidatorCommission,
43
+ MsgFundCommunityPool,
44
+ MsgSetWithdrawAddress,
45
+ };
36
46
 
37
47
  type sendMsgWithdrawDelegatorRewardParams = {
38
- value: MsgWithdrawDelegatorReward,
39
- fee?: StdFee,
40
- memo?: string
48
+ value: MsgWithdrawDelegatorReward;
49
+ fee?: StdFee;
50
+ memo?: string;
41
51
  };
42
52
 
43
53
  type sendMsgWithdrawValidatorCommissionParams = {
44
- value: MsgWithdrawValidatorCommission,
45
- fee?: StdFee,
46
- memo?: string
54
+ value: MsgWithdrawValidatorCommission;
55
+ fee?: StdFee;
56
+ memo?: string;
47
57
  };
48
58
 
49
59
  type sendMsgFundCommunityPoolParams = {
50
- value: MsgFundCommunityPool,
51
- fee?: StdFee,
52
- memo?: string
60
+ value: MsgFundCommunityPool;
61
+ fee?: StdFee;
62
+ memo?: string;
53
63
  };
54
64
 
55
65
  type sendMsgSetWithdrawAddressParams = {
56
- value: MsgSetWithdrawAddress,
57
- fee?: StdFee,
58
- memo?: string
66
+ value: MsgSetWithdrawAddress;
67
+ fee?: StdFee;
68
+ memo?: string;
59
69
  };
60
70
 
61
-
62
71
  type msgWithdrawDelegatorRewardParams = {
63
- value: MsgWithdrawDelegatorReward,
72
+ value: MsgWithdrawDelegatorReward;
64
73
  };
65
74
 
66
75
  type msgWithdrawValidatorCommissionParams = {
67
- value: MsgWithdrawValidatorCommission,
76
+ value: MsgWithdrawValidatorCommission;
68
77
  };
69
78
 
70
79
  type msgFundCommunityPoolParams = {
71
- value: MsgFundCommunityPool,
80
+ value: MsgFundCommunityPool;
72
81
  };
73
82
 
74
83
  type msgSetWithdrawAddressParams = {
75
- value: MsgSetWithdrawAddress,
84
+ value: MsgSetWithdrawAddress;
76
85
  };
77
86
 
78
-
79
87
  export const registry = new Registry(msgTypes);
80
88
 
81
89
  type Field = {
82
- name: string;
83
- type: unknown;
84
- }
90
+ name: string;
91
+ type: unknown;
92
+ };
85
93
  function getStructure(template) {
86
- const structure: {fields: Field[]} = { fields: [] }
87
- for (let [key, value] of Object.entries(template)) {
88
- let field = { name: key, type: typeof value }
89
- structure.fields.push(field)
90
- }
91
- return structure
94
+ const structure: { fields: Field[] } = { fields: [] };
95
+ for (let [key, value] of Object.entries(template)) {
96
+ let field = { name: key, type: typeof value };
97
+ structure.fields.push(field);
98
+ }
99
+ return structure;
92
100
  }
93
101
  const defaultFee = {
94
102
  amount: [],
@@ -96,171 +104,317 @@ const defaultFee = {
96
104
  };
97
105
 
98
106
  interface TxClientOptions {
99
- addr: string
100
- prefix: string
101
- signer?: OfflineSigner
107
+ addr: string;
108
+ prefix: string;
109
+ signer?: OfflineSigner;
102
110
  }
103
111
 
104
- export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
105
-
112
+ export const txClient = (
113
+ { signer, prefix, addr }: TxClientOptions = {
114
+ addr: "http://localhost:26657",
115
+ prefix: "cosmos",
116
+ },
117
+ ) => {
106
118
  return {
107
-
108
- async sendMsgWithdrawDelegatorReward({ value, fee, memo }: sendMsgWithdrawDelegatorRewardParams): Promise<DeliverTxResponse> {
109
- if (!signer) {
110
- throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.')
111
- }
112
- try {
113
- const { address } = (await signer.getAccounts())[0];
114
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
115
- let msg = this.msgWithdrawDelegatorReward({ value: MsgWithdrawDelegatorReward.fromPartial(value) })
116
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
117
- } catch (e: any) {
118
- throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: '+ e.message)
119
- }
120
- },
121
-
122
- async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
123
- if (!signer) {
124
- throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.')
125
- }
126
- try {
127
- const { address } = (await signer.getAccounts())[0];
128
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
129
- let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) })
130
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
131
- } catch (e: any) {
132
- throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message)
133
- }
134
- },
135
-
136
- async sendMsgFundCommunityPool({ value, fee, memo }: sendMsgFundCommunityPoolParams): Promise<DeliverTxResponse> {
137
- if (!signer) {
138
- throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.')
139
- }
140
- try {
141
- const { address } = (await signer.getAccounts())[0];
142
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
143
- let msg = this.msgFundCommunityPool({ value: MsgFundCommunityPool.fromPartial(value) })
144
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
145
- } catch (e: any) {
146
- throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: '+ e.message)
147
- }
148
- },
149
-
150
- async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise<DeliverTxResponse> {
151
- if (!signer) {
152
- throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.')
153
- }
154
- try {
155
- const { address } = (await signer.getAccounts())[0];
156
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
157
- let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) })
158
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
159
- } catch (e: any) {
160
- throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message)
161
- }
162
- },
163
-
164
-
165
- msgWithdrawDelegatorReward({ value }: msgWithdrawDelegatorRewardParams): EncodeObject {
166
- try {
167
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial( value ) }
168
- } catch (e: any) {
169
- throw new Error('TxClient:MsgWithdrawDelegatorReward: Could not create message: ' + e.message)
170
- }
171
- },
172
-
173
- msgWithdrawValidatorCommission({ value }: msgWithdrawValidatorCommissionParams): EncodeObject {
174
- try {
175
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( value ) }
176
- } catch (e: any) {
177
- throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message)
178
- }
179
- },
180
-
181
- msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject {
182
- try {
183
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial( value ) }
184
- } catch (e: any) {
185
- throw new Error('TxClient:MsgFundCommunityPool: Could not create message: ' + e.message)
186
- }
187
- },
188
-
189
- msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject {
190
- try {
191
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) }
192
- } catch (e: any) {
193
- throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message)
194
- }
195
- },
196
-
197
- }
119
+ async sendMsgWithdrawDelegatorReward({
120
+ value,
121
+ fee,
122
+ memo,
123
+ }: sendMsgWithdrawDelegatorRewardParams): Promise<DeliverTxResponse> {
124
+ if (!signer) {
125
+ throw new Error(
126
+ "TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.",
127
+ );
128
+ }
129
+ try {
130
+ const { address } = (await signer.getAccounts())[0];
131
+ const signingClient = await SigningStargateClient.connectWithSigner(
132
+ addr,
133
+ signer,
134
+ { registry, prefix },
135
+ );
136
+ let msg = this.msgWithdrawDelegatorReward({
137
+ value: MsgWithdrawDelegatorReward.fromPartial(value),
138
+ });
139
+ return await signingClient.signAndBroadcast(
140
+ address,
141
+ [msg],
142
+ fee ? fee : defaultFee,
143
+ memo,
144
+ );
145
+ } catch (e: any) {
146
+ throw new Error(
147
+ "TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: " +
148
+ e.message,
149
+ );
150
+ }
151
+ },
152
+
153
+ async sendMsgWithdrawValidatorCommission({
154
+ value,
155
+ fee,
156
+ memo,
157
+ }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
158
+ if (!signer) {
159
+ throw new Error(
160
+ "TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.",
161
+ );
162
+ }
163
+ try {
164
+ const { address } = (await signer.getAccounts())[0];
165
+ const signingClient = await SigningStargateClient.connectWithSigner(
166
+ addr,
167
+ signer,
168
+ { registry, prefix },
169
+ );
170
+ let msg = this.msgWithdrawValidatorCommission({
171
+ value: MsgWithdrawValidatorCommission.fromPartial(value),
172
+ });
173
+ return await signingClient.signAndBroadcast(
174
+ address,
175
+ [msg],
176
+ fee ? fee : defaultFee,
177
+ memo,
178
+ );
179
+ } catch (e: any) {
180
+ throw new Error(
181
+ "TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: " +
182
+ e.message,
183
+ );
184
+ }
185
+ },
186
+
187
+ async sendMsgFundCommunityPool({
188
+ value,
189
+ fee,
190
+ memo,
191
+ }: sendMsgFundCommunityPoolParams): Promise<DeliverTxResponse> {
192
+ if (!signer) {
193
+ throw new Error(
194
+ "TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.",
195
+ );
196
+ }
197
+ try {
198
+ const { address } = (await signer.getAccounts())[0];
199
+ const signingClient = await SigningStargateClient.connectWithSigner(
200
+ addr,
201
+ signer,
202
+ { registry, prefix },
203
+ );
204
+ let msg = this.msgFundCommunityPool({
205
+ value: MsgFundCommunityPool.fromPartial(value),
206
+ });
207
+ return await signingClient.signAndBroadcast(
208
+ address,
209
+ [msg],
210
+ fee ? fee : defaultFee,
211
+ memo,
212
+ );
213
+ } catch (e: any) {
214
+ throw new Error(
215
+ "TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: " +
216
+ e.message,
217
+ );
218
+ }
219
+ },
220
+
221
+ async sendMsgSetWithdrawAddress({
222
+ value,
223
+ fee,
224
+ memo,
225
+ }: sendMsgSetWithdrawAddressParams): Promise<DeliverTxResponse> {
226
+ if (!signer) {
227
+ throw new Error(
228
+ "TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.",
229
+ );
230
+ }
231
+ try {
232
+ const { address } = (await signer.getAccounts())[0];
233
+ const signingClient = await SigningStargateClient.connectWithSigner(
234
+ addr,
235
+ signer,
236
+ { registry, prefix },
237
+ );
238
+ let msg = this.msgSetWithdrawAddress({
239
+ value: MsgSetWithdrawAddress.fromPartial(value),
240
+ });
241
+ return await signingClient.signAndBroadcast(
242
+ address,
243
+ [msg],
244
+ fee ? fee : defaultFee,
245
+ memo,
246
+ );
247
+ } catch (e: any) {
248
+ throw new Error(
249
+ "TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: " +
250
+ e.message,
251
+ );
252
+ }
253
+ },
254
+
255
+ msgWithdrawDelegatorReward({
256
+ value,
257
+ }: msgWithdrawDelegatorRewardParams): EncodeObject {
258
+ try {
259
+ return {
260
+ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
261
+ value: MsgWithdrawDelegatorReward.fromPartial(value),
262
+ };
263
+ } catch (e: any) {
264
+ throw new Error(
265
+ "TxClient:MsgWithdrawDelegatorReward: Could not create message: " +
266
+ e.message,
267
+ );
268
+ }
269
+ },
270
+
271
+ msgWithdrawValidatorCommission({
272
+ value,
273
+ }: msgWithdrawValidatorCommissionParams): EncodeObject {
274
+ try {
275
+ return {
276
+ typeUrl:
277
+ "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",
278
+ value: MsgWithdrawValidatorCommission.fromPartial(value),
279
+ };
280
+ } catch (e: any) {
281
+ throw new Error(
282
+ "TxClient:MsgWithdrawValidatorCommission: Could not create message: " +
283
+ e.message,
284
+ );
285
+ }
286
+ },
287
+
288
+ msgFundCommunityPool({ value }: msgFundCommunityPoolParams): EncodeObject {
289
+ try {
290
+ return {
291
+ typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool",
292
+ value: MsgFundCommunityPool.fromPartial(value),
293
+ };
294
+ } catch (e: any) {
295
+ throw new Error(
296
+ "TxClient:MsgFundCommunityPool: Could not create message: " +
297
+ e.message,
298
+ );
299
+ }
300
+ },
301
+
302
+ msgSetWithdrawAddress({
303
+ value,
304
+ }: msgSetWithdrawAddressParams): EncodeObject {
305
+ try {
306
+ return {
307
+ typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
308
+ value: MsgSetWithdrawAddress.fromPartial(value),
309
+ };
310
+ } catch (e: any) {
311
+ throw new Error(
312
+ "TxClient:MsgSetWithdrawAddress: Could not create message: " +
313
+ e.message,
314
+ );
315
+ }
316
+ },
317
+ };
198
318
  };
199
319
 
200
320
  interface QueryClientOptions {
201
- addr: string
321
+ addr: string;
202
322
  }
203
323
 
204
- export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
324
+ export const queryClient = (
325
+ { addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" },
326
+ ) => {
205
327
  return new Api({ baseURL: addr });
206
328
  };
207
329
 
208
330
  class SDKModule {
209
- public query: ReturnType<typeof queryClient>;
210
- public tx: ReturnType<typeof txClient>;
211
- public structure: Record<string,unknown>;
212
- public registry: Array<[string, GeneratedType]> = [];
331
+ public query: ReturnType<typeof queryClient>;
332
+ public tx: ReturnType<typeof txClient>;
333
+ public structure: Record<string, unknown>;
334
+ public registry: Array<[string, GeneratedType]> = [];
213
335
 
214
- constructor(client: IgniteClient) {
215
-
216
- this.query = queryClient({ addr: client.env.apiURL });
217
- this.updateTX(client);
218
- this.structure = {
219
- Params: getStructure(typeParams.fromPartial({})),
220
- ValidatorHistoricalRewards: getStructure(typeValidatorHistoricalRewards.fromPartial({})),
221
- ValidatorCurrentRewards: getStructure(typeValidatorCurrentRewards.fromPartial({})),
222
- ValidatorAccumulatedCommission: getStructure(typeValidatorAccumulatedCommission.fromPartial({})),
223
- ValidatorOutstandingRewards: getStructure(typeValidatorOutstandingRewards.fromPartial({})),
224
- ValidatorSlashEvent: getStructure(typeValidatorSlashEvent.fromPartial({})),
225
- ValidatorSlashEvents: getStructure(typeValidatorSlashEvents.fromPartial({})),
226
- FeePool: getStructure(typeFeePool.fromPartial({})),
227
- CommunityPoolSpendProposal: getStructure(typeCommunityPoolSpendProposal.fromPartial({})),
228
- DelegatorStartingInfo: getStructure(typeDelegatorStartingInfo.fromPartial({})),
229
- DelegationDelegatorReward: getStructure(typeDelegationDelegatorReward.fromPartial({})),
230
- CommunityPoolSpendProposalWithDeposit: getStructure(typeCommunityPoolSpendProposalWithDeposit.fromPartial({})),
231
- DelegatorWithdrawInfo: getStructure(typeDelegatorWithdrawInfo.fromPartial({})),
232
- ValidatorOutstandingRewardsRecord: getStructure(typeValidatorOutstandingRewardsRecord.fromPartial({})),
233
- ValidatorAccumulatedCommissionRecord: getStructure(typeValidatorAccumulatedCommissionRecord.fromPartial({})),
234
- ValidatorHistoricalRewardsRecord: getStructure(typeValidatorHistoricalRewardsRecord.fromPartial({})),
235
- ValidatorCurrentRewardsRecord: getStructure(typeValidatorCurrentRewardsRecord.fromPartial({})),
236
- DelegatorStartingInfoRecord: getStructure(typeDelegatorStartingInfoRecord.fromPartial({})),
237
- ValidatorSlashEventRecord: getStructure(typeValidatorSlashEventRecord.fromPartial({})),
238
-
239
- };
240
- client.on('signer-changed',(signer) => {
241
- this.updateTX(client);
242
- })
243
- }
244
- updateTX(client: IgniteClient) {
336
+ constructor(client: IgniteClient) {
337
+ this.query = queryClient({ addr: client.env.apiURL });
338
+ this.updateTX(client);
339
+ this.structure = {
340
+ Params: getStructure(typeParams.fromPartial({})),
341
+ ValidatorHistoricalRewards: getStructure(
342
+ typeValidatorHistoricalRewards.fromPartial({}),
343
+ ),
344
+ ValidatorCurrentRewards: getStructure(
345
+ typeValidatorCurrentRewards.fromPartial({}),
346
+ ),
347
+ ValidatorAccumulatedCommission: getStructure(
348
+ typeValidatorAccumulatedCommission.fromPartial({}),
349
+ ),
350
+ ValidatorOutstandingRewards: getStructure(
351
+ typeValidatorOutstandingRewards.fromPartial({}),
352
+ ),
353
+ ValidatorSlashEvent: getStructure(
354
+ typeValidatorSlashEvent.fromPartial({}),
355
+ ),
356
+ ValidatorSlashEvents: getStructure(
357
+ typeValidatorSlashEvents.fromPartial({}),
358
+ ),
359
+ FeePool: getStructure(typeFeePool.fromPartial({})),
360
+ CommunityPoolSpendProposal: getStructure(
361
+ typeCommunityPoolSpendProposal.fromPartial({}),
362
+ ),
363
+ DelegatorStartingInfo: getStructure(
364
+ typeDelegatorStartingInfo.fromPartial({}),
365
+ ),
366
+ DelegationDelegatorReward: getStructure(
367
+ typeDelegationDelegatorReward.fromPartial({}),
368
+ ),
369
+ CommunityPoolSpendProposalWithDeposit: getStructure(
370
+ typeCommunityPoolSpendProposalWithDeposit.fromPartial({}),
371
+ ),
372
+ DelegatorWithdrawInfo: getStructure(
373
+ typeDelegatorWithdrawInfo.fromPartial({}),
374
+ ),
375
+ ValidatorOutstandingRewardsRecord: getStructure(
376
+ typeValidatorOutstandingRewardsRecord.fromPartial({}),
377
+ ),
378
+ ValidatorAccumulatedCommissionRecord: getStructure(
379
+ typeValidatorAccumulatedCommissionRecord.fromPartial({}),
380
+ ),
381
+ ValidatorHistoricalRewardsRecord: getStructure(
382
+ typeValidatorHistoricalRewardsRecord.fromPartial({}),
383
+ ),
384
+ ValidatorCurrentRewardsRecord: getStructure(
385
+ typeValidatorCurrentRewardsRecord.fromPartial({}),
386
+ ),
387
+ DelegatorStartingInfoRecord: getStructure(
388
+ typeDelegatorStartingInfoRecord.fromPartial({}),
389
+ ),
390
+ ValidatorSlashEventRecord: getStructure(
391
+ typeValidatorSlashEventRecord.fromPartial({}),
392
+ ),
393
+ };
394
+ client.on("signer-changed", (signer) => {
395
+ this.updateTX(client);
396
+ });
397
+ }
398
+ updateTX(client: IgniteClient) {
245
399
  const methods = txClient({
246
- signer: client.signer,
247
- addr: client.env.rpcURL,
248
- prefix: client.env.prefix ?? "cosmos",
249
- })
250
-
400
+ signer: client.signer,
401
+ addr: client.env.rpcURL,
402
+ prefix: client.env.prefix ?? "cosmos",
403
+ });
404
+
251
405
  this.tx = methods;
252
406
  for (let m in methods) {
253
- this.tx[m] = methods[m].bind(this.tx);
407
+ this.tx[m] = methods[m].bind(this.tx);
254
408
  }
255
- }
256
- };
257
-
258
- const Module = (test: IgniteClient) => {
259
- return {
260
- module: {
261
- CosmosDistributionV1Beta1: new SDKModule(test)
262
- },
263
- registry: msgTypes
264
409
  }
265
410
  }
266
- export default Module;
411
+
412
+ const Module = (test: IgniteClient) => {
413
+ return {
414
+ module: {
415
+ CosmosDistributionV1Beta1: new SDKModule(test),
416
+ },
417
+ registry: msgTypes,
418
+ };
419
+ };
420
+ export default Module;