decentralcardgame-cardchain-client-ts 0.0.26-rc1 → 0.0.27

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 (105) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +504 -352
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +1505 -1267
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +64 -62
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +64 -62
  5. package/DecentralCardGame.cardchain.cardchain/rest.js +31 -17
  6. package/DecentralCardGame.cardchain.cardchain/rest.ts +139 -94
  7. package/DecentralCardGame.cardchain.cardchain/types/amino/amino.ts +1 -0
  8. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +86 -0
  9. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +90 -0
  10. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +229 -114
  11. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +276 -120
  12. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/set.js +186 -0
  13. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/set.ts +210 -0
  14. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +91 -0
  15. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +113 -0
  16. package/DecentralCardGame.cardchain.cardchain/types.js +3 -1
  17. package/DecentralCardGame.cardchain.cardchain/types.ts +4 -0
  18. package/DecentralCardGame.cardchain.featureflag/module.js +4 -1
  19. package/DecentralCardGame.cardchain.featureflag/module.ts +71 -69
  20. package/DecentralCardGame.cardchain.featureflag/rest.ts +6 -6
  21. package/client.js +3 -9
  22. package/client.ts +154 -167
  23. package/cosmos.auth.v1beta1/module.js +4 -1
  24. package/cosmos.auth.v1beta1/module.ts +71 -69
  25. package/cosmos.auth.v1beta1/rest.ts +21 -21
  26. package/cosmos.authz.v1beta1/module.js +17 -17
  27. package/cosmos.authz.v1beta1/module.ts +25 -25
  28. package/cosmos.authz.v1beta1/registry.js +4 -4
  29. package/cosmos.authz.v1beta1/registry.ts +4 -4
  30. package/cosmos.authz.v1beta1/rest.ts +75 -75
  31. package/cosmos.bank.v1beta1/rest.ts +9 -9
  32. package/cosmos.distribution.v1beta1/module.js +27 -27
  33. package/cosmos.distribution.v1beta1/module.ts +42 -42
  34. package/cosmos.distribution.v1beta1/registry.js +4 -4
  35. package/cosmos.distribution.v1beta1/registry.ts +4 -4
  36. package/cosmos.distribution.v1beta1/rest.ts +20 -20
  37. package/cosmos.gov.v1/module.js +24 -24
  38. package/cosmos.gov.v1/module.ts +36 -36
  39. package/cosmos.gov.v1/registry.js +4 -4
  40. package/cosmos.gov.v1/registry.ts +4 -4
  41. package/cosmos.gov.v1/rest.ts +90 -90
  42. package/cosmos.gov.v1beta1/module.js +27 -27
  43. package/cosmos.gov.v1beta1/module.ts +42 -42
  44. package/cosmos.gov.v1beta1/registry.js +4 -4
  45. package/cosmos.gov.v1beta1/registry.ts +4 -4
  46. package/cosmos.gov.v1beta1/rest.ts +152 -152
  47. package/cosmos.group.v1/module.js +108 -108
  48. package/cosmos.group.v1/module.ts +164 -164
  49. package/cosmos.group.v1/registry.js +18 -18
  50. package/cosmos.group.v1/registry.ts +18 -18
  51. package/cosmos.group.v1/rest.js +5 -5
  52. package/cosmos.group.v1/rest.ts +214 -214
  53. package/cosmos.mint.v1beta1/rest.ts +13 -13
  54. package/cosmos.nft.v1beta1/rest.ts +132 -132
  55. package/cosmos.slashing.v1beta1/rest.ts +19 -19
  56. package/cosmos.staking.v1beta1/module.js +39 -39
  57. package/cosmos.staking.v1beta1/module.ts +59 -59
  58. package/cosmos.staking.v1beta1/registry.js +6 -6
  59. package/cosmos.staking.v1beta1/registry.ts +6 -6
  60. package/cosmos.staking.v1beta1/rest.ts +95 -95
  61. package/cosmos.upgrade.v1beta1/module.js +16 -16
  62. package/cosmos.upgrade.v1beta1/module.ts +24 -24
  63. package/cosmos.upgrade.v1beta1/registry.js +2 -2
  64. package/cosmos.upgrade.v1beta1/registry.ts +2 -2
  65. package/ibc.applications.interchain_accounts.controller.v1/rest.ts +10 -10
  66. package/ibc.applications.interchain_accounts.host.v1/rest.ts +13 -13
  67. package/ibc.applications.transfer.v1/rest.ts +3 -3
  68. package/ibc.core.channel.v1/rest.ts +44 -44
  69. package/package.json +1 -1
  70. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/card.js +0 -651
  71. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/card.ts +0 -735
  72. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/copyright_proposal.js +0 -102
  73. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/copyright_proposal.ts +0 -134
  74. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/council.js +0 -350
  75. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/council.ts +0 -409
  76. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/genesis.js +0 -254
  77. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/genesis.ts +0 -281
  78. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/image.js +0 -88
  79. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/image.ts +0 -115
  80. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match.js +0 -308
  81. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match.ts +0 -355
  82. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match_reporter_proposal.js +0 -67
  83. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match_reporter_proposal.ts +0 -92
  84. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/num.js +0 -73
  85. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/num.ts +0 -102
  86. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/params.js +0 -314
  87. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/params.ts +0 -367
  88. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/query.js +0 -1984
  89. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/query.ts +0 -2382
  90. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/running_average.js +0 -85
  91. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/running_average.ts +0 -111
  92. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/sell_offer.js +0 -148
  93. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/sell_offer.ts +0 -183
  94. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/server.js +0 -93
  95. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/server.ts +0 -124
  96. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set.js +0 -365
  97. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set.ts +0 -416
  98. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set_proposal.js +0 -93
  99. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set_proposal.ts +0 -124
  100. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/tx.js +0 -4494
  101. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/tx.ts +0 -5526
  102. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/user.js +0 -522
  103. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/user.ts +0 -583
  104. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/voting.js +0 -346
  105. package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/voting.ts +0 -417
@@ -9,6 +9,89 @@
9
9
  * ---------------------------------------------------------------
10
10
  */
11
11
 
12
+ /**
13
+ * Deposit defines an amount deposited by an account address to an active
14
+ proposal.
15
+ */
16
+ export interface Govv1Deposit {
17
+ /** @format uint64 */
18
+ proposal_id?: string;
19
+ depositor?: string;
20
+ amount?: V1Beta1Coin[];
21
+ }
22
+
23
+ /**
24
+ * Proposal defines the core field members of a governance proposal.
25
+ */
26
+ export interface Govv1Proposal {
27
+ /** @format uint64 */
28
+ id?: string;
29
+ messages?: ProtobufAny[];
30
+
31
+ /**
32
+ * ProposalStatus enumerates the valid statuses of a proposal.
33
+ *
34
+ * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.
35
+ * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
36
+ * period.
37
+ * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
38
+ * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
39
+ * passed.
40
+ * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
41
+ * been rejected.
42
+ * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
43
+ * failed.
44
+ */
45
+ status?: V1ProposalStatus;
46
+
47
+ /**
48
+ * final_tally_result is the final tally result of the proposal. When
49
+ * querying a proposal via gRPC, this field is not populated until the
50
+ * proposal's voting period has ended.
51
+ */
52
+ final_tally_result?: Govv1TallyResult;
53
+
54
+ /** @format date-time */
55
+ submit_time?: string;
56
+
57
+ /** @format date-time */
58
+ deposit_end_time?: string;
59
+ total_deposit?: V1Beta1Coin[];
60
+
61
+ /** @format date-time */
62
+ voting_start_time?: string;
63
+
64
+ /** @format date-time */
65
+ voting_end_time?: string;
66
+
67
+ /** metadata is any arbitrary metadata attached to the proposal. */
68
+ metadata?: string;
69
+ }
70
+
71
+ /**
72
+ * TallyResult defines a standard tally for a governance proposal.
73
+ */
74
+ export interface Govv1TallyResult {
75
+ yes_count?: string;
76
+ abstain_count?: string;
77
+ no_count?: string;
78
+ no_with_veto_count?: string;
79
+ }
80
+
81
+ /**
82
+ * Vote defines a vote on a governance proposal.
83
+ A Vote consists of a proposal ID, the voter, and the vote option.
84
+ */
85
+ export interface Govv1Vote {
86
+ /** @format uint64 */
87
+ proposal_id?: string;
88
+ voter?: string;
89
+ options?: V1WeightedVoteOption[];
90
+
91
+ /** metadata is any arbitrary metadata to attached to the vote. */
92
+ metadata?: string;
93
+ }
94
+
12
95
  /**
13
96
  * `Any` contains an arbitrary serialized protocol buffer message along with a
14
97
  URL that describes the type of the serialized message.
@@ -130,17 +213,6 @@ export interface RpcStatus {
130
213
  details?: ProtobufAny[];
131
214
  }
132
215
 
133
- /**
134
- * Deposit defines an amount deposited by an account address to an active
135
- proposal.
136
- */
137
- export interface V1Deposit {
138
- /** @format uint64 */
139
- proposal_id?: string;
140
- depositor?: string;
141
- amount?: V1Beta1Coin[];
142
- }
143
-
144
216
  /**
145
217
  * DepositParams defines the params for deposits on governance proposals.
146
218
  */
@@ -183,54 +255,6 @@ export type V1MsgVoteResponse = object;
183
255
  */
184
256
  export type V1MsgVoteWeightedResponse = object;
185
257
 
186
- /**
187
- * Proposal defines the core field members of a governance proposal.
188
- */
189
- export interface V1Proposal {
190
- /** @format uint64 */
191
- id?: string;
192
- messages?: ProtobufAny[];
193
-
194
- /**
195
- * ProposalStatus enumerates the valid statuses of a proposal.
196
- *
197
- * - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.
198
- * - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
199
- * period.
200
- * - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
201
- * - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
202
- * passed.
203
- * - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
204
- * been rejected.
205
- * - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
206
- * failed.
207
- */
208
- status?: V1ProposalStatus;
209
-
210
- /**
211
- * final_tally_result is the final tally result of the proposal. When
212
- * querying a proposal via gRPC, this field is not populated until the
213
- * proposal's voting period has ended.
214
- */
215
- final_tally_result?: V1TallyResult;
216
-
217
- /** @format date-time */
218
- submit_time?: string;
219
-
220
- /** @format date-time */
221
- deposit_end_time?: string;
222
- total_deposit?: V1Beta1Coin[];
223
-
224
- /** @format date-time */
225
- voting_start_time?: string;
226
-
227
- /** @format date-time */
228
- voting_end_time?: string;
229
-
230
- /** metadata is any arbitrary metadata attached to the proposal. */
231
- metadata?: string;
232
- }
233
-
234
258
  /**
235
259
  * ProposalStatus enumerates the valid statuses of a proposal.
236
260
 
@@ -260,14 +284,14 @@ export enum V1ProposalStatus {
260
284
  */
261
285
  export interface V1QueryDepositResponse {
262
286
  /** deposit defines the requested deposit. */
263
- deposit?: V1Deposit;
287
+ deposit?: Govv1Deposit;
264
288
  }
265
289
 
266
290
  /**
267
291
  * QueryDepositsResponse is the response type for the Query/Deposits RPC method.
268
292
  */
269
293
  export interface V1QueryDepositsResponse {
270
- deposits?: V1Deposit[];
294
+ deposits?: Govv1Deposit[];
271
295
 
272
296
  /** pagination defines the pagination in the response. */
273
297
  pagination?: V1Beta1PageResponse;
@@ -292,7 +316,7 @@ export interface V1QueryParamsResponse {
292
316
  */
293
317
  export interface V1QueryProposalResponse {
294
318
  /** Proposal defines the core field members of a governance proposal. */
295
- proposal?: V1Proposal;
319
+ proposal?: Govv1Proposal;
296
320
  }
297
321
 
298
322
  /**
@@ -300,7 +324,7 @@ export interface V1QueryProposalResponse {
300
324
  method.
301
325
  */
302
326
  export interface V1QueryProposalsResponse {
303
- proposals?: V1Proposal[];
327
+ proposals?: Govv1Proposal[];
304
328
 
305
329
  /** pagination defines the pagination in the response. */
306
330
  pagination?: V1Beta1PageResponse;
@@ -311,7 +335,7 @@ export interface V1QueryProposalsResponse {
311
335
  */
312
336
  export interface V1QueryTallyResultResponse {
313
337
  /** tally defines the requested tally. */
314
- tally?: V1TallyResult;
338
+ tally?: Govv1TallyResult;
315
339
  }
316
340
 
317
341
  /**
@@ -319,7 +343,7 @@ export interface V1QueryTallyResultResponse {
319
343
  */
320
344
  export interface V1QueryVoteResponse {
321
345
  /** vote defined the queried vote. */
322
- vote?: V1Vote;
346
+ vote?: Govv1Vote;
323
347
  }
324
348
 
325
349
  /**
@@ -327,7 +351,7 @@ export interface V1QueryVoteResponse {
327
351
  */
328
352
  export interface V1QueryVotesResponse {
329
353
  /** votes defined the queried votes. */
330
- votes?: V1Vote[];
354
+ votes?: Govv1Vote[];
331
355
 
332
356
  /** pagination defines the pagination in the response. */
333
357
  pagination?: V1Beta1PageResponse;
@@ -353,30 +377,6 @@ export interface V1TallyParams {
353
377
  veto_threshold?: string;
354
378
  }
355
379
 
356
- /**
357
- * TallyResult defines a standard tally for a governance proposal.
358
- */
359
- export interface V1TallyResult {
360
- yes_count?: string;
361
- abstain_count?: string;
362
- no_count?: string;
363
- no_with_veto_count?: string;
364
- }
365
-
366
- /**
367
- * Vote defines a vote on a governance proposal.
368
- A Vote consists of a proposal ID, the voter, and the vote option.
369
- */
370
- export interface V1Vote {
371
- /** @format uint64 */
372
- proposal_id?: string;
373
- voter?: string;
374
- options?: V1WeightedVoteOption[];
375
-
376
- /** metadata is any arbitrary metadata to attached to the vote. */
377
- metadata?: string;
378
- }
379
-
380
380
  /**
381
381
  * VoteOption enumerates the valid vote options for a given governance proposal.
382
382
 
@@ -3,10 +3,10 @@ import { SigningStargateClient } from "@cosmjs/stargate";
3
3
  import { Registry } from "@cosmjs/proto-signing";
4
4
  import { msgTypes } from './registry';
5
5
  import { Api } from "./rest";
6
- import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
7
6
  import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx";
8
- import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
7
+ import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
9
8
  import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx";
9
+ import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
10
10
  import { WeightedVoteOption as typeWeightedVoteOption } from "./types";
11
11
  import { TextProposal as typeTextProposal } from "./types";
12
12
  import { Deposit as typeDeposit } from "./types";
@@ -16,7 +16,7 @@ import { Vote as typeVote } from "./types";
16
16
  import { DepositParams as typeDepositParams } from "./types";
17
17
  import { VotingParams as typeVotingParams } from "./types";
18
18
  import { TallyParams as typeTallyParams } from "./types";
19
- export { MsgDeposit, MsgSubmitProposal, MsgVote, MsgVoteWeighted };
19
+ export { MsgSubmitProposal, MsgDeposit, MsgVoteWeighted, MsgVote };
20
20
  export const registry = new Registry(msgTypes);
21
21
  function getStructure(template) {
22
22
  const structure = { fields: [] };
@@ -32,20 +32,6 @@ const defaultFee = {
32
32
  };
33
33
  export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
34
34
  return {
35
- async sendMsgDeposit({ value, fee, memo }) {
36
- if (!signer) {
37
- throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.');
38
- }
39
- try {
40
- const { address } = (await signer.getAccounts())[0];
41
- const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
42
- let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) });
43
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
44
- }
45
- catch (e) {
46
- throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: ' + e.message);
47
- }
48
- },
49
35
  async sendMsgSubmitProposal({ value, fee, memo }) {
50
36
  if (!signer) {
51
37
  throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.');
@@ -60,18 +46,18 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
60
46
  throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: ' + e.message);
61
47
  }
62
48
  },
63
- async sendMsgVote({ value, fee, memo }) {
49
+ async sendMsgDeposit({ value, fee, memo }) {
64
50
  if (!signer) {
65
- throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.');
51
+ throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.');
66
52
  }
67
53
  try {
68
54
  const { address } = (await signer.getAccounts())[0];
69
55
  const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
70
- let msg = this.msgVote({ value: MsgVote.fromPartial(value) });
56
+ let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) });
71
57
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
72
58
  }
73
59
  catch (e) {
74
- throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: ' + e.message);
60
+ throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: ' + e.message);
75
61
  }
76
62
  },
77
63
  async sendMsgVoteWeighted({ value, fee, memo }) {
@@ -88,12 +74,18 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
88
74
  throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: ' + e.message);
89
75
  }
90
76
  },
91
- msgDeposit({ value }) {
77
+ async sendMsgVote({ value, fee, memo }) {
78
+ if (!signer) {
79
+ throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.');
80
+ }
92
81
  try {
93
- return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial(value) };
82
+ const { address } = (await signer.getAccounts())[0];
83
+ const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
84
+ let msg = this.msgVote({ value: MsgVote.fromPartial(value) });
85
+ return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
94
86
  }
95
87
  catch (e) {
96
- throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message);
88
+ throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: ' + e.message);
97
89
  }
98
90
  },
99
91
  msgSubmitProposal({ value }) {
@@ -104,12 +96,12 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
104
96
  throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message);
105
97
  }
106
98
  },
107
- msgVote({ value }) {
99
+ msgDeposit({ value }) {
108
100
  try {
109
- return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial(value) };
101
+ return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial(value) };
110
102
  }
111
103
  catch (e) {
112
- throw new Error('TxClient:MsgVote: Could not create message: ' + e.message);
104
+ throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message);
113
105
  }
114
106
  },
115
107
  msgVoteWeighted({ value }) {
@@ -120,6 +112,14 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
120
112
  throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message);
121
113
  }
122
114
  },
115
+ msgVote({ value }) {
116
+ try {
117
+ return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial(value) };
118
+ }
119
+ catch (e) {
120
+ throw new Error('TxClient:MsgVote: Could not create message: ' + e.message);
121
+ }
122
+ },
123
123
  };
124
124
  };
125
125
  export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {
@@ -7,10 +7,10 @@ import { msgTypes } from './registry';
7
7
  import { IgniteClient } from "../client"
8
8
  import { MissingWalletError } from "../helpers"
9
9
  import { Api } from "./rest";
10
- import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
11
10
  import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx";
12
- import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
11
+ import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
13
12
  import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx";
13
+ import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
14
14
 
15
15
  import { WeightedVoteOption as typeWeightedVoteOption} from "./types"
16
16
  import { TextProposal as typeTextProposal} from "./types"
@@ -22,13 +22,7 @@ import { DepositParams as typeDepositParams} from "./types"
22
22
  import { VotingParams as typeVotingParams} from "./types"
23
23
  import { TallyParams as typeTallyParams} from "./types"
24
24
 
25
- export { MsgDeposit, MsgSubmitProposal, MsgVote, MsgVoteWeighted };
26
-
27
- type sendMsgDepositParams = {
28
- value: MsgDeposit,
29
- fee?: StdFee,
30
- memo?: string
31
- };
25
+ export { MsgSubmitProposal, MsgDeposit, MsgVoteWeighted, MsgVote };
32
26
 
33
27
  type sendMsgSubmitProposalParams = {
34
28
  value: MsgSubmitProposal,
@@ -36,8 +30,8 @@ type sendMsgSubmitProposalParams = {
36
30
  memo?: string
37
31
  };
38
32
 
39
- type sendMsgVoteParams = {
40
- value: MsgVote,
33
+ type sendMsgDepositParams = {
34
+ value: MsgDeposit,
41
35
  fee?: StdFee,
42
36
  memo?: string
43
37
  };
@@ -48,23 +42,29 @@ type sendMsgVoteWeightedParams = {
48
42
  memo?: string
49
43
  };
50
44
 
51
-
52
- type msgDepositParams = {
53
- value: MsgDeposit,
45
+ type sendMsgVoteParams = {
46
+ value: MsgVote,
47
+ fee?: StdFee,
48
+ memo?: string
54
49
  };
55
50
 
51
+
56
52
  type msgSubmitProposalParams = {
57
53
  value: MsgSubmitProposal,
58
54
  };
59
55
 
60
- type msgVoteParams = {
61
- value: MsgVote,
56
+ type msgDepositParams = {
57
+ value: MsgDeposit,
62
58
  };
63
59
 
64
60
  type msgVoteWeightedParams = {
65
61
  value: MsgVoteWeighted,
66
62
  };
67
63
 
64
+ type msgVoteParams = {
65
+ value: MsgVote,
66
+ };
67
+
68
68
 
69
69
  export const registry = new Registry(msgTypes);
70
70
 
@@ -95,20 +95,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
95
95
 
96
96
  return {
97
97
 
98
- async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise<DeliverTxResponse> {
99
- if (!signer) {
100
- throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.')
101
- }
102
- try {
103
- const { address } = (await signer.getAccounts())[0];
104
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
105
- let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) })
106
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
107
- } catch (e: any) {
108
- throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message)
109
- }
110
- },
111
-
112
98
  async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise<DeliverTxResponse> {
113
99
  if (!signer) {
114
100
  throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.')
@@ -123,17 +109,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
123
109
  }
124
110
  },
125
111
 
126
- async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise<DeliverTxResponse> {
112
+ async sendMsgDeposit({ value, fee, memo }: sendMsgDepositParams): Promise<DeliverTxResponse> {
127
113
  if (!signer) {
128
- throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.')
114
+ throw new Error('TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.')
129
115
  }
130
116
  try {
131
117
  const { address } = (await signer.getAccounts())[0];
132
118
  const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
133
- let msg = this.msgVote({ value: MsgVote.fromPartial(value) })
119
+ let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) })
134
120
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
135
121
  } catch (e: any) {
136
- throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message)
122
+ throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: '+ e.message)
137
123
  }
138
124
  },
139
125
 
@@ -151,15 +137,21 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
151
137
  }
152
138
  },
153
139
 
154
-
155
- msgDeposit({ value }: msgDepositParams): EncodeObject {
156
- try {
157
- return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( value ) }
140
+ async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise<DeliverTxResponse> {
141
+ if (!signer) {
142
+ throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.')
143
+ }
144
+ try {
145
+ const { address } = (await signer.getAccounts())[0];
146
+ const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
147
+ let msg = this.msgVote({ value: MsgVote.fromPartial(value) })
148
+ return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
158
149
  } catch (e: any) {
159
- throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message)
150
+ throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message)
160
151
  }
161
152
  },
162
153
 
154
+
163
155
  msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject {
164
156
  try {
165
157
  return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) }
@@ -168,11 +160,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
168
160
  }
169
161
  },
170
162
 
171
- msgVote({ value }: msgVoteParams): EncodeObject {
163
+ msgDeposit({ value }: msgDepositParams): EncodeObject {
172
164
  try {
173
- return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( value ) }
165
+ return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: MsgDeposit.fromPartial( value ) }
174
166
  } catch (e: any) {
175
- throw new Error('TxClient:MsgVote: Could not create message: ' + e.message)
167
+ throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message)
176
168
  }
177
169
  },
178
170
 
@@ -184,6 +176,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
184
176
  }
185
177
  },
186
178
 
179
+ msgVote({ value }: msgVoteParams): EncodeObject {
180
+ try {
181
+ return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: MsgVote.fromPartial( value ) }
182
+ } catch (e: any) {
183
+ throw new Error('TxClient:MsgVote: Could not create message: ' + e.message)
184
+ }
185
+ },
186
+
187
187
  }
188
188
  };
189
189
 
@@ -1,11 +1,11 @@
1
- import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
2
1
  import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx";
3
- import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
2
+ import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
4
3
  import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx";
4
+ import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
5
5
  const msgTypes = [
6
- ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit],
7
6
  ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal],
8
- ["/cosmos.gov.v1beta1.MsgVote", MsgVote],
7
+ ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit],
9
8
  ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted],
9
+ ["/cosmos.gov.v1beta1.MsgVote", MsgVote],
10
10
  ];
11
11
  export { msgTypes };
@@ -1,14 +1,14 @@
1
1
  import { GeneratedType } from "@cosmjs/proto-signing";
2
- import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
3
2
  import { MsgSubmitProposal } from "./types/cosmos/gov/v1beta1/tx";
4
- import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
3
+ import { MsgDeposit } from "./types/cosmos/gov/v1beta1/tx";
5
4
  import { MsgVoteWeighted } from "./types/cosmos/gov/v1beta1/tx";
5
+ import { MsgVote } from "./types/cosmos/gov/v1beta1/tx";
6
6
 
7
7
  const msgTypes: Array<[string, GeneratedType]> = [
8
- ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit],
9
8
  ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal],
10
- ["/cosmos.gov.v1beta1.MsgVote", MsgVote],
9
+ ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit],
11
10
  ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted],
11
+ ["/cosmos.gov.v1beta1.MsgVote", MsgVote],
12
12
 
13
13
  ];
14
14