decentralcardgame-cardchain-client-ts 0.0.3 → 0.0.4
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 +1044 -0
- package/DecentralCardGame.cardchain.cardchain/registry.js +72 -70
- package/DecentralCardGame.cardchain.cardchain/rest.js +1 -1
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +30 -6
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.js +11 -17
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +1 -217
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +166 -8
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +7 -65
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/params.js +30 -10
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/tx.js +4137 -0
- package/DecentralCardGame.cardchain.cardchain/types.js +22 -21
- package/client.js +2 -1
- package/cosmos.authz.v1beta1/module.js +19 -19
- package/cosmos.authz.v1beta1/registry.js +2 -2
- package/cosmos.distribution.v1beta1/module.js +24 -24
- package/cosmos.distribution.v1beta1/registry.js +4 -4
- package/cosmos.gov.v1/module.js +31 -31
- package/cosmos.gov.v1/registry.js +4 -4
- package/cosmos.gov.v1beta1/module.js +22 -22
- package/cosmos.gov.v1beta1/registry.js +2 -2
- package/cosmos.group.v1/module.js +102 -102
- package/cosmos.group.v1/registry.js +14 -14
- package/cosmos.group.v1/rest.js +15 -0
- package/cosmos.group.v1/types/cosmos/group/v1/query.js +110 -0
- package/cosmos.staking.v1beta1/module.js +40 -40
- package/cosmos.staking.v1beta1/registry.js +8 -8
- package/cosmos.vesting.v1beta1/module.js +16 -16
- package/cosmos.vesting.v1beta1/registry.js +2 -2
- package/ibc.applications.interchain_accounts.controller.v1/rest.js +9 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/google/protobuf/any.js +99 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/tx.js +266 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/v1/packet.js +192 -0
- package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.js +24 -6
- package/ibc.core.client.v1/rest.js +14 -14
- package/ibc.core.connection.v1/rest.js +14 -0
- package/ibc.core.connection.v1/types/ibc/core/connection/v1/query.js +83 -1
- package/package.json +2 -2
- package/tsconfig.json +0 -1
|
@@ -3,20 +3,20 @@ 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 { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx";
|
|
7
|
+
import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx";
|
|
6
8
|
import { MsgUpdateGroupPolicyDecisionPolicy } from "./types/cosmos/group/v1/tx";
|
|
9
|
+
import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx";
|
|
10
|
+
import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx";
|
|
7
11
|
import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx";
|
|
8
12
|
import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx";
|
|
9
|
-
import { MsgCreateGroup } from "./types/cosmos/group/v1/tx";
|
|
10
|
-
import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx";
|
|
11
13
|
import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx";
|
|
14
|
+
import { MsgCreateGroup } from "./types/cosmos/group/v1/tx";
|
|
12
15
|
import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx";
|
|
13
|
-
import { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx";
|
|
14
16
|
import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx";
|
|
15
|
-
import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx";
|
|
16
|
-
import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx";
|
|
17
|
-
import { MsgVote } from "./types/cosmos/group/v1/tx";
|
|
18
|
-
import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx";
|
|
19
17
|
import { MsgExec } from "./types/cosmos/group/v1/tx";
|
|
18
|
+
import { MsgVote } from "./types/cosmos/group/v1/tx";
|
|
19
|
+
import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx";
|
|
20
20
|
import { EventCreateGroup as typeEventCreateGroup } from "./types";
|
|
21
21
|
import { EventUpdateGroup as typeEventUpdateGroup } from "./types";
|
|
22
22
|
import { EventCreateGroupPolicy as typeEventCreateGroupPolicy } from "./types";
|
|
@@ -37,7 +37,7 @@ import { GroupPolicyInfo as typeGroupPolicyInfo } from "./types";
|
|
|
37
37
|
import { Proposal as typeProposal } from "./types";
|
|
38
38
|
import { TallyResult as typeTallyResult } from "./types";
|
|
39
39
|
import { Vote as typeVote } from "./types";
|
|
40
|
-
export { MsgUpdateGroupPolicyDecisionPolicy,
|
|
40
|
+
export { MsgUpdateGroupMembers, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgCreateGroupPolicy, MsgSubmitProposal, MsgWithdrawProposal, MsgCreateGroupWithPolicy, MsgCreateGroup, MsgUpdateGroupMetadata, MsgUpdateGroupAdmin, MsgExec, MsgVote, MsgLeaveGroup };
|
|
41
41
|
export const registry = new Registry(msgTypes);
|
|
42
42
|
function getStructure(template) {
|
|
43
43
|
const structure = { fields: [] };
|
|
@@ -53,6 +53,34 @@ const defaultFee = {
|
|
|
53
53
|
};
|
|
54
54
|
export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
|
|
55
55
|
return {
|
|
56
|
+
async sendMsgUpdateGroupMembers({ value, fee, memo }) {
|
|
57
|
+
if (!signer) {
|
|
58
|
+
throw new Error('TxClient:sendMsgUpdateGroupMembers: Unable to sign Tx. Signer is not present.');
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const { address } = (await signer.getAccounts())[0];
|
|
62
|
+
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
63
|
+
let msg = this.msgUpdateGroupMembers({ value: MsgUpdateGroupMembers.fromPartial(value) });
|
|
64
|
+
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
throw new Error('TxClient:sendMsgUpdateGroupMembers: Could not broadcast Tx: ' + e.message);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
async sendMsgUpdateGroupPolicyAdmin({ value, fee, memo }) {
|
|
71
|
+
if (!signer) {
|
|
72
|
+
throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Unable to sign Tx. Signer is not present.');
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const { address } = (await signer.getAccounts())[0];
|
|
76
|
+
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
77
|
+
let msg = this.msgUpdateGroupPolicyAdmin({ value: MsgUpdateGroupPolicyAdmin.fromPartial(value) });
|
|
78
|
+
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
throw new Error('TxClient:sendMsgUpdateGroupPolicyAdmin: Could not broadcast Tx: ' + e.message);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
56
84
|
async sendMsgUpdateGroupPolicyDecisionPolicy({ value, fee, memo }) {
|
|
57
85
|
if (!signer) {
|
|
58
86
|
throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Unable to sign Tx. Signer is not present.');
|
|
@@ -67,60 +95,60 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
67
95
|
throw new Error('TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Could not broadcast Tx: ' + e.message);
|
|
68
96
|
}
|
|
69
97
|
},
|
|
70
|
-
async
|
|
98
|
+
async sendMsgUpdateGroupPolicyMetadata({ value, fee, memo }) {
|
|
71
99
|
if (!signer) {
|
|
72
|
-
throw new Error('TxClient:
|
|
100
|
+
throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.');
|
|
73
101
|
}
|
|
74
102
|
try {
|
|
75
103
|
const { address } = (await signer.getAccounts())[0];
|
|
76
104
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
77
|
-
let msg = this.
|
|
105
|
+
let msg = this.msgUpdateGroupPolicyMetadata({ value: MsgUpdateGroupPolicyMetadata.fromPartial(value) });
|
|
78
106
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
79
107
|
}
|
|
80
108
|
catch (e) {
|
|
81
|
-
throw new Error('TxClient:
|
|
109
|
+
throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: ' + e.message);
|
|
82
110
|
}
|
|
83
111
|
},
|
|
84
|
-
async
|
|
112
|
+
async sendMsgCreateGroupPolicy({ value, fee, memo }) {
|
|
85
113
|
if (!signer) {
|
|
86
|
-
throw new Error('TxClient:
|
|
114
|
+
throw new Error('TxClient:sendMsgCreateGroupPolicy: Unable to sign Tx. Signer is not present.');
|
|
87
115
|
}
|
|
88
116
|
try {
|
|
89
117
|
const { address } = (await signer.getAccounts())[0];
|
|
90
118
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
91
|
-
let msg = this.
|
|
119
|
+
let msg = this.msgCreateGroupPolicy({ value: MsgCreateGroupPolicy.fromPartial(value) });
|
|
92
120
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
93
121
|
}
|
|
94
122
|
catch (e) {
|
|
95
|
-
throw new Error('TxClient:
|
|
123
|
+
throw new Error('TxClient:sendMsgCreateGroupPolicy: Could not broadcast Tx: ' + e.message);
|
|
96
124
|
}
|
|
97
125
|
},
|
|
98
|
-
async
|
|
126
|
+
async sendMsgSubmitProposal({ value, fee, memo }) {
|
|
99
127
|
if (!signer) {
|
|
100
|
-
throw new Error('TxClient:
|
|
128
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.');
|
|
101
129
|
}
|
|
102
130
|
try {
|
|
103
131
|
const { address } = (await signer.getAccounts())[0];
|
|
104
132
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
105
|
-
let msg = this.
|
|
133
|
+
let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) });
|
|
106
134
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
107
135
|
}
|
|
108
136
|
catch (e) {
|
|
109
|
-
throw new Error('TxClient:
|
|
137
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: ' + e.message);
|
|
110
138
|
}
|
|
111
139
|
},
|
|
112
|
-
async
|
|
140
|
+
async sendMsgWithdrawProposal({ value, fee, memo }) {
|
|
113
141
|
if (!signer) {
|
|
114
|
-
throw new Error('TxClient:
|
|
142
|
+
throw new Error('TxClient:sendMsgWithdrawProposal: Unable to sign Tx. Signer is not present.');
|
|
115
143
|
}
|
|
116
144
|
try {
|
|
117
145
|
const { address } = (await signer.getAccounts())[0];
|
|
118
146
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
119
|
-
let msg = this.
|
|
147
|
+
let msg = this.msgWithdrawProposal({ value: MsgWithdrawProposal.fromPartial(value) });
|
|
120
148
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
121
149
|
}
|
|
122
150
|
catch (e) {
|
|
123
|
-
throw new Error('TxClient:
|
|
151
|
+
throw new Error('TxClient:sendMsgWithdrawProposal: Could not broadcast Tx: ' + e.message);
|
|
124
152
|
}
|
|
125
153
|
},
|
|
126
154
|
async sendMsgCreateGroupWithPolicy({ value, fee, memo }) {
|
|
@@ -137,32 +165,32 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
137
165
|
throw new Error('TxClient:sendMsgCreateGroupWithPolicy: Could not broadcast Tx: ' + e.message);
|
|
138
166
|
}
|
|
139
167
|
},
|
|
140
|
-
async
|
|
168
|
+
async sendMsgCreateGroup({ value, fee, memo }) {
|
|
141
169
|
if (!signer) {
|
|
142
|
-
throw new Error('TxClient:
|
|
170
|
+
throw new Error('TxClient:sendMsgCreateGroup: Unable to sign Tx. Signer is not present.');
|
|
143
171
|
}
|
|
144
172
|
try {
|
|
145
173
|
const { address } = (await signer.getAccounts())[0];
|
|
146
174
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
147
|
-
let msg = this.
|
|
175
|
+
let msg = this.msgCreateGroup({ value: MsgCreateGroup.fromPartial(value) });
|
|
148
176
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
149
177
|
}
|
|
150
178
|
catch (e) {
|
|
151
|
-
throw new Error('TxClient:
|
|
179
|
+
throw new Error('TxClient:sendMsgCreateGroup: Could not broadcast Tx: ' + e.message);
|
|
152
180
|
}
|
|
153
181
|
},
|
|
154
|
-
async
|
|
182
|
+
async sendMsgUpdateGroupMetadata({ value, fee, memo }) {
|
|
155
183
|
if (!signer) {
|
|
156
|
-
throw new Error('TxClient:
|
|
184
|
+
throw new Error('TxClient:sendMsgUpdateGroupMetadata: Unable to sign Tx. Signer is not present.');
|
|
157
185
|
}
|
|
158
186
|
try {
|
|
159
187
|
const { address } = (await signer.getAccounts())[0];
|
|
160
188
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
161
|
-
let msg = this.
|
|
189
|
+
let msg = this.msgUpdateGroupMetadata({ value: MsgUpdateGroupMetadata.fromPartial(value) });
|
|
162
190
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
163
191
|
}
|
|
164
192
|
catch (e) {
|
|
165
|
-
throw new Error('TxClient:
|
|
193
|
+
throw new Error('TxClient:sendMsgUpdateGroupMetadata: Could not broadcast Tx: ' + e.message);
|
|
166
194
|
}
|
|
167
195
|
},
|
|
168
196
|
async sendMsgUpdateGroupAdmin({ value, fee, memo }) {
|
|
@@ -179,32 +207,18 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
179
207
|
throw new Error('TxClient:sendMsgUpdateGroupAdmin: Could not broadcast Tx: ' + e.message);
|
|
180
208
|
}
|
|
181
209
|
},
|
|
182
|
-
async
|
|
183
|
-
if (!signer) {
|
|
184
|
-
throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.');
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
const { address } = (await signer.getAccounts())[0];
|
|
188
|
-
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
189
|
-
let msg = this.msgUpdateGroupPolicyMetadata({ value: MsgUpdateGroupPolicyMetadata.fromPartial(value) });
|
|
190
|
-
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
191
|
-
}
|
|
192
|
-
catch (e) {
|
|
193
|
-
throw new Error('TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: ' + e.message);
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
async sendMsgLeaveGroup({ value, fee, memo }) {
|
|
210
|
+
async sendMsgExec({ value, fee, memo }) {
|
|
197
211
|
if (!signer) {
|
|
198
|
-
throw new Error('TxClient:
|
|
212
|
+
throw new Error('TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.');
|
|
199
213
|
}
|
|
200
214
|
try {
|
|
201
215
|
const { address } = (await signer.getAccounts())[0];
|
|
202
216
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
203
|
-
let msg = this.
|
|
217
|
+
let msg = this.msgExec({ value: MsgExec.fromPartial(value) });
|
|
204
218
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
205
219
|
}
|
|
206
220
|
catch (e) {
|
|
207
|
-
throw new Error('TxClient:
|
|
221
|
+
throw new Error('TxClient:sendMsgExec: Could not broadcast Tx: ' + e.message);
|
|
208
222
|
}
|
|
209
223
|
},
|
|
210
224
|
async sendMsgVote({ value, fee, memo }) {
|
|
@@ -221,32 +235,34 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
221
235
|
throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: ' + e.message);
|
|
222
236
|
}
|
|
223
237
|
},
|
|
224
|
-
async
|
|
238
|
+
async sendMsgLeaveGroup({ value, fee, memo }) {
|
|
225
239
|
if (!signer) {
|
|
226
|
-
throw new Error('TxClient:
|
|
240
|
+
throw new Error('TxClient:sendMsgLeaveGroup: Unable to sign Tx. Signer is not present.');
|
|
227
241
|
}
|
|
228
242
|
try {
|
|
229
243
|
const { address } = (await signer.getAccounts())[0];
|
|
230
244
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
231
|
-
let msg = this.
|
|
245
|
+
let msg = this.msgLeaveGroup({ value: MsgLeaveGroup.fromPartial(value) });
|
|
232
246
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
233
247
|
}
|
|
234
248
|
catch (e) {
|
|
235
|
-
throw new Error('TxClient:
|
|
249
|
+
throw new Error('TxClient:sendMsgLeaveGroup: Could not broadcast Tx: ' + e.message);
|
|
236
250
|
}
|
|
237
251
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
252
|
+
msgUpdateGroupMembers({ value }) {
|
|
253
|
+
try {
|
|
254
|
+
return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", value: MsgUpdateGroupMembers.fromPartial(value) };
|
|
241
255
|
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
throw new Error('TxClient:MsgUpdateGroupMembers: Could not create message: ' + e.message);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
msgUpdateGroupPolicyAdmin({ value }) {
|
|
242
261
|
try {
|
|
243
|
-
|
|
244
|
-
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
245
|
-
let msg = this.msgExec({ value: MsgExec.fromPartial(value) });
|
|
246
|
-
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
262
|
+
return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", value: MsgUpdateGroupPolicyAdmin.fromPartial(value) };
|
|
247
263
|
}
|
|
248
264
|
catch (e) {
|
|
249
|
-
throw new Error('TxClient:
|
|
265
|
+
throw new Error('TxClient:MsgUpdateGroupPolicyAdmin: Could not create message: ' + e.message);
|
|
250
266
|
}
|
|
251
267
|
},
|
|
252
268
|
msgUpdateGroupPolicyDecisionPolicy({ value }) {
|
|
@@ -257,36 +273,36 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
257
273
|
throw new Error('TxClient:MsgUpdateGroupPolicyDecisionPolicy: Could not create message: ' + e.message);
|
|
258
274
|
}
|
|
259
275
|
},
|
|
260
|
-
|
|
276
|
+
msgUpdateGroupPolicyMetadata({ value }) {
|
|
261
277
|
try {
|
|
262
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
278
|
+
return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", value: MsgUpdateGroupPolicyMetadata.fromPartial(value) };
|
|
263
279
|
}
|
|
264
280
|
catch (e) {
|
|
265
|
-
throw new Error('TxClient:
|
|
281
|
+
throw new Error('TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: ' + e.message);
|
|
266
282
|
}
|
|
267
283
|
},
|
|
268
|
-
|
|
284
|
+
msgCreateGroupPolicy({ value }) {
|
|
269
285
|
try {
|
|
270
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
286
|
+
return { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", value: MsgCreateGroupPolicy.fromPartial(value) };
|
|
271
287
|
}
|
|
272
288
|
catch (e) {
|
|
273
|
-
throw new Error('TxClient:
|
|
289
|
+
throw new Error('TxClient:MsgCreateGroupPolicy: Could not create message: ' + e.message);
|
|
274
290
|
}
|
|
275
291
|
},
|
|
276
|
-
|
|
292
|
+
msgSubmitProposal({ value }) {
|
|
277
293
|
try {
|
|
278
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
294
|
+
return { typeUrl: "/cosmos.group.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial(value) };
|
|
279
295
|
}
|
|
280
296
|
catch (e) {
|
|
281
|
-
throw new Error('TxClient:
|
|
297
|
+
throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message);
|
|
282
298
|
}
|
|
283
299
|
},
|
|
284
|
-
|
|
300
|
+
msgWithdrawProposal({ value }) {
|
|
285
301
|
try {
|
|
286
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
302
|
+
return { typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", value: MsgWithdrawProposal.fromPartial(value) };
|
|
287
303
|
}
|
|
288
304
|
catch (e) {
|
|
289
|
-
throw new Error('TxClient:
|
|
305
|
+
throw new Error('TxClient:MsgWithdrawProposal: Could not create message: ' + e.message);
|
|
290
306
|
}
|
|
291
307
|
},
|
|
292
308
|
msgCreateGroupWithPolicy({ value }) {
|
|
@@ -297,20 +313,20 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
297
313
|
throw new Error('TxClient:MsgCreateGroupWithPolicy: Could not create message: ' + e.message);
|
|
298
314
|
}
|
|
299
315
|
},
|
|
300
|
-
|
|
316
|
+
msgCreateGroup({ value }) {
|
|
301
317
|
try {
|
|
302
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
318
|
+
return { typeUrl: "/cosmos.group.v1.MsgCreateGroup", value: MsgCreateGroup.fromPartial(value) };
|
|
303
319
|
}
|
|
304
320
|
catch (e) {
|
|
305
|
-
throw new Error('TxClient:
|
|
321
|
+
throw new Error('TxClient:MsgCreateGroup: Could not create message: ' + e.message);
|
|
306
322
|
}
|
|
307
323
|
},
|
|
308
|
-
|
|
324
|
+
msgUpdateGroupMetadata({ value }) {
|
|
309
325
|
try {
|
|
310
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
326
|
+
return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", value: MsgUpdateGroupMetadata.fromPartial(value) };
|
|
311
327
|
}
|
|
312
328
|
catch (e) {
|
|
313
|
-
throw new Error('TxClient:
|
|
329
|
+
throw new Error('TxClient:MsgUpdateGroupMetadata: Could not create message: ' + e.message);
|
|
314
330
|
}
|
|
315
331
|
},
|
|
316
332
|
msgUpdateGroupAdmin({ value }) {
|
|
@@ -321,20 +337,12 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
321
337
|
throw new Error('TxClient:MsgUpdateGroupAdmin: Could not create message: ' + e.message);
|
|
322
338
|
}
|
|
323
339
|
},
|
|
324
|
-
|
|
325
|
-
try {
|
|
326
|
-
return { typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", value: MsgUpdateGroupPolicyMetadata.fromPartial(value) };
|
|
327
|
-
}
|
|
328
|
-
catch (e) {
|
|
329
|
-
throw new Error('TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: ' + e.message);
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
msgLeaveGroup({ value }) {
|
|
340
|
+
msgExec({ value }) {
|
|
333
341
|
try {
|
|
334
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
342
|
+
return { typeUrl: "/cosmos.group.v1.MsgExec", value: MsgExec.fromPartial(value) };
|
|
335
343
|
}
|
|
336
344
|
catch (e) {
|
|
337
|
-
throw new Error('TxClient:
|
|
345
|
+
throw new Error('TxClient:MsgExec: Could not create message: ' + e.message);
|
|
338
346
|
}
|
|
339
347
|
},
|
|
340
348
|
msgVote({ value }) {
|
|
@@ -345,20 +353,12 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
345
353
|
throw new Error('TxClient:MsgVote: Could not create message: ' + e.message);
|
|
346
354
|
}
|
|
347
355
|
},
|
|
348
|
-
|
|
349
|
-
try {
|
|
350
|
-
return { typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", value: MsgCreateGroupPolicy.fromPartial(value) };
|
|
351
|
-
}
|
|
352
|
-
catch (e) {
|
|
353
|
-
throw new Error('TxClient:MsgCreateGroupPolicy: Could not create message: ' + e.message);
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
msgExec({ value }) {
|
|
356
|
+
msgLeaveGroup({ value }) {
|
|
357
357
|
try {
|
|
358
|
-
return { typeUrl: "/cosmos.group.v1.
|
|
358
|
+
return { typeUrl: "/cosmos.group.v1.MsgLeaveGroup", value: MsgLeaveGroup.fromPartial(value) };
|
|
359
359
|
}
|
|
360
360
|
catch (e) {
|
|
361
|
-
throw new Error('TxClient:
|
|
361
|
+
throw new Error('TxClient:MsgLeaveGroup: Could not create message: ' + e.message);
|
|
362
362
|
}
|
|
363
363
|
},
|
|
364
364
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
+
import { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx";
|
|
2
|
+
import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx";
|
|
1
3
|
import { MsgUpdateGroupPolicyDecisionPolicy } from "./types/cosmos/group/v1/tx";
|
|
4
|
+
import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx";
|
|
5
|
+
import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx";
|
|
2
6
|
import { MsgSubmitProposal } from "./types/cosmos/group/v1/tx";
|
|
3
7
|
import { MsgWithdrawProposal } from "./types/cosmos/group/v1/tx";
|
|
4
|
-
import { MsgCreateGroup } from "./types/cosmos/group/v1/tx";
|
|
5
|
-
import { MsgUpdateGroupPolicyAdmin } from "./types/cosmos/group/v1/tx";
|
|
6
8
|
import { MsgCreateGroupWithPolicy } from "./types/cosmos/group/v1/tx";
|
|
9
|
+
import { MsgCreateGroup } from "./types/cosmos/group/v1/tx";
|
|
7
10
|
import { MsgUpdateGroupMetadata } from "./types/cosmos/group/v1/tx";
|
|
8
|
-
import { MsgUpdateGroupMembers } from "./types/cosmos/group/v1/tx";
|
|
9
11
|
import { MsgUpdateGroupAdmin } from "./types/cosmos/group/v1/tx";
|
|
10
|
-
import { MsgUpdateGroupPolicyMetadata } from "./types/cosmos/group/v1/tx";
|
|
11
|
-
import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx";
|
|
12
|
-
import { MsgVote } from "./types/cosmos/group/v1/tx";
|
|
13
|
-
import { MsgCreateGroupPolicy } from "./types/cosmos/group/v1/tx";
|
|
14
12
|
import { MsgExec } from "./types/cosmos/group/v1/tx";
|
|
13
|
+
import { MsgVote } from "./types/cosmos/group/v1/tx";
|
|
14
|
+
import { MsgLeaveGroup } from "./types/cosmos/group/v1/tx";
|
|
15
15
|
const msgTypes = [
|
|
16
|
+
["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers],
|
|
17
|
+
["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin],
|
|
16
18
|
["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", MsgUpdateGroupPolicyDecisionPolicy],
|
|
19
|
+
["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata],
|
|
20
|
+
["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy],
|
|
17
21
|
["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal],
|
|
18
22
|
["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal],
|
|
19
|
-
["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup],
|
|
20
|
-
["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin],
|
|
21
23
|
["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy],
|
|
24
|
+
["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup],
|
|
22
25
|
["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata],
|
|
23
|
-
["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers],
|
|
24
26
|
["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin],
|
|
25
|
-
["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata],
|
|
26
|
-
["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup],
|
|
27
|
-
["/cosmos.group.v1.MsgVote", MsgVote],
|
|
28
|
-
["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy],
|
|
29
27
|
["/cosmos.group.v1.MsgExec", MsgExec],
|
|
28
|
+
["/cosmos.group.v1.MsgVote", MsgVote],
|
|
29
|
+
["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup],
|
|
30
30
|
];
|
|
31
31
|
export { msgTypes };
|
package/cosmos.group.v1/rest.js
CHANGED
|
@@ -226,6 +226,21 @@ export class Api extends HttpClient {
|
|
|
226
226
|
format: "json",
|
|
227
227
|
...params,
|
|
228
228
|
});
|
|
229
|
+
/**
|
|
230
|
+
* @description Since: cosmos-sdk 0.47.1
|
|
231
|
+
*
|
|
232
|
+
* @tags Query
|
|
233
|
+
* @name QueryGroups
|
|
234
|
+
* @summary Groups queries all groups in state.
|
|
235
|
+
* @request GET:/cosmos/group/v1/groups
|
|
236
|
+
*/
|
|
237
|
+
this.queryGroups = (query, params = {}) => this.request({
|
|
238
|
+
path: `/cosmos/group/v1/groups`,
|
|
239
|
+
method: "GET",
|
|
240
|
+
query: query,
|
|
241
|
+
format: "json",
|
|
242
|
+
...params,
|
|
243
|
+
});
|
|
229
244
|
/**
|
|
230
245
|
* No description
|
|
231
246
|
*
|
|
@@ -1355,6 +1355,110 @@ export const QueryTallyResultResponse = {
|
|
|
1355
1355
|
return message;
|
|
1356
1356
|
},
|
|
1357
1357
|
};
|
|
1358
|
+
function createBaseQueryGroupsRequest() {
|
|
1359
|
+
return { pagination: undefined };
|
|
1360
|
+
}
|
|
1361
|
+
export const QueryGroupsRequest = {
|
|
1362
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1363
|
+
if (message.pagination !== undefined) {
|
|
1364
|
+
PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
1365
|
+
}
|
|
1366
|
+
return writer;
|
|
1367
|
+
},
|
|
1368
|
+
decode(input, length) {
|
|
1369
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1370
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1371
|
+
const message = createBaseQueryGroupsRequest();
|
|
1372
|
+
while (reader.pos < end) {
|
|
1373
|
+
const tag = reader.uint32();
|
|
1374
|
+
switch (tag >>> 3) {
|
|
1375
|
+
case 2:
|
|
1376
|
+
message.pagination = PageRequest.decode(reader, reader.uint32());
|
|
1377
|
+
break;
|
|
1378
|
+
default:
|
|
1379
|
+
reader.skipType(tag & 7);
|
|
1380
|
+
break;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return message;
|
|
1384
|
+
},
|
|
1385
|
+
fromJSON(object) {
|
|
1386
|
+
return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined };
|
|
1387
|
+
},
|
|
1388
|
+
toJSON(message) {
|
|
1389
|
+
const obj = {};
|
|
1390
|
+
message.pagination !== undefined
|
|
1391
|
+
&& (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
|
|
1392
|
+
return obj;
|
|
1393
|
+
},
|
|
1394
|
+
fromPartial(object) {
|
|
1395
|
+
const message = createBaseQueryGroupsRequest();
|
|
1396
|
+
message.pagination = (object.pagination !== undefined && object.pagination !== null)
|
|
1397
|
+
? PageRequest.fromPartial(object.pagination)
|
|
1398
|
+
: undefined;
|
|
1399
|
+
return message;
|
|
1400
|
+
},
|
|
1401
|
+
};
|
|
1402
|
+
function createBaseQueryGroupsResponse() {
|
|
1403
|
+
return { groups: [], pagination: undefined };
|
|
1404
|
+
}
|
|
1405
|
+
export const QueryGroupsResponse = {
|
|
1406
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1407
|
+
for (const v of message.groups) {
|
|
1408
|
+
GroupInfo.encode(v, writer.uint32(10).fork()).ldelim();
|
|
1409
|
+
}
|
|
1410
|
+
if (message.pagination !== undefined) {
|
|
1411
|
+
PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
1412
|
+
}
|
|
1413
|
+
return writer;
|
|
1414
|
+
},
|
|
1415
|
+
decode(input, length) {
|
|
1416
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1417
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1418
|
+
const message = createBaseQueryGroupsResponse();
|
|
1419
|
+
while (reader.pos < end) {
|
|
1420
|
+
const tag = reader.uint32();
|
|
1421
|
+
switch (tag >>> 3) {
|
|
1422
|
+
case 1:
|
|
1423
|
+
message.groups.push(GroupInfo.decode(reader, reader.uint32()));
|
|
1424
|
+
break;
|
|
1425
|
+
case 2:
|
|
1426
|
+
message.pagination = PageResponse.decode(reader, reader.uint32());
|
|
1427
|
+
break;
|
|
1428
|
+
default:
|
|
1429
|
+
reader.skipType(tag & 7);
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
return message;
|
|
1434
|
+
},
|
|
1435
|
+
fromJSON(object) {
|
|
1436
|
+
return {
|
|
1437
|
+
groups: Array.isArray(object?.groups) ? object.groups.map((e) => GroupInfo.fromJSON(e)) : [],
|
|
1438
|
+
pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined,
|
|
1439
|
+
};
|
|
1440
|
+
},
|
|
1441
|
+
toJSON(message) {
|
|
1442
|
+
const obj = {};
|
|
1443
|
+
if (message.groups) {
|
|
1444
|
+
obj.groups = message.groups.map((e) => e ? GroupInfo.toJSON(e) : undefined);
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
obj.groups = [];
|
|
1448
|
+
}
|
|
1449
|
+
message.pagination !== undefined
|
|
1450
|
+
&& (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
|
|
1451
|
+
return obj;
|
|
1452
|
+
},
|
|
1453
|
+
fromPartial(object) {
|
|
1454
|
+
const message = createBaseQueryGroupsResponse();
|
|
1455
|
+
message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || [];
|
|
1456
|
+
message.pagination = (object.pagination !== undefined && object.pagination !== null)
|
|
1457
|
+
? PageResponse.fromPartial(object.pagination)
|
|
1458
|
+
: undefined;
|
|
1459
|
+
return message;
|
|
1460
|
+
},
|
|
1461
|
+
};
|
|
1358
1462
|
export class QueryClientImpl {
|
|
1359
1463
|
constructor(rpc) {
|
|
1360
1464
|
this.rpc = rpc;
|
|
@@ -1371,6 +1475,7 @@ export class QueryClientImpl {
|
|
|
1371
1475
|
this.VotesByVoter = this.VotesByVoter.bind(this);
|
|
1372
1476
|
this.GroupsByMember = this.GroupsByMember.bind(this);
|
|
1373
1477
|
this.TallyResult = this.TallyResult.bind(this);
|
|
1478
|
+
this.Groups = this.Groups.bind(this);
|
|
1374
1479
|
}
|
|
1375
1480
|
GroupInfo(request) {
|
|
1376
1481
|
const data = QueryGroupInfoRequest.encode(request).finish();
|
|
@@ -1437,6 +1542,11 @@ export class QueryClientImpl {
|
|
|
1437
1542
|
const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data);
|
|
1438
1543
|
return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data)));
|
|
1439
1544
|
}
|
|
1545
|
+
Groups(request) {
|
|
1546
|
+
const data = QueryGroupsRequest.encode(request).finish();
|
|
1547
|
+
const promise = this.rpc.request("cosmos.group.v1.Query", "Groups", data);
|
|
1548
|
+
return promise.then((data) => QueryGroupsResponse.decode(new _m0.Reader(data)));
|
|
1549
|
+
}
|
|
1440
1550
|
}
|
|
1441
1551
|
var globalThis = (() => {
|
|
1442
1552
|
if (typeof globalThis !== "undefined") {
|