decentralcardgame-cardchain-client-ts 0.0.16 → 0.0.18
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 +304 -310
- package/DecentralCardGame.cardchain.cardchain/module.ts +460 -466
- package/DecentralCardGame.cardchain.cardchain/registry.js +60 -60
- package/DecentralCardGame.cardchain.cardchain/registry.ts +60 -60
- package/DecentralCardGame.cardchain.cardchain/rest.js +7 -31
- package/DecentralCardGame.cardchain.cardchain/rest.ts +9 -84
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +0 -6
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +0 -6
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.js +11 -17
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/council.ts +11 -17
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/params.js +0 -11
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/params.ts +0 -13
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +2 -331
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +2 -390
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +8 -8
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +9 -9
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +57 -81
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +56 -93
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/voting.js +50 -59
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/voting.ts +53 -71
- package/DecentralCardGame.cardchain.cardchain/types.js +1 -4
- package/DecentralCardGame.cardchain.cardchain/types.ts +0 -6
- package/package.json +1 -1
|
@@ -4,6 +4,51 @@ import _m0 from "protobufjs/minimal";
|
|
|
4
4
|
|
|
5
5
|
export const protobufPackage = "DecentralCardGame.cardchain.cardchain";
|
|
6
6
|
|
|
7
|
+
export enum VoteType {
|
|
8
|
+
fairEnough = 0,
|
|
9
|
+
inappropriate = 1,
|
|
10
|
+
overpowered = 2,
|
|
11
|
+
underpowered = 3,
|
|
12
|
+
UNRECOGNIZED = -1,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function voteTypeFromJSON(object: any): VoteType {
|
|
16
|
+
switch (object) {
|
|
17
|
+
case 0:
|
|
18
|
+
case "fairEnough":
|
|
19
|
+
return VoteType.fairEnough;
|
|
20
|
+
case 1:
|
|
21
|
+
case "inappropriate":
|
|
22
|
+
return VoteType.inappropriate;
|
|
23
|
+
case 2:
|
|
24
|
+
case "overpowered":
|
|
25
|
+
return VoteType.overpowered;
|
|
26
|
+
case 3:
|
|
27
|
+
case "underpowered":
|
|
28
|
+
return VoteType.underpowered;
|
|
29
|
+
case -1:
|
|
30
|
+
case "UNRECOGNIZED":
|
|
31
|
+
default:
|
|
32
|
+
return VoteType.UNRECOGNIZED;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function voteTypeToJSON(object: VoteType): string {
|
|
37
|
+
switch (object) {
|
|
38
|
+
case VoteType.fairEnough:
|
|
39
|
+
return "fairEnough";
|
|
40
|
+
case VoteType.inappropriate:
|
|
41
|
+
return "inappropriate";
|
|
42
|
+
case VoteType.overpowered:
|
|
43
|
+
return "overpowered";
|
|
44
|
+
case VoteType.underpowered:
|
|
45
|
+
return "underpowered";
|
|
46
|
+
case VoteType.UNRECOGNIZED:
|
|
47
|
+
default:
|
|
48
|
+
return "UNRECOGNIZED";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
7
52
|
export interface VotingResults {
|
|
8
53
|
totalVotes: number;
|
|
9
54
|
totalFairEnoughVotes: number;
|
|
@@ -25,12 +70,7 @@ export interface VotingResult {
|
|
|
25
70
|
|
|
26
71
|
export interface SingleVote {
|
|
27
72
|
cardId: number;
|
|
28
|
-
voteType:
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface VoteRight {
|
|
32
|
-
cardId: number;
|
|
33
|
-
expireBlock: number;
|
|
73
|
+
voteType: VoteType;
|
|
34
74
|
}
|
|
35
75
|
|
|
36
76
|
function createBaseVotingResults(): VotingResults {
|
|
@@ -255,7 +295,7 @@ export const VotingResult = {
|
|
|
255
295
|
};
|
|
256
296
|
|
|
257
297
|
function createBaseSingleVote(): SingleVote {
|
|
258
|
-
return { cardId: 0, voteType:
|
|
298
|
+
return { cardId: 0, voteType: 0 };
|
|
259
299
|
}
|
|
260
300
|
|
|
261
301
|
export const SingleVote = {
|
|
@@ -263,8 +303,8 @@ export const SingleVote = {
|
|
|
263
303
|
if (message.cardId !== 0) {
|
|
264
304
|
writer.uint32(8).uint64(message.cardId);
|
|
265
305
|
}
|
|
266
|
-
if (message.voteType !==
|
|
267
|
-
writer.uint32(
|
|
306
|
+
if (message.voteType !== 0) {
|
|
307
|
+
writer.uint32(16).int32(message.voteType);
|
|
268
308
|
}
|
|
269
309
|
return writer;
|
|
270
310
|
},
|
|
@@ -280,7 +320,7 @@ export const SingleVote = {
|
|
|
280
320
|
message.cardId = longToNumber(reader.uint64() as Long);
|
|
281
321
|
break;
|
|
282
322
|
case 2:
|
|
283
|
-
message.voteType = reader.
|
|
323
|
+
message.voteType = reader.int32() as any;
|
|
284
324
|
break;
|
|
285
325
|
default:
|
|
286
326
|
reader.skipType(tag & 7);
|
|
@@ -293,79 +333,21 @@ export const SingleVote = {
|
|
|
293
333
|
fromJSON(object: any): SingleVote {
|
|
294
334
|
return {
|
|
295
335
|
cardId: isSet(object.cardId) ? Number(object.cardId) : 0,
|
|
296
|
-
voteType: isSet(object.voteType) ?
|
|
336
|
+
voteType: isSet(object.voteType) ? voteTypeFromJSON(object.voteType) : 0,
|
|
297
337
|
};
|
|
298
338
|
},
|
|
299
339
|
|
|
300
340
|
toJSON(message: SingleVote): unknown {
|
|
301
341
|
const obj: any = {};
|
|
302
342
|
message.cardId !== undefined && (obj.cardId = Math.round(message.cardId));
|
|
303
|
-
message.voteType !== undefined && (obj.voteType = message.voteType);
|
|
343
|
+
message.voteType !== undefined && (obj.voteType = voteTypeToJSON(message.voteType));
|
|
304
344
|
return obj;
|
|
305
345
|
},
|
|
306
346
|
|
|
307
347
|
fromPartial<I extends Exact<DeepPartial<SingleVote>, I>>(object: I): SingleVote {
|
|
308
348
|
const message = createBaseSingleVote();
|
|
309
349
|
message.cardId = object.cardId ?? 0;
|
|
310
|
-
message.voteType = object.voteType ??
|
|
311
|
-
return message;
|
|
312
|
-
},
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
function createBaseVoteRight(): VoteRight {
|
|
316
|
-
return { cardId: 0, expireBlock: 0 };
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export const VoteRight = {
|
|
320
|
-
encode(message: VoteRight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
321
|
-
if (message.cardId !== 0) {
|
|
322
|
-
writer.uint32(8).uint64(message.cardId);
|
|
323
|
-
}
|
|
324
|
-
if (message.expireBlock !== 0) {
|
|
325
|
-
writer.uint32(16).int64(message.expireBlock);
|
|
326
|
-
}
|
|
327
|
-
return writer;
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): VoteRight {
|
|
331
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
332
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
333
|
-
const message = createBaseVoteRight();
|
|
334
|
-
while (reader.pos < end) {
|
|
335
|
-
const tag = reader.uint32();
|
|
336
|
-
switch (tag >>> 3) {
|
|
337
|
-
case 1:
|
|
338
|
-
message.cardId = longToNumber(reader.uint64() as Long);
|
|
339
|
-
break;
|
|
340
|
-
case 2:
|
|
341
|
-
message.expireBlock = longToNumber(reader.int64() as Long);
|
|
342
|
-
break;
|
|
343
|
-
default:
|
|
344
|
-
reader.skipType(tag & 7);
|
|
345
|
-
break;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return message;
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
fromJSON(object: any): VoteRight {
|
|
352
|
-
return {
|
|
353
|
-
cardId: isSet(object.cardId) ? Number(object.cardId) : 0,
|
|
354
|
-
expireBlock: isSet(object.expireBlock) ? Number(object.expireBlock) : 0,
|
|
355
|
-
};
|
|
356
|
-
},
|
|
357
|
-
|
|
358
|
-
toJSON(message: VoteRight): unknown {
|
|
359
|
-
const obj: any = {};
|
|
360
|
-
message.cardId !== undefined && (obj.cardId = Math.round(message.cardId));
|
|
361
|
-
message.expireBlock !== undefined && (obj.expireBlock = Math.round(message.expireBlock));
|
|
362
|
-
return obj;
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
fromPartial<I extends Exact<DeepPartial<VoteRight>, I>>(object: I): VoteRight {
|
|
366
|
-
const message = createBaseVoteRight();
|
|
367
|
-
message.cardId = object.cardId ?? 0;
|
|
368
|
-
message.expireBlock = object.expireBlock ?? 0;
|
|
350
|
+
message.voteType = object.voteType ?? 0;
|
|
369
351
|
return message;
|
|
370
352
|
},
|
|
371
353
|
};
|
|
@@ -11,15 +11,12 @@ import { Params } from "./types/cardchain/cardchain/params";
|
|
|
11
11
|
import { IgnoreMatches } from "./types/cardchain/cardchain/query";
|
|
12
12
|
import { IgnoreSellOffers } from "./types/cardchain/cardchain/query";
|
|
13
13
|
import { QueryQServerResponse } from "./types/cardchain/cardchain/query";
|
|
14
|
-
import { IgnoreCouncils } from "./types/cardchain/cardchain/query";
|
|
15
14
|
import { RunningAverage } from "./types/cardchain/cardchain/running_average";
|
|
16
15
|
import { Set } from "./types/cardchain/cardchain/set";
|
|
17
16
|
import { SetProposal } from "./types/cardchain/cardchain/set_proposal";
|
|
18
|
-
import { CouncilParticipation } from "./types/cardchain/cardchain/user";
|
|
19
17
|
import { BoosterPack } from "./types/cardchain/cardchain/user";
|
|
20
18
|
import { AirDrops } from "./types/cardchain/cardchain/user";
|
|
21
19
|
import { VotingResults } from "./types/cardchain/cardchain/voting";
|
|
22
20
|
import { VotingResult } from "./types/cardchain/cardchain/voting";
|
|
23
21
|
import { SingleVote } from "./types/cardchain/cardchain/voting";
|
|
24
|
-
|
|
25
|
-
export { Card, TimeStamp, CopyrightProposal, WrapClearResponse, WrapHashResponse, Image, MatchPlayer, MatchReporterProposal, Num, Params, IgnoreMatches, IgnoreSellOffers, QueryQServerResponse, IgnoreCouncils, RunningAverage, Set, SetProposal, CouncilParticipation, BoosterPack, AirDrops, VotingResults, VotingResult, SingleVote, VoteRight, };
|
|
22
|
+
export { Card, TimeStamp, CopyrightProposal, WrapClearResponse, WrapHashResponse, Image, MatchPlayer, MatchReporterProposal, Num, Params, IgnoreMatches, IgnoreSellOffers, QueryQServerResponse, RunningAverage, Set, SetProposal, BoosterPack, AirDrops, VotingResults, VotingResult, SingleVote, };
|
|
@@ -11,17 +11,14 @@ import { Params } from "./types/cardchain/cardchain/params"
|
|
|
11
11
|
import { IgnoreMatches } from "./types/cardchain/cardchain/query"
|
|
12
12
|
import { IgnoreSellOffers } from "./types/cardchain/cardchain/query"
|
|
13
13
|
import { QueryQServerResponse } from "./types/cardchain/cardchain/query"
|
|
14
|
-
import { IgnoreCouncils } from "./types/cardchain/cardchain/query"
|
|
15
14
|
import { RunningAverage } from "./types/cardchain/cardchain/running_average"
|
|
16
15
|
import { Set } from "./types/cardchain/cardchain/set"
|
|
17
16
|
import { SetProposal } from "./types/cardchain/cardchain/set_proposal"
|
|
18
|
-
import { CouncilParticipation } from "./types/cardchain/cardchain/user"
|
|
19
17
|
import { BoosterPack } from "./types/cardchain/cardchain/user"
|
|
20
18
|
import { AirDrops } from "./types/cardchain/cardchain/user"
|
|
21
19
|
import { VotingResults } from "./types/cardchain/cardchain/voting"
|
|
22
20
|
import { VotingResult } from "./types/cardchain/cardchain/voting"
|
|
23
21
|
import { SingleVote } from "./types/cardchain/cardchain/voting"
|
|
24
|
-
import { VoteRight } from "./types/cardchain/cardchain/voting"
|
|
25
22
|
|
|
26
23
|
|
|
27
24
|
export {
|
|
@@ -38,16 +35,13 @@ export {
|
|
|
38
35
|
IgnoreMatches,
|
|
39
36
|
IgnoreSellOffers,
|
|
40
37
|
QueryQServerResponse,
|
|
41
|
-
IgnoreCouncils,
|
|
42
38
|
RunningAverage,
|
|
43
39
|
Set,
|
|
44
40
|
SetProposal,
|
|
45
|
-
CouncilParticipation,
|
|
46
41
|
BoosterPack,
|
|
47
42
|
AirDrops,
|
|
48
43
|
VotingResults,
|
|
49
44
|
VotingResult,
|
|
50
45
|
SingleVote,
|
|
51
|
-
VoteRight,
|
|
52
46
|
|
|
53
47
|
}
|
package/package.json
CHANGED