decentralcardgame-cardchain-client-ts 0.0.1 → 0.0.3
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.ts +673 -638
- package/DecentralCardGame.cardchain.cardchain/registry.ts +72 -70
- package/DecentralCardGame.cardchain.cardchain/rest.ts +11 -1
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +33 -6
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.ts +11 -17
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +1 -252
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +203 -11
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +8 -77
- package/DecentralCardGame.cardchain.cardchain/types.ts +22 -20
- package/cosmos.authz.v1beta1/module.ts +24 -24
- package/cosmos.authz.v1beta1/registry.ts +2 -2
- package/cosmos.bank.v1beta1/module.ts +24 -24
- package/cosmos.bank.v1beta1/registry.ts +2 -2
- package/cosmos.base.tendermint.v1beta1/rest.ts +3 -3
- package/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts +1 -1
- package/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts +1 -1
- package/cosmos.distribution.v1beta1/module.ts +46 -46
- package/cosmos.distribution.v1beta1/registry.ts +4 -4
- package/cosmos.gov.v1/module.ts +29 -29
- package/cosmos.gov.v1/registry.ts +2 -2
- package/cosmos.gov.v1beta1/module.ts +47 -47
- package/cosmos.gov.v1beta1/registry.ts +4 -4
- package/cosmos.group.v1/module.ts +163 -163
- package/cosmos.group.v1/registry.ts +18 -18
- package/cosmos.group.v1/rest.ts +39 -0
- package/cosmos.group.v1/types/cosmos/group/v1/query.ts +150 -0
- package/cosmos.staking.v1beta1/module.ts +64 -64
- package/cosmos.staking.v1beta1/registry.ts +6 -6
- package/cosmos.staking.v1beta1/rest.ts +2 -2
- package/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts +1 -1
- package/cosmos.staking.v1beta1/types/tendermint/types/types.ts +1 -1
- package/cosmos.tx.v1beta1/rest.ts +3 -3
- package/cosmos.tx.v1beta1/types/tendermint/abci/types.ts +1 -1
- package/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts +1 -1
- package/cosmos.tx.v1beta1/types/tendermint/types/types.ts +1 -1
- package/cosmos.vesting.v1beta1/module.ts +29 -29
- package/cosmos.vesting.v1beta1/registry.ts +2 -2
- package/cosmos.vesting.v1beta1/rest.ts +4 -1
- package/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts +2 -0
- package/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts +6 -1
- package/ibc.applications.interchain_accounts.controller.v1/rest.ts +143 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/google/protobuf/any.ts +240 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/tx.ts +361 -0
- package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/v1/packet.ts +234 -0
- package/ibc.applications.transfer.v1/rest.ts +7 -1
- package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.ts +28 -6
- package/ibc.core.client.v1/rest.ts +16 -16
- package/ibc.core.client.v1/types/ibc/core/client/v1/query.ts +1 -1
- package/ibc.core.connection.v1/rest.ts +37 -0
- package/ibc.core.connection.v1/types/ibc/core/connection/v1/query.ts +110 -1
- package/package.json +1 -1
|
@@ -107,7 +107,7 @@ export interface User {
|
|
|
107
107
|
ownedPrototypes: number[];
|
|
108
108
|
cards: number[];
|
|
109
109
|
voteRights: VoteRight[];
|
|
110
|
-
|
|
110
|
+
CouncilStatus: CouncilStatus;
|
|
111
111
|
ReportMatches: boolean;
|
|
112
112
|
profileCard: number;
|
|
113
113
|
airDrops: AirDrops | undefined;
|
|
@@ -116,11 +116,6 @@ export interface User {
|
|
|
116
116
|
biography: string;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
export interface CouncilParticipation {
|
|
120
|
-
status: CouncilStatus;
|
|
121
|
-
council: number;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
119
|
export interface BoosterPack {
|
|
125
120
|
collectionId: number;
|
|
126
121
|
timeStamp: number;
|
|
@@ -142,7 +137,7 @@ function createBaseUser(): User {
|
|
|
142
137
|
ownedPrototypes: [],
|
|
143
138
|
cards: [],
|
|
144
139
|
voteRights: [],
|
|
145
|
-
|
|
140
|
+
CouncilStatus: 0,
|
|
146
141
|
ReportMatches: false,
|
|
147
142
|
profileCard: 0,
|
|
148
143
|
airDrops: undefined,
|
|
@@ -175,8 +170,8 @@ export const User = {
|
|
|
175
170
|
for (const v of message.voteRights) {
|
|
176
171
|
VoteRight.encode(v!, writer.uint32(42).fork()).ldelim();
|
|
177
172
|
}
|
|
178
|
-
if (message.
|
|
179
|
-
|
|
173
|
+
if (message.CouncilStatus !== 0) {
|
|
174
|
+
writer.uint32(48).int32(message.CouncilStatus);
|
|
180
175
|
}
|
|
181
176
|
if (message.ReportMatches === true) {
|
|
182
177
|
writer.uint32(56).bool(message.ReportMatches);
|
|
@@ -243,7 +238,7 @@ export const User = {
|
|
|
243
238
|
message.voteRights.push(VoteRight.decode(reader, reader.uint32()));
|
|
244
239
|
break;
|
|
245
240
|
case 6:
|
|
246
|
-
message.
|
|
241
|
+
message.CouncilStatus = reader.int32() as any;
|
|
247
242
|
break;
|
|
248
243
|
case 7:
|
|
249
244
|
message.ReportMatches = reader.bool();
|
|
@@ -280,9 +275,7 @@ export const User = {
|
|
|
280
275
|
ownedPrototypes: Array.isArray(object?.ownedPrototypes) ? object.ownedPrototypes.map((e: any) => Number(e)) : [],
|
|
281
276
|
cards: Array.isArray(object?.cards) ? object.cards.map((e: any) => Number(e)) : [],
|
|
282
277
|
voteRights: Array.isArray(object?.voteRights) ? object.voteRights.map((e: any) => VoteRight.fromJSON(e)) : [],
|
|
283
|
-
|
|
284
|
-
? CouncilParticipation.fromJSON(object.councilParticipation)
|
|
285
|
-
: undefined,
|
|
278
|
+
CouncilStatus: isSet(object.CouncilStatus) ? councilStatusFromJSON(object.CouncilStatus) : 0,
|
|
286
279
|
ReportMatches: isSet(object.ReportMatches) ? Boolean(object.ReportMatches) : false,
|
|
287
280
|
profileCard: isSet(object.profileCard) ? Number(object.profileCard) : 0,
|
|
288
281
|
airDrops: isSet(object.airDrops) ? AirDrops.fromJSON(object.airDrops) : undefined,
|
|
@@ -317,9 +310,7 @@ export const User = {
|
|
|
317
310
|
} else {
|
|
318
311
|
obj.voteRights = [];
|
|
319
312
|
}
|
|
320
|
-
message.
|
|
321
|
-
? CouncilParticipation.toJSON(message.councilParticipation)
|
|
322
|
-
: undefined);
|
|
313
|
+
message.CouncilStatus !== undefined && (obj.CouncilStatus = councilStatusToJSON(message.CouncilStatus));
|
|
323
314
|
message.ReportMatches !== undefined && (obj.ReportMatches = message.ReportMatches);
|
|
324
315
|
message.profileCard !== undefined && (obj.profileCard = Math.round(message.profileCard));
|
|
325
316
|
message.airDrops !== undefined && (obj.airDrops = message.airDrops ? AirDrops.toJSON(message.airDrops) : undefined);
|
|
@@ -340,9 +331,7 @@ export const User = {
|
|
|
340
331
|
message.ownedPrototypes = object.ownedPrototypes?.map((e) => e) || [];
|
|
341
332
|
message.cards = object.cards?.map((e) => e) || [];
|
|
342
333
|
message.voteRights = object.voteRights?.map((e) => VoteRight.fromPartial(e)) || [];
|
|
343
|
-
message.
|
|
344
|
-
? CouncilParticipation.fromPartial(object.councilParticipation)
|
|
345
|
-
: undefined;
|
|
334
|
+
message.CouncilStatus = object.CouncilStatus ?? 0;
|
|
346
335
|
message.ReportMatches = object.ReportMatches ?? false;
|
|
347
336
|
message.profileCard = object.profileCard ?? 0;
|
|
348
337
|
message.airDrops = (object.airDrops !== undefined && object.airDrops !== null)
|
|
@@ -355,64 +344,6 @@ export const User = {
|
|
|
355
344
|
},
|
|
356
345
|
};
|
|
357
346
|
|
|
358
|
-
function createBaseCouncilParticipation(): CouncilParticipation {
|
|
359
|
-
return { status: 0, council: 0 };
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export const CouncilParticipation = {
|
|
363
|
-
encode(message: CouncilParticipation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
364
|
-
if (message.status !== 0) {
|
|
365
|
-
writer.uint32(8).int32(message.status);
|
|
366
|
-
}
|
|
367
|
-
if (message.council !== 0) {
|
|
368
|
-
writer.uint32(16).uint64(message.council);
|
|
369
|
-
}
|
|
370
|
-
return writer;
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): CouncilParticipation {
|
|
374
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
375
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
376
|
-
const message = createBaseCouncilParticipation();
|
|
377
|
-
while (reader.pos < end) {
|
|
378
|
-
const tag = reader.uint32();
|
|
379
|
-
switch (tag >>> 3) {
|
|
380
|
-
case 1:
|
|
381
|
-
message.status = reader.int32() as any;
|
|
382
|
-
break;
|
|
383
|
-
case 2:
|
|
384
|
-
message.council = longToNumber(reader.uint64() as Long);
|
|
385
|
-
break;
|
|
386
|
-
default:
|
|
387
|
-
reader.skipType(tag & 7);
|
|
388
|
-
break;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
return message;
|
|
392
|
-
},
|
|
393
|
-
|
|
394
|
-
fromJSON(object: any): CouncilParticipation {
|
|
395
|
-
return {
|
|
396
|
-
status: isSet(object.status) ? councilStatusFromJSON(object.status) : 0,
|
|
397
|
-
council: isSet(object.council) ? Number(object.council) : 0,
|
|
398
|
-
};
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
toJSON(message: CouncilParticipation): unknown {
|
|
402
|
-
const obj: any = {};
|
|
403
|
-
message.status !== undefined && (obj.status = councilStatusToJSON(message.status));
|
|
404
|
-
message.council !== undefined && (obj.council = Math.round(message.council));
|
|
405
|
-
return obj;
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
fromPartial<I extends Exact<DeepPartial<CouncilParticipation>, I>>(object: I): CouncilParticipation {
|
|
409
|
-
const message = createBaseCouncilParticipation();
|
|
410
|
-
message.status = object.status ?? 0;
|
|
411
|
-
message.council = object.council ?? 0;
|
|
412
|
-
return message;
|
|
413
|
-
},
|
|
414
|
-
};
|
|
415
|
-
|
|
416
347
|
function createBaseBoosterPack(): BoosterPack {
|
|
417
348
|
return { collectionId: 0, timeStamp: 0, raritiesPerPack: [] };
|
|
418
349
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { Card } from "./types/cardchain/card"
|
|
2
|
-
import { Collection } from "./types/cardchain/collection"
|
|
3
|
-
import { CollectionProposal } from "./types/cardchain/collection_proposal"
|
|
4
|
-
import { CopyrightProposal } from "./types/cardchain/copyright_proposal"
|
|
5
|
-
import { WrapClearResponse } from "./types/cardchain/council"
|
|
6
|
-
import { WrapHashResponse } from "./types/cardchain/council"
|
|
7
|
-
import { Image } from "./types/cardchain/image"
|
|
8
|
-
import { MatchPlayer } from "./types/cardchain/match"
|
|
9
|
-
import { MatchReporterProposal } from "./types/cardchain/match_reporter_proposal"
|
|
10
|
-
import { Num } from "./types/cardchain/num"
|
|
11
|
-
import { Params } from "./types/cardchain/params"
|
|
12
|
-
import { IgnoreMatches } from "./types/cardchain/query"
|
|
13
|
-
import { IgnoreSellOffers } from "./types/cardchain/query"
|
|
14
|
-
import { QueryQServerResponse } from "./types/cardchain/query"
|
|
15
|
-
import { RunningAverage } from "./types/cardchain/running_average"
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
1
|
+
import { Card } from "./types/cardchain/cardchain/card"
|
|
2
|
+
import { Collection } from "./types/cardchain/cardchain/collection"
|
|
3
|
+
import { CollectionProposal } from "./types/cardchain/cardchain/collection_proposal"
|
|
4
|
+
import { CopyrightProposal } from "./types/cardchain/cardchain/copyright_proposal"
|
|
5
|
+
import { WrapClearResponse } from "./types/cardchain/cardchain/council"
|
|
6
|
+
import { WrapHashResponse } from "./types/cardchain/cardchain/council"
|
|
7
|
+
import { Image } from "./types/cardchain/cardchain/image"
|
|
8
|
+
import { MatchPlayer } from "./types/cardchain/cardchain/match"
|
|
9
|
+
import { MatchReporterProposal } from "./types/cardchain/cardchain/match_reporter_proposal"
|
|
10
|
+
import { Num } from "./types/cardchain/cardchain/num"
|
|
11
|
+
import { Params } from "./types/cardchain/cardchain/params"
|
|
12
|
+
import { IgnoreMatches } from "./types/cardchain/cardchain/query"
|
|
13
|
+
import { IgnoreSellOffers } from "./types/cardchain/cardchain/query"
|
|
14
|
+
import { QueryQServerResponse } from "./types/cardchain/cardchain/query"
|
|
15
|
+
import { RunningAverage } from "./types/cardchain/cardchain/running_average"
|
|
16
|
+
import { SingleVote } from "./types/cardchain/cardchain/tx"
|
|
17
|
+
import { BoosterPack } from "./types/cardchain/cardchain/user"
|
|
18
|
+
import { AirDrops } from "./types/cardchain/cardchain/user"
|
|
19
|
+
import { VoteRight } from "./types/cardchain/cardchain/vote_right"
|
|
20
|
+
import { VotingResult } from "./types/cardchain/cardchain/voting_result"
|
|
21
|
+
import { VotingResults } from "./types/cardchain/cardchain/voting_results"
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
export {
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
IgnoreSellOffers,
|
|
37
38
|
QueryQServerResponse,
|
|
38
39
|
RunningAverage,
|
|
40
|
+
SingleVote,
|
|
39
41
|
BoosterPack,
|
|
40
42
|
AirDrops,
|
|
41
43
|
VoteRight,
|
|
@@ -7,8 +7,8 @@ import { msgTypes } from './registry';
|
|
|
7
7
|
import { IgniteClient } from "../client"
|
|
8
8
|
import { MissingWalletError } from "../helpers"
|
|
9
9
|
import { Api } from "./rest";
|
|
10
|
-
import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx";
|
|
11
10
|
import { MsgExec } from "./types/cosmos/authz/v1beta1/tx";
|
|
11
|
+
import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx";
|
|
12
12
|
import { MsgGrant } from "./types/cosmos/authz/v1beta1/tx";
|
|
13
13
|
|
|
14
14
|
import { GenericAuthorization as typeGenericAuthorization} from "./types"
|
|
@@ -18,16 +18,16 @@ import { GrantQueueItem as typeGrantQueueItem} from "./types"
|
|
|
18
18
|
import { EventGrant as typeEventGrant} from "./types"
|
|
19
19
|
import { EventRevoke as typeEventRevoke} from "./types"
|
|
20
20
|
|
|
21
|
-
export {
|
|
21
|
+
export { MsgExec, MsgRevoke, MsgGrant };
|
|
22
22
|
|
|
23
|
-
type
|
|
24
|
-
value:
|
|
23
|
+
type sendMsgExecParams = {
|
|
24
|
+
value: MsgExec,
|
|
25
25
|
fee?: StdFee,
|
|
26
26
|
memo?: string
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
type
|
|
30
|
-
value:
|
|
29
|
+
type sendMsgRevokeParams = {
|
|
30
|
+
value: MsgRevoke,
|
|
31
31
|
fee?: StdFee,
|
|
32
32
|
memo?: string
|
|
33
33
|
};
|
|
@@ -39,14 +39,14 @@ type sendMsgGrantParams = {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
type msgRevokeParams = {
|
|
43
|
-
value: MsgRevoke,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
42
|
type msgExecParams = {
|
|
47
43
|
value: MsgExec,
|
|
48
44
|
};
|
|
49
45
|
|
|
46
|
+
type msgRevokeParams = {
|
|
47
|
+
value: MsgRevoke,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
50
|
type msgGrantParams = {
|
|
51
51
|
value: MsgGrant,
|
|
52
52
|
};
|
|
@@ -81,31 +81,31 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
81
81
|
|
|
82
82
|
return {
|
|
83
83
|
|
|
84
|
-
async
|
|
84
|
+
async sendMsgExec({ value, fee, memo }: sendMsgExecParams): Promise<DeliverTxResponse> {
|
|
85
85
|
if (!signer) {
|
|
86
|
-
throw new Error('TxClient:
|
|
86
|
+
throw new Error('TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.')
|
|
87
87
|
}
|
|
88
88
|
try {
|
|
89
89
|
const { address } = (await signer.getAccounts())[0];
|
|
90
90
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
91
|
-
let msg = this.
|
|
91
|
+
let msg = this.msgExec({ value: MsgExec.fromPartial(value) })
|
|
92
92
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
93
93
|
} catch (e: any) {
|
|
94
|
-
throw new Error('TxClient:
|
|
94
|
+
throw new Error('TxClient:sendMsgExec: Could not broadcast Tx: '+ e.message)
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
|
|
98
|
-
async
|
|
98
|
+
async sendMsgRevoke({ value, fee, memo }: sendMsgRevokeParams): Promise<DeliverTxResponse> {
|
|
99
99
|
if (!signer) {
|
|
100
|
-
throw new Error('TxClient:
|
|
100
|
+
throw new Error('TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.')
|
|
101
101
|
}
|
|
102
102
|
try {
|
|
103
103
|
const { address } = (await signer.getAccounts())[0];
|
|
104
104
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
105
|
-
let msg = this.
|
|
105
|
+
let msg = this.msgRevoke({ value: MsgRevoke.fromPartial(value) })
|
|
106
106
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
107
107
|
} catch (e: any) {
|
|
108
|
-
throw new Error('TxClient:
|
|
108
|
+
throw new Error('TxClient:sendMsgRevoke: Could not broadcast Tx: '+ e.message)
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
|
|
@@ -124,19 +124,19 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
124
124
|
},
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
msgExec({ value }: msgExecParams): EncodeObject {
|
|
128
128
|
try {
|
|
129
|
-
return { typeUrl: "/cosmos.authz.v1beta1.
|
|
129
|
+
return { typeUrl: "/cosmos.authz.v1beta1.MsgExec", value: MsgExec.fromPartial( value ) }
|
|
130
130
|
} catch (e: any) {
|
|
131
|
-
throw new Error('TxClient:
|
|
131
|
+
throw new Error('TxClient:MsgExec: Could not create message: ' + e.message)
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
msgRevoke({ value }: msgRevokeParams): EncodeObject {
|
|
136
136
|
try {
|
|
137
|
-
return { typeUrl: "/cosmos.authz.v1beta1.
|
|
137
|
+
return { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", value: MsgRevoke.fromPartial( value ) }
|
|
138
138
|
} catch (e: any) {
|
|
139
|
-
throw new Error('TxClient:
|
|
139
|
+
throw new Error('TxClient:MsgRevoke: Could not create message: ' + e.message)
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx";
|
|
3
2
|
import { MsgExec } from "./types/cosmos/authz/v1beta1/tx";
|
|
3
|
+
import { MsgRevoke } from "./types/cosmos/authz/v1beta1/tx";
|
|
4
4
|
import { MsgGrant } from "./types/cosmos/authz/v1beta1/tx";
|
|
5
5
|
|
|
6
6
|
const msgTypes: Array<[string, GeneratedType]> = [
|
|
7
|
-
["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke],
|
|
8
7
|
["/cosmos.authz.v1beta1.MsgExec", MsgExec],
|
|
8
|
+
["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke],
|
|
9
9
|
["/cosmos.authz.v1beta1.MsgGrant", MsgGrant],
|
|
10
10
|
|
|
11
11
|
];
|
|
@@ -7,8 +7,8 @@ import { msgTypes } from './registry';
|
|
|
7
7
|
import { IgniteClient } from "../client"
|
|
8
8
|
import { MissingWalletError } from "../helpers"
|
|
9
9
|
import { Api } from "./rest";
|
|
10
|
-
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
11
10
|
import { MsgSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
11
|
+
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
12
12
|
|
|
13
13
|
import { SendAuthorization as typeSendAuthorization} from "./types"
|
|
14
14
|
import { Params as typeParams} from "./types"
|
|
@@ -21,13 +21,7 @@ import { Metadata as typeMetadata} from "./types"
|
|
|
21
21
|
import { Balance as typeBalance} from "./types"
|
|
22
22
|
import { DenomOwner as typeDenomOwner} from "./types"
|
|
23
23
|
|
|
24
|
-
export {
|
|
25
|
-
|
|
26
|
-
type sendMsgMultiSendParams = {
|
|
27
|
-
value: MsgMultiSend,
|
|
28
|
-
fee?: StdFee,
|
|
29
|
-
memo?: string
|
|
30
|
-
};
|
|
24
|
+
export { MsgSend, MsgMultiSend };
|
|
31
25
|
|
|
32
26
|
type sendMsgSendParams = {
|
|
33
27
|
value: MsgSend,
|
|
@@ -35,15 +29,21 @@ type sendMsgSendParams = {
|
|
|
35
29
|
memo?: string
|
|
36
30
|
};
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
type msgMultiSendParams = {
|
|
32
|
+
type sendMsgMultiSendParams = {
|
|
40
33
|
value: MsgMultiSend,
|
|
34
|
+
fee?: StdFee,
|
|
35
|
+
memo?: string
|
|
41
36
|
};
|
|
42
37
|
|
|
38
|
+
|
|
43
39
|
type msgSendParams = {
|
|
44
40
|
value: MsgSend,
|
|
45
41
|
};
|
|
46
42
|
|
|
43
|
+
type msgMultiSendParams = {
|
|
44
|
+
value: MsgMultiSend,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
47
|
|
|
48
48
|
export const registry = new Registry(msgTypes);
|
|
49
49
|
|
|
@@ -74,48 +74,48 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
|
|
|
74
74
|
|
|
75
75
|
return {
|
|
76
76
|
|
|
77
|
-
async
|
|
77
|
+
async sendMsgSend({ value, fee, memo }: sendMsgSendParams): Promise<DeliverTxResponse> {
|
|
78
78
|
if (!signer) {
|
|
79
|
-
throw new Error('TxClient:
|
|
79
|
+
throw new Error('TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.')
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
82
|
const { address } = (await signer.getAccounts())[0];
|
|
83
83
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
84
|
-
let msg = this.
|
|
84
|
+
let msg = this.msgSend({ value: MsgSend.fromPartial(value) })
|
|
85
85
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
86
86
|
} catch (e: any) {
|
|
87
|
-
throw new Error('TxClient:
|
|
87
|
+
throw new Error('TxClient:sendMsgSend: Could not broadcast Tx: '+ e.message)
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
|
|
91
|
-
async
|
|
91
|
+
async sendMsgMultiSend({ value, fee, memo }: sendMsgMultiSendParams): Promise<DeliverTxResponse> {
|
|
92
92
|
if (!signer) {
|
|
93
|
-
throw new Error('TxClient:
|
|
93
|
+
throw new Error('TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.')
|
|
94
94
|
}
|
|
95
95
|
try {
|
|
96
96
|
const { address } = (await signer.getAccounts())[0];
|
|
97
97
|
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
|
|
98
|
-
let msg = this.
|
|
98
|
+
let msg = this.msgMultiSend({ value: MsgMultiSend.fromPartial(value) })
|
|
99
99
|
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
100
100
|
} catch (e: any) {
|
|
101
|
-
throw new Error('TxClient:
|
|
101
|
+
throw new Error('TxClient:sendMsgMultiSend: Could not broadcast Tx: '+ e.message)
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
msgSend({ value }: msgSendParams): EncodeObject {
|
|
107
107
|
try {
|
|
108
|
-
return { typeUrl: "/cosmos.bank.v1beta1.
|
|
108
|
+
return { typeUrl: "/cosmos.bank.v1beta1.MsgSend", value: MsgSend.fromPartial( value ) }
|
|
109
109
|
} catch (e: any) {
|
|
110
|
-
throw new Error('TxClient:
|
|
110
|
+
throw new Error('TxClient:MsgSend: Could not create message: ' + e.message)
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
msgMultiSend({ value }: msgMultiSendParams): EncodeObject {
|
|
115
115
|
try {
|
|
116
|
-
return { typeUrl: "/cosmos.bank.v1beta1.
|
|
116
|
+
return { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial( value ) }
|
|
117
117
|
} catch (e: any) {
|
|
118
|
-
throw new Error('TxClient:
|
|
118
|
+
throw new Error('TxClient:MsgMultiSend: Could not create message: ' + e.message)
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
3
2
|
import { MsgSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
3
|
+
import { MsgMultiSend } from "./types/cosmos/bank/v1beta1/tx";
|
|
4
4
|
|
|
5
5
|
const msgTypes: Array<[string, GeneratedType]> = [
|
|
6
|
-
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],
|
|
7
6
|
["/cosmos.bank.v1beta1.MsgSend", MsgSend],
|
|
7
|
+
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],
|
|
8
8
|
|
|
9
9
|
];
|
|
10
10
|
|
|
@@ -168,7 +168,7 @@ export interface RpcStatus {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export interface TenderminttypesBlock {
|
|
171
|
-
/** Header defines the structure of a
|
|
171
|
+
/** Header defines the structure of a block header. */
|
|
172
172
|
header?: TenderminttypesHeader;
|
|
173
173
|
data?: TypesData;
|
|
174
174
|
evidence?: TypesEvidenceList;
|
|
@@ -178,7 +178,7 @@ export interface TenderminttypesBlock {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* Header defines the structure of a
|
|
181
|
+
* Header defines the structure of a block header.
|
|
182
182
|
*/
|
|
183
183
|
export interface TenderminttypesHeader {
|
|
184
184
|
/**
|
|
@@ -587,7 +587,7 @@ export interface TypesPartSetHeader {
|
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
export interface TypesSignedHeader {
|
|
590
|
-
/** Header defines the structure of a
|
|
590
|
+
/** Header defines the structure of a block header. */
|
|
591
591
|
header?: TenderminttypesHeader;
|
|
592
592
|
|
|
593
593
|
/** Commit contains the evidence that a block was committed by a set of validators. */
|
|
@@ -3,7 +3,7 @@ import _m0 from "protobufjs/minimal";
|
|
|
3
3
|
|
|
4
4
|
export const protobufPackage = "tendermint.crypto";
|
|
5
5
|
|
|
6
|
-
/** PublicKey defines the keys available for use with
|
|
6
|
+
/** PublicKey defines the keys available for use with Validators */
|
|
7
7
|
export interface PublicKey {
|
|
8
8
|
ed25519: Uint8Array | undefined;
|
|
9
9
|
secp256k1: Uint8Array | undefined;
|
|
@@ -120,7 +120,7 @@ export interface BlockID {
|
|
|
120
120
|
partSetHeader: PartSetHeader | undefined;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
/** Header defines the structure of a
|
|
123
|
+
/** Header defines the structure of a block header. */
|
|
124
124
|
export interface Header {
|
|
125
125
|
/** basic block info */
|
|
126
126
|
version: Consensus | undefined;
|