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,69 +2,72 @@
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 { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx";
11
16
  import { MsgExec } from "./types/cosmos/authz/v1beta1/tx";
12
17
  import { MsgGrant } from "./types/cosmos/authz/v1beta1/tx";
13
18
 
14
- import { GenericAuthorization as typeGenericAuthorization} from "./types"
15
- import { Grant as typeGrant} from "./types"
16
- import { GrantAuthorization as typeGrantAuthorization} from "./types"
17
- import { GrantQueueItem as typeGrantQueueItem} from "./types"
18
- import { EventGrant as typeEventGrant} from "./types"
19
- import { EventRevoke as typeEventRevoke} from "./types"
19
+ import { GenericAuthorization as typeGenericAuthorization } from "./types";
20
+ import { Grant as typeGrant } from "./types";
21
+ import { GrantAuthorization as typeGrantAuthorization } from "./types";
22
+ import { GrantQueueItem as typeGrantQueueItem } from "./types";
23
+ import { EventGrant as typeEventGrant } from "./types";
24
+ import { EventRevoke as typeEventRevoke } from "./types";
20
25
 
21
26
  export { MsgRevoke, MsgExec, MsgGrant };
22
27
 
23
28
  type sendMsgRevokeParams = {
24
- value: MsgRevoke,
25
- fee?: StdFee,
26
- memo?: string
29
+ value: MsgRevoke;
30
+ fee?: StdFee;
31
+ memo?: string;
27
32
  };
28
33
 
29
34
  type sendMsgExecParams = {
30
- value: MsgExec,
31
- fee?: StdFee,
32
- memo?: string
35
+ value: MsgExec;
36
+ fee?: StdFee;
37
+ memo?: string;
33
38
  };
34
39
 
35
40
  type sendMsgGrantParams = {
36
- value: MsgGrant,
37
- fee?: StdFee,
38
- memo?: string
41
+ value: MsgGrant;
42
+ fee?: StdFee;
43
+ memo?: string;
39
44
  };
40
45
 
41
-
42
46
  type msgRevokeParams = {
43
- value: MsgRevoke,
47
+ value: MsgRevoke;
44
48
  };
45
49
 
46
50
  type msgExecParams = {
47
- value: MsgExec,
51
+ value: MsgExec;
48
52
  };
49
53
 
50
54
  type msgGrantParams = {
51
- value: MsgGrant,
55
+ value: MsgGrant;
52
56
  };
53
57
 
54
-
55
58
  export const registry = new Registry(msgTypes);
56
59
 
57
60
  type Field = {
58
- name: string;
59
- type: unknown;
60
- }
61
+ name: string;
62
+ type: unknown;
63
+ };
61
64
  function getStructure(template) {
62
- const structure: {fields: Field[]} = { fields: [] }
63
- for (let [key, value] of Object.entries(template)) {
64
- let field = { name: key, type: typeof value }
65
- structure.fields.push(field)
66
- }
67
- return structure
65
+ const structure: { fields: Field[] } = { fields: [] };
66
+ for (let [key, value] of Object.entries(template)) {
67
+ let field = { name: key, type: typeof value };
68
+ structure.fields.push(field);
69
+ }
70
+ return structure;
68
71
  }
69
72
  const defaultFee = {
70
73
  amount: [],
@@ -72,136 +75,205 @@ const defaultFee = {
72
75
  };
73
76
 
74
77
  interface TxClientOptions {
75
- addr: string
76
- prefix: string
77
- signer?: OfflineSigner
78
+ addr: string;
79
+ prefix: string;
80
+ signer?: OfflineSigner;
78
81
  }
79
82
 
80
- export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
81
-
83
+ export const txClient = (
84
+ { signer, prefix, addr }: TxClientOptions = {
85
+ addr: "http://localhost:26657",
86
+ prefix: "cosmos",
87
+ },
88
+ ) => {
82
89
  return {
83
-
84
- async sendMsgRevoke({ value, fee, memo }: sendMsgRevokeParams): Promise<DeliverTxResponse> {
85
- if (!signer) {
86
- throw new Error('TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.')
87
- }
88
- try {
89
- const { address } = (await signer.getAccounts())[0];
90
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
91
- let msg = this.msgRevoke({ value: MsgRevoke.fromPartial(value) })
92
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
93
- } catch (e: any) {
94
- throw new Error('TxClient:sendMsgRevoke: Could not broadcast Tx: '+ e.message)
95
- }
96
- },
97
-
98
- async sendMsgExec({ value, fee, memo }: sendMsgExecParams): Promise<DeliverTxResponse> {
99
- if (!signer) {
100
- throw new Error('TxClient:sendMsgExec: 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.msgExec({ value: MsgExec.fromPartial(value) })
106
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
107
- } catch (e: any) {
108
- throw new Error('TxClient:sendMsgExec: Could not broadcast Tx: '+ e.message)
109
- }
110
- },
111
-
112
- async sendMsgGrant({ value, fee, memo }: sendMsgGrantParams): Promise<DeliverTxResponse> {
113
- if (!signer) {
114
- throw new Error('TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.')
115
- }
116
- try {
117
- const { address } = (await signer.getAccounts())[0];
118
- const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
119
- let msg = this.msgGrant({ value: MsgGrant.fromPartial(value) })
120
- return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
121
- } catch (e: any) {
122
- throw new Error('TxClient:sendMsgGrant: Could not broadcast Tx: '+ e.message)
123
- }
124
- },
125
-
126
-
127
- msgRevoke({ value }: msgRevokeParams): EncodeObject {
128
- try {
129
- return { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", value: MsgRevoke.fromPartial( value ) }
130
- } catch (e: any) {
131
- throw new Error('TxClient:MsgRevoke: Could not create message: ' + e.message)
132
- }
133
- },
134
-
135
- msgExec({ value }: msgExecParams): EncodeObject {
136
- try {
137
- return { typeUrl: "/cosmos.authz.v1beta1.MsgExec", value: MsgExec.fromPartial( value ) }
138
- } catch (e: any) {
139
- throw new Error('TxClient:MsgExec: Could not create message: ' + e.message)
140
- }
141
- },
142
-
143
- msgGrant({ value }: msgGrantParams): EncodeObject {
144
- try {
145
- return { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", value: MsgGrant.fromPartial( value ) }
146
- } catch (e: any) {
147
- throw new Error('TxClient:MsgGrant: Could not create message: ' + e.message)
148
- }
149
- },
150
-
151
- }
90
+ async sendMsgRevoke({
91
+ value,
92
+ fee,
93
+ memo,
94
+ }: sendMsgRevokeParams): Promise<DeliverTxResponse> {
95
+ if (!signer) {
96
+ throw new Error(
97
+ "TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.",
98
+ );
99
+ }
100
+ try {
101
+ const { address } = (await signer.getAccounts())[0];
102
+ const signingClient = await SigningStargateClient.connectWithSigner(
103
+ addr,
104
+ signer,
105
+ { registry, prefix },
106
+ );
107
+ let msg = this.msgRevoke({ value: MsgRevoke.fromPartial(value) });
108
+ return await signingClient.signAndBroadcast(
109
+ address,
110
+ [msg],
111
+ fee ? fee : defaultFee,
112
+ memo,
113
+ );
114
+ } catch (e: any) {
115
+ throw new Error(
116
+ "TxClient:sendMsgRevoke: Could not broadcast Tx: " + e.message,
117
+ );
118
+ }
119
+ },
120
+
121
+ async sendMsgExec({
122
+ value,
123
+ fee,
124
+ memo,
125
+ }: sendMsgExecParams): Promise<DeliverTxResponse> {
126
+ if (!signer) {
127
+ throw new Error(
128
+ "TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.",
129
+ );
130
+ }
131
+ try {
132
+ const { address } = (await signer.getAccounts())[0];
133
+ const signingClient = await SigningStargateClient.connectWithSigner(
134
+ addr,
135
+ signer,
136
+ { registry, prefix },
137
+ );
138
+ let msg = this.msgExec({ value: MsgExec.fromPartial(value) });
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:sendMsgExec: Could not broadcast Tx: " + e.message,
148
+ );
149
+ }
150
+ },
151
+
152
+ async sendMsgGrant({
153
+ value,
154
+ fee,
155
+ memo,
156
+ }: sendMsgGrantParams): Promise<DeliverTxResponse> {
157
+ if (!signer) {
158
+ throw new Error(
159
+ "TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.",
160
+ );
161
+ }
162
+ try {
163
+ const { address } = (await signer.getAccounts())[0];
164
+ const signingClient = await SigningStargateClient.connectWithSigner(
165
+ addr,
166
+ signer,
167
+ { registry, prefix },
168
+ );
169
+ let msg = this.msgGrant({ value: MsgGrant.fromPartial(value) });
170
+ return await signingClient.signAndBroadcast(
171
+ address,
172
+ [msg],
173
+ fee ? fee : defaultFee,
174
+ memo,
175
+ );
176
+ } catch (e: any) {
177
+ throw new Error(
178
+ "TxClient:sendMsgGrant: Could not broadcast Tx: " + e.message,
179
+ );
180
+ }
181
+ },
182
+
183
+ msgRevoke({ value }: msgRevokeParams): EncodeObject {
184
+ try {
185
+ return {
186
+ typeUrl: "/cosmos.authz.v1beta1.MsgRevoke",
187
+ value: MsgRevoke.fromPartial(value),
188
+ };
189
+ } catch (e: any) {
190
+ throw new Error(
191
+ "TxClient:MsgRevoke: Could not create message: " + e.message,
192
+ );
193
+ }
194
+ },
195
+
196
+ msgExec({ value }: msgExecParams): EncodeObject {
197
+ try {
198
+ return {
199
+ typeUrl: "/cosmos.authz.v1beta1.MsgExec",
200
+ value: MsgExec.fromPartial(value),
201
+ };
202
+ } catch (e: any) {
203
+ throw new Error(
204
+ "TxClient:MsgExec: Could not create message: " + e.message,
205
+ );
206
+ }
207
+ },
208
+
209
+ msgGrant({ value }: msgGrantParams): EncodeObject {
210
+ try {
211
+ return {
212
+ typeUrl: "/cosmos.authz.v1beta1.MsgGrant",
213
+ value: MsgGrant.fromPartial(value),
214
+ };
215
+ } catch (e: any) {
216
+ throw new Error(
217
+ "TxClient:MsgGrant: Could not create message: " + e.message,
218
+ );
219
+ }
220
+ },
221
+ };
152
222
  };
153
223
 
154
224
  interface QueryClientOptions {
155
- addr: string
225
+ addr: string;
156
226
  }
157
227
 
158
- export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
228
+ export const queryClient = (
229
+ { addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" },
230
+ ) => {
159
231
  return new Api({ baseURL: addr });
160
232
  };
161
233
 
162
234
  class SDKModule {
163
- public query: ReturnType<typeof queryClient>;
164
- public tx: ReturnType<typeof txClient>;
165
- public structure: Record<string,unknown>;
166
- public registry: Array<[string, GeneratedType]> = [];
167
-
168
- constructor(client: IgniteClient) {
169
-
170
- this.query = queryClient({ addr: client.env.apiURL });
171
- this.updateTX(client);
172
- this.structure = {
173
- GenericAuthorization: getStructure(typeGenericAuthorization.fromPartial({})),
174
- Grant: getStructure(typeGrant.fromPartial({})),
175
- GrantAuthorization: getStructure(typeGrantAuthorization.fromPartial({})),
176
- GrantQueueItem: getStructure(typeGrantQueueItem.fromPartial({})),
177
- EventGrant: getStructure(typeEventGrant.fromPartial({})),
178
- EventRevoke: getStructure(typeEventRevoke.fromPartial({})),
179
-
180
- };
181
- client.on('signer-changed',(signer) => {
182
- this.updateTX(client);
183
- })
184
- }
185
- updateTX(client: IgniteClient) {
235
+ public query: ReturnType<typeof queryClient>;
236
+ public tx: ReturnType<typeof txClient>;
237
+ public structure: Record<string, unknown>;
238
+ public registry: Array<[string, GeneratedType]> = [];
239
+
240
+ constructor(client: IgniteClient) {
241
+ this.query = queryClient({ addr: client.env.apiURL });
242
+ this.updateTX(client);
243
+ this.structure = {
244
+ GenericAuthorization: getStructure(
245
+ typeGenericAuthorization.fromPartial({}),
246
+ ),
247
+ Grant: getStructure(typeGrant.fromPartial({})),
248
+ GrantAuthorization: getStructure(typeGrantAuthorization.fromPartial({})),
249
+ GrantQueueItem: getStructure(typeGrantQueueItem.fromPartial({})),
250
+ EventGrant: getStructure(typeEventGrant.fromPartial({})),
251
+ EventRevoke: getStructure(typeEventRevoke.fromPartial({})),
252
+ };
253
+ client.on("signer-changed", (signer) => {
254
+ this.updateTX(client);
255
+ });
256
+ }
257
+ updateTX(client: IgniteClient) {
186
258
  const methods = txClient({
187
- signer: client.signer,
188
- addr: client.env.rpcURL,
189
- prefix: client.env.prefix ?? "cosmos",
190
- })
191
-
259
+ signer: client.signer,
260
+ addr: client.env.rpcURL,
261
+ prefix: client.env.prefix ?? "cosmos",
262
+ });
263
+
192
264
  this.tx = methods;
193
265
  for (let m in methods) {
194
- this.tx[m] = methods[m].bind(this.tx);
266
+ this.tx[m] = methods[m].bind(this.tx);
195
267
  }
196
- }
197
- };
198
-
199
- const Module = (test: IgniteClient) => {
200
- return {
201
- module: {
202
- CosmosAuthzV1Beta1: new SDKModule(test)
203
- },
204
- registry: msgTypes
205
268
  }
206
269
  }
207
- export default Module;
270
+
271
+ const Module = (test: IgniteClient) => {
272
+ return {
273
+ module: {
274
+ CosmosAuthzV1Beta1: new SDKModule(test),
275
+ },
276
+ registry: msgTypes,
277
+ };
278
+ };
279
+ export default Module;
@@ -1,7 +1,7 @@
1
1
  // Generated by Ignite ignite.com/cli
2
2
  import { SigningStargateClient } from "@cosmjs/stargate";
3
- import { Registry } from "@cosmjs/proto-signing";
4
- import { msgTypes } from './registry';
3
+ import { Registry, } from "@cosmjs/proto-signing";
4
+ import { msgTypes } from "./registry";
5
5
  import { Api } from "./rest";
6
6
  import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
7
7
  import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
@@ -26,7 +26,7 @@ import { ValidatorHistoricalRewardsRecord as typeValidatorHistoricalRewardsRecor
26
26
  import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord } from "./types";
27
27
  import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord } from "./types";
28
28
  import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord } from "./types";
29
- export { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgSetWithdrawAddress };
29
+ export { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgSetWithdrawAddress, };
30
30
  export const registry = new Registry(msgTypes);
31
31
  function getStructure(template) {
32
32
  const structure = { fields: [] };
@@ -40,94 +40,125 @@ const defaultFee = {
40
40
  amount: [],
41
41
  gas: "200000",
42
42
  };
43
- export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
43
+ export const txClient = ({ signer, prefix, addr } = {
44
+ addr: "http://localhost:26657",
45
+ prefix: "cosmos",
46
+ }) => {
44
47
  return {
45
- async sendMsgWithdrawDelegatorReward({ value, fee, memo }) {
48
+ async sendMsgWithdrawDelegatorReward({ value, fee, memo, }) {
46
49
  if (!signer) {
47
- throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.');
50
+ throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.");
48
51
  }
49
52
  try {
50
53
  const { address } = (await signer.getAccounts())[0];
51
54
  const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
52
- let msg = this.msgWithdrawDelegatorReward({ value: MsgWithdrawDelegatorReward.fromPartial(value) });
55
+ let msg = this.msgWithdrawDelegatorReward({
56
+ value: MsgWithdrawDelegatorReward.fromPartial(value),
57
+ });
53
58
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
54
59
  }
55
60
  catch (e) {
56
- throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: ' + e.message);
61
+ throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: " +
62
+ e.message);
57
63
  }
58
64
  },
59
- async sendMsgWithdrawValidatorCommission({ value, fee, memo }) {
65
+ async sendMsgWithdrawValidatorCommission({ value, fee, memo, }) {
60
66
  if (!signer) {
61
- throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.');
67
+ throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.");
62
68
  }
63
69
  try {
64
70
  const { address } = (await signer.getAccounts())[0];
65
71
  const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
66
- let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) });
72
+ let msg = this.msgWithdrawValidatorCommission({
73
+ value: MsgWithdrawValidatorCommission.fromPartial(value),
74
+ });
67
75
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
68
76
  }
69
77
  catch (e) {
70
- throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: ' + e.message);
78
+ throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: " +
79
+ e.message);
71
80
  }
72
81
  },
73
- async sendMsgFundCommunityPool({ value, fee, memo }) {
82
+ async sendMsgFundCommunityPool({ value, fee, memo, }) {
74
83
  if (!signer) {
75
- throw new Error('TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.');
84
+ throw new Error("TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.");
76
85
  }
77
86
  try {
78
87
  const { address } = (await signer.getAccounts())[0];
79
88
  const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
80
- let msg = this.msgFundCommunityPool({ value: MsgFundCommunityPool.fromPartial(value) });
89
+ let msg = this.msgFundCommunityPool({
90
+ value: MsgFundCommunityPool.fromPartial(value),
91
+ });
81
92
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
82
93
  }
83
94
  catch (e) {
84
- throw new Error('TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: ' + e.message);
95
+ throw new Error("TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: " +
96
+ e.message);
85
97
  }
86
98
  },
87
- async sendMsgSetWithdrawAddress({ value, fee, memo }) {
99
+ async sendMsgSetWithdrawAddress({ value, fee, memo, }) {
88
100
  if (!signer) {
89
- throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.');
101
+ throw new Error("TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.");
90
102
  }
91
103
  try {
92
104
  const { address } = (await signer.getAccounts())[0];
93
105
  const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
94
- let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) });
106
+ let msg = this.msgSetWithdrawAddress({
107
+ value: MsgSetWithdrawAddress.fromPartial(value),
108
+ });
95
109
  return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
96
110
  }
97
111
  catch (e) {
98
- throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: ' + e.message);
112
+ throw new Error("TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: " +
113
+ e.message);
99
114
  }
100
115
  },
101
- msgWithdrawDelegatorReward({ value }) {
116
+ msgWithdrawDelegatorReward({ value, }) {
102
117
  try {
103
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial(value) };
118
+ return {
119
+ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
120
+ value: MsgWithdrawDelegatorReward.fromPartial(value),
121
+ };
104
122
  }
105
123
  catch (e) {
106
- throw new Error('TxClient:MsgWithdrawDelegatorReward: Could not create message: ' + e.message);
124
+ throw new Error("TxClient:MsgWithdrawDelegatorReward: Could not create message: " +
125
+ e.message);
107
126
  }
108
127
  },
109
- msgWithdrawValidatorCommission({ value }) {
128
+ msgWithdrawValidatorCommission({ value, }) {
110
129
  try {
111
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial(value) };
130
+ return {
131
+ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",
132
+ value: MsgWithdrawValidatorCommission.fromPartial(value),
133
+ };
112
134
  }
113
135
  catch (e) {
114
- throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message);
136
+ throw new Error("TxClient:MsgWithdrawValidatorCommission: Could not create message: " +
137
+ e.message);
115
138
  }
116
139
  },
117
140
  msgFundCommunityPool({ value }) {
118
141
  try {
119
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial(value) };
142
+ return {
143
+ typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool",
144
+ value: MsgFundCommunityPool.fromPartial(value),
145
+ };
120
146
  }
121
147
  catch (e) {
122
- throw new Error('TxClient:MsgFundCommunityPool: Could not create message: ' + e.message);
148
+ throw new Error("TxClient:MsgFundCommunityPool: Could not create message: " +
149
+ e.message);
123
150
  }
124
151
  },
125
- msgSetWithdrawAddress({ value }) {
152
+ msgSetWithdrawAddress({ value, }) {
126
153
  try {
127
- return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial(value) };
154
+ return {
155
+ typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
156
+ value: MsgSetWithdrawAddress.fromPartial(value),
157
+ };
128
158
  }
129
159
  catch (e) {
130
- throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message);
160
+ throw new Error("TxClient:MsgSetWithdrawAddress: Could not create message: " +
161
+ e.message);
131
162
  }
132
163
  },
133
164
  };
@@ -161,7 +192,7 @@ class SDKModule {
161
192
  DelegatorStartingInfoRecord: getStructure(typeDelegatorStartingInfoRecord.fromPartial({})),
162
193
  ValidatorSlashEventRecord: getStructure(typeValidatorSlashEventRecord.fromPartial({})),
163
194
  };
164
- client.on('signer-changed', (signer) => {
195
+ client.on("signer-changed", (signer) => {
165
196
  this.updateTX(client);
166
197
  });
167
198
  }
@@ -177,13 +208,12 @@ class SDKModule {
177
208
  }
178
209
  }
179
210
  }
180
- ;
181
211
  const Module = (test) => {
182
212
  return {
183
213
  module: {
184
- CosmosDistributionV1Beta1: new SDKModule(test)
214
+ CosmosDistributionV1Beta1: new SDKModule(test),
185
215
  },
186
- registry: msgTypes
216
+ registry: msgTypes,
187
217
  };
188
218
  };
189
219
  export default Module;