decentralcardgame-cardchain-client-ts 0.0.26-rc1 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DecentralCardGame.cardchain.cardchain/module.js +504 -352
- package/DecentralCardGame.cardchain.cardchain/module.ts +1505 -1267
- package/DecentralCardGame.cardchain.cardchain/registry.js +64 -62
- package/DecentralCardGame.cardchain.cardchain/registry.ts +64 -62
- package/DecentralCardGame.cardchain.cardchain/rest.js +31 -17
- package/DecentralCardGame.cardchain.cardchain/rest.ts +139 -94
- package/DecentralCardGame.cardchain.cardchain/types/amino/amino.ts +1 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +86 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +90 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +229 -114
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +276 -120
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/set.js +186 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/set.ts +210 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +91 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +113 -0
- package/DecentralCardGame.cardchain.cardchain/types.js +3 -1
- package/DecentralCardGame.cardchain.cardchain/types.ts +4 -0
- package/DecentralCardGame.cardchain.featureflag/module.js +4 -1
- package/DecentralCardGame.cardchain.featureflag/module.ts +71 -69
- package/DecentralCardGame.cardchain.featureflag/rest.ts +6 -6
- package/client.js +3 -9
- package/client.ts +154 -167
- package/cosmos.auth.v1beta1/module.js +4 -1
- package/cosmos.auth.v1beta1/module.ts +71 -69
- package/cosmos.auth.v1beta1/rest.ts +21 -21
- package/cosmos.authz.v1beta1/module.js +17 -17
- package/cosmos.authz.v1beta1/module.ts +25 -25
- package/cosmos.authz.v1beta1/registry.js +4 -4
- package/cosmos.authz.v1beta1/registry.ts +4 -4
- package/cosmos.authz.v1beta1/rest.ts +75 -75
- package/cosmos.bank.v1beta1/rest.ts +9 -9
- package/cosmos.distribution.v1beta1/module.js +27 -27
- package/cosmos.distribution.v1beta1/module.ts +42 -42
- package/cosmos.distribution.v1beta1/registry.js +4 -4
- package/cosmos.distribution.v1beta1/registry.ts +4 -4
- package/cosmos.distribution.v1beta1/rest.ts +20 -20
- package/cosmos.gov.v1/module.js +24 -24
- package/cosmos.gov.v1/module.ts +36 -36
- package/cosmos.gov.v1/registry.js +4 -4
- package/cosmos.gov.v1/registry.ts +4 -4
- package/cosmos.gov.v1/rest.ts +90 -90
- package/cosmos.gov.v1beta1/module.js +27 -27
- package/cosmos.gov.v1beta1/module.ts +42 -42
- package/cosmos.gov.v1beta1/registry.js +4 -4
- package/cosmos.gov.v1beta1/registry.ts +4 -4
- package/cosmos.gov.v1beta1/rest.ts +152 -152
- package/cosmos.group.v1/module.js +108 -108
- package/cosmos.group.v1/module.ts +164 -164
- package/cosmos.group.v1/registry.js +18 -18
- package/cosmos.group.v1/registry.ts +18 -18
- package/cosmos.group.v1/rest.js +5 -5
- package/cosmos.group.v1/rest.ts +214 -214
- package/cosmos.mint.v1beta1/rest.ts +13 -13
- package/cosmos.nft.v1beta1/rest.ts +132 -132
- package/cosmos.slashing.v1beta1/rest.ts +19 -19
- package/cosmos.staking.v1beta1/module.js +39 -39
- package/cosmos.staking.v1beta1/module.ts +59 -59
- package/cosmos.staking.v1beta1/registry.js +6 -6
- package/cosmos.staking.v1beta1/registry.ts +6 -6
- package/cosmos.staking.v1beta1/rest.ts +95 -95
- package/cosmos.upgrade.v1beta1/module.js +16 -16
- package/cosmos.upgrade.v1beta1/module.ts +24 -24
- package/cosmos.upgrade.v1beta1/registry.js +2 -2
- package/cosmos.upgrade.v1beta1/registry.ts +2 -2
- package/ibc.applications.interchain_accounts.controller.v1/rest.ts +10 -10
- package/ibc.applications.interchain_accounts.host.v1/rest.ts +13 -13
- package/ibc.applications.transfer.v1/rest.ts +3 -3
- package/ibc.core.channel.v1/rest.ts +44 -44
- package/package.json +1 -1
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/card.js +0 -651
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/card.ts +0 -735
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/copyright_proposal.js +0 -102
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/copyright_proposal.ts +0 -134
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/council.js +0 -350
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/council.ts +0 -409
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/genesis.js +0 -254
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/genesis.ts +0 -281
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/image.js +0 -88
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/image.ts +0 -115
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match.js +0 -308
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match.ts +0 -355
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match_reporter_proposal.js +0 -67
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/match_reporter_proposal.ts +0 -92
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/num.js +0 -73
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/num.ts +0 -102
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/params.js +0 -314
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/params.ts +0 -367
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/query.js +0 -1984
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/query.ts +0 -2382
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/running_average.js +0 -85
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/running_average.ts +0 -111
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/sell_offer.js +0 -148
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/sell_offer.ts +0 -183
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/server.js +0 -93
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/server.ts +0 -124
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set.js +0 -365
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set.ts +0 -416
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set_proposal.js +0 -93
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/set_proposal.ts +0 -124
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/tx.js +0 -4494
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/tx.ts +0 -5526
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/user.js +0 -522
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/user.ts +0 -583
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/voting.js +0 -346
- package/DecentralCardGame.cardchain.cardchain/types/DecentralCardGame/cardchain/cardchain/voting.ts +0 -417
|
@@ -7,10 +7,10 @@ import { msgTypes } from './registry';
|
|
|
7
7
|
import { IgniteClient } from "../client"
|
|
8
8
|
import { MissingWalletError } from "../helpers"
|
|
9
9
|
import { Api } from "./rest";
|
|
10
|
-
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
11
10
|
import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
|
|
12
|
-
import {
|
|
11
|
+
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
13
12
|
import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
|
|
13
|
+
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
|
|
14
14
|
|
|
15
15
|
import { Params as typeParams} from "./types"
|
|
16
16
|
import { ValidatorHistoricalRewards as typeValidatorHistoricalRewards} from "./types"
|
|
@@ -32,13 +32,7 @@ import { ValidatorCurrentRewardsRecord as typeValidatorCurrentRewardsRecord} fro
|
|
|
32
32
|
import { DelegatorStartingInfoRecord as typeDelegatorStartingInfoRecord} from "./types"
|
|
33
33
|
import { ValidatorSlashEventRecord as typeValidatorSlashEventRecord} from "./types"
|
|
34
34
|
|
|
35
|
-
export { MsgWithdrawValidatorCommission,
|
|
36
|
-
|
|
37
|
-
type sendMsgWithdrawValidatorCommissionParams = {
|
|
38
|
-
value: MsgWithdrawValidatorCommission,
|
|
39
|
-
fee?: StdFee,
|
|
40
|
-
memo?: string
|
|
41
|
-
};
|
|
35
|
+
export { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgSetWithdrawAddress };
|
|
42
36
|
|
|
43
37
|
type sendMsgWithdrawDelegatorRewardParams = {
|
|
44
38
|
value: MsgWithdrawDelegatorReward,
|
|
@@ -46,8 +40,8 @@ type sendMsgWithdrawDelegatorRewardParams = {
|
|
|
46
40
|
memo?: string
|
|
47
41
|
};
|
|
48
42
|
|
|
49
|
-
type
|
|
50
|
-
value:
|
|
43
|
+
type sendMsgWithdrawValidatorCommissionParams = {
|
|
44
|
+
value: MsgWithdrawValidatorCommission,
|
|
51
45
|
fee?: StdFee,
|
|
52
46
|
memo?: string
|
|
53
47
|
};
|
|
@@ -58,23 +52,29 @@ type sendMsgFundCommunityPoolParams = {
|
|
|
58
52
|
memo?: string
|
|
59
53
|
};
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
type sendMsgSetWithdrawAddressParams = {
|
|
56
|
+
value: MsgSetWithdrawAddress,
|
|
57
|
+
fee?: StdFee,
|
|
58
|
+
memo?: string
|
|
64
59
|
};
|
|
65
60
|
|
|
61
|
+
|
|
66
62
|
type msgWithdrawDelegatorRewardParams = {
|
|
67
63
|
value: MsgWithdrawDelegatorReward,
|
|
68
64
|
};
|
|
69
65
|
|
|
70
|
-
type
|
|
71
|
-
value:
|
|
66
|
+
type msgWithdrawValidatorCommissionParams = {
|
|
67
|
+
value: MsgWithdrawValidatorCommission,
|
|
72
68
|
};
|
|
73
69
|
|
|
74
70
|
type msgFundCommunityPoolParams = {
|
|
75
71
|
value: MsgFundCommunityPool,
|
|
76
72
|
};
|
|
77
73
|
|
|
74
|
+
type msgSetWithdrawAddressParams = {
|
|
75
|
+
value: MsgSetWithdrawAddress,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
78
|
|
|
79
79
|
export const registry = new Registry(msgTypes);
|
|
80
80
|
|
|
@@ -105,20 +105,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
105
105
|
|
|
106
106
|
return {
|
|
107
107
|
|
|
108
|
-
async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
|
|
109
|
-
if (!signer) {
|
|
110
|
-
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.')
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const { address } = (await signer.getAccounts())[0];
|
|
114
|
-
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
115
|
-
let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) })
|
|
116
|
-
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
117
|
-
} catch (e: any) {
|
|
118
|
-
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message)
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
|
|
122
108
|
async sendMsgWithdrawDelegatorReward({ value, fee, memo }: sendMsgWithdrawDelegatorRewardParams): Promise<DeliverTxResponse> {
|
|
123
109
|
if (!signer) {
|
|
124
110
|
throw new Error('TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.')
|
|
@@ -133,17 +119,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
133
119
|
}
|
|
134
120
|
},
|
|
135
121
|
|
|
136
|
-
async
|
|
122
|
+
async sendMsgWithdrawValidatorCommission({ value, fee, memo }: sendMsgWithdrawValidatorCommissionParams): Promise<DeliverTxResponse> {
|
|
137
123
|
if (!signer) {
|
|
138
|
-
throw new Error('TxClient:
|
|
124
|
+
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.')
|
|
139
125
|
}
|
|
140
126
|
try {
|
|
141
127
|
const { address } = (await signer.getAccounts())[0];
|
|
142
128
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
143
|
-
let msg = this.
|
|
129
|
+
let msg = this.msgWithdrawValidatorCommission({ value: MsgWithdrawValidatorCommission.fromPartial(value) })
|
|
144
130
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
145
131
|
} catch (e: any) {
|
|
146
|
-
throw new Error('TxClient:
|
|
132
|
+
throw new Error('TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: '+ e.message)
|
|
147
133
|
}
|
|
148
134
|
},
|
|
149
135
|
|
|
@@ -161,15 +147,21 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
161
147
|
}
|
|
162
148
|
},
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
150
|
+
async sendMsgSetWithdrawAddress({ value, fee, memo }: sendMsgSetWithdrawAddressParams): Promise<DeliverTxResponse> {
|
|
151
|
+
if (!signer) {
|
|
152
|
+
throw new Error('TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.')
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const { address } = (await signer.getAccounts())[0];
|
|
156
|
+
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
157
|
+
let msg = this.msgSetWithdrawAddress({ value: MsgSetWithdrawAddress.fromPartial(value) })
|
|
158
|
+
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
168
159
|
} catch (e: any) {
|
|
169
|
-
throw new Error('TxClient:
|
|
160
|
+
throw new Error('TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: '+ e.message)
|
|
170
161
|
}
|
|
171
162
|
},
|
|
172
163
|
|
|
164
|
+
|
|
173
165
|
msgWithdrawDelegatorReward({ value }: msgWithdrawDelegatorRewardParams): EncodeObject {
|
|
174
166
|
try {
|
|
175
167
|
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: MsgWithdrawDelegatorReward.fromPartial( value ) }
|
|
@@ -178,11 +170,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
178
170
|
}
|
|
179
171
|
},
|
|
180
172
|
|
|
181
|
-
|
|
173
|
+
msgWithdrawValidatorCommission({ value }: msgWithdrawValidatorCommissionParams): EncodeObject {
|
|
182
174
|
try {
|
|
183
|
-
return { typeUrl: "/cosmos.distribution.v1beta1.
|
|
175
|
+
return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.fromPartial( value ) }
|
|
184
176
|
} catch (e: any) {
|
|
185
|
-
throw new Error('TxClient:
|
|
177
|
+
throw new Error('TxClient:MsgWithdrawValidatorCommission: Could not create message: ' + e.message)
|
|
186
178
|
}
|
|
187
179
|
},
|
|
188
180
|
|
|
@@ -194,6 +186,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
194
186
|
}
|
|
195
187
|
},
|
|
196
188
|
|
|
189
|
+
msgSetWithdrawAddress({ value }: msgSetWithdrawAddressParams): EncodeObject {
|
|
190
|
+
try {
|
|
191
|
+
return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: MsgSetWithdrawAddress.fromPartial( value ) }
|
|
192
|
+
} catch (e: any) {
|
|
193
|
+
throw new Error('TxClient:MsgSetWithdrawAddress: Could not create message: ' + e.message)
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
2
1
|
import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
|
|
3
|
-
import {
|
|
2
|
+
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
4
3
|
import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
|
|
4
|
+
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
|
|
5
5
|
const msgTypes = [
|
|
6
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
|
|
7
6
|
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward],
|
|
8
|
-
["/cosmos.distribution.v1beta1.
|
|
7
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
|
|
9
8
|
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool],
|
|
9
|
+
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],
|
|
10
10
|
];
|
|
11
11
|
export { msgTypes };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
3
2
|
import { MsgWithdrawDelegatorReward } from "./types/cosmos/distribution/v1beta1/tx";
|
|
4
|
-
import {
|
|
3
|
+
import { MsgWithdrawValidatorCommission } from "./types/cosmos/distribution/v1beta1/tx";
|
|
5
4
|
import { MsgFundCommunityPool } from "./types/cosmos/distribution/v1beta1/tx";
|
|
5
|
+
import { MsgSetWithdrawAddress } from "./types/cosmos/distribution/v1beta1/tx";
|
|
6
6
|
|
|
7
7
|
const msgTypes: Array<[string, GeneratedType]> = [
|
|
8
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
|
|
9
8
|
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward],
|
|
10
|
-
["/cosmos.distribution.v1beta1.
|
|
9
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
|
|
11
10
|
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool],
|
|
11
|
+
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],
|
|
12
12
|
|
|
13
13
|
];
|
|
14
14
|
|
|
@@ -9,6 +9,24 @@
|
|
|
9
9
|
* ---------------------------------------------------------------
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Params defines the set of params for the distribution module.
|
|
14
|
+
*/
|
|
15
|
+
export interface Distributionv1Beta1Params {
|
|
16
|
+
community_tax?: string;
|
|
17
|
+
base_proposer_reward?: string;
|
|
18
|
+
bonus_proposer_reward?: string;
|
|
19
|
+
withdraw_addr_enabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
|
|
24
|
+
for a validator inexpensive to track, allows simple sanity checks.
|
|
25
|
+
*/
|
|
26
|
+
export interface Distributionv1Beta1ValidatorOutstandingRewards {
|
|
27
|
+
rewards?: V1Beta1DecCoin[];
|
|
28
|
+
}
|
|
29
|
+
|
|
12
30
|
export interface ProtobufAny {
|
|
13
31
|
"@type"?: string;
|
|
14
32
|
}
|
|
@@ -149,16 +167,6 @@ export interface V1Beta1PageResponse {
|
|
|
149
167
|
total?: string;
|
|
150
168
|
}
|
|
151
169
|
|
|
152
|
-
/**
|
|
153
|
-
* Params defines the set of params for the distribution module.
|
|
154
|
-
*/
|
|
155
|
-
export interface V1Beta1Params {
|
|
156
|
-
community_tax?: string;
|
|
157
|
-
base_proposer_reward?: string;
|
|
158
|
-
bonus_proposer_reward?: string;
|
|
159
|
-
withdraw_addr_enabled?: boolean;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
170
|
/**
|
|
163
171
|
* QueryCommunityPoolResponse is the response type for the Query/CommunityPool
|
|
164
172
|
RPC method.
|
|
@@ -212,7 +220,7 @@ export interface V1Beta1QueryDelegatorWithdrawAddressResponse {
|
|
|
212
220
|
*/
|
|
213
221
|
export interface V1Beta1QueryParamsResponse {
|
|
214
222
|
/** params defines the parameters of the module. */
|
|
215
|
-
params?:
|
|
223
|
+
params?: Distributionv1Beta1Params;
|
|
216
224
|
}
|
|
217
225
|
|
|
218
226
|
export interface V1Beta1QueryValidatorCommissionResponse {
|
|
@@ -229,7 +237,7 @@ export interface V1Beta1QueryValidatorOutstandingRewardsResponse {
|
|
|
229
237
|
* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
|
|
230
238
|
* for a validator inexpensive to track, allows simple sanity checks.
|
|
231
239
|
*/
|
|
232
|
-
rewards?:
|
|
240
|
+
rewards?: Distributionv1Beta1ValidatorOutstandingRewards;
|
|
233
241
|
}
|
|
234
242
|
|
|
235
243
|
/**
|
|
@@ -252,14 +260,6 @@ export interface V1Beta1ValidatorAccumulatedCommission {
|
|
|
252
260
|
commission?: V1Beta1DecCoin[];
|
|
253
261
|
}
|
|
254
262
|
|
|
255
|
-
/**
|
|
256
|
-
* ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
|
|
257
|
-
for a validator inexpensive to track, allows simple sanity checks.
|
|
258
|
-
*/
|
|
259
|
-
export interface V1Beta1ValidatorOutstandingRewards {
|
|
260
|
-
rewards?: V1Beta1DecCoin[];
|
|
261
|
-
}
|
|
262
|
-
|
|
263
263
|
/**
|
|
264
264
|
* ValidatorSlashEvent represents a validator slash event.
|
|
265
265
|
Height is implicit within the store key.
|
package/cosmos.gov.v1/module.js
CHANGED
|
@@ -3,10 +3,10 @@ import { SigningStargateClient } from "@cosmjs/stargate";
|
|
|
3
3
|
import { Registry } from "@cosmjs/proto-signing";
|
|
4
4
|
import { msgTypes } from './registry';
|
|
5
5
|
import { Api } from "./rest";
|
|
6
|
+
import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
6
7
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
7
|
-
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
8
8
|
import { MsgDeposit } from "./types/cosmos/gov/v1/tx";
|
|
9
|
-
import {
|
|
9
|
+
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
10
10
|
import { WeightedVoteOption as typeWeightedVoteOption } from "./types";
|
|
11
11
|
import { Deposit as typeDeposit } from "./types";
|
|
12
12
|
import { Proposal as typeProposal } from "./types";
|
|
@@ -15,7 +15,7 @@ import { Vote as typeVote } from "./types";
|
|
|
15
15
|
import { DepositParams as typeDepositParams } from "./types";
|
|
16
16
|
import { VotingParams as typeVotingParams } from "./types";
|
|
17
17
|
import { TallyParams as typeTallyParams } from "./types";
|
|
18
|
-
export {
|
|
18
|
+
export { MsgSubmitProposal, MsgVote, MsgDeposit, MsgVoteWeighted };
|
|
19
19
|
export const registry = new Registry(msgTypes);
|
|
20
20
|
function getStructure(template) {
|
|
21
21
|
const structure = { fields: [] };
|
|
@@ -31,32 +31,32 @@ const defaultFee = {
|
|
|
31
31
|
};
|
|
32
32
|
export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
|
|
33
33
|
return {
|
|
34
|
-
async
|
|
34
|
+
async sendMsgSubmitProposal({ value, fee, memo }) {
|
|
35
35
|
if (!signer) {
|
|
36
|
-
throw new Error('TxClient:
|
|
36
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.');
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
39
|
const { address } = (await signer.getAccounts())[0];
|
|
40
40
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
41
|
-
let msg = this.
|
|
41
|
+
let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) });
|
|
42
42
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
|
45
|
-
throw new Error('TxClient:
|
|
45
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: ' + e.message);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
async
|
|
48
|
+
async sendMsgVote({ value, fee, memo }) {
|
|
49
49
|
if (!signer) {
|
|
50
|
-
throw new Error('TxClient:
|
|
50
|
+
throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.');
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
53
|
const { address } = (await signer.getAccounts())[0];
|
|
54
54
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
55
|
-
let msg = this.
|
|
55
|
+
let msg = this.msgVote({ value: MsgVote.fromPartial(value) });
|
|
56
56
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
57
57
|
}
|
|
58
58
|
catch (e) {
|
|
59
|
-
throw new Error('TxClient:
|
|
59
|
+
throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: ' + e.message);
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
async sendMsgDeposit({ value, fee, memo }) {
|
|
@@ -73,34 +73,34 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
73
73
|
throw new Error('TxClient:sendMsgDeposit: Could not broadcast Tx: ' + e.message);
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
async
|
|
76
|
+
async sendMsgVoteWeighted({ value, fee, memo }) {
|
|
77
77
|
if (!signer) {
|
|
78
|
-
throw new Error('TxClient:
|
|
78
|
+
throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.');
|
|
79
79
|
}
|
|
80
80
|
try {
|
|
81
81
|
const { address } = (await signer.getAccounts())[0];
|
|
82
82
|
const signingClient = await SigningStargateClient.connectWithSigner(addr, signer, { registry, prefix });
|
|
83
|
-
let msg = this.
|
|
83
|
+
let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) });
|
|
84
84
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo);
|
|
85
85
|
}
|
|
86
86
|
catch (e) {
|
|
87
|
-
throw new Error('TxClient:
|
|
87
|
+
throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: ' + e.message);
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
-
|
|
90
|
+
msgSubmitProposal({ value }) {
|
|
91
91
|
try {
|
|
92
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
92
|
+
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial(value) };
|
|
93
93
|
}
|
|
94
94
|
catch (e) {
|
|
95
|
-
throw new Error('TxClient:
|
|
95
|
+
throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message);
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
msgVote({ value }) {
|
|
99
99
|
try {
|
|
100
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
100
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVote", value: MsgVote.fromPartial(value) };
|
|
101
101
|
}
|
|
102
102
|
catch (e) {
|
|
103
|
-
throw new Error('TxClient:
|
|
103
|
+
throw new Error('TxClient:MsgVote: Could not create message: ' + e.message);
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
msgDeposit({ value }) {
|
|
@@ -111,12 +111,12 @@ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26
|
|
|
111
111
|
throw new Error('TxClient:MsgDeposit: Could not create message: ' + e.message);
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
|
|
114
|
+
msgVoteWeighted({ value }) {
|
|
115
115
|
try {
|
|
116
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
116
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial(value) };
|
|
117
117
|
}
|
|
118
118
|
catch (e) {
|
|
119
|
-
throw new Error('TxClient:
|
|
119
|
+
throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message);
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
};
|
package/cosmos.gov.v1/module.ts
CHANGED
|
@@ -7,10 +7,10 @@ import { msgTypes } from './registry';
|
|
|
7
7
|
import { IgniteClient } from "../client"
|
|
8
8
|
import { MissingWalletError } from "../helpers"
|
|
9
9
|
import { Api } from "./rest";
|
|
10
|
+
import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
10
11
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
11
|
-
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
12
12
|
import { MsgDeposit } from "./types/cosmos/gov/v1/tx";
|
|
13
|
-
import {
|
|
13
|
+
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
14
14
|
|
|
15
15
|
import { WeightedVoteOption as typeWeightedVoteOption} from "./types"
|
|
16
16
|
import { Deposit as typeDeposit} from "./types"
|
|
@@ -21,16 +21,16 @@ import { DepositParams as typeDepositParams} from "./types"
|
|
|
21
21
|
import { VotingParams as typeVotingParams} from "./types"
|
|
22
22
|
import { TallyParams as typeTallyParams} from "./types"
|
|
23
23
|
|
|
24
|
-
export {
|
|
24
|
+
export { MsgSubmitProposal, MsgVote, MsgDeposit, MsgVoteWeighted };
|
|
25
25
|
|
|
26
|
-
type
|
|
27
|
-
value:
|
|
26
|
+
type sendMsgSubmitProposalParams = {
|
|
27
|
+
value: MsgSubmitProposal,
|
|
28
28
|
fee?: StdFee,
|
|
29
29
|
memo?: string
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
type
|
|
33
|
-
value:
|
|
32
|
+
type sendMsgVoteParams = {
|
|
33
|
+
value: MsgVote,
|
|
34
34
|
fee?: StdFee,
|
|
35
35
|
memo?: string
|
|
36
36
|
};
|
|
@@ -41,27 +41,27 @@ type sendMsgDepositParams = {
|
|
|
41
41
|
memo?: string
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
type
|
|
45
|
-
value:
|
|
44
|
+
type sendMsgVoteWeightedParams = {
|
|
45
|
+
value: MsgVoteWeighted,
|
|
46
46
|
fee?: StdFee,
|
|
47
47
|
memo?: string
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
type
|
|
52
|
-
value:
|
|
51
|
+
type msgSubmitProposalParams = {
|
|
52
|
+
value: MsgSubmitProposal,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
type
|
|
56
|
-
value:
|
|
55
|
+
type msgVoteParams = {
|
|
56
|
+
value: MsgVote,
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
type msgDepositParams = {
|
|
60
60
|
value: MsgDeposit,
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
type
|
|
64
|
-
value:
|
|
63
|
+
type msgVoteWeightedParams = {
|
|
64
|
+
value: MsgVoteWeighted,
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
|
|
@@ -94,31 +94,31 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
94
94
|
|
|
95
95
|
return {
|
|
96
96
|
|
|
97
|
-
async
|
|
97
|
+
async sendMsgSubmitProposal({ value, fee, memo }: sendMsgSubmitProposalParams): Promise<DeliverTxResponse> {
|
|
98
98
|
if (!signer) {
|
|
99
|
-
throw new Error('TxClient:
|
|
99
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.')
|
|
100
100
|
}
|
|
101
101
|
try {
|
|
102
102
|
const { address } = (await signer.getAccounts())[0];
|
|
103
103
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
104
|
-
let msg = this.
|
|
104
|
+
let msg = this.msgSubmitProposal({ value: MsgSubmitProposal.fromPartial(value) })
|
|
105
105
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
106
106
|
} catch (e: any) {
|
|
107
|
-
throw new Error('TxClient:
|
|
107
|
+
throw new Error('TxClient:sendMsgSubmitProposal: Could not broadcast Tx: '+ e.message)
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
|
|
111
|
-
async
|
|
111
|
+
async sendMsgVote({ value, fee, memo }: sendMsgVoteParams): Promise<DeliverTxResponse> {
|
|
112
112
|
if (!signer) {
|
|
113
|
-
throw new Error('TxClient:
|
|
113
|
+
throw new Error('TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.')
|
|
114
114
|
}
|
|
115
115
|
try {
|
|
116
116
|
const { address } = (await signer.getAccounts())[0];
|
|
117
117
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
118
|
-
let msg = this.
|
|
118
|
+
let msg = this.msgVote({ value: MsgVote.fromPartial(value) })
|
|
119
119
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
120
120
|
} catch (e: any) {
|
|
121
|
-
throw new Error('TxClient:
|
|
121
|
+
throw new Error('TxClient:sendMsgVote: Could not broadcast Tx: '+ e.message)
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
|
|
@@ -136,34 +136,34 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
|
|
139
|
-
async
|
|
139
|
+
async sendMsgVoteWeighted({ value, fee, memo }: sendMsgVoteWeightedParams): Promise<DeliverTxResponse> {
|
|
140
140
|
if (!signer) {
|
|
141
|
-
throw new Error('TxClient:
|
|
141
|
+
throw new Error('TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.')
|
|
142
142
|
}
|
|
143
143
|
try {
|
|
144
144
|
const { address } = (await signer.getAccounts())[0];
|
|
145
145
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
146
|
-
let msg = this.
|
|
146
|
+
let msg = this.msgVoteWeighted({ value: MsgVoteWeighted.fromPartial(value) })
|
|
147
147
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
148
148
|
} catch (e: any) {
|
|
149
|
-
throw new Error('TxClient:
|
|
149
|
+
throw new Error('TxClient:sendMsgVoteWeighted: Could not broadcast Tx: '+ e.message)
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
msgSubmitProposal({ value }: msgSubmitProposalParams): EncodeObject {
|
|
155
155
|
try {
|
|
156
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
156
|
+
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: MsgSubmitProposal.fromPartial( value ) }
|
|
157
157
|
} catch (e: any) {
|
|
158
|
-
throw new Error('TxClient:
|
|
158
|
+
throw new Error('TxClient:MsgSubmitProposal: Could not create message: ' + e.message)
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
msgVote({ value }: msgVoteParams): EncodeObject {
|
|
163
163
|
try {
|
|
164
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
164
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVote", value: MsgVote.fromPartial( value ) }
|
|
165
165
|
} catch (e: any) {
|
|
166
|
-
throw new Error('TxClient:
|
|
166
|
+
throw new Error('TxClient:MsgVote: Could not create message: ' + e.message)
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
|
|
@@ -175,11 +175,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
msgVoteWeighted({ value }: msgVoteWeightedParams): EncodeObject {
|
|
179
179
|
try {
|
|
180
|
-
return { typeUrl: "/cosmos.gov.v1.
|
|
180
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: MsgVoteWeighted.fromPartial( value ) }
|
|
181
181
|
} catch (e: any) {
|
|
182
|
-
throw new Error('TxClient:
|
|
182
|
+
throw new Error('TxClient:MsgVoteWeighted: Could not create message: ' + e.message)
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
1
2
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
2
|
-
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
3
3
|
import { MsgDeposit } from "./types/cosmos/gov/v1/tx";
|
|
4
|
-
import {
|
|
4
|
+
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
5
5
|
const msgTypes = [
|
|
6
|
+
["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal],
|
|
6
7
|
["/cosmos.gov.v1.MsgVote", MsgVote],
|
|
7
|
-
["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted],
|
|
8
8
|
["/cosmos.gov.v1.MsgDeposit", MsgDeposit],
|
|
9
|
-
["/cosmos.gov.v1.
|
|
9
|
+
["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted],
|
|
10
10
|
];
|
|
11
11
|
export { msgTypes };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
+
import { MsgSubmitProposal } from "./types/cosmos/gov/v1/tx";
|
|
2
3
|
import { MsgVote } from "./types/cosmos/gov/v1/tx";
|
|
3
|
-
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
4
4
|
import { MsgDeposit } from "./types/cosmos/gov/v1/tx";
|
|
5
|
-
import {
|
|
5
|
+
import { MsgVoteWeighted } from "./types/cosmos/gov/v1/tx";
|
|
6
6
|
|
|
7
7
|
const msgTypes: Array<[string, GeneratedType]> = [
|
|
8
|
+
["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal],
|
|
8
9
|
["/cosmos.gov.v1.MsgVote", MsgVote],
|
|
9
|
-
["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted],
|
|
10
10
|
["/cosmos.gov.v1.MsgDeposit", MsgDeposit],
|
|
11
|
-
["/cosmos.gov.v1.
|
|
11
|
+
["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted],
|
|
12
12
|
|
|
13
13
|
];
|
|
14
14
|
|