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
|
@@ -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
|
|
3
|
+
import { Registry, } from "@cosmjs/proto-signing";
|
|
4
|
+
import { msgTypes } from "./registry";
|
|
5
5
|
import { Api } from "./rest";
|
|
6
6
|
import { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx";
|
|
7
7
|
import { Equivocation as typeEquivocation } from "./types";
|
|
@@ -19,28 +19,37 @@ const defaultFee = {
|
|
|
19
19
|
amount: [],
|
|
20
20
|
gas: "200000",
|
|
21
21
|
};
|
|
22
|
-
export const txClient = ({ signer, prefix, addr } = {
|
|
22
|
+
export const txClient = ({ signer, prefix, addr } = {
|
|
23
|
+
addr: "http://localhost:26657",
|
|
24
|
+
prefix: "cosmos",
|
|
25
|
+
}) => {
|
|
23
26
|
return {
|
|
24
|
-
async sendMsgSubmitEvidence({ value, fee, memo }) {
|
|
27
|
+
async sendMsgSubmitEvidence({ value, fee, memo, }) {
|
|
25
28
|
if (!signer) {
|
|
26
|
-
throw new Error(
|
|
29
|
+
throw new Error("TxClient:sendMsgSubmitEvidence: Unable to sign Tx. Signer is not present.");
|
|
27
30
|
}
|
|
28
31
|
try {
|
|
29
32
|
const { address } = (await signer.getAccounts())[0];
|
|
30
33
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
31
|
-
let msg = this.msgSubmitEvidence({
|
|
34
|
+
let msg = this.msgSubmitEvidence({
|
|
35
|
+
value: MsgSubmitEvidence.fromPartial(value),
|
|
36
|
+
});
|
|
32
37
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
33
38
|
}
|
|
34
39
|
catch (e) {
|
|
35
|
-
throw new Error(
|
|
40
|
+
throw new Error("TxClient:sendMsgSubmitEvidence: Could not broadcast Tx: " +
|
|
41
|
+
e.message);
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
msgSubmitEvidence({ value }) {
|
|
39
45
|
try {
|
|
40
|
-
return {
|
|
46
|
+
return {
|
|
47
|
+
typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence",
|
|
48
|
+
value: MsgSubmitEvidence.fromPartial(value),
|
|
49
|
+
};
|
|
41
50
|
}
|
|
42
51
|
catch (e) {
|
|
43
|
-
throw new Error(
|
|
52
|
+
throw new Error("TxClient:MsgSubmitEvidence: Could not create message: " + e.message);
|
|
44
53
|
}
|
|
45
54
|
},
|
|
46
55
|
};
|
|
@@ -56,7 +65,7 @@ class SDKModule {
|
|
|
56
65
|
this.structure = {
|
|
57
66
|
Equivocation: getStructure(typeEquivocation.fromPartial({})),
|
|
58
67
|
};
|
|
59
|
-
client.on(
|
|
68
|
+
client.on("signer-changed", (signer) => {
|
|
60
69
|
this.updateTX(client);
|
|
61
70
|
});
|
|
62
71
|
}
|
|
@@ -72,13 +81,12 @@ class SDKModule {
|
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
|
-
;
|
|
76
84
|
const Module = (test) => {
|
|
77
85
|
return {
|
|
78
86
|
module: {
|
|
79
|
-
CosmosEvidenceV1Beta1: new SDKModule(test)
|
|
87
|
+
CosmosEvidenceV1Beta1: new SDKModule(test),
|
|
80
88
|
},
|
|
81
|
-
registry: msgTypes
|
|
89
|
+
registry: msgTypes,
|
|
82
90
|
};
|
|
83
91
|
};
|
|
84
92
|
export default Module;
|
|
@@ -2,42 +2,45 @@
|
|
|
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 { MsgSubmitEvidence } from "./types/cosmos/evidence/v1beta1/tx";
|
|
11
16
|
|
|
12
|
-
import { Equivocation as typeEquivocation} from "./types"
|
|
17
|
+
import { Equivocation as typeEquivocation } from "./types";
|
|
13
18
|
|
|
14
19
|
export { MsgSubmitEvidence };
|
|
15
20
|
|
|
16
21
|
type sendMsgSubmitEvidenceParams = {
|
|
17
|
-
value: MsgSubmitEvidence
|
|
18
|
-
fee?: StdFee
|
|
19
|
-
memo?: string
|
|
22
|
+
value: MsgSubmitEvidence;
|
|
23
|
+
fee?: StdFee;
|
|
24
|
+
memo?: string;
|
|
20
25
|
};
|
|
21
26
|
|
|
22
|
-
|
|
23
27
|
type msgSubmitEvidenceParams = {
|
|
24
|
-
value: MsgSubmitEvidence
|
|
28
|
+
value: MsgSubmitEvidence;
|
|
25
29
|
};
|
|
26
30
|
|
|
27
|
-
|
|
28
31
|
export const registry = new Registry(msgTypes);
|
|
29
32
|
|
|
30
33
|
type Field = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
+
name: string;
|
|
35
|
+
type: unknown;
|
|
36
|
+
};
|
|
34
37
|
function getStructure(template) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const structure: { fields: Field[] } = { fields: [] };
|
|
39
|
+
for (let [key, value] of Object.entries(template)) {
|
|
40
|
+
let field = { name: key, type: typeof value };
|
|
41
|
+
structure.fields.push(field);
|
|
42
|
+
}
|
|
43
|
+
return structure;
|
|
41
44
|
}
|
|
42
45
|
const defaultFee = {
|
|
43
46
|
amount: [],
|
|
@@ -45,87 +48,113 @@ const defaultFee = {
|
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
interface TxClientOptions {
|
|
48
|
-
addr: string
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
addr: string;
|
|
52
|
+
prefix: string;
|
|
53
|
+
signer?: OfflineSigner;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
export const txClient = (
|
|
54
|
-
|
|
56
|
+
export const txClient = (
|
|
57
|
+
{ signer, prefix, addr }: TxClientOptions = {
|
|
58
|
+
addr: "http://localhost:26657",
|
|
59
|
+
prefix: "cosmos",
|
|
60
|
+
},
|
|
61
|
+
) => {
|
|
55
62
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
async sendMsgSubmitEvidence({
|
|
64
|
+
value,
|
|
65
|
+
fee,
|
|
66
|
+
memo,
|
|
67
|
+
}: sendMsgSubmitEvidenceParams): Promise<DeliverTxResponse> {
|
|
68
|
+
if (!signer) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
"TxClient:sendMsgSubmitEvidence: Unable to sign Tx. Signer is not present.",
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const { address } = (await signer.getAccounts())[0];
|
|
75
|
+
const signingClient = await SigningStargateClient.connectWithSigner(
|
|
76
|
+
addr,
|
|
77
|
+
signer,
|
|
78
|
+
{ registry, prefix },
|
|
79
|
+
);
|
|
80
|
+
let msg = this.msgSubmitEvidence({
|
|
81
|
+
value: MsgSubmitEvidence.fromPartial(value),
|
|
82
|
+
});
|
|
83
|
+
return await signingClient.signAndBroadcast(
|
|
84
|
+
address,
|
|
85
|
+
[msg],
|
|
86
|
+
fee ? fee : defaultFee,
|
|
87
|
+
memo,
|
|
88
|
+
);
|
|
89
|
+
} catch (e: any) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
"TxClient:sendMsgSubmitEvidence: Could not broadcast Tx: " +
|
|
92
|
+
e.message,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
msgSubmitEvidence({ value }: msgSubmitEvidenceParams): EncodeObject {
|
|
98
|
+
try {
|
|
99
|
+
return {
|
|
100
|
+
typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence",
|
|
101
|
+
value: MsgSubmitEvidence.fromPartial(value),
|
|
102
|
+
};
|
|
103
|
+
} catch (e: any) {
|
|
104
|
+
throw new Error(
|
|
105
|
+
"TxClient:MsgSubmitEvidence: Could not create message: " + e.message,
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
};
|
|
81
110
|
};
|
|
82
111
|
|
|
83
112
|
interface QueryClientOptions {
|
|
84
|
-
addr: string
|
|
113
|
+
addr: string;
|
|
85
114
|
}
|
|
86
115
|
|
|
87
|
-
export const queryClient = (
|
|
116
|
+
export const queryClient = (
|
|
117
|
+
{ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" },
|
|
118
|
+
) => {
|
|
88
119
|
return new Api({ baseURL: addr });
|
|
89
120
|
};
|
|
90
121
|
|
|
91
122
|
class SDKModule {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
updateTX(client: IgniteClient) {
|
|
123
|
+
public query: ReturnType<typeof queryClient>;
|
|
124
|
+
public tx: ReturnType<typeof txClient>;
|
|
125
|
+
public structure: Record<string, unknown>;
|
|
126
|
+
public registry: Array<[string, GeneratedType]> = [];
|
|
127
|
+
|
|
128
|
+
constructor(client: IgniteClient) {
|
|
129
|
+
this.query = queryClient({ addr: client.env.apiURL });
|
|
130
|
+
this.updateTX(client);
|
|
131
|
+
this.structure = {
|
|
132
|
+
Equivocation: getStructure(typeEquivocation.fromPartial({})),
|
|
133
|
+
};
|
|
134
|
+
client.on("signer-changed", (signer) => {
|
|
135
|
+
this.updateTX(client);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
updateTX(client: IgniteClient) {
|
|
110
139
|
const methods = txClient({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
})
|
|
115
|
-
|
|
140
|
+
signer: client.signer,
|
|
141
|
+
addr: client.env.rpcURL,
|
|
142
|
+
prefix: client.env.prefix ?? "cosmos",
|
|
143
|
+
});
|
|
144
|
+
|
|
116
145
|
this.tx = methods;
|
|
117
146
|
for (let m in methods) {
|
|
118
|
-
|
|
147
|
+
this.tx[m] = methods[m].bind(this.tx);
|
|
119
148
|
}
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const Module = (test: IgniteClient) => {
|
|
124
|
-
return {
|
|
125
|
-
module: {
|
|
126
|
-
CosmosEvidenceV1Beta1: new SDKModule(test)
|
|
127
|
-
},
|
|
128
|
-
registry: msgTypes
|
|
129
149
|
}
|
|
130
150
|
}
|
|
131
|
-
|
|
151
|
+
|
|
152
|
+
const Module = (test: IgniteClient) => {
|
|
153
|
+
return {
|
|
154
|
+
module: {
|
|
155
|
+
CosmosEvidenceV1Beta1: new SDKModule(test),
|
|
156
|
+
},
|
|
157
|
+
registry: msgTypes,
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export default Module;
|
package/cosmos.gov.v1/module.js
CHANGED
|
@@ -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
|
|
3
|
+
import { Registry, } from "@cosmjs/proto-signing";
|
|
4
|
+
import { msgTypes } from "./registry";
|
|
5
5
|
import { Api } from "./rest";
|
|
6
6
|
import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
7
7
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
@@ -29,25 +29,31 @@ const defaultFee = {
|
|
|
29
29
|
amount: [],
|
|
30
30
|
gas: "200000",
|
|
31
31
|
};
|
|
32
|
-
export const txClient = ({ signer, prefix, addr } = {
|
|
32
|
+
export const txClient = ({ signer, prefix, addr } = {
|
|
33
|
+
addr: "http://localhost:26657",
|
|
34
|
+
prefix: "cosmos",
|
|
35
|
+
}) => {
|
|
33
36
|
return {
|
|
34
|
-
async sendMsgSubmitProposal({ value, fee, memo }) {
|
|
37
|
+
async sendMsgSubmitProposal({ value, fee, memo, }) {
|
|
35
38
|
if (!signer) {
|
|
36
|
-
throw new Error(
|
|
39
|
+
throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");
|
|
37
40
|
}
|
|
38
41
|
try {
|
|
39
42
|
const { address } = (await signer.getAccounts())[0];
|
|
40
43
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
41
|
-
let msg = this.msgSubmitProposal({
|
|
44
|
+
let msg = this.msgSubmitProposal({
|
|
45
|
+
value: MsgSubmitProposal.fromPartial(value),
|
|
46
|
+
});
|
|
42
47
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
43
48
|
}
|
|
44
49
|
catch (e) {
|
|
45
|
-
throw new Error(
|
|
50
|
+
throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: " +
|
|
51
|
+
e.message);
|
|
46
52
|
}
|
|
47
53
|
},
|
|
48
|
-
async sendMsgVote({ value, fee, memo }) {
|
|
54
|
+
async sendMsgVote({ value, fee, memo, }) {
|
|
49
55
|
if (!signer) {
|
|
50
|
-
throw new Error(
|
|
56
|
+
throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");
|
|
51
57
|
}
|
|
52
58
|
try {
|
|
53
59
|
const { address } = (await signer.getAccounts())[0];
|
|
@@ -56,12 +62,12 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
56
62
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
57
63
|
}
|
|
58
64
|
catch (e) {
|
|
59
|
-
throw new Error(
|
|
65
|
+
throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: " + e.message);
|
|
60
66
|
}
|
|
61
67
|
},
|
|
62
|
-
async sendMsgDeposit({ value, fee, memo }) {
|
|
68
|
+
async sendMsgDeposit({ value, fee, memo, }) {
|
|
63
69
|
if (!signer) {
|
|
64
|
-
throw new Error(
|
|
70
|
+
throw new Error("TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.");
|
|
65
71
|
}
|
|
66
72
|
try {
|
|
67
73
|
const { address } = (await signer.getAccounts())[0];
|
|
@@ -70,53 +76,67 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
70
76
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
71
77
|
}
|
|
72
78
|
catch (e) {
|
|
73
|
-
throw new Error(
|
|
79
|
+
throw new Error("TxClient:sendMsgDeposit: Could not broadcast Tx: " + e.message);
|
|
74
80
|
}
|
|
75
81
|
},
|
|
76
|
-
async sendMsgVoteWeighted({ value, fee, memo }) {
|
|
82
|
+
async sendMsgVoteWeighted({ value, fee, memo, }) {
|
|
77
83
|
if (!signer) {
|
|
78
|
-
throw new Error(
|
|
84
|
+
throw new Error("TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.");
|
|
79
85
|
}
|
|
80
86
|
try {
|
|
81
87
|
const { address } = (await signer.getAccounts())[0];
|
|
82
88
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
83
|
-
let msg = this.msgVoteWeighted({
|
|
89
|
+
let msg = this.msgVoteWeighted({
|
|
90
|
+
value: MsgVoteWeighted.fromPartial(value),
|
|
91
|
+
});
|
|
84
92
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
85
93
|
}
|
|
86
94
|
catch (e) {
|
|
87
|
-
throw new Error(
|
|
95
|
+
throw new Error("TxClient:sendMsgVoteWeighted: Could not broadcast Tx: " + e.message);
|
|
88
96
|
}
|
|
89
97
|
},
|
|
90
98
|
msgSubmitProposal({ value }) {
|
|
91
99
|
try {
|
|
92
|
-
return {
|
|
100
|
+
return {
|
|
101
|
+
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
102
|
+
value: MsgSubmitProposal.fromPartial(value),
|
|
103
|
+
};
|
|
93
104
|
}
|
|
94
105
|
catch (e) {
|
|
95
|
-
throw new Error(
|
|
106
|
+
throw new Error("TxClient:MsgSubmitProposal: Could not create message: " + e.message);
|
|
96
107
|
}
|
|
97
108
|
},
|
|
98
109
|
msgVote({ value }) {
|
|
99
110
|
try {
|
|
100
|
-
return {
|
|
111
|
+
return {
|
|
112
|
+
typeUrl: "/cosmos.gov.v1.MsgVote",
|
|
113
|
+
value: MsgVote.fromPartial(value),
|
|
114
|
+
};
|
|
101
115
|
}
|
|
102
116
|
catch (e) {
|
|
103
|
-
throw new Error(
|
|
117
|
+
throw new Error("TxClient:MsgVote: Could not create message: " + e.message);
|
|
104
118
|
}
|
|
105
119
|
},
|
|
106
120
|
msgDeposit({ value }) {
|
|
107
121
|
try {
|
|
108
|
-
return {
|
|
122
|
+
return {
|
|
123
|
+
typeUrl: "/cosmos.gov.v1.MsgDeposit",
|
|
124
|
+
value: MsgDeposit.fromPartial(value),
|
|
125
|
+
};
|
|
109
126
|
}
|
|
110
127
|
catch (e) {
|
|
111
|
-
throw new Error(
|
|
128
|
+
throw new Error("TxClient:MsgDeposit: Could not create message: " + e.message);
|
|
112
129
|
}
|
|
113
130
|
},
|
|
114
131
|
msgVoteWeighted({ value }) {
|
|
115
132
|
try {
|
|
116
|
-
return {
|
|
133
|
+
return {
|
|
134
|
+
typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
|
|
135
|
+
value: MsgVoteWeighted.fromPartial(value),
|
|
136
|
+
};
|
|
117
137
|
}
|
|
118
138
|
catch (e) {
|
|
119
|
-
throw new Error(
|
|
139
|
+
throw new Error("TxClient:MsgVoteWeighted: Could not create message: " + e.message);
|
|
120
140
|
}
|
|
121
141
|
},
|
|
122
142
|
};
|
|
@@ -139,7 +159,7 @@ class SDKModule {
|
|
|
139
159
|
VotingParams: getStructure(typeVotingParams.fromPartial({})),
|
|
140
160
|
TallyParams: getStructure(typeTallyParams.fromPartial({})),
|
|
141
161
|
};
|
|
142
|
-
client.on(
|
|
162
|
+
client.on("signer-changed", (signer) => {
|
|
143
163
|
this.updateTX(client);
|
|
144
164
|
});
|
|
145
165
|
}
|
|
@@ -155,13 +175,12 @@ class SDKModule {
|
|
|
155
175
|
}
|
|
156
176
|
}
|
|
157
177
|
}
|
|
158
|
-
;
|
|
159
178
|
const Module = (test) => {
|
|
160
179
|
return {
|
|
161
180
|
module: {
|
|
162
|
-
CosmosGovV1: new SDKModule(test)
|
|
181
|
+
CosmosGovV1: new SDKModule(test),
|
|
163
182
|
},
|
|
164
|
-
registry: msgTypes
|
|
183
|
+
registry: msgTypes,
|
|
165
184
|
};
|
|
166
185
|
};
|
|
167
186
|
export default Module;
|