decentralcardgame-cardchain-client-ts 0.0.2 → 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 +493 -458
- package/DecentralCardGame.cardchain.cardchain/registry.ts +71 -69
- 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/package.json +1 -1
|
@@ -3,7 +3,7 @@ import Long from "long";
|
|
|
3
3
|
import _m0 from "protobufjs/minimal";
|
|
4
4
|
import { OutpCard } from "./card";
|
|
5
5
|
import { CStatus, cStatusFromJSON, cStatusToJSON, OutpCollection } from "./collection";
|
|
6
|
-
import {
|
|
6
|
+
import { Council } from "./council";
|
|
7
7
|
import { Match } from "./match";
|
|
8
8
|
import { Params } from "./params";
|
|
9
9
|
import { SellOffer, SellOfferStatus, sellOfferStatusFromJSON, sellOfferStatusToJSON } from "./sell_offer";
|
|
@@ -256,24 +256,6 @@ export interface QueryRarityDistributionResponse {
|
|
|
256
256
|
wanted: number[];
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
export interface QueryQCouncilsRequest {
|
|
260
|
-
status: CouncelingStatus;
|
|
261
|
-
voters: string[];
|
|
262
|
-
card: number;
|
|
263
|
-
creator: string;
|
|
264
|
-
ignore: IgnoreCouncils | undefined;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export interface IgnoreCouncils {
|
|
268
|
-
status: boolean;
|
|
269
|
-
card: boolean;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export interface QueryQCouncilsResponse {
|
|
273
|
-
councilssIds: number[];
|
|
274
|
-
councils: Council[];
|
|
275
|
-
}
|
|
276
|
-
|
|
277
259
|
function createBaseQueryParamsRequest(): QueryParamsRequest {
|
|
278
260
|
return {};
|
|
279
261
|
}
|
|
@@ -2170,230 +2152,6 @@ export const QueryRarityDistributionResponse = {
|
|
|
2170
2152
|
},
|
|
2171
2153
|
};
|
|
2172
2154
|
|
|
2173
|
-
function createBaseQueryQCouncilsRequest(): QueryQCouncilsRequest {
|
|
2174
|
-
return { status: 0, voters: [], card: 0, creator: "", ignore: undefined };
|
|
2175
|
-
}
|
|
2176
|
-
|
|
2177
|
-
export const QueryQCouncilsRequest = {
|
|
2178
|
-
encode(message: QueryQCouncilsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2179
|
-
if (message.status !== 0) {
|
|
2180
|
-
writer.uint32(8).int32(message.status);
|
|
2181
|
-
}
|
|
2182
|
-
for (const v of message.voters) {
|
|
2183
|
-
writer.uint32(26).string(v!);
|
|
2184
|
-
}
|
|
2185
|
-
if (message.card !== 0) {
|
|
2186
|
-
writer.uint32(32).uint64(message.card);
|
|
2187
|
-
}
|
|
2188
|
-
if (message.creator !== "") {
|
|
2189
|
-
writer.uint32(42).string(message.creator);
|
|
2190
|
-
}
|
|
2191
|
-
if (message.ignore !== undefined) {
|
|
2192
|
-
IgnoreCouncils.encode(message.ignore, writer.uint32(18).fork()).ldelim();
|
|
2193
|
-
}
|
|
2194
|
-
return writer;
|
|
2195
|
-
},
|
|
2196
|
-
|
|
2197
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): QueryQCouncilsRequest {
|
|
2198
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
2199
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2200
|
-
const message = createBaseQueryQCouncilsRequest();
|
|
2201
|
-
while (reader.pos < end) {
|
|
2202
|
-
const tag = reader.uint32();
|
|
2203
|
-
switch (tag >>> 3) {
|
|
2204
|
-
case 1:
|
|
2205
|
-
message.status = reader.int32() as any;
|
|
2206
|
-
break;
|
|
2207
|
-
case 3:
|
|
2208
|
-
message.voters.push(reader.string());
|
|
2209
|
-
break;
|
|
2210
|
-
case 4:
|
|
2211
|
-
message.card = longToNumber(reader.uint64() as Long);
|
|
2212
|
-
break;
|
|
2213
|
-
case 5:
|
|
2214
|
-
message.creator = reader.string();
|
|
2215
|
-
break;
|
|
2216
|
-
case 2:
|
|
2217
|
-
message.ignore = IgnoreCouncils.decode(reader, reader.uint32());
|
|
2218
|
-
break;
|
|
2219
|
-
default:
|
|
2220
|
-
reader.skipType(tag & 7);
|
|
2221
|
-
break;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
return message;
|
|
2225
|
-
},
|
|
2226
|
-
|
|
2227
|
-
fromJSON(object: any): QueryQCouncilsRequest {
|
|
2228
|
-
return {
|
|
2229
|
-
status: isSet(object.status) ? councelingStatusFromJSON(object.status) : 0,
|
|
2230
|
-
voters: Array.isArray(object?.voters) ? object.voters.map((e: any) => String(e)) : [],
|
|
2231
|
-
card: isSet(object.card) ? Number(object.card) : 0,
|
|
2232
|
-
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
2233
|
-
ignore: isSet(object.ignore) ? IgnoreCouncils.fromJSON(object.ignore) : undefined,
|
|
2234
|
-
};
|
|
2235
|
-
},
|
|
2236
|
-
|
|
2237
|
-
toJSON(message: QueryQCouncilsRequest): unknown {
|
|
2238
|
-
const obj: any = {};
|
|
2239
|
-
message.status !== undefined && (obj.status = councelingStatusToJSON(message.status));
|
|
2240
|
-
if (message.voters) {
|
|
2241
|
-
obj.voters = message.voters.map((e) => e);
|
|
2242
|
-
} else {
|
|
2243
|
-
obj.voters = [];
|
|
2244
|
-
}
|
|
2245
|
-
message.card !== undefined && (obj.card = Math.round(message.card));
|
|
2246
|
-
message.creator !== undefined && (obj.creator = message.creator);
|
|
2247
|
-
message.ignore !== undefined && (obj.ignore = message.ignore ? IgnoreCouncils.toJSON(message.ignore) : undefined);
|
|
2248
|
-
return obj;
|
|
2249
|
-
},
|
|
2250
|
-
|
|
2251
|
-
fromPartial<I extends Exact<DeepPartial<QueryQCouncilsRequest>, I>>(object: I): QueryQCouncilsRequest {
|
|
2252
|
-
const message = createBaseQueryQCouncilsRequest();
|
|
2253
|
-
message.status = object.status ?? 0;
|
|
2254
|
-
message.voters = object.voters?.map((e) => e) || [];
|
|
2255
|
-
message.card = object.card ?? 0;
|
|
2256
|
-
message.creator = object.creator ?? "";
|
|
2257
|
-
message.ignore = (object.ignore !== undefined && object.ignore !== null)
|
|
2258
|
-
? IgnoreCouncils.fromPartial(object.ignore)
|
|
2259
|
-
: undefined;
|
|
2260
|
-
return message;
|
|
2261
|
-
},
|
|
2262
|
-
};
|
|
2263
|
-
|
|
2264
|
-
function createBaseIgnoreCouncils(): IgnoreCouncils {
|
|
2265
|
-
return { status: false, card: false };
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
export const IgnoreCouncils = {
|
|
2269
|
-
encode(message: IgnoreCouncils, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2270
|
-
if (message.status === true) {
|
|
2271
|
-
writer.uint32(8).bool(message.status);
|
|
2272
|
-
}
|
|
2273
|
-
if (message.card === true) {
|
|
2274
|
-
writer.uint32(16).bool(message.card);
|
|
2275
|
-
}
|
|
2276
|
-
return writer;
|
|
2277
|
-
},
|
|
2278
|
-
|
|
2279
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): IgnoreCouncils {
|
|
2280
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
2281
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2282
|
-
const message = createBaseIgnoreCouncils();
|
|
2283
|
-
while (reader.pos < end) {
|
|
2284
|
-
const tag = reader.uint32();
|
|
2285
|
-
switch (tag >>> 3) {
|
|
2286
|
-
case 1:
|
|
2287
|
-
message.status = reader.bool();
|
|
2288
|
-
break;
|
|
2289
|
-
case 2:
|
|
2290
|
-
message.card = reader.bool();
|
|
2291
|
-
break;
|
|
2292
|
-
default:
|
|
2293
|
-
reader.skipType(tag & 7);
|
|
2294
|
-
break;
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
return message;
|
|
2298
|
-
},
|
|
2299
|
-
|
|
2300
|
-
fromJSON(object: any): IgnoreCouncils {
|
|
2301
|
-
return {
|
|
2302
|
-
status: isSet(object.status) ? Boolean(object.status) : false,
|
|
2303
|
-
card: isSet(object.card) ? Boolean(object.card) : false,
|
|
2304
|
-
};
|
|
2305
|
-
},
|
|
2306
|
-
|
|
2307
|
-
toJSON(message: IgnoreCouncils): unknown {
|
|
2308
|
-
const obj: any = {};
|
|
2309
|
-
message.status !== undefined && (obj.status = message.status);
|
|
2310
|
-
message.card !== undefined && (obj.card = message.card);
|
|
2311
|
-
return obj;
|
|
2312
|
-
},
|
|
2313
|
-
|
|
2314
|
-
fromPartial<I extends Exact<DeepPartial<IgnoreCouncils>, I>>(object: I): IgnoreCouncils {
|
|
2315
|
-
const message = createBaseIgnoreCouncils();
|
|
2316
|
-
message.status = object.status ?? false;
|
|
2317
|
-
message.card = object.card ?? false;
|
|
2318
|
-
return message;
|
|
2319
|
-
},
|
|
2320
|
-
};
|
|
2321
|
-
|
|
2322
|
-
function createBaseQueryQCouncilsResponse(): QueryQCouncilsResponse {
|
|
2323
|
-
return { councilssIds: [], councils: [] };
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
export const QueryQCouncilsResponse = {
|
|
2327
|
-
encode(message: QueryQCouncilsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2328
|
-
writer.uint32(10).fork();
|
|
2329
|
-
for (const v of message.councilssIds) {
|
|
2330
|
-
writer.uint64(v);
|
|
2331
|
-
}
|
|
2332
|
-
writer.ldelim();
|
|
2333
|
-
for (const v of message.councils) {
|
|
2334
|
-
Council.encode(v!, writer.uint32(18).fork()).ldelim();
|
|
2335
|
-
}
|
|
2336
|
-
return writer;
|
|
2337
|
-
},
|
|
2338
|
-
|
|
2339
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): QueryQCouncilsResponse {
|
|
2340
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
2341
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2342
|
-
const message = createBaseQueryQCouncilsResponse();
|
|
2343
|
-
while (reader.pos < end) {
|
|
2344
|
-
const tag = reader.uint32();
|
|
2345
|
-
switch (tag >>> 3) {
|
|
2346
|
-
case 1:
|
|
2347
|
-
if ((tag & 7) === 2) {
|
|
2348
|
-
const end2 = reader.uint32() + reader.pos;
|
|
2349
|
-
while (reader.pos < end2) {
|
|
2350
|
-
message.councilssIds.push(longToNumber(reader.uint64() as Long));
|
|
2351
|
-
}
|
|
2352
|
-
} else {
|
|
2353
|
-
message.councilssIds.push(longToNumber(reader.uint64() as Long));
|
|
2354
|
-
}
|
|
2355
|
-
break;
|
|
2356
|
-
case 2:
|
|
2357
|
-
message.councils.push(Council.decode(reader, reader.uint32()));
|
|
2358
|
-
break;
|
|
2359
|
-
default:
|
|
2360
|
-
reader.skipType(tag & 7);
|
|
2361
|
-
break;
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
return message;
|
|
2365
|
-
},
|
|
2366
|
-
|
|
2367
|
-
fromJSON(object: any): QueryQCouncilsResponse {
|
|
2368
|
-
return {
|
|
2369
|
-
councilssIds: Array.isArray(object?.councilssIds) ? object.councilssIds.map((e: any) => Number(e)) : [],
|
|
2370
|
-
councils: Array.isArray(object?.councils) ? object.councils.map((e: any) => Council.fromJSON(e)) : [],
|
|
2371
|
-
};
|
|
2372
|
-
},
|
|
2373
|
-
|
|
2374
|
-
toJSON(message: QueryQCouncilsResponse): unknown {
|
|
2375
|
-
const obj: any = {};
|
|
2376
|
-
if (message.councilssIds) {
|
|
2377
|
-
obj.councilssIds = message.councilssIds.map((e) => Math.round(e));
|
|
2378
|
-
} else {
|
|
2379
|
-
obj.councilssIds = [];
|
|
2380
|
-
}
|
|
2381
|
-
if (message.councils) {
|
|
2382
|
-
obj.councils = message.councils.map((e) => e ? Council.toJSON(e) : undefined);
|
|
2383
|
-
} else {
|
|
2384
|
-
obj.councils = [];
|
|
2385
|
-
}
|
|
2386
|
-
return obj;
|
|
2387
|
-
},
|
|
2388
|
-
|
|
2389
|
-
fromPartial<I extends Exact<DeepPartial<QueryQCouncilsResponse>, I>>(object: I): QueryQCouncilsResponse {
|
|
2390
|
-
const message = createBaseQueryQCouncilsResponse();
|
|
2391
|
-
message.councilssIds = object.councilssIds?.map((e) => e) || [];
|
|
2392
|
-
message.councils = object.councils?.map((e) => Council.fromPartial(e)) || [];
|
|
2393
|
-
return message;
|
|
2394
|
-
},
|
|
2395
|
-
};
|
|
2396
|
-
|
|
2397
2155
|
/** Query defines the gRPC querier service. */
|
|
2398
2156
|
export interface Query {
|
|
2399
2157
|
/** Parameters queries the parameters of the module. */
|
|
@@ -2430,8 +2188,6 @@ export interface Query {
|
|
|
2430
2188
|
QCollections(request: QueryQCollectionsRequest): Promise<QueryQCollectionsResponse>;
|
|
2431
2189
|
/** Queries a list of RarityDistribution items. */
|
|
2432
2190
|
RarityDistribution(request: QueryRarityDistributionRequest): Promise<QueryRarityDistributionResponse>;
|
|
2433
|
-
/** Queries a list of QCouncils items. */
|
|
2434
|
-
QCouncils(request: QueryQCouncilsRequest): Promise<QueryQCouncilsResponse>;
|
|
2435
2191
|
}
|
|
2436
2192
|
|
|
2437
2193
|
export class QueryClientImpl implements Query {
|
|
@@ -2455,7 +2211,6 @@ export class QueryClientImpl implements Query {
|
|
|
2455
2211
|
this.QServer = this.QServer.bind(this);
|
|
2456
2212
|
this.QCollections = this.QCollections.bind(this);
|
|
2457
2213
|
this.RarityDistribution = this.RarityDistribution.bind(this);
|
|
2458
|
-
this.QCouncils = this.QCouncils.bind(this);
|
|
2459
2214
|
}
|
|
2460
2215
|
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
|
|
2461
2216
|
const data = QueryParamsRequest.encode(request).finish();
|
|
@@ -2558,12 +2313,6 @@ export class QueryClientImpl implements Query {
|
|
|
2558
2313
|
const promise = this.rpc.request("DecentralCardGame.cardchain.cardchain.Query", "RarityDistribution", data);
|
|
2559
2314
|
return promise.then((data) => QueryRarityDistributionResponse.decode(new _m0.Reader(data)));
|
|
2560
2315
|
}
|
|
2561
|
-
|
|
2562
|
-
QCouncils(request: QueryQCouncilsRequest): Promise<QueryQCouncilsResponse> {
|
|
2563
|
-
const data = QueryQCouncilsRequest.encode(request).finish();
|
|
2564
|
-
const promise = this.rpc.request("DecentralCardGame.cardchain.cardchain.Query", "QCouncils", data);
|
|
2565
|
-
return promise.then((data) => QueryQCouncilsResponse.decode(new _m0.Reader(data)));
|
|
2566
|
-
}
|
|
2567
2316
|
}
|
|
2568
2317
|
|
|
2569
2318
|
interface Rpc {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import Long from "long";
|
|
3
3
|
import _m0 from "protobufjs/minimal";
|
|
4
|
+
import { Coin } from "../../cosmos/base/v1beta1/coin";
|
|
4
5
|
import { Response, responseFromJSON, responseToJSON } from "./council";
|
|
5
6
|
|
|
6
7
|
export const protobufPackage = "DecentralCardGame.cardchain.cardchain";
|
|
@@ -61,8 +62,7 @@ export interface MsgCreateuserResponse {
|
|
|
61
62
|
|
|
62
63
|
export interface MsgBuyCardScheme {
|
|
63
64
|
creator: string;
|
|
64
|
-
|
|
65
|
-
bid: string;
|
|
65
|
+
bid: Coin | undefined;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export interface MsgBuyCardSchemeResponse {
|
|
@@ -88,6 +88,7 @@ export interface MsgSaveCardContent {
|
|
|
88
88
|
*/
|
|
89
89
|
notes: string;
|
|
90
90
|
artist: string;
|
|
91
|
+
balanceAnchor: boolean;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
export interface MsgSaveCardContentResponse {
|
|
@@ -312,6 +313,7 @@ export interface MsgCreateCouncil {
|
|
|
312
313
|
export interface MsgCreateCouncilResponse {
|
|
313
314
|
}
|
|
314
315
|
|
|
316
|
+
/** Add revision */
|
|
315
317
|
export interface MsgCommitCouncilResponse {
|
|
316
318
|
creator: string;
|
|
317
319
|
response: string;
|
|
@@ -415,6 +417,20 @@ export interface MsgSetUserBiography {
|
|
|
415
417
|
export interface MsgSetUserBiographyResponse {
|
|
416
418
|
}
|
|
417
419
|
|
|
420
|
+
export interface SingleVote {
|
|
421
|
+
cardId: number;
|
|
422
|
+
voteType: string;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** this line is used by starport scaffolding # proto/tx/message */
|
|
426
|
+
export interface MsgMultiVoteCard {
|
|
427
|
+
creator: string;
|
|
428
|
+
votes: SingleVote[];
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface MsgMultiVoteCardResponse {
|
|
432
|
+
}
|
|
433
|
+
|
|
418
434
|
function createBaseMsgCreateuser(): MsgCreateuser {
|
|
419
435
|
return { creator: "", newUser: "", alias: "" };
|
|
420
436
|
}
|
|
@@ -522,7 +538,7 @@ export const MsgCreateuserResponse = {
|
|
|
522
538
|
};
|
|
523
539
|
|
|
524
540
|
function createBaseMsgBuyCardScheme(): MsgBuyCardScheme {
|
|
525
|
-
return { creator: "", bid:
|
|
541
|
+
return { creator: "", bid: undefined };
|
|
526
542
|
}
|
|
527
543
|
|
|
528
544
|
export const MsgBuyCardScheme = {
|
|
@@ -530,8 +546,8 @@ export const MsgBuyCardScheme = {
|
|
|
530
546
|
if (message.creator !== "") {
|
|
531
547
|
writer.uint32(10).string(message.creator);
|
|
532
548
|
}
|
|
533
|
-
if (message.bid !==
|
|
534
|
-
writer.uint32(18).
|
|
549
|
+
if (message.bid !== undefined) {
|
|
550
|
+
Coin.encode(message.bid, writer.uint32(18).fork()).ldelim();
|
|
535
551
|
}
|
|
536
552
|
return writer;
|
|
537
553
|
},
|
|
@@ -547,7 +563,7 @@ export const MsgBuyCardScheme = {
|
|
|
547
563
|
message.creator = reader.string();
|
|
548
564
|
break;
|
|
549
565
|
case 2:
|
|
550
|
-
message.bid = reader.
|
|
566
|
+
message.bid = Coin.decode(reader, reader.uint32());
|
|
551
567
|
break;
|
|
552
568
|
default:
|
|
553
569
|
reader.skipType(tag & 7);
|
|
@@ -560,21 +576,21 @@ export const MsgBuyCardScheme = {
|
|
|
560
576
|
fromJSON(object: any): MsgBuyCardScheme {
|
|
561
577
|
return {
|
|
562
578
|
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
563
|
-
bid: isSet(object.bid) ?
|
|
579
|
+
bid: isSet(object.bid) ? Coin.fromJSON(object.bid) : undefined,
|
|
564
580
|
};
|
|
565
581
|
},
|
|
566
582
|
|
|
567
583
|
toJSON(message: MsgBuyCardScheme): unknown {
|
|
568
584
|
const obj: any = {};
|
|
569
585
|
message.creator !== undefined && (obj.creator = message.creator);
|
|
570
|
-
message.bid !== undefined && (obj.bid = message.bid);
|
|
586
|
+
message.bid !== undefined && (obj.bid = message.bid ? Coin.toJSON(message.bid) : undefined);
|
|
571
587
|
return obj;
|
|
572
588
|
},
|
|
573
589
|
|
|
574
590
|
fromPartial<I extends Exact<DeepPartial<MsgBuyCardScheme>, I>>(object: I): MsgBuyCardScheme {
|
|
575
591
|
const message = createBaseMsgBuyCardScheme();
|
|
576
592
|
message.creator = object.creator ?? "";
|
|
577
|
-
message.bid = object.bid
|
|
593
|
+
message.bid = (object.bid !== undefined && object.bid !== null) ? Coin.fromPartial(object.bid) : undefined;
|
|
578
594
|
return message;
|
|
579
595
|
},
|
|
580
596
|
};
|
|
@@ -733,7 +749,7 @@ export const MsgVoteCardResponse = {
|
|
|
733
749
|
};
|
|
734
750
|
|
|
735
751
|
function createBaseMsgSaveCardContent(): MsgSaveCardContent {
|
|
736
|
-
return { creator: "", cardId: 0, content: new Uint8Array(), notes: "", artist: "" };
|
|
752
|
+
return { creator: "", cardId: 0, content: new Uint8Array(), notes: "", artist: "", balanceAnchor: false };
|
|
737
753
|
}
|
|
738
754
|
|
|
739
755
|
export const MsgSaveCardContent = {
|
|
@@ -753,6 +769,9 @@ export const MsgSaveCardContent = {
|
|
|
753
769
|
if (message.artist !== "") {
|
|
754
770
|
writer.uint32(42).string(message.artist);
|
|
755
771
|
}
|
|
772
|
+
if (message.balanceAnchor === true) {
|
|
773
|
+
writer.uint32(48).bool(message.balanceAnchor);
|
|
774
|
+
}
|
|
756
775
|
return writer;
|
|
757
776
|
},
|
|
758
777
|
|
|
@@ -778,6 +797,9 @@ export const MsgSaveCardContent = {
|
|
|
778
797
|
case 5:
|
|
779
798
|
message.artist = reader.string();
|
|
780
799
|
break;
|
|
800
|
+
case 6:
|
|
801
|
+
message.balanceAnchor = reader.bool();
|
|
802
|
+
break;
|
|
781
803
|
default:
|
|
782
804
|
reader.skipType(tag & 7);
|
|
783
805
|
break;
|
|
@@ -793,6 +815,7 @@ export const MsgSaveCardContent = {
|
|
|
793
815
|
content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(),
|
|
794
816
|
notes: isSet(object.notes) ? String(object.notes) : "",
|
|
795
817
|
artist: isSet(object.artist) ? String(object.artist) : "",
|
|
818
|
+
balanceAnchor: isSet(object.balanceAnchor) ? Boolean(object.balanceAnchor) : false,
|
|
796
819
|
};
|
|
797
820
|
},
|
|
798
821
|
|
|
@@ -804,6 +827,7 @@ export const MsgSaveCardContent = {
|
|
|
804
827
|
&& (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array()));
|
|
805
828
|
message.notes !== undefined && (obj.notes = message.notes);
|
|
806
829
|
message.artist !== undefined && (obj.artist = message.artist);
|
|
830
|
+
message.balanceAnchor !== undefined && (obj.balanceAnchor = message.balanceAnchor);
|
|
807
831
|
return obj;
|
|
808
832
|
},
|
|
809
833
|
|
|
@@ -814,6 +838,7 @@ export const MsgSaveCardContent = {
|
|
|
814
838
|
message.content = object.content ?? new Uint8Array();
|
|
815
839
|
message.notes = object.notes ?? "";
|
|
816
840
|
message.artist = object.artist ?? "";
|
|
841
|
+
message.balanceAnchor = object.balanceAnchor ?? false;
|
|
817
842
|
return message;
|
|
818
843
|
},
|
|
819
844
|
};
|
|
@@ -4708,6 +4733,165 @@ export const MsgSetUserBiographyResponse = {
|
|
|
4708
4733
|
},
|
|
4709
4734
|
};
|
|
4710
4735
|
|
|
4736
|
+
function createBaseSingleVote(): SingleVote {
|
|
4737
|
+
return { cardId: 0, voteType: "" };
|
|
4738
|
+
}
|
|
4739
|
+
|
|
4740
|
+
export const SingleVote = {
|
|
4741
|
+
encode(message: SingleVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
4742
|
+
if (message.cardId !== 0) {
|
|
4743
|
+
writer.uint32(8).uint64(message.cardId);
|
|
4744
|
+
}
|
|
4745
|
+
if (message.voteType !== "") {
|
|
4746
|
+
writer.uint32(18).string(message.voteType);
|
|
4747
|
+
}
|
|
4748
|
+
return writer;
|
|
4749
|
+
},
|
|
4750
|
+
|
|
4751
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): SingleVote {
|
|
4752
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
4753
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4754
|
+
const message = createBaseSingleVote();
|
|
4755
|
+
while (reader.pos < end) {
|
|
4756
|
+
const tag = reader.uint32();
|
|
4757
|
+
switch (tag >>> 3) {
|
|
4758
|
+
case 1:
|
|
4759
|
+
message.cardId = longToNumber(reader.uint64() as Long);
|
|
4760
|
+
break;
|
|
4761
|
+
case 2:
|
|
4762
|
+
message.voteType = reader.string();
|
|
4763
|
+
break;
|
|
4764
|
+
default:
|
|
4765
|
+
reader.skipType(tag & 7);
|
|
4766
|
+
break;
|
|
4767
|
+
}
|
|
4768
|
+
}
|
|
4769
|
+
return message;
|
|
4770
|
+
},
|
|
4771
|
+
|
|
4772
|
+
fromJSON(object: any): SingleVote {
|
|
4773
|
+
return {
|
|
4774
|
+
cardId: isSet(object.cardId) ? Number(object.cardId) : 0,
|
|
4775
|
+
voteType: isSet(object.voteType) ? String(object.voteType) : "",
|
|
4776
|
+
};
|
|
4777
|
+
},
|
|
4778
|
+
|
|
4779
|
+
toJSON(message: SingleVote): unknown {
|
|
4780
|
+
const obj: any = {};
|
|
4781
|
+
message.cardId !== undefined && (obj.cardId = Math.round(message.cardId));
|
|
4782
|
+
message.voteType !== undefined && (obj.voteType = message.voteType);
|
|
4783
|
+
return obj;
|
|
4784
|
+
},
|
|
4785
|
+
|
|
4786
|
+
fromPartial<I extends Exact<DeepPartial<SingleVote>, I>>(object: I): SingleVote {
|
|
4787
|
+
const message = createBaseSingleVote();
|
|
4788
|
+
message.cardId = object.cardId ?? 0;
|
|
4789
|
+
message.voteType = object.voteType ?? "";
|
|
4790
|
+
return message;
|
|
4791
|
+
},
|
|
4792
|
+
};
|
|
4793
|
+
|
|
4794
|
+
function createBaseMsgMultiVoteCard(): MsgMultiVoteCard {
|
|
4795
|
+
return { creator: "", votes: [] };
|
|
4796
|
+
}
|
|
4797
|
+
|
|
4798
|
+
export const MsgMultiVoteCard = {
|
|
4799
|
+
encode(message: MsgMultiVoteCard, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
4800
|
+
if (message.creator !== "") {
|
|
4801
|
+
writer.uint32(10).string(message.creator);
|
|
4802
|
+
}
|
|
4803
|
+
for (const v of message.votes) {
|
|
4804
|
+
SingleVote.encode(v!, writer.uint32(18).fork()).ldelim();
|
|
4805
|
+
}
|
|
4806
|
+
return writer;
|
|
4807
|
+
},
|
|
4808
|
+
|
|
4809
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiVoteCard {
|
|
4810
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
4811
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4812
|
+
const message = createBaseMsgMultiVoteCard();
|
|
4813
|
+
while (reader.pos < end) {
|
|
4814
|
+
const tag = reader.uint32();
|
|
4815
|
+
switch (tag >>> 3) {
|
|
4816
|
+
case 1:
|
|
4817
|
+
message.creator = reader.string();
|
|
4818
|
+
break;
|
|
4819
|
+
case 2:
|
|
4820
|
+
message.votes.push(SingleVote.decode(reader, reader.uint32()));
|
|
4821
|
+
break;
|
|
4822
|
+
default:
|
|
4823
|
+
reader.skipType(tag & 7);
|
|
4824
|
+
break;
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
return message;
|
|
4828
|
+
},
|
|
4829
|
+
|
|
4830
|
+
fromJSON(object: any): MsgMultiVoteCard {
|
|
4831
|
+
return {
|
|
4832
|
+
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
4833
|
+
votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => SingleVote.fromJSON(e)) : [],
|
|
4834
|
+
};
|
|
4835
|
+
},
|
|
4836
|
+
|
|
4837
|
+
toJSON(message: MsgMultiVoteCard): unknown {
|
|
4838
|
+
const obj: any = {};
|
|
4839
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
4840
|
+
if (message.votes) {
|
|
4841
|
+
obj.votes = message.votes.map((e) => e ? SingleVote.toJSON(e) : undefined);
|
|
4842
|
+
} else {
|
|
4843
|
+
obj.votes = [];
|
|
4844
|
+
}
|
|
4845
|
+
return obj;
|
|
4846
|
+
},
|
|
4847
|
+
|
|
4848
|
+
fromPartial<I extends Exact<DeepPartial<MsgMultiVoteCard>, I>>(object: I): MsgMultiVoteCard {
|
|
4849
|
+
const message = createBaseMsgMultiVoteCard();
|
|
4850
|
+
message.creator = object.creator ?? "";
|
|
4851
|
+
message.votes = object.votes?.map((e) => SingleVote.fromPartial(e)) || [];
|
|
4852
|
+
return message;
|
|
4853
|
+
},
|
|
4854
|
+
};
|
|
4855
|
+
|
|
4856
|
+
function createBaseMsgMultiVoteCardResponse(): MsgMultiVoteCardResponse {
|
|
4857
|
+
return {};
|
|
4858
|
+
}
|
|
4859
|
+
|
|
4860
|
+
export const MsgMultiVoteCardResponse = {
|
|
4861
|
+
encode(_: MsgMultiVoteCardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
4862
|
+
return writer;
|
|
4863
|
+
},
|
|
4864
|
+
|
|
4865
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiVoteCardResponse {
|
|
4866
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
4867
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4868
|
+
const message = createBaseMsgMultiVoteCardResponse();
|
|
4869
|
+
while (reader.pos < end) {
|
|
4870
|
+
const tag = reader.uint32();
|
|
4871
|
+
switch (tag >>> 3) {
|
|
4872
|
+
default:
|
|
4873
|
+
reader.skipType(tag & 7);
|
|
4874
|
+
break;
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
return message;
|
|
4878
|
+
},
|
|
4879
|
+
|
|
4880
|
+
fromJSON(_: any): MsgMultiVoteCardResponse {
|
|
4881
|
+
return {};
|
|
4882
|
+
},
|
|
4883
|
+
|
|
4884
|
+
toJSON(_: MsgMultiVoteCardResponse): unknown {
|
|
4885
|
+
const obj: any = {};
|
|
4886
|
+
return obj;
|
|
4887
|
+
},
|
|
4888
|
+
|
|
4889
|
+
fromPartial<I extends Exact<DeepPartial<MsgMultiVoteCardResponse>, I>>(_: I): MsgMultiVoteCardResponse {
|
|
4890
|
+
const message = createBaseMsgMultiVoteCardResponse();
|
|
4891
|
+
return message;
|
|
4892
|
+
},
|
|
4893
|
+
};
|
|
4894
|
+
|
|
4711
4895
|
/** Msg defines the Msg service. */
|
|
4712
4896
|
export interface Msg {
|
|
4713
4897
|
Createuser(request: MsgCreateuser): Promise<MsgCreateuserResponse>;
|
|
@@ -4751,8 +4935,9 @@ export interface Msg {
|
|
|
4751
4935
|
SetCollectionStoryWriter(request: MsgSetCollectionStoryWriter): Promise<MsgSetCollectionStoryWriterResponse>;
|
|
4752
4936
|
SetCollectionArtist(request: MsgSetCollectionArtist): Promise<MsgSetCollectionArtistResponse>;
|
|
4753
4937
|
SetUserWebsite(request: MsgSetUserWebsite): Promise<MsgSetUserWebsiteResponse>;
|
|
4754
|
-
/** this line is used by starport scaffolding # proto/tx/rpc */
|
|
4755
4938
|
SetUserBiography(request: MsgSetUserBiography): Promise<MsgSetUserBiographyResponse>;
|
|
4939
|
+
/** this line is used by starport scaffolding # proto/tx/rpc */
|
|
4940
|
+
MultiVoteCard(request: MsgMultiVoteCard): Promise<MsgMultiVoteCardResponse>;
|
|
4756
4941
|
}
|
|
4757
4942
|
|
|
4758
4943
|
export class MsgClientImpl implements Msg {
|
|
@@ -4799,6 +4984,7 @@ export class MsgClientImpl implements Msg {
|
|
|
4799
4984
|
this.SetCollectionArtist = this.SetCollectionArtist.bind(this);
|
|
4800
4985
|
this.SetUserWebsite = this.SetUserWebsite.bind(this);
|
|
4801
4986
|
this.SetUserBiography = this.SetUserBiography.bind(this);
|
|
4987
|
+
this.MultiVoteCard = this.MultiVoteCard.bind(this);
|
|
4802
4988
|
}
|
|
4803
4989
|
Createuser(request: MsgCreateuser): Promise<MsgCreateuserResponse> {
|
|
4804
4990
|
const data = MsgCreateuser.encode(request).finish();
|
|
@@ -5047,6 +5233,12 @@ export class MsgClientImpl implements Msg {
|
|
|
5047
5233
|
const promise = this.rpc.request("DecentralCardGame.cardchain.cardchain.Msg", "SetUserBiography", data);
|
|
5048
5234
|
return promise.then((data) => MsgSetUserBiographyResponse.decode(new _m0.Reader(data)));
|
|
5049
5235
|
}
|
|
5236
|
+
|
|
5237
|
+
MultiVoteCard(request: MsgMultiVoteCard): Promise<MsgMultiVoteCardResponse> {
|
|
5238
|
+
const data = MsgMultiVoteCard.encode(request).finish();
|
|
5239
|
+
const promise = this.rpc.request("DecentralCardGame.cardchain.cardchain.Msg", "MultiVoteCard", data);
|
|
5240
|
+
return promise.then((data) => MsgMultiVoteCardResponse.decode(new _m0.Reader(data)));
|
|
5241
|
+
}
|
|
5050
5242
|
}
|
|
5051
5243
|
|
|
5052
5244
|
interface Rpc {
|