zklighter-perps 1.0.335 → 1.0.337
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/.openapi-generator/FILES +18 -0
- package/apis/GuildApi.ts +1211 -65
- package/models/Guild.ts +16 -0
- package/models/GuildDuel.ts +231 -0
- package/models/GuildDuelMemberScore.ts +106 -0
- package/models/GuildDuelOffer.ts +212 -0
- package/models/GuildDuelPayout.ts +144 -0
- package/models/GuildDuelRecord.ts +88 -0
- package/models/GuildDuelRosterMember.ts +79 -0
- package/models/GuildDuelScore.ts +79 -0
- package/models/GuildDuelSide.ts +115 -0
- package/models/GuildDuelStakeInfo.ts +88 -0
- package/models/GuildDuelTerms.ts +120 -0
- package/models/GuildListItem.ts +16 -0
- package/models/GuildMember.ts +9 -0
- package/models/NotificationPreferences.ts +9 -0
- package/models/ReqGetGuildDuel.ts +61 -0
- package/models/ReqGetGuildDuelList.ts +98 -0
- package/models/ReqGetGuildDuelMine.ts +107 -0
- package/models/ReqGetGuildDuelMineDetail.ts +78 -0
- package/models/RespGetGuild.ts +15 -0
- package/models/RespGetGuildDuel.ts +160 -0
- package/models/RespGetGuildDuelList.ts +93 -0
- package/models/RespGuildDuelMetrics.ts +78 -0
- package/models/RespGuildDuelOptIn.ts +78 -0
- package/models/index.ts +18 -0
- package/openapi.json +3668 -2118
- package/package.json +1 -1
package/apis/GuildApi.ts
CHANGED
|
@@ -17,8 +17,12 @@ import * as runtime from '../runtime';
|
|
|
17
17
|
import type {
|
|
18
18
|
Guild,
|
|
19
19
|
RespGetGuild,
|
|
20
|
+
RespGetGuildDuel,
|
|
21
|
+
RespGetGuildDuelList,
|
|
20
22
|
RespGetGuildList,
|
|
21
23
|
RespGuildByReferralCode,
|
|
24
|
+
RespGuildDuelMetrics,
|
|
25
|
+
RespGuildDuelOptIn,
|
|
22
26
|
RespGuildInviteCodes,
|
|
23
27
|
RespGuildJoinRequest,
|
|
24
28
|
RespGuildJoinRequests,
|
|
@@ -32,10 +36,18 @@ import {
|
|
|
32
36
|
GuildToJSON,
|
|
33
37
|
RespGetGuildFromJSON,
|
|
34
38
|
RespGetGuildToJSON,
|
|
39
|
+
RespGetGuildDuelFromJSON,
|
|
40
|
+
RespGetGuildDuelToJSON,
|
|
41
|
+
RespGetGuildDuelListFromJSON,
|
|
42
|
+
RespGetGuildDuelListToJSON,
|
|
35
43
|
RespGetGuildListFromJSON,
|
|
36
44
|
RespGetGuildListToJSON,
|
|
37
45
|
RespGuildByReferralCodeFromJSON,
|
|
38
46
|
RespGuildByReferralCodeToJSON,
|
|
47
|
+
RespGuildDuelMetricsFromJSON,
|
|
48
|
+
RespGuildDuelMetricsToJSON,
|
|
49
|
+
RespGuildDuelOptInFromJSON,
|
|
50
|
+
RespGuildDuelOptInToJSON,
|
|
39
51
|
RespGuildInviteCodesFromJSON,
|
|
40
52
|
RespGuildInviteCodesToJSON,
|
|
41
53
|
RespGuildJoinRequestFromJSON,
|
|
@@ -77,6 +89,90 @@ export interface GuildCreateRequest {
|
|
|
77
89
|
max_members?: number;
|
|
78
90
|
}
|
|
79
91
|
|
|
92
|
+
export interface GuildDuelRequest {
|
|
93
|
+
duel_id: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface GuildDuelAcceptRequest {
|
|
97
|
+
account_index: number;
|
|
98
|
+
duel_id: number;
|
|
99
|
+
offer_id: number;
|
|
100
|
+
authorization?: string;
|
|
101
|
+
auth?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface GuildDuelCancelRequest {
|
|
105
|
+
account_index: number;
|
|
106
|
+
duel_id: number;
|
|
107
|
+
authorization?: string;
|
|
108
|
+
auth?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface GuildDuelChallengeRequest {
|
|
112
|
+
account_index: number;
|
|
113
|
+
target_guild_id: number;
|
|
114
|
+
metric: GuildDuelChallengeMetricEnum;
|
|
115
|
+
stake_amount: number;
|
|
116
|
+
start_time: number;
|
|
117
|
+
duration_secs: number;
|
|
118
|
+
min_members: number;
|
|
119
|
+
authorization?: string;
|
|
120
|
+
auth?: string;
|
|
121
|
+
message?: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface GuildDuelCounterRequest {
|
|
125
|
+
account_index: number;
|
|
126
|
+
duel_id: number;
|
|
127
|
+
offer_id: number;
|
|
128
|
+
metric: GuildDuelCounterMetricEnum;
|
|
129
|
+
stake_amount: number;
|
|
130
|
+
start_time: number;
|
|
131
|
+
duration_secs: number;
|
|
132
|
+
min_members: number;
|
|
133
|
+
authorization?: string;
|
|
134
|
+
auth?: string;
|
|
135
|
+
message?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface GuildDuelDeclineRequest {
|
|
139
|
+
account_index: number;
|
|
140
|
+
duel_id: number;
|
|
141
|
+
offer_id: number;
|
|
142
|
+
authorization?: string;
|
|
143
|
+
auth?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface GuildDuelListRequest {
|
|
147
|
+
limit: number;
|
|
148
|
+
guild_id?: number;
|
|
149
|
+
status?: GuildDuelListStatusEnum;
|
|
150
|
+
cursor?: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface GuildDuelOptInRequest {
|
|
154
|
+
account_index: number;
|
|
155
|
+
opt_in: boolean;
|
|
156
|
+
authorization?: string;
|
|
157
|
+
auth?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface GuildDuelRosterRequest {
|
|
161
|
+
account_index: number;
|
|
162
|
+
duel_id: number;
|
|
163
|
+
authorization?: string;
|
|
164
|
+
auth?: string;
|
|
165
|
+
l1_addresses?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface GuildDuelStakeRequest {
|
|
169
|
+
account_index: number;
|
|
170
|
+
duel_id: number;
|
|
171
|
+
tx_hash: string;
|
|
172
|
+
authorization?: string;
|
|
173
|
+
auth?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
80
176
|
export interface GuildInviteCodeCreateRequest {
|
|
81
177
|
account_index: number;
|
|
82
178
|
authorization?: string;
|
|
@@ -161,6 +257,22 @@ export interface GuildMembershipRequest {
|
|
|
161
257
|
auth?: string;
|
|
162
258
|
}
|
|
163
259
|
|
|
260
|
+
export interface GuildMyDuelRequest {
|
|
261
|
+
account_index: number;
|
|
262
|
+
duel_id: number;
|
|
263
|
+
authorization?: string;
|
|
264
|
+
auth?: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface GuildMyDuelsRequest {
|
|
268
|
+
account_index: number;
|
|
269
|
+
limit: number;
|
|
270
|
+
authorization?: string;
|
|
271
|
+
auth?: string;
|
|
272
|
+
status?: GuildMyDuelsStatusEnum;
|
|
273
|
+
cursor?: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
164
276
|
export interface GuildRequestsRequest {
|
|
165
277
|
account_index: number;
|
|
166
278
|
authorization?: string;
|
|
@@ -199,14 +311,798 @@ export interface GuildUpdateRequest {
|
|
|
199
311
|
export class GuildApi extends runtime.BaseAPI {
|
|
200
312
|
|
|
201
313
|
/**
|
|
202
|
-
* Public guild page: identity, leader, members
|
|
203
|
-
* guild
|
|
314
|
+
* Public guild page: identity, leader, members
|
|
315
|
+
* guild
|
|
316
|
+
*/
|
|
317
|
+
async guildRaw(requestParameters: GuildRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuild>> {
|
|
318
|
+
if (requestParameters['guild_id'] == null) {
|
|
319
|
+
throw new runtime.RequiredError(
|
|
320
|
+
'guild_id',
|
|
321
|
+
'Required parameter "guild_id" was null or undefined when calling guild().'
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const queryParameters: any = {};
|
|
326
|
+
|
|
327
|
+
if (requestParameters['guild_id'] != null) {
|
|
328
|
+
queryParameters['guild_id'] = requestParameters['guild_id'];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (requestParameters['include_positions'] != null) {
|
|
332
|
+
queryParameters['include_positions'] = requestParameters['include_positions'];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
336
|
+
|
|
337
|
+
const response = await this.request({
|
|
338
|
+
path: `/api/v1/guild`,
|
|
339
|
+
method: 'GET',
|
|
340
|
+
headers: headerParameters,
|
|
341
|
+
query: queryParameters,
|
|
342
|
+
}, initOverrides);
|
|
343
|
+
|
|
344
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildFromJSON(jsonValue));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Public guild page: identity, leader, members
|
|
349
|
+
* guild
|
|
350
|
+
*/
|
|
351
|
+
async guild(requestParameters: GuildRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuild> {
|
|
352
|
+
const response = await this.guildRaw(requestParameters, initOverrides);
|
|
353
|
+
return await response.value();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Archive the caller\'s guild (leader only, no other members)
|
|
358
|
+
* guild_archive
|
|
359
|
+
*/
|
|
360
|
+
async guildArchiveRaw(requestParameters: GuildArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
361
|
+
if (requestParameters['account_index'] == null) {
|
|
362
|
+
throw new runtime.RequiredError(
|
|
363
|
+
'account_index',
|
|
364
|
+
'Required parameter "account_index" was null or undefined when calling guildArchive().'
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const queryParameters: any = {};
|
|
369
|
+
|
|
370
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
371
|
+
|
|
372
|
+
if (requestParameters['authorization'] != null) {
|
|
373
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const consumes: runtime.Consume[] = [
|
|
377
|
+
{ contentType: 'multipart/form-data' },
|
|
378
|
+
];
|
|
379
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
380
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
381
|
+
|
|
382
|
+
let formParams: { append(param: string, value: any): any };
|
|
383
|
+
let useForm = false;
|
|
384
|
+
if (useForm) {
|
|
385
|
+
formParams = new FormData();
|
|
386
|
+
} else {
|
|
387
|
+
formParams = new URLSearchParams();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (requestParameters['auth'] != null) {
|
|
391
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (requestParameters['account_index'] != null) {
|
|
395
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const response = await this.request({
|
|
399
|
+
path: `/api/v1/guild/archive`,
|
|
400
|
+
method: 'POST',
|
|
401
|
+
headers: headerParameters,
|
|
402
|
+
query: queryParameters,
|
|
403
|
+
body: formParams,
|
|
404
|
+
}, initOverrides);
|
|
405
|
+
|
|
406
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Archive the caller\'s guild (leader only, no other members)
|
|
411
|
+
* guild_archive
|
|
412
|
+
*/
|
|
413
|
+
async guildArchive(requestParameters: GuildArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
414
|
+
const response = await this.guildArchiveRaw(requestParameters, initOverrides);
|
|
415
|
+
return await response.value();
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Active guild of a referral code\'s owner, for the pre-redemption join prompt (empty if none)
|
|
420
|
+
* guild_byReferralCode
|
|
421
|
+
*/
|
|
422
|
+
async guildByReferralCodeRaw(requestParameters: GuildByReferralCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGuildByReferralCode>> {
|
|
423
|
+
if (requestParameters['code'] == null) {
|
|
424
|
+
throw new runtime.RequiredError(
|
|
425
|
+
'code',
|
|
426
|
+
'Required parameter "code" was null or undefined when calling guildByReferralCode().'
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const queryParameters: any = {};
|
|
431
|
+
|
|
432
|
+
if (requestParameters['code'] != null) {
|
|
433
|
+
queryParameters['code'] = requestParameters['code'];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
437
|
+
|
|
438
|
+
const response = await this.request({
|
|
439
|
+
path: `/api/v1/guild/byReferralCode`,
|
|
440
|
+
method: 'GET',
|
|
441
|
+
headers: headerParameters,
|
|
442
|
+
query: queryParameters,
|
|
443
|
+
}, initOverrides);
|
|
444
|
+
|
|
445
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGuildByReferralCodeFromJSON(jsonValue));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Active guild of a referral code\'s owner, for the pre-redemption join prompt (empty if none)
|
|
450
|
+
* guild_byReferralCode
|
|
451
|
+
*/
|
|
452
|
+
async guildByReferralCode(requestParameters: GuildByReferralCodeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGuildByReferralCode> {
|
|
453
|
+
const response = await this.guildByReferralCodeRaw(requestParameters, initOverrides);
|
|
454
|
+
return await response.value();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Create a guild (whitelisted creators only, one guild per creator)
|
|
459
|
+
* guild_create
|
|
460
|
+
*/
|
|
461
|
+
async guildCreateRaw(requestParameters: GuildCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Guild>> {
|
|
462
|
+
if (requestParameters['account_index'] == null) {
|
|
463
|
+
throw new runtime.RequiredError(
|
|
464
|
+
'account_index',
|
|
465
|
+
'Required parameter "account_index" was null or undefined when calling guildCreate().'
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (requestParameters['name'] == null) {
|
|
470
|
+
throw new runtime.RequiredError(
|
|
471
|
+
'name',
|
|
472
|
+
'Required parameter "name" was null or undefined when calling guildCreate().'
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
const queryParameters: any = {};
|
|
477
|
+
|
|
478
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
479
|
+
|
|
480
|
+
if (requestParameters['authorization'] != null) {
|
|
481
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const consumes: runtime.Consume[] = [
|
|
485
|
+
{ contentType: 'multipart/form-data' },
|
|
486
|
+
];
|
|
487
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
488
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
489
|
+
|
|
490
|
+
let formParams: { append(param: string, value: any): any };
|
|
491
|
+
let useForm = false;
|
|
492
|
+
if (useForm) {
|
|
493
|
+
formParams = new FormData();
|
|
494
|
+
} else {
|
|
495
|
+
formParams = new URLSearchParams();
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (requestParameters['auth'] != null) {
|
|
499
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (requestParameters['account_index'] != null) {
|
|
503
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (requestParameters['name'] != null) {
|
|
507
|
+
formParams.append('name', requestParameters['name'] as any);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
if (requestParameters['description'] != null) {
|
|
511
|
+
formParams.append('description', requestParameters['description'] as any);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (requestParameters['accepts_join_requests'] != null) {
|
|
515
|
+
formParams.append('accepts_join_requests', requestParameters['accepts_join_requests'] as any);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
if (requestParameters['max_members'] != null) {
|
|
519
|
+
formParams.append('max_members', requestParameters['max_members'] as any);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const response = await this.request({
|
|
523
|
+
path: `/api/v1/guild/create`,
|
|
524
|
+
method: 'POST',
|
|
525
|
+
headers: headerParameters,
|
|
526
|
+
query: queryParameters,
|
|
527
|
+
body: formParams,
|
|
528
|
+
}, initOverrides);
|
|
529
|
+
|
|
530
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GuildFromJSON(jsonValue));
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Create a guild (whitelisted creators only, one guild per creator)
|
|
535
|
+
* guild_create
|
|
536
|
+
*/
|
|
537
|
+
async guildCreate(requestParameters: GuildCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Guild> {
|
|
538
|
+
const response = await this.guildCreateRaw(requestParameters, initOverrides);
|
|
539
|
+
return await response.value();
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Public duel detail (funded/live/finished/settled only): sides, terms, offer history, locked rosters
|
|
544
|
+
* guild_duel
|
|
545
|
+
*/
|
|
546
|
+
async guildDuelRaw(requestParameters: GuildDuelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
547
|
+
if (requestParameters['duel_id'] == null) {
|
|
548
|
+
throw new runtime.RequiredError(
|
|
549
|
+
'duel_id',
|
|
550
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuel().'
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const queryParameters: any = {};
|
|
555
|
+
|
|
556
|
+
if (requestParameters['duel_id'] != null) {
|
|
557
|
+
queryParameters['duel_id'] = requestParameters['duel_id'];
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
561
|
+
|
|
562
|
+
const response = await this.request({
|
|
563
|
+
path: `/api/v1/guild/duel`,
|
|
564
|
+
method: 'GET',
|
|
565
|
+
headers: headerParameters,
|
|
566
|
+
query: queryParameters,
|
|
567
|
+
}, initOverrides);
|
|
568
|
+
|
|
569
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Public duel detail (funded/live/finished/settled only): sides, terms, offer history, locked rosters
|
|
574
|
+
* guild_duel
|
|
575
|
+
*/
|
|
576
|
+
async guildDuel(requestParameters: GuildDuelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
577
|
+
const response = await this.guildDuelRaw(requestParameters, initOverrides);
|
|
578
|
+
return await response.value();
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Accept the pending offer (leader of the side that did not author it)
|
|
583
|
+
* guild_duel_accept
|
|
584
|
+
*/
|
|
585
|
+
async guildDuelAcceptRaw(requestParameters: GuildDuelAcceptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
586
|
+
if (requestParameters['account_index'] == null) {
|
|
587
|
+
throw new runtime.RequiredError(
|
|
588
|
+
'account_index',
|
|
589
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelAccept().'
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (requestParameters['duel_id'] == null) {
|
|
594
|
+
throw new runtime.RequiredError(
|
|
595
|
+
'duel_id',
|
|
596
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelAccept().'
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
if (requestParameters['offer_id'] == null) {
|
|
601
|
+
throw new runtime.RequiredError(
|
|
602
|
+
'offer_id',
|
|
603
|
+
'Required parameter "offer_id" was null or undefined when calling guildDuelAccept().'
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
const queryParameters: any = {};
|
|
608
|
+
|
|
609
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
610
|
+
|
|
611
|
+
if (requestParameters['authorization'] != null) {
|
|
612
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const consumes: runtime.Consume[] = [
|
|
616
|
+
{ contentType: 'multipart/form-data' },
|
|
617
|
+
];
|
|
618
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
619
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
620
|
+
|
|
621
|
+
let formParams: { append(param: string, value: any): any };
|
|
622
|
+
let useForm = false;
|
|
623
|
+
if (useForm) {
|
|
624
|
+
formParams = new FormData();
|
|
625
|
+
} else {
|
|
626
|
+
formParams = new URLSearchParams();
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
if (requestParameters['auth'] != null) {
|
|
630
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
if (requestParameters['account_index'] != null) {
|
|
634
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (requestParameters['duel_id'] != null) {
|
|
638
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (requestParameters['offer_id'] != null) {
|
|
642
|
+
formParams.append('offer_id', requestParameters['offer_id'] as any);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const response = await this.request({
|
|
646
|
+
path: `/api/v1/guild/duel/accept`,
|
|
647
|
+
method: 'POST',
|
|
648
|
+
headers: headerParameters,
|
|
649
|
+
query: queryParameters,
|
|
650
|
+
body: formParams,
|
|
651
|
+
}, initOverrides);
|
|
652
|
+
|
|
653
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Accept the pending offer (leader of the side that did not author it)
|
|
658
|
+
* guild_duel_accept
|
|
659
|
+
*/
|
|
660
|
+
async guildDuelAccept(requestParameters: GuildDuelAcceptRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
661
|
+
const response = await this.guildDuelAcceptRaw(requestParameters, initOverrides);
|
|
662
|
+
return await response.value();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Cancel: proposer while proposed; either leader while accepted
|
|
667
|
+
* guild_duel_cancel
|
|
668
|
+
*/
|
|
669
|
+
async guildDuelCancelRaw(requestParameters: GuildDuelCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
670
|
+
if (requestParameters['account_index'] == null) {
|
|
671
|
+
throw new runtime.RequiredError(
|
|
672
|
+
'account_index',
|
|
673
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelCancel().'
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if (requestParameters['duel_id'] == null) {
|
|
678
|
+
throw new runtime.RequiredError(
|
|
679
|
+
'duel_id',
|
|
680
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelCancel().'
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
const queryParameters: any = {};
|
|
685
|
+
|
|
686
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
687
|
+
|
|
688
|
+
if (requestParameters['authorization'] != null) {
|
|
689
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const consumes: runtime.Consume[] = [
|
|
693
|
+
{ contentType: 'multipart/form-data' },
|
|
694
|
+
];
|
|
695
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
696
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
697
|
+
|
|
698
|
+
let formParams: { append(param: string, value: any): any };
|
|
699
|
+
let useForm = false;
|
|
700
|
+
if (useForm) {
|
|
701
|
+
formParams = new FormData();
|
|
702
|
+
} else {
|
|
703
|
+
formParams = new URLSearchParams();
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
if (requestParameters['auth'] != null) {
|
|
707
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (requestParameters['account_index'] != null) {
|
|
711
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (requestParameters['duel_id'] != null) {
|
|
715
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
const response = await this.request({
|
|
719
|
+
path: `/api/v1/guild/duel/cancel`,
|
|
720
|
+
method: 'POST',
|
|
721
|
+
headers: headerParameters,
|
|
722
|
+
query: queryParameters,
|
|
723
|
+
body: formParams,
|
|
724
|
+
}, initOverrides);
|
|
725
|
+
|
|
726
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Cancel: proposer while proposed; either leader while accepted
|
|
731
|
+
* guild_duel_cancel
|
|
732
|
+
*/
|
|
733
|
+
async guildDuelCancel(requestParameters: GuildDuelCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
734
|
+
const response = await this.guildDuelCancelRaw(requestParameters, initOverrides);
|
|
735
|
+
return await response.value();
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Challenge another guild (leader only)
|
|
740
|
+
* guild_duel_challenge
|
|
741
|
+
*/
|
|
742
|
+
async guildDuelChallengeRaw(requestParameters: GuildDuelChallengeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
743
|
+
if (requestParameters['account_index'] == null) {
|
|
744
|
+
throw new runtime.RequiredError(
|
|
745
|
+
'account_index',
|
|
746
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelChallenge().'
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (requestParameters['target_guild_id'] == null) {
|
|
751
|
+
throw new runtime.RequiredError(
|
|
752
|
+
'target_guild_id',
|
|
753
|
+
'Required parameter "target_guild_id" was null or undefined when calling guildDuelChallenge().'
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (requestParameters['metric'] == null) {
|
|
758
|
+
throw new runtime.RequiredError(
|
|
759
|
+
'metric',
|
|
760
|
+
'Required parameter "metric" was null or undefined when calling guildDuelChallenge().'
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if (requestParameters['stake_amount'] == null) {
|
|
765
|
+
throw new runtime.RequiredError(
|
|
766
|
+
'stake_amount',
|
|
767
|
+
'Required parameter "stake_amount" was null or undefined when calling guildDuelChallenge().'
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
if (requestParameters['start_time'] == null) {
|
|
772
|
+
throw new runtime.RequiredError(
|
|
773
|
+
'start_time',
|
|
774
|
+
'Required parameter "start_time" was null or undefined when calling guildDuelChallenge().'
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (requestParameters['duration_secs'] == null) {
|
|
779
|
+
throw new runtime.RequiredError(
|
|
780
|
+
'duration_secs',
|
|
781
|
+
'Required parameter "duration_secs" was null or undefined when calling guildDuelChallenge().'
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
if (requestParameters['min_members'] == null) {
|
|
786
|
+
throw new runtime.RequiredError(
|
|
787
|
+
'min_members',
|
|
788
|
+
'Required parameter "min_members" was null or undefined when calling guildDuelChallenge().'
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
const queryParameters: any = {};
|
|
793
|
+
|
|
794
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
795
|
+
|
|
796
|
+
if (requestParameters['authorization'] != null) {
|
|
797
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
const consumes: runtime.Consume[] = [
|
|
801
|
+
{ contentType: 'multipart/form-data' },
|
|
802
|
+
];
|
|
803
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
804
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
805
|
+
|
|
806
|
+
let formParams: { append(param: string, value: any): any };
|
|
807
|
+
let useForm = false;
|
|
808
|
+
if (useForm) {
|
|
809
|
+
formParams = new FormData();
|
|
810
|
+
} else {
|
|
811
|
+
formParams = new URLSearchParams();
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (requestParameters['auth'] != null) {
|
|
815
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (requestParameters['account_index'] != null) {
|
|
819
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
if (requestParameters['target_guild_id'] != null) {
|
|
823
|
+
formParams.append('target_guild_id', requestParameters['target_guild_id'] as any);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
if (requestParameters['metric'] != null) {
|
|
827
|
+
formParams.append('metric', requestParameters['metric'] as any);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
if (requestParameters['stake_amount'] != null) {
|
|
831
|
+
formParams.append('stake_amount', requestParameters['stake_amount'] as any);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
if (requestParameters['start_time'] != null) {
|
|
835
|
+
formParams.append('start_time', requestParameters['start_time'] as any);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (requestParameters['duration_secs'] != null) {
|
|
839
|
+
formParams.append('duration_secs', requestParameters['duration_secs'] as any);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
if (requestParameters['min_members'] != null) {
|
|
843
|
+
formParams.append('min_members', requestParameters['min_members'] as any);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
if (requestParameters['message'] != null) {
|
|
847
|
+
formParams.append('message', requestParameters['message'] as any);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const response = await this.request({
|
|
851
|
+
path: `/api/v1/guild/duel/challenge`,
|
|
852
|
+
method: 'POST',
|
|
853
|
+
headers: headerParameters,
|
|
854
|
+
query: queryParameters,
|
|
855
|
+
body: formParams,
|
|
856
|
+
}, initOverrides);
|
|
857
|
+
|
|
858
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Challenge another guild (leader only)
|
|
863
|
+
* guild_duel_challenge
|
|
864
|
+
*/
|
|
865
|
+
async guildDuelChallenge(requestParameters: GuildDuelChallengeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
866
|
+
const response = await this.guildDuelChallengeRaw(requestParameters, initOverrides);
|
|
867
|
+
return await response.value();
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Counter the pending offer with new terms (leader of the side that did not author it)
|
|
872
|
+
* guild_duel_counter
|
|
873
|
+
*/
|
|
874
|
+
async guildDuelCounterRaw(requestParameters: GuildDuelCounterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
875
|
+
if (requestParameters['account_index'] == null) {
|
|
876
|
+
throw new runtime.RequiredError(
|
|
877
|
+
'account_index',
|
|
878
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelCounter().'
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
if (requestParameters['duel_id'] == null) {
|
|
883
|
+
throw new runtime.RequiredError(
|
|
884
|
+
'duel_id',
|
|
885
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelCounter().'
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (requestParameters['offer_id'] == null) {
|
|
890
|
+
throw new runtime.RequiredError(
|
|
891
|
+
'offer_id',
|
|
892
|
+
'Required parameter "offer_id" was null or undefined when calling guildDuelCounter().'
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
if (requestParameters['metric'] == null) {
|
|
897
|
+
throw new runtime.RequiredError(
|
|
898
|
+
'metric',
|
|
899
|
+
'Required parameter "metric" was null or undefined when calling guildDuelCounter().'
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (requestParameters['stake_amount'] == null) {
|
|
904
|
+
throw new runtime.RequiredError(
|
|
905
|
+
'stake_amount',
|
|
906
|
+
'Required parameter "stake_amount" was null or undefined when calling guildDuelCounter().'
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
if (requestParameters['start_time'] == null) {
|
|
911
|
+
throw new runtime.RequiredError(
|
|
912
|
+
'start_time',
|
|
913
|
+
'Required parameter "start_time" was null or undefined when calling guildDuelCounter().'
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
if (requestParameters['duration_secs'] == null) {
|
|
918
|
+
throw new runtime.RequiredError(
|
|
919
|
+
'duration_secs',
|
|
920
|
+
'Required parameter "duration_secs" was null or undefined when calling guildDuelCounter().'
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
if (requestParameters['min_members'] == null) {
|
|
925
|
+
throw new runtime.RequiredError(
|
|
926
|
+
'min_members',
|
|
927
|
+
'Required parameter "min_members" was null or undefined when calling guildDuelCounter().'
|
|
928
|
+
);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const queryParameters: any = {};
|
|
932
|
+
|
|
933
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
934
|
+
|
|
935
|
+
if (requestParameters['authorization'] != null) {
|
|
936
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
const consumes: runtime.Consume[] = [
|
|
940
|
+
{ contentType: 'multipart/form-data' },
|
|
941
|
+
];
|
|
942
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
943
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
944
|
+
|
|
945
|
+
let formParams: { append(param: string, value: any): any };
|
|
946
|
+
let useForm = false;
|
|
947
|
+
if (useForm) {
|
|
948
|
+
formParams = new FormData();
|
|
949
|
+
} else {
|
|
950
|
+
formParams = new URLSearchParams();
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
if (requestParameters['auth'] != null) {
|
|
954
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
if (requestParameters['account_index'] != null) {
|
|
958
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
if (requestParameters['duel_id'] != null) {
|
|
962
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
if (requestParameters['offer_id'] != null) {
|
|
966
|
+
formParams.append('offer_id', requestParameters['offer_id'] as any);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
if (requestParameters['metric'] != null) {
|
|
970
|
+
formParams.append('metric', requestParameters['metric'] as any);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
if (requestParameters['stake_amount'] != null) {
|
|
974
|
+
formParams.append('stake_amount', requestParameters['stake_amount'] as any);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (requestParameters['start_time'] != null) {
|
|
978
|
+
formParams.append('start_time', requestParameters['start_time'] as any);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
if (requestParameters['duration_secs'] != null) {
|
|
982
|
+
formParams.append('duration_secs', requestParameters['duration_secs'] as any);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
if (requestParameters['min_members'] != null) {
|
|
986
|
+
formParams.append('min_members', requestParameters['min_members'] as any);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
if (requestParameters['message'] != null) {
|
|
990
|
+
formParams.append('message', requestParameters['message'] as any);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
const response = await this.request({
|
|
994
|
+
path: `/api/v1/guild/duel/counter`,
|
|
995
|
+
method: 'POST',
|
|
996
|
+
headers: headerParameters,
|
|
997
|
+
query: queryParameters,
|
|
998
|
+
body: formParams,
|
|
999
|
+
}, initOverrides);
|
|
1000
|
+
|
|
1001
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Counter the pending offer with new terms (leader of the side that did not author it)
|
|
1006
|
+
* guild_duel_counter
|
|
1007
|
+
*/
|
|
1008
|
+
async guildDuelCounter(requestParameters: GuildDuelCounterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
1009
|
+
const response = await this.guildDuelCounterRaw(requestParameters, initOverrides);
|
|
1010
|
+
return await response.value();
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Decline the pending offer (leader of the side it was made to)
|
|
1015
|
+
* guild_duel_decline
|
|
1016
|
+
*/
|
|
1017
|
+
async guildDuelDeclineRaw(requestParameters: GuildDuelDeclineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
1018
|
+
if (requestParameters['account_index'] == null) {
|
|
1019
|
+
throw new runtime.RequiredError(
|
|
1020
|
+
'account_index',
|
|
1021
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelDecline().'
|
|
1022
|
+
);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
if (requestParameters['duel_id'] == null) {
|
|
1026
|
+
throw new runtime.RequiredError(
|
|
1027
|
+
'duel_id',
|
|
1028
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelDecline().'
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
if (requestParameters['offer_id'] == null) {
|
|
1033
|
+
throw new runtime.RequiredError(
|
|
1034
|
+
'offer_id',
|
|
1035
|
+
'Required parameter "offer_id" was null or undefined when calling guildDuelDecline().'
|
|
1036
|
+
);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
const queryParameters: any = {};
|
|
1040
|
+
|
|
1041
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1042
|
+
|
|
1043
|
+
if (requestParameters['authorization'] != null) {
|
|
1044
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
const consumes: runtime.Consume[] = [
|
|
1048
|
+
{ contentType: 'multipart/form-data' },
|
|
1049
|
+
];
|
|
1050
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
1051
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
1052
|
+
|
|
1053
|
+
let formParams: { append(param: string, value: any): any };
|
|
1054
|
+
let useForm = false;
|
|
1055
|
+
if (useForm) {
|
|
1056
|
+
formParams = new FormData();
|
|
1057
|
+
} else {
|
|
1058
|
+
formParams = new URLSearchParams();
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
if (requestParameters['auth'] != null) {
|
|
1062
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
if (requestParameters['account_index'] != null) {
|
|
1066
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
if (requestParameters['duel_id'] != null) {
|
|
1070
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
if (requestParameters['offer_id'] != null) {
|
|
1074
|
+
formParams.append('offer_id', requestParameters['offer_id'] as any);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
const response = await this.request({
|
|
1078
|
+
path: `/api/v1/guild/duel/decline`,
|
|
1079
|
+
method: 'POST',
|
|
1080
|
+
headers: headerParameters,
|
|
1081
|
+
query: queryParameters,
|
|
1082
|
+
body: formParams,
|
|
1083
|
+
}, initOverrides);
|
|
1084
|
+
|
|
1085
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Decline the pending offer (leader of the side it was made to)
|
|
1090
|
+
* guild_duel_decline
|
|
1091
|
+
*/
|
|
1092
|
+
async guildDuelDecline(requestParameters: GuildDuelDeclineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
1093
|
+
const response = await this.guildDuelDeclineRaw(requestParameters, initOverrides);
|
|
1094
|
+
return await response.value();
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Public duels (both stakes in escrow) of a guild or all, newest first; status=upcoming|live|finished|all
|
|
1099
|
+
* guild_duel_list
|
|
204
1100
|
*/
|
|
205
|
-
async
|
|
206
|
-
if (requestParameters['
|
|
1101
|
+
async guildDuelListRaw(requestParameters: GuildDuelListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuelList>> {
|
|
1102
|
+
if (requestParameters['limit'] == null) {
|
|
207
1103
|
throw new runtime.RequiredError(
|
|
208
|
-
'
|
|
209
|
-
'Required parameter "
|
|
1104
|
+
'limit',
|
|
1105
|
+
'Required parameter "limit" was null or undefined when calling guildDuelList().'
|
|
210
1106
|
);
|
|
211
1107
|
}
|
|
212
1108
|
|
|
@@ -216,40 +1112,83 @@ export class GuildApi extends runtime.BaseAPI {
|
|
|
216
1112
|
queryParameters['guild_id'] = requestParameters['guild_id'];
|
|
217
1113
|
}
|
|
218
1114
|
|
|
219
|
-
if (requestParameters['
|
|
220
|
-
queryParameters['
|
|
1115
|
+
if (requestParameters['status'] != null) {
|
|
1116
|
+
queryParameters['status'] = requestParameters['status'];
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
if (requestParameters['limit'] != null) {
|
|
1120
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
if (requestParameters['cursor'] != null) {
|
|
1124
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
221
1125
|
}
|
|
222
1126
|
|
|
223
1127
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
224
1128
|
|
|
225
1129
|
const response = await this.request({
|
|
226
|
-
path: `/api/v1/guild`,
|
|
1130
|
+
path: `/api/v1/guild/duel/list`,
|
|
227
1131
|
method: 'GET',
|
|
228
1132
|
headers: headerParameters,
|
|
229
1133
|
query: queryParameters,
|
|
230
1134
|
}, initOverrides);
|
|
231
1135
|
|
|
232
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
1136
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelListFromJSON(jsonValue));
|
|
233
1137
|
}
|
|
234
1138
|
|
|
235
1139
|
/**
|
|
236
|
-
* Public guild
|
|
237
|
-
*
|
|
1140
|
+
* Public duels (both stakes in escrow) of a guild or all, newest first; status=upcoming|live|finished|all
|
|
1141
|
+
* guild_duel_list
|
|
238
1142
|
*/
|
|
239
|
-
async
|
|
240
|
-
const response = await this.
|
|
1143
|
+
async guildDuelList(requestParameters: GuildDuelListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuelList> {
|
|
1144
|
+
const response = await this.guildDuelListRaw(requestParameters, initOverrides);
|
|
241
1145
|
return await response.value();
|
|
242
1146
|
}
|
|
243
1147
|
|
|
244
1148
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
1149
|
+
* Metrics a guild duel can be scored on
|
|
1150
|
+
* guild_duel_metrics
|
|
247
1151
|
*/
|
|
248
|
-
async
|
|
1152
|
+
async guildDuelMetricsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGuildDuelMetrics>> {
|
|
1153
|
+
const queryParameters: any = {};
|
|
1154
|
+
|
|
1155
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1156
|
+
|
|
1157
|
+
const response = await this.request({
|
|
1158
|
+
path: `/api/v1/guild/duel/metrics`,
|
|
1159
|
+
method: 'GET',
|
|
1160
|
+
headers: headerParameters,
|
|
1161
|
+
query: queryParameters,
|
|
1162
|
+
}, initOverrides);
|
|
1163
|
+
|
|
1164
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGuildDuelMetricsFromJSON(jsonValue));
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Metrics a guild duel can be scored on
|
|
1169
|
+
* guild_duel_metrics
|
|
1170
|
+
*/
|
|
1171
|
+
async guildDuelMetrics(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGuildDuelMetrics> {
|
|
1172
|
+
const response = await this.guildDuelMetricsRaw(initOverrides);
|
|
1173
|
+
return await response.value();
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Prefer (or stop preferring) to be auto-selected into your guild\'s duel rosters; a preference only: leaders may draft anyone and the top-up to min_members on accept picks opted-in members first, then the rest
|
|
1178
|
+
* guild_duel_optIn
|
|
1179
|
+
*/
|
|
1180
|
+
async guildDuelOptInRaw(requestParameters: GuildDuelOptInRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGuildDuelOptIn>> {
|
|
249
1181
|
if (requestParameters['account_index'] == null) {
|
|
250
1182
|
throw new runtime.RequiredError(
|
|
251
1183
|
'account_index',
|
|
252
|
-
'Required parameter "account_index" was null or undefined when calling
|
|
1184
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelOptIn().'
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (requestParameters['opt_in'] == null) {
|
|
1189
|
+
throw new runtime.RequiredError(
|
|
1190
|
+
'opt_in',
|
|
1191
|
+
'Required parameter "opt_in" was null or undefined when calling guildDuelOptIn().'
|
|
253
1192
|
);
|
|
254
1193
|
}
|
|
255
1194
|
|
|
@@ -283,81 +1222,130 @@ export class GuildApi extends runtime.BaseAPI {
|
|
|
283
1222
|
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
284
1223
|
}
|
|
285
1224
|
|
|
1225
|
+
if (requestParameters['opt_in'] != null) {
|
|
1226
|
+
formParams.append('opt_in', requestParameters['opt_in'] as any);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
286
1229
|
const response = await this.request({
|
|
287
|
-
path: `/api/v1/guild/
|
|
1230
|
+
path: `/api/v1/guild/duel/optIn`,
|
|
288
1231
|
method: 'POST',
|
|
289
1232
|
headers: headerParameters,
|
|
290
1233
|
query: queryParameters,
|
|
291
1234
|
body: formParams,
|
|
292
1235
|
}, initOverrides);
|
|
293
1236
|
|
|
294
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
1237
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGuildDuelOptInFromJSON(jsonValue));
|
|
295
1238
|
}
|
|
296
1239
|
|
|
297
1240
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
1241
|
+
* Prefer (or stop preferring) to be auto-selected into your guild\'s duel rosters; a preference only: leaders may draft anyone and the top-up to min_members on accept picks opted-in members first, then the rest
|
|
1242
|
+
* guild_duel_optIn
|
|
300
1243
|
*/
|
|
301
|
-
async
|
|
302
|
-
const response = await this.
|
|
1244
|
+
async guildDuelOptIn(requestParameters: GuildDuelOptInRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGuildDuelOptIn> {
|
|
1245
|
+
const response = await this.guildDuelOptInRaw(requestParameters, initOverrides);
|
|
303
1246
|
return await response.value();
|
|
304
1247
|
}
|
|
305
1248
|
|
|
306
1249
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
1250
|
+
* Draft your side\'s roster from your guild\'s members while the duel is proposed (leader only); rosters lock on accept
|
|
1251
|
+
* guild_duel_roster
|
|
309
1252
|
*/
|
|
310
|
-
async
|
|
311
|
-
if (requestParameters['
|
|
1253
|
+
async guildDuelRosterRaw(requestParameters: GuildDuelRosterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
1254
|
+
if (requestParameters['account_index'] == null) {
|
|
312
1255
|
throw new runtime.RequiredError(
|
|
313
|
-
'
|
|
314
|
-
'Required parameter "
|
|
1256
|
+
'account_index',
|
|
1257
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelRoster().'
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
if (requestParameters['duel_id'] == null) {
|
|
1262
|
+
throw new runtime.RequiredError(
|
|
1263
|
+
'duel_id',
|
|
1264
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelRoster().'
|
|
315
1265
|
);
|
|
316
1266
|
}
|
|
317
1267
|
|
|
318
1268
|
const queryParameters: any = {};
|
|
319
1269
|
|
|
320
|
-
|
|
321
|
-
|
|
1270
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1271
|
+
|
|
1272
|
+
if (requestParameters['authorization'] != null) {
|
|
1273
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
322
1274
|
}
|
|
323
1275
|
|
|
324
|
-
const
|
|
1276
|
+
const consumes: runtime.Consume[] = [
|
|
1277
|
+
{ contentType: 'multipart/form-data' },
|
|
1278
|
+
];
|
|
1279
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
1280
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
1281
|
+
|
|
1282
|
+
let formParams: { append(param: string, value: any): any };
|
|
1283
|
+
let useForm = false;
|
|
1284
|
+
if (useForm) {
|
|
1285
|
+
formParams = new FormData();
|
|
1286
|
+
} else {
|
|
1287
|
+
formParams = new URLSearchParams();
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
if (requestParameters['auth'] != null) {
|
|
1291
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
if (requestParameters['account_index'] != null) {
|
|
1295
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
if (requestParameters['duel_id'] != null) {
|
|
1299
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
if (requestParameters['l1_addresses'] != null) {
|
|
1303
|
+
formParams.append('l1_addresses', requestParameters['l1_addresses'] as any);
|
|
1304
|
+
}
|
|
325
1305
|
|
|
326
1306
|
const response = await this.request({
|
|
327
|
-
path: `/api/v1/guild/
|
|
328
|
-
method: '
|
|
1307
|
+
path: `/api/v1/guild/duel/roster`,
|
|
1308
|
+
method: 'POST',
|
|
329
1309
|
headers: headerParameters,
|
|
330
1310
|
query: queryParameters,
|
|
1311
|
+
body: formParams,
|
|
331
1312
|
}, initOverrides);
|
|
332
1313
|
|
|
333
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
1314
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
334
1315
|
}
|
|
335
1316
|
|
|
336
1317
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
1318
|
+
* Draft your side\'s roster from your guild\'s members while the duel is proposed (leader only); rosters lock on accept
|
|
1319
|
+
* guild_duel_roster
|
|
339
1320
|
*/
|
|
340
|
-
async
|
|
341
|
-
const response = await this.
|
|
1321
|
+
async guildDuelRoster(requestParameters: GuildDuelRosterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
1322
|
+
const response = await this.guildDuelRosterRaw(requestParameters, initOverrides);
|
|
342
1323
|
return await response.value();
|
|
343
1324
|
}
|
|
344
1325
|
|
|
345
1326
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
1327
|
+
* Record your side\'s stake: the leader\'s executed L2 transfer of the exact stake to the escrow perps balance; only that guild\'s leader may report it, other members get 42009. A transfer to escrow with this duel\'s memo that cannot be the stake any more (wrong amount, deadline passed, duel no longer accepted, side already staked) is answered with 42040 and queued for a manual refund. While guild duels are disabled the endpoint answers 42038 and queues nothing, so a transfer that reached escrow just before the switch was turned off is reconciled by ops rather than refunded automatically
|
|
1328
|
+
* guild_duel_stake
|
|
348
1329
|
*/
|
|
349
|
-
async
|
|
1330
|
+
async guildDuelStakeRaw(requestParameters: GuildDuelStakeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
350
1331
|
if (requestParameters['account_index'] == null) {
|
|
351
1332
|
throw new runtime.RequiredError(
|
|
352
1333
|
'account_index',
|
|
353
|
-
'Required parameter "account_index" was null or undefined when calling
|
|
1334
|
+
'Required parameter "account_index" was null or undefined when calling guildDuelStake().'
|
|
354
1335
|
);
|
|
355
1336
|
}
|
|
356
1337
|
|
|
357
|
-
if (requestParameters['
|
|
1338
|
+
if (requestParameters['duel_id'] == null) {
|
|
358
1339
|
throw new runtime.RequiredError(
|
|
359
|
-
'
|
|
360
|
-
'Required parameter "
|
|
1340
|
+
'duel_id',
|
|
1341
|
+
'Required parameter "duel_id" was null or undefined when calling guildDuelStake().'
|
|
1342
|
+
);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
if (requestParameters['tx_hash'] == null) {
|
|
1346
|
+
throw new runtime.RequiredError(
|
|
1347
|
+
'tx_hash',
|
|
1348
|
+
'Required parameter "tx_hash" was null or undefined when calling guildDuelStake().'
|
|
361
1349
|
);
|
|
362
1350
|
}
|
|
363
1351
|
|
|
@@ -391,39 +1379,31 @@ export class GuildApi extends runtime.BaseAPI {
|
|
|
391
1379
|
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
392
1380
|
}
|
|
393
1381
|
|
|
394
|
-
if (requestParameters['
|
|
395
|
-
formParams.append('
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
if (requestParameters['description'] != null) {
|
|
399
|
-
formParams.append('description', requestParameters['description'] as any);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
if (requestParameters['accepts_join_requests'] != null) {
|
|
403
|
-
formParams.append('accepts_join_requests', requestParameters['accepts_join_requests'] as any);
|
|
1382
|
+
if (requestParameters['duel_id'] != null) {
|
|
1383
|
+
formParams.append('duel_id', requestParameters['duel_id'] as any);
|
|
404
1384
|
}
|
|
405
1385
|
|
|
406
|
-
if (requestParameters['
|
|
407
|
-
formParams.append('
|
|
1386
|
+
if (requestParameters['tx_hash'] != null) {
|
|
1387
|
+
formParams.append('tx_hash', requestParameters['tx_hash'] as any);
|
|
408
1388
|
}
|
|
409
1389
|
|
|
410
1390
|
const response = await this.request({
|
|
411
|
-
path: `/api/v1/guild/
|
|
1391
|
+
path: `/api/v1/guild/duel/stake`,
|
|
412
1392
|
method: 'POST',
|
|
413
1393
|
headers: headerParameters,
|
|
414
1394
|
query: queryParameters,
|
|
415
1395
|
body: formParams,
|
|
416
1396
|
}, initOverrides);
|
|
417
1397
|
|
|
418
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
1398
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
419
1399
|
}
|
|
420
1400
|
|
|
421
1401
|
/**
|
|
422
|
-
*
|
|
423
|
-
*
|
|
1402
|
+
* Record your side\'s stake: the leader\'s executed L2 transfer of the exact stake to the escrow perps balance; only that guild\'s leader may report it, other members get 42009. A transfer to escrow with this duel\'s memo that cannot be the stake any more (wrong amount, deadline passed, duel no longer accepted, side already staked) is answered with 42040 and queued for a manual refund. While guild duels are disabled the endpoint answers 42038 and queues nothing, so a transfer that reached escrow just before the switch was turned off is reconciled by ops rather than refunded automatically
|
|
1403
|
+
* guild_duel_stake
|
|
424
1404
|
*/
|
|
425
|
-
async
|
|
426
|
-
const response = await this.
|
|
1405
|
+
async guildDuelStake(requestParameters: GuildDuelStakeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
1406
|
+
const response = await this.guildDuelStakeRaw(requestParameters, initOverrides);
|
|
427
1407
|
return await response.value();
|
|
428
1408
|
}
|
|
429
1409
|
|
|
@@ -1222,6 +2202,130 @@ export class GuildApi extends runtime.BaseAPI {
|
|
|
1222
2202
|
return await response.value();
|
|
1223
2203
|
}
|
|
1224
2204
|
|
|
2205
|
+
/**
|
|
2206
|
+
* Detail of one duel of the caller\'s guild in any status (any member): sides, terms, offers, the caller\'s side\'s draft and every locked roster
|
|
2207
|
+
* guild_myDuel
|
|
2208
|
+
*/
|
|
2209
|
+
async guildMyDuelRaw(requestParameters: GuildMyDuelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuel>> {
|
|
2210
|
+
if (requestParameters['account_index'] == null) {
|
|
2211
|
+
throw new runtime.RequiredError(
|
|
2212
|
+
'account_index',
|
|
2213
|
+
'Required parameter "account_index" was null or undefined when calling guildMyDuel().'
|
|
2214
|
+
);
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
if (requestParameters['duel_id'] == null) {
|
|
2218
|
+
throw new runtime.RequiredError(
|
|
2219
|
+
'duel_id',
|
|
2220
|
+
'Required parameter "duel_id" was null or undefined when calling guildMyDuel().'
|
|
2221
|
+
);
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
const queryParameters: any = {};
|
|
2225
|
+
|
|
2226
|
+
if (requestParameters['auth'] != null) {
|
|
2227
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
if (requestParameters['account_index'] != null) {
|
|
2231
|
+
queryParameters['account_index'] = requestParameters['account_index'];
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
if (requestParameters['duel_id'] != null) {
|
|
2235
|
+
queryParameters['duel_id'] = requestParameters['duel_id'];
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
2239
|
+
|
|
2240
|
+
if (requestParameters['authorization'] != null) {
|
|
2241
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
const response = await this.request({
|
|
2245
|
+
path: `/api/v1/guild/myDuel`,
|
|
2246
|
+
method: 'GET',
|
|
2247
|
+
headers: headerParameters,
|
|
2248
|
+
query: queryParameters,
|
|
2249
|
+
}, initOverrides);
|
|
2250
|
+
|
|
2251
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelFromJSON(jsonValue));
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* Detail of one duel of the caller\'s guild in any status (any member): sides, terms, offers, the caller\'s side\'s draft and every locked roster
|
|
2256
|
+
* guild_myDuel
|
|
2257
|
+
*/
|
|
2258
|
+
async guildMyDuel(requestParameters: GuildMyDuelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuel> {
|
|
2259
|
+
const response = await this.guildMyDuelRaw(requestParameters, initOverrides);
|
|
2260
|
+
return await response.value();
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
/**
|
|
2264
|
+
* Duels of the caller\'s guild in every status incl. proposals (any member); status=active|live|finished|all
|
|
2265
|
+
* guild_myDuels
|
|
2266
|
+
*/
|
|
2267
|
+
async guildMyDuelsRaw(requestParameters: GuildMyDuelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetGuildDuelList>> {
|
|
2268
|
+
if (requestParameters['account_index'] == null) {
|
|
2269
|
+
throw new runtime.RequiredError(
|
|
2270
|
+
'account_index',
|
|
2271
|
+
'Required parameter "account_index" was null or undefined when calling guildMyDuels().'
|
|
2272
|
+
);
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
if (requestParameters['limit'] == null) {
|
|
2276
|
+
throw new runtime.RequiredError(
|
|
2277
|
+
'limit',
|
|
2278
|
+
'Required parameter "limit" was null or undefined when calling guildMyDuels().'
|
|
2279
|
+
);
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
const queryParameters: any = {};
|
|
2283
|
+
|
|
2284
|
+
if (requestParameters['auth'] != null) {
|
|
2285
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
if (requestParameters['account_index'] != null) {
|
|
2289
|
+
queryParameters['account_index'] = requestParameters['account_index'];
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
if (requestParameters['status'] != null) {
|
|
2293
|
+
queryParameters['status'] = requestParameters['status'];
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
if (requestParameters['limit'] != null) {
|
|
2297
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
if (requestParameters['cursor'] != null) {
|
|
2301
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
2305
|
+
|
|
2306
|
+
if (requestParameters['authorization'] != null) {
|
|
2307
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
const response = await this.request({
|
|
2311
|
+
path: `/api/v1/guild/myDuels`,
|
|
2312
|
+
method: 'GET',
|
|
2313
|
+
headers: headerParameters,
|
|
2314
|
+
query: queryParameters,
|
|
2315
|
+
}, initOverrides);
|
|
2316
|
+
|
|
2317
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespGetGuildDuelListFromJSON(jsonValue));
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* Duels of the caller\'s guild in every status incl. proposals (any member); status=active|live|finished|all
|
|
2322
|
+
* guild_myDuels
|
|
2323
|
+
*/
|
|
2324
|
+
async guildMyDuels(requestParameters: GuildMyDuelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetGuildDuelList> {
|
|
2325
|
+
const response = await this.guildMyDuelsRaw(requestParameters, initOverrides);
|
|
2326
|
+
return await response.value();
|
|
2327
|
+
}
|
|
2328
|
+
|
|
1225
2329
|
/**
|
|
1226
2330
|
* Pending join requests for the caller\'s guild (leader/admin)
|
|
1227
2331
|
* guild_requests
|
|
@@ -1538,6 +2642,38 @@ export class GuildApi extends runtime.BaseAPI {
|
|
|
1538
2642
|
|
|
1539
2643
|
}
|
|
1540
2644
|
|
|
2645
|
+
/**
|
|
2646
|
+
* @export
|
|
2647
|
+
*/
|
|
2648
|
+
export const GuildDuelChallengeMetricEnum = {
|
|
2649
|
+
MedianRoi: 'median_roi',
|
|
2650
|
+
GuildRoi: 'guild_roi',
|
|
2651
|
+
Pnl: 'pnl',
|
|
2652
|
+
Volume: 'volume',
|
|
2653
|
+
RoiSqrtVolume: 'roi_sqrt_volume'
|
|
2654
|
+
} as const;
|
|
2655
|
+
export type GuildDuelChallengeMetricEnum = typeof GuildDuelChallengeMetricEnum[keyof typeof GuildDuelChallengeMetricEnum];
|
|
2656
|
+
/**
|
|
2657
|
+
* @export
|
|
2658
|
+
*/
|
|
2659
|
+
export const GuildDuelCounterMetricEnum = {
|
|
2660
|
+
MedianRoi: 'median_roi',
|
|
2661
|
+
GuildRoi: 'guild_roi',
|
|
2662
|
+
Pnl: 'pnl',
|
|
2663
|
+
Volume: 'volume',
|
|
2664
|
+
RoiSqrtVolume: 'roi_sqrt_volume'
|
|
2665
|
+
} as const;
|
|
2666
|
+
export type GuildDuelCounterMetricEnum = typeof GuildDuelCounterMetricEnum[keyof typeof GuildDuelCounterMetricEnum];
|
|
2667
|
+
/**
|
|
2668
|
+
* @export
|
|
2669
|
+
*/
|
|
2670
|
+
export const GuildDuelListStatusEnum = {
|
|
2671
|
+
Upcoming: 'upcoming',
|
|
2672
|
+
Live: 'live',
|
|
2673
|
+
Finished: 'finished',
|
|
2674
|
+
All: 'all'
|
|
2675
|
+
} as const;
|
|
2676
|
+
export type GuildDuelListStatusEnum = typeof GuildDuelListStatusEnum[keyof typeof GuildDuelListStatusEnum];
|
|
1541
2677
|
/**
|
|
1542
2678
|
* @export
|
|
1543
2679
|
*/
|
|
@@ -1548,6 +2684,16 @@ export const GuildLeaderboardTimeWindowEnum = {
|
|
|
1548
2684
|
All: 'all'
|
|
1549
2685
|
} as const;
|
|
1550
2686
|
export type GuildLeaderboardTimeWindowEnum = typeof GuildLeaderboardTimeWindowEnum[keyof typeof GuildLeaderboardTimeWindowEnum];
|
|
2687
|
+
/**
|
|
2688
|
+
* @export
|
|
2689
|
+
*/
|
|
2690
|
+
export const GuildMyDuelsStatusEnum = {
|
|
2691
|
+
Active: 'active',
|
|
2692
|
+
Live: 'live',
|
|
2693
|
+
Finished: 'finished',
|
|
2694
|
+
All: 'all'
|
|
2695
|
+
} as const;
|
|
2696
|
+
export type GuildMyDuelsStatusEnum = typeof GuildMyDuelsStatusEnum[keyof typeof GuildMyDuelsStatusEnum];
|
|
1551
2697
|
/**
|
|
1552
2698
|
* @export
|
|
1553
2699
|
*/
|