decentralcardgame-cardchain-client-ts 0.0.41 → 0.0.42
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/lib/cardchain.cardchain/module.d.ts +12 -1
- package/lib/cardchain.cardchain/module.js +26 -3
- package/lib/cardchain.cardchain/registry.js +2 -0
- package/lib/cardchain.cardchain/rest.d.ts +8 -2
- package/lib/cardchain.cardchain/types.d.ts +2 -2
- package/lib/cardchain.cardchain/types.js +2 -2
- package/lib/index.d.ts +78 -78
- package/lib/index.js +23 -23
- package/lib/types/cardchain/cardchain/card.d.ts +2 -0
- package/lib/types/cardchain/cardchain/card.js +19 -0
- package/lib/types/cardchain/cardchain/encounter.d.ts +1 -5
- package/lib/types/cardchain/cardchain/encounter.js +1 -68
- package/lib/types/cardchain/cardchain/parameter.d.ts +26 -0
- package/lib/types/cardchain/cardchain/parameter.js +79 -0
- package/lib/types/cardchain/cardchain/query.d.ts +2 -0
- package/lib/types/cardchain/cardchain/query.js +40 -12
- package/lib/types/cardchain/cardchain/tx.d.ts +18 -1
- package/lib/types/cardchain/cardchain/tx.js +209 -2
- package/package.json +1 -1
|
@@ -8,8 +8,8 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
8
8
|
import { Coin } from "../../cosmos/base/v1beta1/coin";
|
|
9
9
|
import { cardRarityFromJSON, cardRarityToJSON } from "./card";
|
|
10
10
|
import { responseFromJSON, responseToJSON } from "./council";
|
|
11
|
-
import { Parameter } from "./encounter";
|
|
12
11
|
import { outcomeFromJSON, outcomeToJSON } from "./match";
|
|
12
|
+
import { Parameter } from "./parameter";
|
|
13
13
|
import { Params } from "./params";
|
|
14
14
|
import { SingleVote } from "./voting";
|
|
15
15
|
export const protobufPackage = "cardchain.cardchain";
|
|
@@ -360,7 +360,15 @@ export const MsgCardSchemeBuyResponse = {
|
|
|
360
360
|
},
|
|
361
361
|
};
|
|
362
362
|
function createBaseMsgCardSaveContent() {
|
|
363
|
-
return {
|
|
363
|
+
return {
|
|
364
|
+
creator: "",
|
|
365
|
+
cardId: 0,
|
|
366
|
+
content: new Uint8Array(0),
|
|
367
|
+
notes: "",
|
|
368
|
+
artist: "",
|
|
369
|
+
balanceAnchor: false,
|
|
370
|
+
parameters: [],
|
|
371
|
+
};
|
|
364
372
|
}
|
|
365
373
|
export const MsgCardSaveContent = {
|
|
366
374
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -382,6 +390,9 @@ export const MsgCardSaveContent = {
|
|
|
382
390
|
if (message.balanceAnchor !== false) {
|
|
383
391
|
writer.uint32(48).bool(message.balanceAnchor);
|
|
384
392
|
}
|
|
393
|
+
for (const v of message.parameters) {
|
|
394
|
+
Parameter.encode(v, writer.uint32(58).fork()).join();
|
|
395
|
+
}
|
|
385
396
|
return writer;
|
|
386
397
|
},
|
|
387
398
|
decode(input, length) {
|
|
@@ -433,6 +444,13 @@ export const MsgCardSaveContent = {
|
|
|
433
444
|
message.balanceAnchor = reader.bool();
|
|
434
445
|
continue;
|
|
435
446
|
}
|
|
447
|
+
case 7: {
|
|
448
|
+
if (tag !== 58) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
message.parameters.push(Parameter.decode(reader, reader.uint32()));
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
436
454
|
}
|
|
437
455
|
if ((tag & 7) === 4 || tag === 0) {
|
|
438
456
|
break;
|
|
@@ -449,6 +467,9 @@ export const MsgCardSaveContent = {
|
|
|
449
467
|
notes: isSet(object.notes) ? globalThis.String(object.notes) : "",
|
|
450
468
|
artist: isSet(object.artist) ? globalThis.String(object.artist) : "",
|
|
451
469
|
balanceAnchor: isSet(object.balanceAnchor) ? globalThis.Boolean(object.balanceAnchor) : false,
|
|
470
|
+
parameters: globalThis.Array.isArray(object?.parameters)
|
|
471
|
+
? object.parameters.map((e) => Parameter.fromJSON(e))
|
|
472
|
+
: [],
|
|
452
473
|
};
|
|
453
474
|
},
|
|
454
475
|
toJSON(message) {
|
|
@@ -471,6 +492,9 @@ export const MsgCardSaveContent = {
|
|
|
471
492
|
if (message.balanceAnchor !== false) {
|
|
472
493
|
obj.balanceAnchor = message.balanceAnchor;
|
|
473
494
|
}
|
|
495
|
+
if (message.parameters?.length) {
|
|
496
|
+
obj.parameters = message.parameters.map((e) => Parameter.toJSON(e));
|
|
497
|
+
}
|
|
474
498
|
return obj;
|
|
475
499
|
},
|
|
476
500
|
create(base) {
|
|
@@ -484,6 +508,7 @@ export const MsgCardSaveContent = {
|
|
|
484
508
|
message.notes = object.notes ?? "";
|
|
485
509
|
message.artist = object.artist ?? "";
|
|
486
510
|
message.balanceAnchor = object.balanceAnchor ?? false;
|
|
511
|
+
message.parameters = object.parameters?.map((e) => Parameter.fromPartial(e)) || [];
|
|
487
512
|
return message;
|
|
488
513
|
},
|
|
489
514
|
};
|
|
@@ -5493,6 +5518,182 @@ export const MsgEncounterCreateResponse = {
|
|
|
5493
5518
|
return message;
|
|
5494
5519
|
},
|
|
5495
5520
|
};
|
|
5521
|
+
function createBaseMsgEncounterEdit() {
|
|
5522
|
+
return { creator: "", id: 0, name: "", drawlist: [], parameters: [], image: new Uint8Array(0) };
|
|
5523
|
+
}
|
|
5524
|
+
export const MsgEncounterEdit = {
|
|
5525
|
+
encode(message, writer = new BinaryWriter()) {
|
|
5526
|
+
if (message.creator !== "") {
|
|
5527
|
+
writer.uint32(10).string(message.creator);
|
|
5528
|
+
}
|
|
5529
|
+
if (message.id !== 0) {
|
|
5530
|
+
writer.uint32(16).uint64(message.id);
|
|
5531
|
+
}
|
|
5532
|
+
if (message.name !== "") {
|
|
5533
|
+
writer.uint32(26).string(message.name);
|
|
5534
|
+
}
|
|
5535
|
+
writer.uint32(34).fork();
|
|
5536
|
+
for (const v of message.drawlist) {
|
|
5537
|
+
writer.uint64(v);
|
|
5538
|
+
}
|
|
5539
|
+
writer.join();
|
|
5540
|
+
for (const v of message.parameters) {
|
|
5541
|
+
Parameter.encode(v, writer.uint32(42).fork()).join();
|
|
5542
|
+
}
|
|
5543
|
+
if (message.image.length !== 0) {
|
|
5544
|
+
writer.uint32(50).bytes(message.image);
|
|
5545
|
+
}
|
|
5546
|
+
return writer;
|
|
5547
|
+
},
|
|
5548
|
+
decode(input, length) {
|
|
5549
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5550
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5551
|
+
const message = createBaseMsgEncounterEdit();
|
|
5552
|
+
while (reader.pos < end) {
|
|
5553
|
+
const tag = reader.uint32();
|
|
5554
|
+
switch (tag >>> 3) {
|
|
5555
|
+
case 1: {
|
|
5556
|
+
if (tag !== 10) {
|
|
5557
|
+
break;
|
|
5558
|
+
}
|
|
5559
|
+
message.creator = reader.string();
|
|
5560
|
+
continue;
|
|
5561
|
+
}
|
|
5562
|
+
case 2: {
|
|
5563
|
+
if (tag !== 16) {
|
|
5564
|
+
break;
|
|
5565
|
+
}
|
|
5566
|
+
message.id = longToNumber(reader.uint64());
|
|
5567
|
+
continue;
|
|
5568
|
+
}
|
|
5569
|
+
case 3: {
|
|
5570
|
+
if (tag !== 26) {
|
|
5571
|
+
break;
|
|
5572
|
+
}
|
|
5573
|
+
message.name = reader.string();
|
|
5574
|
+
continue;
|
|
5575
|
+
}
|
|
5576
|
+
case 4: {
|
|
5577
|
+
if (tag === 32) {
|
|
5578
|
+
message.drawlist.push(longToNumber(reader.uint64()));
|
|
5579
|
+
continue;
|
|
5580
|
+
}
|
|
5581
|
+
if (tag === 34) {
|
|
5582
|
+
const end2 = reader.uint32() + reader.pos;
|
|
5583
|
+
while (reader.pos < end2) {
|
|
5584
|
+
message.drawlist.push(longToNumber(reader.uint64()));
|
|
5585
|
+
}
|
|
5586
|
+
continue;
|
|
5587
|
+
}
|
|
5588
|
+
break;
|
|
5589
|
+
}
|
|
5590
|
+
case 5: {
|
|
5591
|
+
if (tag !== 42) {
|
|
5592
|
+
break;
|
|
5593
|
+
}
|
|
5594
|
+
message.parameters.push(Parameter.decode(reader, reader.uint32()));
|
|
5595
|
+
continue;
|
|
5596
|
+
}
|
|
5597
|
+
case 6: {
|
|
5598
|
+
if (tag !== 50) {
|
|
5599
|
+
break;
|
|
5600
|
+
}
|
|
5601
|
+
message.image = reader.bytes();
|
|
5602
|
+
continue;
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5606
|
+
break;
|
|
5607
|
+
}
|
|
5608
|
+
reader.skip(tag & 7);
|
|
5609
|
+
}
|
|
5610
|
+
return message;
|
|
5611
|
+
},
|
|
5612
|
+
fromJSON(object) {
|
|
5613
|
+
return {
|
|
5614
|
+
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
5615
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
5616
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
5617
|
+
drawlist: globalThis.Array.isArray(object?.drawlist) ? object.drawlist.map((e) => globalThis.Number(e)) : [],
|
|
5618
|
+
parameters: globalThis.Array.isArray(object?.parameters)
|
|
5619
|
+
? object.parameters.map((e) => Parameter.fromJSON(e))
|
|
5620
|
+
: [],
|
|
5621
|
+
image: isSet(object.image) ? bytesFromBase64(object.image) : new Uint8Array(0),
|
|
5622
|
+
};
|
|
5623
|
+
},
|
|
5624
|
+
toJSON(message) {
|
|
5625
|
+
const obj = {};
|
|
5626
|
+
if (message.creator !== "") {
|
|
5627
|
+
obj.creator = message.creator;
|
|
5628
|
+
}
|
|
5629
|
+
if (message.id !== 0) {
|
|
5630
|
+
obj.id = Math.round(message.id);
|
|
5631
|
+
}
|
|
5632
|
+
if (message.name !== "") {
|
|
5633
|
+
obj.name = message.name;
|
|
5634
|
+
}
|
|
5635
|
+
if (message.drawlist?.length) {
|
|
5636
|
+
obj.drawlist = message.drawlist.map((e) => Math.round(e));
|
|
5637
|
+
}
|
|
5638
|
+
if (message.parameters?.length) {
|
|
5639
|
+
obj.parameters = message.parameters.map((e) => Parameter.toJSON(e));
|
|
5640
|
+
}
|
|
5641
|
+
if (message.image.length !== 0) {
|
|
5642
|
+
obj.image = base64FromBytes(message.image);
|
|
5643
|
+
}
|
|
5644
|
+
return obj;
|
|
5645
|
+
},
|
|
5646
|
+
create(base) {
|
|
5647
|
+
return MsgEncounterEdit.fromPartial(base ?? {});
|
|
5648
|
+
},
|
|
5649
|
+
fromPartial(object) {
|
|
5650
|
+
const message = createBaseMsgEncounterEdit();
|
|
5651
|
+
message.creator = object.creator ?? "";
|
|
5652
|
+
message.id = object.id ?? 0;
|
|
5653
|
+
message.name = object.name ?? "";
|
|
5654
|
+
message.drawlist = object.drawlist?.map((e) => e) || [];
|
|
5655
|
+
message.parameters = object.parameters?.map((e) => Parameter.fromPartial(e)) || [];
|
|
5656
|
+
message.image = object.image ?? new Uint8Array(0);
|
|
5657
|
+
return message;
|
|
5658
|
+
},
|
|
5659
|
+
};
|
|
5660
|
+
function createBaseMsgEncounterEditResponse() {
|
|
5661
|
+
return {};
|
|
5662
|
+
}
|
|
5663
|
+
export const MsgEncounterEditResponse = {
|
|
5664
|
+
encode(_, writer = new BinaryWriter()) {
|
|
5665
|
+
return writer;
|
|
5666
|
+
},
|
|
5667
|
+
decode(input, length) {
|
|
5668
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5669
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5670
|
+
const message = createBaseMsgEncounterEditResponse();
|
|
5671
|
+
while (reader.pos < end) {
|
|
5672
|
+
const tag = reader.uint32();
|
|
5673
|
+
switch (tag >>> 3) {
|
|
5674
|
+
}
|
|
5675
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5676
|
+
break;
|
|
5677
|
+
}
|
|
5678
|
+
reader.skip(tag & 7);
|
|
5679
|
+
}
|
|
5680
|
+
return message;
|
|
5681
|
+
},
|
|
5682
|
+
fromJSON(_) {
|
|
5683
|
+
return {};
|
|
5684
|
+
},
|
|
5685
|
+
toJSON(_) {
|
|
5686
|
+
const obj = {};
|
|
5687
|
+
return obj;
|
|
5688
|
+
},
|
|
5689
|
+
create(base) {
|
|
5690
|
+
return MsgEncounterEditResponse.fromPartial(base ?? {});
|
|
5691
|
+
},
|
|
5692
|
+
fromPartial(_) {
|
|
5693
|
+
const message = createBaseMsgEncounterEditResponse();
|
|
5694
|
+
return message;
|
|
5695
|
+
},
|
|
5696
|
+
};
|
|
5496
5697
|
function createBaseMsgEncounterDo() {
|
|
5497
5698
|
return { creator: "", encounterId: 0, user: "" };
|
|
5498
5699
|
}
|
|
@@ -6323,6 +6524,7 @@ export class MsgClientImpl {
|
|
|
6323
6524
|
this.EarlyAccessInvite = this.EarlyAccessInvite.bind(this);
|
|
6324
6525
|
this.ZealyConnect = this.ZealyConnect.bind(this);
|
|
6325
6526
|
this.EncounterCreate = this.EncounterCreate.bind(this);
|
|
6527
|
+
this.EncounterEdit = this.EncounterEdit.bind(this);
|
|
6326
6528
|
this.EncounterDo = this.EncounterDo.bind(this);
|
|
6327
6529
|
this.EncounterClose = this.EncounterClose.bind(this);
|
|
6328
6530
|
this.EarlyAccessDisinvite = this.EarlyAccessDisinvite.bind(this);
|
|
@@ -6556,6 +6758,11 @@ export class MsgClientImpl {
|
|
|
6556
6758
|
const promise = this.rpc.request(this.service, "EncounterCreate", data);
|
|
6557
6759
|
return promise.then((data) => MsgEncounterCreateResponse.decode(new BinaryReader(data)));
|
|
6558
6760
|
}
|
|
6761
|
+
EncounterEdit(request) {
|
|
6762
|
+
const data = MsgEncounterEdit.encode(request).finish();
|
|
6763
|
+
const promise = this.rpc.request(this.service, "EncounterEdit", data);
|
|
6764
|
+
return promise.then((data) => MsgEncounterEditResponse.decode(new BinaryReader(data)));
|
|
6765
|
+
}
|
|
6559
6766
|
EncounterDo(request) {
|
|
6560
6767
|
const data = MsgEncounterDo.encode(request).finish();
|
|
6561
6768
|
const promise = this.rpc.request(this.service, "EncounterDo", data);
|
package/package.json
CHANGED