decentralcardgame-cardchain-client-ts 0.0.28 → 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.
- package/DecentralCardGame.cardchain.cardchain/module.js +428 -460
- package/DecentralCardGame.cardchain.cardchain/module.ts +1496 -1571
- package/DecentralCardGame.cardchain.cardchain/registry.js +74 -66
- package/DecentralCardGame.cardchain.cardchain/registry.ts +74 -66
- package/DecentralCardGame.cardchain.cardchain/rest.js +71 -0
- package/DecentralCardGame.cardchain.cardchain/rest.ts +132 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +6 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +6 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.js +81 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.ts +106 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.js +295 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.ts +354 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.js +16 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.ts +19 -1
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +447 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +570 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +504 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +613 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +50 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +48 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.js +58 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.ts +82 -0
- package/DecentralCardGame.cardchain.cardchain/types.js +5 -1
- package/DecentralCardGame.cardchain.cardchain/types.ts +8 -0
- package/DecentralCardGame.cardchain.featureflag/module.js +9 -7
- package/DecentralCardGame.cardchain.featureflag/module.ts +69 -65
- package/client.js +2 -5
- package/client.ts +164 -162
- package/cosmos.authz.v1beta1/module.js +33 -22
- package/cosmos.authz.v1beta1/module.ts +220 -148
- package/cosmos.distribution.v1beta1/module.js +65 -35
- package/cosmos.distribution.v1beta1/module.ts +354 -200
- package/cosmos.evidence.v1beta1/module.js +21 -13
- package/cosmos.evidence.v1beta1/module.ts +115 -86
- package/cosmos.gov.v1/module.js +48 -29
- package/cosmos.gov.v1/module.ts +275 -178
- package/cosmos.mint.v1beta1/module.js +9 -7
- package/cosmos.mint.v1beta1/module.ts +67 -63
- package/cosmos.nft.v1beta1/module.js +9 -7
- package/cosmos.nft.v1beta1/module.ts +75 -71
- package/cosmos.tx.v1beta1/module.js +9 -7
- package/cosmos.tx.v1beta1/module.ts +89 -85
- package/cosmos.vesting.v1beta1/module.js +52 -29
- package/cosmos.vesting.v1beta1/module.ts +249 -149
- package/ibc.applications.interchain_accounts.controller.v1/module.js +9 -7
- package/ibc.applications.interchain_accounts.controller.v1/module.ts +65 -61
- package/ibc.applications.transfer.v1/module.js +17 -12
- package/ibc.applications.transfer.v1/module.ts +114 -88
- package/ibc.core.channel.v1/module.js +1 -4
- package/ibc.core.channel.v1/module.ts +79 -81
- package/ibc.core.client.v1/module.js +1 -4
- package/ibc.core.client.v1/module.ts +81 -83
- package/ibc.core.connection.v1/module.js +6 -7
- package/ibc.core.connection.v1/module.ts +88 -84
- package/package.json +4 -1
- package/tsconfig.json +1 -1
package/cosmos.gov.v1/module.ts
CHANGED
|
@@ -2,82 +2,85 @@
|
|
|
2
2
|
|
|
3
3
|
import { StdFee } from "@cosmjs/amino";
|
|
4
4
|
import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
11
16
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
12
17
|
import { MsgDeposit } from "./types/cosmos/gov/v1/tx";
|
|
13
18
|
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
14
19
|
|
|
15
|
-
import { WeightedVoteOption as typeWeightedVoteOption} from "./types"
|
|
16
|
-
import { Deposit as typeDeposit} from "./types"
|
|
17
|
-
import { Proposal as typeProposal} from "./types"
|
|
18
|
-
import { TallyResult as typeTallyResult} from "./types"
|
|
19
|
-
import { Vote as typeVote} from "./types"
|
|
20
|
-
import { DepositParams as typeDepositParams} from "./types"
|
|
21
|
-
import { VotingParams as typeVotingParams} from "./types"
|
|
22
|
-
import { TallyParams as typeTallyParams} from "./types"
|
|
20
|
+
import { WeightedVoteOption as typeWeightedVoteOption } from "./types";
|
|
21
|
+
import { Deposit as typeDeposit } from "./types";
|
|
22
|
+
import { Proposal as typeProposal } from "./types";
|
|
23
|
+
import { TallyResult as typeTallyResult } from "./types";
|
|
24
|
+
import { Vote as typeVote } from "./types";
|
|
25
|
+
import { DepositParams as typeDepositParams } from "./types";
|
|
26
|
+
import { VotingParams as typeVotingParams } from "./types";
|
|
27
|
+
import { TallyParams as typeTallyParams } from "./types";
|
|
23
28
|
|
|
24
29
|
export { MsgSubmitProposal, MsgVote, MsgDeposit, MsgVoteWeighted };
|
|
25
30
|
|
|
26
31
|
type sendMsgSubmitProposalParams = {
|
|
27
|
-
value: MsgSubmitProposal
|
|
28
|
-
fee?: StdFee
|
|
29
|
-
memo?: string
|
|
32
|
+
value: MsgSubmitProposal;
|
|
33
|
+
fee?: StdFee;
|
|
34
|
+
memo?: string;
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
type sendMsgVoteParams = {
|
|
33
|
-
value: MsgVote
|
|
34
|
-
fee?: StdFee
|
|
35
|
-
memo?: string
|
|
38
|
+
value: MsgVote;
|
|
39
|
+
fee?: StdFee;
|
|
40
|
+
memo?: string;
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
type sendMsgDepositParams = {
|
|
39
|
-
value: MsgDeposit
|
|
40
|
-
fee?: StdFee
|
|
41
|
-
memo?: string
|
|
44
|
+
value: MsgDeposit;
|
|
45
|
+
fee?: StdFee;
|
|
46
|
+
memo?: string;
|
|
42
47
|
};
|
|
43
48
|
|
|
44
49
|
type sendMsgVoteWeightedParams = {
|
|
45
|
-
value: MsgVoteWeighted
|
|
46
|
-
fee?: StdFee
|
|
47
|
-
memo?: string
|
|
50
|
+
value: MsgVoteWeighted;
|
|
51
|
+
fee?: StdFee;
|
|
52
|
+
memo?: string;
|
|
48
53
|
};
|
|
49
54
|
|
|
50
|
-
|
|
51
55
|
type msgSubmitProposalParams = {
|
|
52
|
-
value: MsgSubmitProposal
|
|
56
|
+
value: MsgSubmitProposal;
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
type msgVoteParams = {
|
|
56
|
-
value: MsgVote
|
|
60
|
+
value: MsgVote;
|
|
57
61
|
};
|
|
58
62
|
|
|
59
63
|
type msgDepositParams = {
|
|
60
|
-
value: MsgDeposit
|
|
64
|
+
value: MsgDeposit;
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
type msgVoteWeightedParams = {
|
|
64
|
-
value: MsgVoteWeighted
|
|
68
|
+
value: MsgVoteWeighted;
|
|
65
69
|
};
|
|
66
70
|
|
|
67
|
-
|
|
68
71
|
export const registry = new Registry(msgTypes);
|
|
69
72
|
|
|
70
73
|
type Field = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
+
name: string;
|
|
75
|
+
type: unknown;
|
|
76
|
+
};
|
|
74
77
|
function getStructure(template) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const structure: { fields: Field[] } = { fields: [] };
|
|
79
|
+
for (let [key, value] of Object.entries(template)) {
|
|
80
|
+
let field = { name: key, type: typeof value };
|
|
81
|
+
structure.fields.push(field);
|
|
82
|
+
}
|
|
83
|
+
return structure;
|
|
81
84
|
}
|
|
82
85
|
const defaultFee = {
|
|
83
86
|
amount: [],
|
|
@@ -85,160 +88,254 @@ const defaultFee = {
|
|
|
85
88
|
};
|
|
86
89
|
|
|
87
90
|
interface TxClientOptions {
|
|
88
|
-
addr: string
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
addr: string;
|
|
92
|
+
prefix: string;
|
|
93
|
+
signer?: OfflineSigner;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
export const txClient = (
|
|
94
|
-
|
|
96
|
+
export const txClient = (
|
|
97
|
+
{ signer, prefix, addr }: TxClientOptions = {
|
|
98
|
+
addr: "http://localhost:26657",
|
|
99
|
+
prefix: "cosmos",
|
|
100
|
+
},
|
|
101
|
+
) => {
|
|
95
102
|
return {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
103
|
+
async sendMsgSubmitProposal({
|
|
104
|
+
value,
|
|
105
|
+
fee,
|
|
106
|
+
memo,
|
|
107
|
+
}: sendMsgSubmitProposalParams): Promise<DeliverTxResponse> {
|
|
108
|
+
if (!signer) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
"TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.",
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const { address } = (await signer.getAccounts())[0];
|
|
115
|
+
const signingClient = await SigningStargateClient.connectWithSigner(
|
|
116
|
+
addr,
|
|
117
|
+
signer,
|
|
118
|
+
{ registry, prefix },
|
|
119
|
+
);
|
|
120
|
+
let msg = this.msgSubmitProposal({
|
|
121
|
+
value: MsgSubmitProposal.fromPartial(value),
|
|
122
|
+
});
|
|
123
|
+
return await signingClient.signAndBroadcast(
|
|
124
|
+
address,
|
|
125
|
+
[msg],
|
|
126
|
+
fee ? fee : defaultFee,
|
|
127
|
+
memo,
|
|
128
|
+
);
|
|
129
|
+
} catch (e: any) {
|
|
130
|
+
throw new Error(
|
|
131
|
+
"TxClient:sendMsgSubmitProposal: Could not broadcast Tx: " +
|
|
132
|
+
e.message,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
async sendMsgVote({
|
|
138
|
+
value,
|
|
139
|
+
fee,
|
|
140
|
+
memo,
|
|
141
|
+
}: sendMsgVoteParams): Promise<DeliverTxResponse> {
|
|
142
|
+
if (!signer) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
"TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.",
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
const { address } = (await signer.getAccounts())[0];
|
|
149
|
+
const signingClient = await SigningStargateClient.connectWithSigner(
|
|
150
|
+
addr,
|
|
151
|
+
signer,
|
|
152
|
+
{ registry, prefix },
|
|
153
|
+
);
|
|
154
|
+
let msg = this.msgVote({ value: MsgVote.fromPartial(value) });
|
|
155
|
+
return await signingClient.signAndBroadcast(
|
|
156
|
+
address,
|
|
157
|
+
[msg],
|
|
158
|
+
fee ? fee : defaultFee,
|
|
159
|
+
memo,
|
|
160
|
+
);
|
|
161
|
+
} catch (e: any) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
"TxClient:sendMsgVote: Could not broadcast Tx: " + e.message,
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
async sendMsgDeposit({
|
|
169
|
+
value,
|
|
170
|
+
fee,
|
|
171
|
+
memo,
|
|
172
|
+
}: sendMsgDepositParams): Promise<DeliverTxResponse> {
|
|
173
|
+
if (!signer) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
"TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.",
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const { address } = (await signer.getAccounts())[0];
|
|
180
|
+
const signingClient = await SigningStargateClient.connectWithSigner(
|
|
181
|
+
addr,
|
|
182
|
+
signer,
|
|
183
|
+
{ registry, prefix },
|
|
184
|
+
);
|
|
185
|
+
let msg = this.msgDeposit({ value: MsgDeposit.fromPartial(value) });
|
|
186
|
+
return await signingClient.signAndBroadcast(
|
|
187
|
+
address,
|
|
188
|
+
[msg],
|
|
189
|
+
fee ? fee : defaultFee,
|
|
190
|
+
memo,
|
|
191
|
+
);
|
|
192
|
+
} catch (e: any) {
|
|
193
|
+
throw new Error(
|
|
194
|
+
"TxClient:sendMsgDeposit: Could not broadcast Tx: " + e.message,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
async sendMsgVoteWeighted({
|
|
200
|
+
value,
|
|
201
|
+
fee,
|
|
202
|
+
memo,
|
|
203
|
+
}: sendMsgVoteWeightedParams): Promise<DeliverTxResponse> {
|
|
204
|
+
if (!signer) {
|
|
205
|
+
throw new Error(
|
|
206
|
+
"TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.",
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
const { address } = (await signer.getAccounts())[0];
|
|
211
|
+
const signingClient = await SigningStargateClient.connectWithSigner(
|
|
212
|
+
addr,
|
|
213
|
+
signer,
|
|
214
|
+
{ registry, prefix },
|
|
215
|
+
);
|
|
216
|
+
let msg = this.msgVoteWeighted({
|
|
217
|
+
value: MsgVoteWeighted.fromPartial(value),
|
|
218
|
+
});
|
|
219
|
+
return await signingClient.signAndBroadcast(
|
|
220
|
+
address,
|
|
221
|
+
[msg],
|
|
222
|
+
fee ? fee : defaultFee,
|
|
223
|
+
memo,
|
|
224
|
+
);
|
|
225
|
+
} catch (e: any) {
|
|
226
|
+
throw new Error(
|
|
227
|
+
"TxClient:sendMsgVoteWeighted: Could not broadcast Tx: " + e.message,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject {
|
|
233
|
+
try {
|
|
234
|
+
return {
|
|
235
|
+
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
236
|
+
value: MsgSubmitProposal.fromPartial(value),
|
|
237
|
+
};
|
|
238
|
+
} catch (e: any) {
|
|
239
|
+
throw new Error(
|
|
240
|
+
"TxClient:MsgSubmitProposal: Could not create message: " + e.message,
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
msgVote({ value }: msgVoteParams): EncodeObject {
|
|
246
|
+
try {
|
|
247
|
+
return {
|
|
248
|
+
typeUrl: "/cosmos.gov.v1.MsgVote",
|
|
249
|
+
value: MsgVote.fromPartial(value),
|
|
250
|
+
};
|
|
251
|
+
} catch (e: any) {
|
|
252
|
+
throw new Error(
|
|
253
|
+
"TxClient:MsgVote: Could not create message: " + e.message,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
msgDeposit({ value }: msgDepositParams): EncodeObject {
|
|
259
|
+
try {
|
|
260
|
+
return {
|
|
261
|
+
typeUrl: "/cosmos.gov.v1.MsgDeposit",
|
|
262
|
+
value: MsgDeposit.fromPartial(value),
|
|
263
|
+
};
|
|
264
|
+
} catch (e: any) {
|
|
265
|
+
throw new Error(
|
|
266
|
+
"TxClient:MsgDeposit: Could not create message: " + e.message,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject {
|
|
272
|
+
try {
|
|
273
|
+
return {
|
|
274
|
+
typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
|
|
275
|
+
value: MsgVoteWeighted.fromPartial(value),
|
|
276
|
+
};
|
|
277
|
+
} catch (e: any) {
|
|
278
|
+
throw new Error(
|
|
279
|
+
"TxClient:MsgVoteWeighted: Could not create message: " + e.message,
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
};
|
|
187
284
|
};
|
|
188
285
|
|
|
189
286
|
interface QueryClientOptions {
|
|
190
|
-
addr: string
|
|
287
|
+
addr: string;
|
|
191
288
|
}
|
|
192
289
|
|
|
193
|
-
export const queryClient = (
|
|
290
|
+
export const queryClient = (
|
|
291
|
+
{ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" },
|
|
292
|
+
) => {
|
|
194
293
|
return new Api({ baseURL: addr });
|
|
195
294
|
};
|
|
196
295
|
|
|
197
296
|
class SDKModule {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
updateTX(client: IgniteClient) {
|
|
297
|
+
public query: ReturnType<typeof queryClient>;
|
|
298
|
+
public tx: ReturnType<typeof txClient>;
|
|
299
|
+
public structure: Record<string, unknown>;
|
|
300
|
+
public registry: Array<[string, GeneratedType]> = [];
|
|
301
|
+
|
|
302
|
+
constructor(client: IgniteClient) {
|
|
303
|
+
this.query = queryClient({ addr: client.env.apiURL });
|
|
304
|
+
this.updateTX(client);
|
|
305
|
+
this.structure = {
|
|
306
|
+
WeightedVoteOption: getStructure(typeWeightedVoteOption.fromPartial({})),
|
|
307
|
+
Deposit: getStructure(typeDeposit.fromPartial({})),
|
|
308
|
+
Proposal: getStructure(typeProposal.fromPartial({})),
|
|
309
|
+
TallyResult: getStructure(typeTallyResult.fromPartial({})),
|
|
310
|
+
Vote: getStructure(typeVote.fromPartial({})),
|
|
311
|
+
DepositParams: getStructure(typeDepositParams.fromPartial({})),
|
|
312
|
+
VotingParams: getStructure(typeVotingParams.fromPartial({})),
|
|
313
|
+
TallyParams: getStructure(typeTallyParams.fromPartial({})),
|
|
314
|
+
};
|
|
315
|
+
client.on("signer-changed", (signer) => {
|
|
316
|
+
this.updateTX(client);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
updateTX(client: IgniteClient) {
|
|
223
320
|
const methods = txClient({
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
})
|
|
228
|
-
|
|
321
|
+
signer: client.signer,
|
|
322
|
+
addr: client.env.rpcURL,
|
|
323
|
+
prefix: client.env.prefix ?? "cosmos",
|
|
324
|
+
});
|
|
325
|
+
|
|
229
326
|
this.tx = methods;
|
|
230
327
|
for (let m in methods) {
|
|
231
|
-
|
|
328
|
+
this.tx[m] = methods[m].bind(this.tx);
|
|
232
329
|
}
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
const Module = (test: IgniteClient) => {
|
|
237
|
-
return {
|
|
238
|
-
module: {
|
|
239
|
-
CosmosGovV1: new SDKModule(test)
|
|
240
|
-
},
|
|
241
|
-
registry: msgTypes
|
|
242
330
|
}
|
|
243
331
|
}
|
|
244
|
-
|
|
332
|
+
|
|
333
|
+
const Module = (test: IgniteClient) => {
|
|
334
|
+
return {
|
|
335
|
+
module: {
|
|
336
|
+
CosmosGovV1: new SDKModule(test),
|
|
337
|
+
},
|
|
338
|
+
registry: msgTypes,
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
export default Module;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by Ignite ignite.com/cli
|
|
2
|
-
import { Registry } from "@cosmjs/proto-signing";
|
|
3
|
-
import { msgTypes } from
|
|
2
|
+
import { Registry, } from "@cosmjs/proto-signing";
|
|
3
|
+
import { msgTypes } from "./registry";
|
|
4
4
|
import { Api } from "./rest";
|
|
5
5
|
import { Minter as typeMinter } from "./types";
|
|
6
6
|
import { Params as typeParams } from "./types";
|
|
@@ -17,7 +17,10 @@ const defaultFee = {
|
|
|
17
17
|
amount: [],
|
|
18
18
|
gas: "200000",
|
|
19
19
|
};
|
|
20
|
-
export const txClient = ({ signer, prefix, addr } = {
|
|
20
|
+
export const txClient = ({ signer, prefix, addr } = {
|
|
21
|
+
addr: "http://localhost:26657",
|
|
22
|
+
prefix: "cosmos",
|
|
23
|
+
}) => {
|
|
21
24
|
return {};
|
|
22
25
|
};
|
|
23
26
|
export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {
|
|
@@ -32,7 +35,7 @@ class SDKModule {
|
|
|
32
35
|
Minter: getStructure(typeMinter.fromPartial({})),
|
|
33
36
|
Params: getStructure(typeParams.fromPartial({})),
|
|
34
37
|
};
|
|
35
|
-
client.on(
|
|
38
|
+
client.on("signer-changed", (signer) => {
|
|
36
39
|
this.updateTX(client);
|
|
37
40
|
});
|
|
38
41
|
}
|
|
@@ -48,13 +51,12 @@ class SDKModule {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
;
|
|
52
54
|
const Module = (test) => {
|
|
53
55
|
return {
|
|
54
56
|
module: {
|
|
55
|
-
CosmosMintV1Beta1: new SDKModule(test)
|
|
57
|
+
CosmosMintV1Beta1: new SDKModule(test),
|
|
56
58
|
},
|
|
57
|
-
registry: msgTypes
|
|
59
|
+
registry: msgTypes,
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
62
|
export default Module;
|