@openfort/openfort-js 0.7.0 → 0.7.1

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.
Files changed (3) hide show
  1. package/dist/index.cjs +2581 -5
  2. package/dist/index.js +2578 -2
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var hash = require('@ethersproject/hash');
6
- var openapiClients = require('@openfort/openapi-clients');
7
- require('axios');
6
+ var globalAxios = require('axios');
8
7
  var jose = require('jose');
9
8
  var secp256k1 = require('@noble/curves/secp256k1');
10
9
  var signingKey = require('@ethersproject/signing-key');
@@ -56,6 +55,2583 @@ exports.OAuthProvider = void 0;
56
55
  OAuthProvider["SUPABASE"] = "supabase";
57
56
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
58
57
 
58
+ /* tslint:disable */
59
+ /* eslint-disable */
60
+ /**
61
+ * Openfort API
62
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
63
+ *
64
+ * The version of the OpenAPI document: 1.0.0
65
+ * Contact: founders@openfort.xyz
66
+ *
67
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
68
+ * https://openapi-generator.tech
69
+ * Do not edit the class manually.
70
+ */
71
+ const BASE_PATH = "https://api.openfort.xyz".replace(/\/+$/, "");
72
+ /**
73
+ *
74
+ * @export
75
+ * @class BaseAPI
76
+ */
77
+ class BaseAPI {
78
+ basePath;
79
+ axios;
80
+ configuration;
81
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
82
+ this.basePath = basePath;
83
+ this.axios = axios;
84
+ if (configuration) {
85
+ this.configuration = configuration;
86
+ this.basePath = configuration.basePath || this.basePath;
87
+ }
88
+ }
89
+ }
90
+ /**
91
+ *
92
+ * @export
93
+ * @class RequiredError
94
+ * @extends {Error}
95
+ */
96
+ class RequiredError extends Error {
97
+ field;
98
+ constructor(field, msg) {
99
+ super(msg);
100
+ this.field = field;
101
+ this.name = "RequiredError";
102
+ }
103
+ }
104
+
105
+ /* tslint:disable */
106
+ /* eslint-disable */
107
+ /**
108
+ * Openfort API
109
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
110
+ *
111
+ * The version of the OpenAPI document: 1.0.0
112
+ * Contact: founders@openfort.xyz
113
+ *
114
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
115
+ * https://openapi-generator.tech
116
+ * Do not edit the class manually.
117
+ */
118
+ /**
119
+ *
120
+ * @export
121
+ */
122
+ const DUMMY_BASE_URL = 'https://example.com';
123
+ /**
124
+ *
125
+ * @throws {RequiredError}
126
+ * @export
127
+ */
128
+ const assertParamExists = function (functionName, paramName, paramValue) {
129
+ if (paramValue === null || paramValue === undefined) {
130
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
131
+ }
132
+ };
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ const setBearerAuthToObject = async function (object, configuration) {
138
+ if (configuration && configuration.accessToken) {
139
+ const accessToken = typeof configuration.accessToken === 'function'
140
+ ? await configuration.accessToken()
141
+ : await configuration.accessToken;
142
+ object["Authorization"] = "Bearer " + accessToken;
143
+ }
144
+ };
145
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
146
+ if (parameter == null)
147
+ return;
148
+ if (typeof parameter === "object") {
149
+ if (Array.isArray(parameter)) {
150
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
151
+ }
152
+ else {
153
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
154
+ }
155
+ }
156
+ else {
157
+ if (urlSearchParams.has(key)) {
158
+ urlSearchParams.append(key, parameter);
159
+ }
160
+ else {
161
+ urlSearchParams.set(key, parameter);
162
+ }
163
+ }
164
+ }
165
+ /**
166
+ *
167
+ * @export
168
+ */
169
+ const setSearchParams = function (url, ...objects) {
170
+ const searchParams = new URLSearchParams(url.search);
171
+ setFlattenedQueryParams(searchParams, objects);
172
+ url.search = searchParams.toString();
173
+ };
174
+ /**
175
+ *
176
+ * @export
177
+ */
178
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
179
+ const nonString = typeof value !== 'string';
180
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
181
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
182
+ : nonString;
183
+ return needsSerialization
184
+ ? JSON.stringify(value !== undefined ? value : {})
185
+ : (value || "");
186
+ };
187
+ /**
188
+ *
189
+ * @export
190
+ */
191
+ const toPathString = function (url) {
192
+ return url.pathname + url.search + url.hash;
193
+ };
194
+ /**
195
+ *
196
+ * @export
197
+ */
198
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
199
+ return (axios = globalAxios, basePath = BASE_PATH) => {
200
+ const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url };
201
+ return axios.request(axiosRequestArgs);
202
+ };
203
+ };
204
+
205
+ /* tslint:disable */
206
+ /* eslint-disable */
207
+ /**
208
+ * Openfort API
209
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
210
+ *
211
+ * The version of the OpenAPI document: 1.0.0
212
+ * Contact: founders@openfort.xyz
213
+ *
214
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
215
+ * https://openapi-generator.tech
216
+ * Do not edit the class manually.
217
+ */
218
+ /**
219
+ * AccountsApi - axios parameter creator
220
+ * @export
221
+ */
222
+ const AccountsApiAxiosParamCreator = function (configuration) {
223
+ return {
224
+ /**
225
+ * Cancel a pending transfer of ownership.
226
+ * @summary Cancel request to transfer ownership of an account.
227
+ * @param {string} id Specifies the unique account ID (starts with acc_).
228
+ * @param {CancelTransferOwnershipRequest} cancelTransferOwnershipRequest
229
+ * @param {*} [options] Override http request option.
230
+ * @throws {RequiredError}
231
+ */
232
+ cancelTransferOwnership: async (id, cancelTransferOwnershipRequest, options = {}) => {
233
+ // verify required parameter 'id' is not null or undefined
234
+ assertParamExists('cancelTransferOwnership', 'id', id);
235
+ // verify required parameter 'cancelTransferOwnershipRequest' is not null or undefined
236
+ assertParamExists('cancelTransferOwnership', 'cancelTransferOwnershipRequest', cancelTransferOwnershipRequest);
237
+ const localVarPath = `/v1/accounts/{id}/cancel_transfer_ownership`
238
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
239
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
240
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
241
+ let baseOptions;
242
+ if (configuration) {
243
+ baseOptions = configuration.baseOptions;
244
+ }
245
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
246
+ const localVarHeaderParameter = {};
247
+ const localVarQueryParameter = {};
248
+ // authentication sk required
249
+ // http bearer authentication required
250
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
251
+ localVarHeaderParameter['Content-Type'] = 'application/json';
252
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
253
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
254
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
255
+ localVarRequestOptions.data = serializeDataIfNeeded(cancelTransferOwnershipRequest, localVarRequestOptions, configuration);
256
+ return {
257
+ url: toPathString(localVarUrlObj),
258
+ options: localVarRequestOptions,
259
+ };
260
+ },
261
+ /**
262
+ *
263
+ * @summary Complete a recovery process of a recoverable account.
264
+ * @param {string} id Specifies the unique account ID (starts with acc_).
265
+ * @param {CompleteRecoveryRequest} completeRecoveryRequest
266
+ * @param {*} [options] Override http request option.
267
+ * @throws {RequiredError}
268
+ */
269
+ completeRecovery: async (id, completeRecoveryRequest, options = {}) => {
270
+ // verify required parameter 'id' is not null or undefined
271
+ assertParamExists('completeRecovery', 'id', id);
272
+ // verify required parameter 'completeRecoveryRequest' is not null or undefined
273
+ assertParamExists('completeRecovery', 'completeRecoveryRequest', completeRecoveryRequest);
274
+ const localVarPath = `/v1/accounts/{id}/complete_recovery`
275
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
276
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
277
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
278
+ let baseOptions;
279
+ if (configuration) {
280
+ baseOptions = configuration.baseOptions;
281
+ }
282
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
283
+ const localVarHeaderParameter = {};
284
+ const localVarQueryParameter = {};
285
+ // authentication sk required
286
+ // http bearer authentication required
287
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
288
+ localVarHeaderParameter['Content-Type'] = 'application/json';
289
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
290
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
291
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
292
+ localVarRequestOptions.data = serializeDataIfNeeded(completeRecoveryRequest, localVarRequestOptions, configuration);
293
+ return {
294
+ url: toPathString(localVarUrlObj),
295
+ options: localVarRequestOptions,
296
+ };
297
+ },
298
+ /**
299
+ * Creates a new blockchain account for the provided player. If not player is provided, a new one will be created. Account creation does not consume any gas. All accounts of a player will use the same address across blockchains. Each player can only have one account per chain.
300
+ * @summary Create an account object.
301
+ * @param {CreateAccountRequest} createAccountRequest
302
+ * @param {*} [options] Override http request option.
303
+ * @throws {RequiredError}
304
+ */
305
+ createAccount: async (createAccountRequest, options = {}) => {
306
+ // verify required parameter 'createAccountRequest' is not null or undefined
307
+ assertParamExists('createAccount', 'createAccountRequest', createAccountRequest);
308
+ const localVarPath = `/v1/accounts`;
309
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
310
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
311
+ let baseOptions;
312
+ if (configuration) {
313
+ baseOptions = configuration.baseOptions;
314
+ }
315
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
316
+ const localVarHeaderParameter = {};
317
+ const localVarQueryParameter = {};
318
+ // authentication sk required
319
+ // http bearer authentication required
320
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
321
+ localVarHeaderParameter['Content-Type'] = 'application/json';
322
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
323
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
324
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
325
+ localVarRequestOptions.data = serializeDataIfNeeded(createAccountRequest, localVarRequestOptions, configuration);
326
+ return {
327
+ url: toPathString(localVarUrlObj),
328
+ options: localVarRequestOptions,
329
+ };
330
+ },
331
+ /**
332
+ * This endpoint can be used to deploy a smart contract account that was counterfactually generated.
333
+ * @summary Deploy an account.
334
+ * @param {string} id Specifies the unique account ID (starts with acc_).
335
+ * @param {DeployRequest} deployRequest
336
+ * @param {*} [options] Override http request option.
337
+ * @throws {RequiredError}
338
+ */
339
+ deployAccount: async (id, deployRequest, options = {}) => {
340
+ // verify required parameter 'id' is not null or undefined
341
+ assertParamExists('deployAccount', 'id', id);
342
+ // verify required parameter 'deployRequest' is not null or undefined
343
+ assertParamExists('deployAccount', 'deployRequest', deployRequest);
344
+ const localVarPath = `/v1/accounts/{id}/deploy`
345
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
346
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
347
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
348
+ let baseOptions;
349
+ if (configuration) {
350
+ baseOptions = configuration.baseOptions;
351
+ }
352
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
353
+ const localVarHeaderParameter = {};
354
+ const localVarQueryParameter = {};
355
+ // authentication sk required
356
+ // http bearer authentication required
357
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
358
+ localVarHeaderParameter['Content-Type'] = 'application/json';
359
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
360
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
361
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
362
+ localVarRequestOptions.data = serializeDataIfNeeded(deployRequest, localVarRequestOptions, configuration);
363
+ return {
364
+ url: toPathString(localVarUrlObj),
365
+ options: localVarRequestOptions,
366
+ };
367
+ },
368
+ /**
369
+ * Retrieves the details of an existing account. Supply the unique account ID from either a account creation request or the account list, and Openfort will return the corresponding account information. Returns the latest 10 transaction intents created by this account.
370
+ * @summary Get existing account.
371
+ * @param {string} id Specifies the unique account ID (starts with acc_).
372
+ * @param {Array<AccountResponseExpandable>} [expand]
373
+ * @param {*} [options] Override http request option.
374
+ * @throws {RequiredError}
375
+ */
376
+ getAccount: async (id, expand, options = {}) => {
377
+ // verify required parameter 'id' is not null or undefined
378
+ assertParamExists('getAccount', 'id', id);
379
+ const localVarPath = `/v1/accounts/{id}`
380
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
381
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
382
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
383
+ let baseOptions;
384
+ if (configuration) {
385
+ baseOptions = configuration.baseOptions;
386
+ }
387
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
388
+ const localVarHeaderParameter = {};
389
+ const localVarQueryParameter = {};
390
+ // authentication sk required
391
+ // http bearer authentication required
392
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
393
+ if (expand) {
394
+ localVarQueryParameter['expand'] = expand;
395
+ }
396
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
397
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
398
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
399
+ return {
400
+ url: toPathString(localVarUrlObj),
401
+ options: localVarRequestOptions,
402
+ };
403
+ },
404
+ /**
405
+ * Returns a list of accounts for the given player. This object represents a player\'s account, which is a blockchain smart account that can be used to interact with the blockchain. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. Returns the latest 10 transaction intents for each account. By default, a maximum of 10 accounts are shown per page.
406
+ * @summary List accounts of a player.
407
+ * @param {string} player Specifies the unique player ID (starts with pla_)
408
+ * @param {number} [limit] Specifies the maximum number of records to return.
409
+ * @param {number} [skip] Specifies the offset for the first records to return.
410
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
411
+ * @param {Array<AccountResponseExpandable>} [expand] Specifies the fields to expand in the response.
412
+ * @param {*} [options] Override http request option.
413
+ * @throws {RequiredError}
414
+ */
415
+ getAccounts: async (player, limit, skip, order, expand, options = {}) => {
416
+ // verify required parameter 'player' is not null or undefined
417
+ assertParamExists('getAccounts', 'player', player);
418
+ const localVarPath = `/v1/accounts`;
419
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
420
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
421
+ let baseOptions;
422
+ if (configuration) {
423
+ baseOptions = configuration.baseOptions;
424
+ }
425
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
426
+ const localVarHeaderParameter = {};
427
+ const localVarQueryParameter = {};
428
+ // authentication sk required
429
+ // http bearer authentication required
430
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
431
+ if (limit !== undefined) {
432
+ localVarQueryParameter['limit'] = limit;
433
+ }
434
+ if (skip !== undefined) {
435
+ localVarQueryParameter['skip'] = skip;
436
+ }
437
+ if (order !== undefined) {
438
+ localVarQueryParameter['order'] = order;
439
+ }
440
+ if (expand) {
441
+ localVarQueryParameter['expand'] = expand;
442
+ }
443
+ if (player !== undefined) {
444
+ localVarQueryParameter['player'] = player;
445
+ }
446
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
447
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
448
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
449
+ return {
450
+ url: toPathString(localVarUrlObj),
451
+ options: localVarRequestOptions,
452
+ };
453
+ },
454
+ /**
455
+ * Perform a request to change the owner of an account. To perform an update on the owner of an account, first you must provide a new owner address. Once requested, the owner must accept to take ownership by calling `acceptOwnership()` in the smart contract account.
456
+ * @summary Request transfer ownership of account.
457
+ * @param {string} id Specifies the unique account ID (starts with acc_).
458
+ * @param {TransferOwnershipRequest} transferOwnershipRequest
459
+ * @param {*} [options] Override http request option.
460
+ * @throws {RequiredError}
461
+ */
462
+ requestTransferOwnership: async (id, transferOwnershipRequest, options = {}) => {
463
+ // verify required parameter 'id' is not null or undefined
464
+ assertParamExists('requestTransferOwnership', 'id', id);
465
+ // verify required parameter 'transferOwnershipRequest' is not null or undefined
466
+ assertParamExists('requestTransferOwnership', 'transferOwnershipRequest', transferOwnershipRequest);
467
+ const localVarPath = `/v1/accounts/{id}/request_transfer_ownership`
468
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
469
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
470
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
471
+ let baseOptions;
472
+ if (configuration) {
473
+ baseOptions = configuration.baseOptions;
474
+ }
475
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
476
+ const localVarHeaderParameter = {};
477
+ const localVarQueryParameter = {};
478
+ // authentication sk required
479
+ // http bearer authentication required
480
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
481
+ localVarHeaderParameter['Content-Type'] = 'application/json';
482
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
483
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
484
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
485
+ localVarRequestOptions.data = serializeDataIfNeeded(transferOwnershipRequest, localVarRequestOptions, configuration);
486
+ return {
487
+ url: toPathString(localVarUrlObj),
488
+ options: localVarRequestOptions,
489
+ };
490
+ },
491
+ /**
492
+ * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
493
+ * @summary Sign a given payload
494
+ * @param {string} id Specifies the unique account ID (starts with acc_).
495
+ * @param {SignPayloadRequest} signPayloadRequest
496
+ * @param {*} [options] Override http request option.
497
+ * @throws {RequiredError}
498
+ */
499
+ signPayload: async (id, signPayloadRequest, options = {}) => {
500
+ // verify required parameter 'id' is not null or undefined
501
+ assertParamExists('signPayload', 'id', id);
502
+ // verify required parameter 'signPayloadRequest' is not null or undefined
503
+ assertParamExists('signPayload', 'signPayloadRequest', signPayloadRequest);
504
+ const localVarPath = `/v1/accounts/{id}/sign_payload`
505
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
506
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
507
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
508
+ let baseOptions;
509
+ if (configuration) {
510
+ baseOptions = configuration.baseOptions;
511
+ }
512
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
513
+ const localVarHeaderParameter = {};
514
+ const localVarQueryParameter = {};
515
+ // authentication sk required
516
+ // http bearer authentication required
517
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
518
+ localVarHeaderParameter['Content-Type'] = 'application/json';
519
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
520
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
521
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
522
+ localVarRequestOptions.data = serializeDataIfNeeded(signPayloadRequest, localVarRequestOptions, configuration);
523
+ return {
524
+ url: toPathString(localVarUrlObj),
525
+ options: localVarRequestOptions,
526
+ };
527
+ },
528
+ /**
529
+ *
530
+ * @summary Start a recovery process of a recoverable account.
531
+ * @param {string} id Specifies the unique account ID (starts with acc_).
532
+ * @param {StartRecoveryRequest} startRecoveryRequest
533
+ * @param {*} [options] Override http request option.
534
+ * @throws {RequiredError}
535
+ */
536
+ startRecovery: async (id, startRecoveryRequest, options = {}) => {
537
+ // verify required parameter 'id' is not null or undefined
538
+ assertParamExists('startRecovery', 'id', id);
539
+ // verify required parameter 'startRecoveryRequest' is not null or undefined
540
+ assertParamExists('startRecovery', 'startRecoveryRequest', startRecoveryRequest);
541
+ const localVarPath = `/v1/accounts/{id}/start_recovery`
542
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
543
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
544
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
545
+ let baseOptions;
546
+ if (configuration) {
547
+ baseOptions = configuration.baseOptions;
548
+ }
549
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
550
+ const localVarHeaderParameter = {};
551
+ const localVarQueryParameter = {};
552
+ // authentication sk required
553
+ // http bearer authentication required
554
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
555
+ localVarHeaderParameter['Content-Type'] = 'application/json';
556
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
557
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
558
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
559
+ localVarRequestOptions.data = serializeDataIfNeeded(startRecoveryRequest, localVarRequestOptions, configuration);
560
+ return {
561
+ url: toPathString(localVarUrlObj),
562
+ options: localVarRequestOptions,
563
+ };
564
+ },
565
+ /**
566
+ * Synchronize the account state with the blockchain. Specifically, it updates the account owner and whether its deployed or not.
567
+ * @summary Sync account state with the blockchain
568
+ * @param {string} id Specifies the unique account ID (starts with acc_).
569
+ * @param {*} [options] Override http request option.
570
+ * @throws {RequiredError}
571
+ */
572
+ syncAccount: async (id, options = {}) => {
573
+ // verify required parameter 'id' is not null or undefined
574
+ assertParamExists('syncAccount', 'id', id);
575
+ const localVarPath = `/v1/accounts/{id}/sync`
576
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
577
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
578
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
579
+ let baseOptions;
580
+ if (configuration) {
581
+ baseOptions = configuration.baseOptions;
582
+ }
583
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
584
+ const localVarHeaderParameter = {};
585
+ const localVarQueryParameter = {};
586
+ // authentication sk required
587
+ // http bearer authentication required
588
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
589
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
590
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
591
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
592
+ return {
593
+ url: toPathString(localVarUrlObj),
594
+ options: localVarRequestOptions,
595
+ };
596
+ },
597
+ };
598
+ };
599
+ /**
600
+ * AccountsApi - functional programming interface
601
+ * @export
602
+ */
603
+ const AccountsApiFp = function (configuration) {
604
+ const localVarAxiosParamCreator = AccountsApiAxiosParamCreator(configuration);
605
+ return {
606
+ /**
607
+ * Cancel a pending transfer of ownership.
608
+ * @summary Cancel request to transfer ownership of an account.
609
+ * @param {string} id Specifies the unique account ID (starts with acc_).
610
+ * @param {CancelTransferOwnershipRequest} cancelTransferOwnershipRequest
611
+ * @param {*} [options] Override http request option.
612
+ * @throws {RequiredError}
613
+ */
614
+ async cancelTransferOwnership(id, cancelTransferOwnershipRequest, options) {
615
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelTransferOwnership(id, cancelTransferOwnershipRequest, options);
616
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
617
+ },
618
+ /**
619
+ *
620
+ * @summary Complete a recovery process of a recoverable account.
621
+ * @param {string} id Specifies the unique account ID (starts with acc_).
622
+ * @param {CompleteRecoveryRequest} completeRecoveryRequest
623
+ * @param {*} [options] Override http request option.
624
+ * @throws {RequiredError}
625
+ */
626
+ async completeRecovery(id, completeRecoveryRequest, options) {
627
+ const localVarAxiosArgs = await localVarAxiosParamCreator.completeRecovery(id, completeRecoveryRequest, options);
628
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
629
+ },
630
+ /**
631
+ * Creates a new blockchain account for the provided player. If not player is provided, a new one will be created. Account creation does not consume any gas. All accounts of a player will use the same address across blockchains. Each player can only have one account per chain.
632
+ * @summary Create an account object.
633
+ * @param {CreateAccountRequest} createAccountRequest
634
+ * @param {*} [options] Override http request option.
635
+ * @throws {RequiredError}
636
+ */
637
+ async createAccount(createAccountRequest, options) {
638
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createAccount(createAccountRequest, options);
639
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
640
+ },
641
+ /**
642
+ * This endpoint can be used to deploy a smart contract account that was counterfactually generated.
643
+ * @summary Deploy an account.
644
+ * @param {string} id Specifies the unique account ID (starts with acc_).
645
+ * @param {DeployRequest} deployRequest
646
+ * @param {*} [options] Override http request option.
647
+ * @throws {RequiredError}
648
+ */
649
+ async deployAccount(id, deployRequest, options) {
650
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deployAccount(id, deployRequest, options);
651
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
652
+ },
653
+ /**
654
+ * Retrieves the details of an existing account. Supply the unique account ID from either a account creation request or the account list, and Openfort will return the corresponding account information. Returns the latest 10 transaction intents created by this account.
655
+ * @summary Get existing account.
656
+ * @param {string} id Specifies the unique account ID (starts with acc_).
657
+ * @param {Array<AccountResponseExpandable>} [expand]
658
+ * @param {*} [options] Override http request option.
659
+ * @throws {RequiredError}
660
+ */
661
+ async getAccount(id, expand, options) {
662
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(id, expand, options);
663
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
664
+ },
665
+ /**
666
+ * Returns a list of accounts for the given player. This object represents a player\'s account, which is a blockchain smart account that can be used to interact with the blockchain. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. Returns the latest 10 transaction intents for each account. By default, a maximum of 10 accounts are shown per page.
667
+ * @summary List accounts of a player.
668
+ * @param {string} player Specifies the unique player ID (starts with pla_)
669
+ * @param {number} [limit] Specifies the maximum number of records to return.
670
+ * @param {number} [skip] Specifies the offset for the first records to return.
671
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
672
+ * @param {Array<AccountResponseExpandable>} [expand] Specifies the fields to expand in the response.
673
+ * @param {*} [options] Override http request option.
674
+ * @throws {RequiredError}
675
+ */
676
+ async getAccounts(player, limit, skip, order, expand, options) {
677
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getAccounts(player, limit, skip, order, expand, options);
678
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
679
+ },
680
+ /**
681
+ * Perform a request to change the owner of an account. To perform an update on the owner of an account, first you must provide a new owner address. Once requested, the owner must accept to take ownership by calling `acceptOwnership()` in the smart contract account.
682
+ * @summary Request transfer ownership of account.
683
+ * @param {string} id Specifies the unique account ID (starts with acc_).
684
+ * @param {TransferOwnershipRequest} transferOwnershipRequest
685
+ * @param {*} [options] Override http request option.
686
+ * @throws {RequiredError}
687
+ */
688
+ async requestTransferOwnership(id, transferOwnershipRequest, options) {
689
+ const localVarAxiosArgs = await localVarAxiosParamCreator.requestTransferOwnership(id, transferOwnershipRequest, options);
690
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
691
+ },
692
+ /**
693
+ * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
694
+ * @summary Sign a given payload
695
+ * @param {string} id Specifies the unique account ID (starts with acc_).
696
+ * @param {SignPayloadRequest} signPayloadRequest
697
+ * @param {*} [options] Override http request option.
698
+ * @throws {RequiredError}
699
+ */
700
+ async signPayload(id, signPayloadRequest, options) {
701
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signPayload(id, signPayloadRequest, options);
702
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
703
+ },
704
+ /**
705
+ *
706
+ * @summary Start a recovery process of a recoverable account.
707
+ * @param {string} id Specifies the unique account ID (starts with acc_).
708
+ * @param {StartRecoveryRequest} startRecoveryRequest
709
+ * @param {*} [options] Override http request option.
710
+ * @throws {RequiredError}
711
+ */
712
+ async startRecovery(id, startRecoveryRequest, options) {
713
+ const localVarAxiosArgs = await localVarAxiosParamCreator.startRecovery(id, startRecoveryRequest, options);
714
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
715
+ },
716
+ /**
717
+ * Synchronize the account state with the blockchain. Specifically, it updates the account owner and whether its deployed or not.
718
+ * @summary Sync account state with the blockchain
719
+ * @param {string} id Specifies the unique account ID (starts with acc_).
720
+ * @param {*} [options] Override http request option.
721
+ * @throws {RequiredError}
722
+ */
723
+ async syncAccount(id, options) {
724
+ const localVarAxiosArgs = await localVarAxiosParamCreator.syncAccount(id, options);
725
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
726
+ },
727
+ };
728
+ };
729
+ /**
730
+ * AccountsApi - object-oriented interface
731
+ * @export
732
+ * @class AccountsApi
733
+ * @extends {BaseAPI}
734
+ */
735
+ class AccountsApi extends BaseAPI {
736
+ /**
737
+ * Cancel a pending transfer of ownership.
738
+ * @summary Cancel request to transfer ownership of an account.
739
+ * @param {AccountsApiCancelTransferOwnershipRequest} requestParameters Request parameters.
740
+ * @param {*} [options] Override http request option.
741
+ * @throws {RequiredError}
742
+ * @memberof AccountsApi
743
+ */
744
+ cancelTransferOwnership(requestParameters, options) {
745
+ return AccountsApiFp(this.configuration).cancelTransferOwnership(requestParameters.id, requestParameters.cancelTransferOwnershipRequest, options).then((request) => request(this.axios, this.basePath));
746
+ }
747
+ /**
748
+ *
749
+ * @summary Complete a recovery process of a recoverable account.
750
+ * @param {AccountsApiCompleteRecoveryRequest} requestParameters Request parameters.
751
+ * @param {*} [options] Override http request option.
752
+ * @throws {RequiredError}
753
+ * @memberof AccountsApi
754
+ */
755
+ completeRecovery(requestParameters, options) {
756
+ return AccountsApiFp(this.configuration).completeRecovery(requestParameters.id, requestParameters.completeRecoveryRequest, options).then((request) => request(this.axios, this.basePath));
757
+ }
758
+ /**
759
+ * Creates a new blockchain account for the provided player. If not player is provided, a new one will be created. Account creation does not consume any gas. All accounts of a player will use the same address across blockchains. Each player can only have one account per chain.
760
+ * @summary Create an account object.
761
+ * @param {AccountsApiCreateAccountRequest} requestParameters Request parameters.
762
+ * @param {*} [options] Override http request option.
763
+ * @throws {RequiredError}
764
+ * @memberof AccountsApi
765
+ */
766
+ createAccount(requestParameters, options) {
767
+ return AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequest, options).then((request) => request(this.axios, this.basePath));
768
+ }
769
+ /**
770
+ * This endpoint can be used to deploy a smart contract account that was counterfactually generated.
771
+ * @summary Deploy an account.
772
+ * @param {AccountsApiDeployAccountRequest} requestParameters Request parameters.
773
+ * @param {*} [options] Override http request option.
774
+ * @throws {RequiredError}
775
+ * @memberof AccountsApi
776
+ */
777
+ deployAccount(requestParameters, options) {
778
+ return AccountsApiFp(this.configuration).deployAccount(requestParameters.id, requestParameters.deployRequest, options).then((request) => request(this.axios, this.basePath));
779
+ }
780
+ /**
781
+ * Retrieves the details of an existing account. Supply the unique account ID from either a account creation request or the account list, and Openfort will return the corresponding account information. Returns the latest 10 transaction intents created by this account.
782
+ * @summary Get existing account.
783
+ * @param {AccountsApiGetAccountRequest} requestParameters Request parameters.
784
+ * @param {*} [options] Override http request option.
785
+ * @throws {RequiredError}
786
+ * @memberof AccountsApi
787
+ */
788
+ getAccount(requestParameters, options) {
789
+ return AccountsApiFp(this.configuration).getAccount(requestParameters.id, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
790
+ }
791
+ /**
792
+ * Returns a list of accounts for the given player. This object represents a player\'s account, which is a blockchain smart account that can be used to interact with the blockchain. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. Returns the latest 10 transaction intents for each account. By default, a maximum of 10 accounts are shown per page.
793
+ * @summary List accounts of a player.
794
+ * @param {AccountsApiGetAccountsRequest} requestParameters Request parameters.
795
+ * @param {*} [options] Override http request option.
796
+ * @throws {RequiredError}
797
+ * @memberof AccountsApi
798
+ */
799
+ getAccounts(requestParameters, options) {
800
+ return AccountsApiFp(this.configuration).getAccounts(requestParameters.player, requestParameters.limit, requestParameters.skip, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
801
+ }
802
+ /**
803
+ * Perform a request to change the owner of an account. To perform an update on the owner of an account, first you must provide a new owner address. Once requested, the owner must accept to take ownership by calling `acceptOwnership()` in the smart contract account.
804
+ * @summary Request transfer ownership of account.
805
+ * @param {AccountsApiRequestTransferOwnershipRequest} requestParameters Request parameters.
806
+ * @param {*} [options] Override http request option.
807
+ * @throws {RequiredError}
808
+ * @memberof AccountsApi
809
+ */
810
+ requestTransferOwnership(requestParameters, options) {
811
+ return AccountsApiFp(this.configuration).requestTransferOwnership(requestParameters.id, requestParameters.transferOwnershipRequest, options).then((request) => request(this.axios, this.basePath));
812
+ }
813
+ /**
814
+ * **Custodial Accounts only** - Signs the typed data value with types data structure for domain using the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification.
815
+ * @summary Sign a given payload
816
+ * @param {AccountsApiSignPayloadRequest} requestParameters Request parameters.
817
+ * @param {*} [options] Override http request option.
818
+ * @throws {RequiredError}
819
+ * @memberof AccountsApi
820
+ */
821
+ signPayload(requestParameters, options) {
822
+ return AccountsApiFp(this.configuration).signPayload(requestParameters.id, requestParameters.signPayloadRequest, options).then((request) => request(this.axios, this.basePath));
823
+ }
824
+ /**
825
+ *
826
+ * @summary Start a recovery process of a recoverable account.
827
+ * @param {AccountsApiStartRecoveryRequest} requestParameters Request parameters.
828
+ * @param {*} [options] Override http request option.
829
+ * @throws {RequiredError}
830
+ * @memberof AccountsApi
831
+ */
832
+ startRecovery(requestParameters, options) {
833
+ return AccountsApiFp(this.configuration).startRecovery(requestParameters.id, requestParameters.startRecoveryRequest, options).then((request) => request(this.axios, this.basePath));
834
+ }
835
+ /**
836
+ * Synchronize the account state with the blockchain. Specifically, it updates the account owner and whether its deployed or not.
837
+ * @summary Sync account state with the blockchain
838
+ * @param {AccountsApiSyncAccountRequest} requestParameters Request parameters.
839
+ * @param {*} [options] Override http request option.
840
+ * @throws {RequiredError}
841
+ * @memberof AccountsApi
842
+ */
843
+ syncAccount(requestParameters, options) {
844
+ return AccountsApiFp(this.configuration).syncAccount(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
845
+ }
846
+ }
847
+
848
+ /* tslint:disable */
849
+ /* eslint-disable */
850
+ /**
851
+ * Openfort API
852
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
853
+ *
854
+ * The version of the OpenAPI document: 1.0.0
855
+ * Contact: founders@openfort.xyz
856
+ *
857
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
858
+ * https://openapi-generator.tech
859
+ * Do not edit the class manually.
860
+ */
861
+ /**
862
+ * AuthenticationApi - axios parameter creator
863
+ * @export
864
+ */
865
+ const AuthenticationApiAxiosParamCreator = function (configuration) {
866
+ return {
867
+ /**
868
+ *
869
+ * @summary Authenticate player with oauth token.
870
+ * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
871
+ * @param {*} [options] Override http request option.
872
+ * @throws {RequiredError}
873
+ */
874
+ authenticateOAuth: async (authenticateOAuthRequest, options = {}) => {
875
+ // verify required parameter 'authenticateOAuthRequest' is not null or undefined
876
+ assertParamExists('authenticateOAuth', 'authenticateOAuthRequest', authenticateOAuthRequest);
877
+ const localVarPath = `/iam/v1/oauth/authenticate`;
878
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
879
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
880
+ let baseOptions;
881
+ if (configuration) {
882
+ baseOptions = configuration.baseOptions;
883
+ }
884
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
885
+ const localVarHeaderParameter = {};
886
+ const localVarQueryParameter = {};
887
+ // authentication pk required
888
+ // http bearer authentication required
889
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
890
+ localVarHeaderParameter['Content-Type'] = 'application/json';
891
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
892
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
893
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
894
+ localVarRequestOptions.data = serializeDataIfNeeded(authenticateOAuthRequest, localVarRequestOptions, configuration);
895
+ return {
896
+ url: toPathString(localVarUrlObj),
897
+ options: localVarRequestOptions,
898
+ };
899
+ },
900
+ /**
901
+ *
902
+ * @summary Authenticate player with SIWE
903
+ * @param {SIWEAuthenticateRequest} sIWEAuthenticateRequest
904
+ * @param {*} [options] Override http request option.
905
+ * @throws {RequiredError}
906
+ */
907
+ authenticateSIWE: async (sIWEAuthenticateRequest, options = {}) => {
908
+ // verify required parameter 'sIWEAuthenticateRequest' is not null or undefined
909
+ assertParamExists('authenticateSIWE', 'sIWEAuthenticateRequest', sIWEAuthenticateRequest);
910
+ const localVarPath = `/iam/v1/siwe/authenticate`;
911
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
912
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
913
+ let baseOptions;
914
+ if (configuration) {
915
+ baseOptions = configuration.baseOptions;
916
+ }
917
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
918
+ const localVarHeaderParameter = {};
919
+ const localVarQueryParameter = {};
920
+ // authentication pk required
921
+ // http bearer authentication required
922
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
923
+ localVarHeaderParameter['Content-Type'] = 'application/json';
924
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
925
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
926
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
927
+ localVarRequestOptions.data = serializeDataIfNeeded(sIWEAuthenticateRequest, localVarRequestOptions, configuration);
928
+ return {
929
+ url: toPathString(localVarUrlObj),
930
+ options: localVarRequestOptions,
931
+ };
932
+ },
933
+ /**
934
+ * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
935
+ * @summary Authorize player with token.
936
+ * @param {OAuthProvider} provider OAuth provider
937
+ * @param {OAuthRequest} oAuthRequest
938
+ * @param {*} [options] Override http request option.
939
+ * @deprecated
940
+ * @throws {RequiredError}
941
+ */
942
+ authorizeWithOAuthToken: async (provider, oAuthRequest, options = {}) => {
943
+ // verify required parameter 'provider' is not null or undefined
944
+ assertParamExists('authorizeWithOAuthToken', 'provider', provider);
945
+ // verify required parameter 'oAuthRequest' is not null or undefined
946
+ assertParamExists('authorizeWithOAuthToken', 'oAuthRequest', oAuthRequest);
947
+ const localVarPath = `/iam/v1/oauth/{provider}/authorize`
948
+ .replace(`{${"provider"}}`, encodeURIComponent(String(provider)));
949
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
950
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
951
+ let baseOptions;
952
+ if (configuration) {
953
+ baseOptions = configuration.baseOptions;
954
+ }
955
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
956
+ const localVarHeaderParameter = {};
957
+ const localVarQueryParameter = {};
958
+ // authentication sk required
959
+ // http bearer authentication required
960
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
961
+ // authentication pk required
962
+ // http bearer authentication required
963
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
964
+ localVarHeaderParameter['Content-Type'] = 'application/json';
965
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
966
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
967
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
968
+ localVarRequestOptions.data = serializeDataIfNeeded(oAuthRequest, localVarRequestOptions, configuration);
969
+ return {
970
+ url: toPathString(localVarUrlObj),
971
+ options: localVarRequestOptions,
972
+ };
973
+ },
974
+ /**
975
+ * Get the jwks.json file. You can use the jwks.json file to verify the signature of a JWT token issued by Openfort Auth.
976
+ * @summary Get the jwks.json file.
977
+ * @param {string} publishableKey Specifies the project publishable key (starts with pk_).
978
+ * @param {*} [options] Override http request option.
979
+ * @throws {RequiredError}
980
+ */
981
+ getJwks: async (publishableKey, options = {}) => {
982
+ // verify required parameter 'publishableKey' is not null or undefined
983
+ assertParamExists('getJwks', 'publishableKey', publishableKey);
984
+ const localVarPath = `/iam/v1/{publishable_key}/jwks.json`
985
+ .replace(`{${"publishable_key"}}`, encodeURIComponent(String(publishableKey)));
986
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
987
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
988
+ let baseOptions;
989
+ if (configuration) {
990
+ baseOptions = configuration.baseOptions;
991
+ }
992
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
993
+ const localVarHeaderParameter = {};
994
+ const localVarQueryParameter = {};
995
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
996
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
997
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
998
+ return {
999
+ url: toPathString(localVarUrlObj),
1000
+ options: localVarRequestOptions,
1001
+ };
1002
+ },
1003
+ /**
1004
+ *
1005
+ * @summary Initialize OAuth.
1006
+ * @param {OAuthInitRequest} oAuthInitRequest
1007
+ * @param {*} [options] Override http request option.
1008
+ * @throws {RequiredError}
1009
+ */
1010
+ initOAuth: async (oAuthInitRequest, options = {}) => {
1011
+ // verify required parameter 'oAuthInitRequest' is not null or undefined
1012
+ assertParamExists('initOAuth', 'oAuthInitRequest', oAuthInitRequest);
1013
+ const localVarPath = `/iam/v1/oauth/init`;
1014
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1015
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1016
+ let baseOptions;
1017
+ if (configuration) {
1018
+ baseOptions = configuration.baseOptions;
1019
+ }
1020
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1021
+ const localVarHeaderParameter = {};
1022
+ const localVarQueryParameter = {};
1023
+ // authentication pk required
1024
+ // http bearer authentication required
1025
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1026
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1027
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1028
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1029
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1030
+ localVarRequestOptions.data = serializeDataIfNeeded(oAuthInitRequest, localVarRequestOptions, configuration);
1031
+ return {
1032
+ url: toPathString(localVarUrlObj),
1033
+ options: localVarRequestOptions,
1034
+ };
1035
+ },
1036
+ /**
1037
+ * Create a challenge to link external wallet to the player.
1038
+ * @summary Initialize SIWE.
1039
+ * @param {SIWERequest} sIWERequest
1040
+ * @param {*} [options] Override http request option.
1041
+ * @throws {RequiredError}
1042
+ */
1043
+ initSIWE: async (sIWERequest, options = {}) => {
1044
+ // verify required parameter 'sIWERequest' is not null or undefined
1045
+ assertParamExists('initSIWE', 'sIWERequest', sIWERequest);
1046
+ const localVarPath = `/iam/v1/siwe/init`;
1047
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1048
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1049
+ let baseOptions;
1050
+ if (configuration) {
1051
+ baseOptions = configuration.baseOptions;
1052
+ }
1053
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1054
+ const localVarHeaderParameter = {};
1055
+ const localVarQueryParameter = {};
1056
+ // authentication pk required
1057
+ // http bearer authentication required
1058
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1059
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1060
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1061
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1062
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1063
+ localVarRequestOptions.data = serializeDataIfNeeded(sIWERequest, localVarRequestOptions, configuration);
1064
+ return {
1065
+ url: toPathString(localVarUrlObj),
1066
+ options: localVarRequestOptions,
1067
+ };
1068
+ },
1069
+ /**
1070
+ *
1071
+ * @summary Link external wallet.
1072
+ * @param {SIWEAuthenticateRequest} sIWEAuthenticateRequest
1073
+ * @param {*} [options] Override http request option.
1074
+ * @throws {RequiredError}
1075
+ */
1076
+ linkSIWE: async (sIWEAuthenticateRequest, options = {}) => {
1077
+ // verify required parameter 'sIWEAuthenticateRequest' is not null or undefined
1078
+ assertParamExists('linkSIWE', 'sIWEAuthenticateRequest', sIWEAuthenticateRequest);
1079
+ const localVarPath = `/iam/v1/siwe/link`;
1080
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1081
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1082
+ let baseOptions;
1083
+ if (configuration) {
1084
+ baseOptions = configuration.baseOptions;
1085
+ }
1086
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1087
+ const localVarHeaderParameter = {};
1088
+ const localVarQueryParameter = {};
1089
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1090
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1091
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1092
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1093
+ localVarRequestOptions.data = serializeDataIfNeeded(sIWEAuthenticateRequest, localVarRequestOptions, configuration);
1094
+ return {
1095
+ url: toPathString(localVarUrlObj),
1096
+ options: localVarRequestOptions,
1097
+ };
1098
+ },
1099
+ /**
1100
+ * Authenticate a player based on email and password.
1101
+ * @summary Email and password login.
1102
+ * @param {LoginRequest} loginRequest
1103
+ * @param {*} [options] Override http request option.
1104
+ * @throws {RequiredError}
1105
+ */
1106
+ loginEmailPassword: async (loginRequest, options = {}) => {
1107
+ // verify required parameter 'loginRequest' is not null or undefined
1108
+ assertParamExists('loginEmailPassword', 'loginRequest', loginRequest);
1109
+ const localVarPath = `/iam/v1/password/login`;
1110
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1111
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1112
+ let baseOptions;
1113
+ if (configuration) {
1114
+ baseOptions = configuration.baseOptions;
1115
+ }
1116
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1117
+ const localVarHeaderParameter = {};
1118
+ const localVarQueryParameter = {};
1119
+ // authentication pk required
1120
+ // http bearer authentication required
1121
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1122
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1123
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1124
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1125
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1126
+ localVarRequestOptions.data = serializeDataIfNeeded(loginRequest, localVarRequestOptions, configuration);
1127
+ return {
1128
+ url: toPathString(localVarUrlObj),
1129
+ options: localVarRequestOptions,
1130
+ };
1131
+ },
1132
+ /**
1133
+ * When using Openfort Auth, the endpoint logs out the player.
1134
+ * @summary Log out a player.
1135
+ * @param {LogoutRequest} logoutRequest
1136
+ * @param {*} [options] Override http request option.
1137
+ * @throws {RequiredError}
1138
+ */
1139
+ logout: async (logoutRequest, options = {}) => {
1140
+ // verify required parameter 'logoutRequest' is not null or undefined
1141
+ assertParamExists('logout', 'logoutRequest', logoutRequest);
1142
+ const localVarPath = `/iam/v1/sessions/logout`;
1143
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1144
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1145
+ let baseOptions;
1146
+ if (configuration) {
1147
+ baseOptions = configuration.baseOptions;
1148
+ }
1149
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1150
+ const localVarHeaderParameter = {};
1151
+ const localVarQueryParameter = {};
1152
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1153
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1154
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1155
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1156
+ localVarRequestOptions.data = serializeDataIfNeeded(logoutRequest, localVarRequestOptions, configuration);
1157
+ return {
1158
+ url: toPathString(localVarUrlObj),
1159
+ options: localVarRequestOptions,
1160
+ };
1161
+ },
1162
+ /**
1163
+ *
1164
+ * @param {*} [options] Override http request option.
1165
+ * @throws {RequiredError}
1166
+ */
1167
+ me: async (options = {}) => {
1168
+ const localVarPath = `/iam/v1/me`;
1169
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1170
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1171
+ let baseOptions;
1172
+ if (configuration) {
1173
+ baseOptions = configuration.baseOptions;
1174
+ }
1175
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1176
+ const localVarHeaderParameter = {};
1177
+ const localVarQueryParameter = {};
1178
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1179
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1180
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1181
+ return {
1182
+ url: toPathString(localVarUrlObj),
1183
+ options: localVarRequestOptions,
1184
+ };
1185
+ },
1186
+ /**
1187
+ * Get or create a new session for the player based on the refresh token.
1188
+ * @summary Refresh or create auth session.
1189
+ * @param {RefreshTokenRequest} refreshTokenRequest
1190
+ * @param {*} [options] Override http request option.
1191
+ * @throws {RequiredError}
1192
+ */
1193
+ refresh: async (refreshTokenRequest, options = {}) => {
1194
+ // verify required parameter 'refreshTokenRequest' is not null or undefined
1195
+ assertParamExists('refresh', 'refreshTokenRequest', refreshTokenRequest);
1196
+ const localVarPath = `/iam/v1/sessions`;
1197
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1198
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1199
+ let baseOptions;
1200
+ if (configuration) {
1201
+ baseOptions = configuration.baseOptions;
1202
+ }
1203
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1204
+ const localVarHeaderParameter = {};
1205
+ const localVarQueryParameter = {};
1206
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1207
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1208
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1209
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1210
+ localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequest, localVarRequestOptions, configuration);
1211
+ return {
1212
+ url: toPathString(localVarUrlObj),
1213
+ options: localVarRequestOptions,
1214
+ };
1215
+ },
1216
+ /**
1217
+ * Create and authenticate a player based on email and password.
1218
+ * @summary Email and password signup.
1219
+ * @param {SignupRequest} signupRequest
1220
+ * @param {*} [options] Override http request option.
1221
+ * @throws {RequiredError}
1222
+ */
1223
+ signupEmailPassword: async (signupRequest, options = {}) => {
1224
+ // verify required parameter 'signupRequest' is not null or undefined
1225
+ assertParamExists('signupEmailPassword', 'signupRequest', signupRequest);
1226
+ const localVarPath = `/iam/v1/password/signup`;
1227
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1228
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1229
+ let baseOptions;
1230
+ if (configuration) {
1231
+ baseOptions = configuration.baseOptions;
1232
+ }
1233
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1234
+ const localVarHeaderParameter = {};
1235
+ const localVarQueryParameter = {};
1236
+ // authentication pk required
1237
+ // http bearer authentication required
1238
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1239
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1240
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1241
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1242
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1243
+ localVarRequestOptions.data = serializeDataIfNeeded(signupRequest, localVarRequestOptions, configuration);
1244
+ return {
1245
+ url: toPathString(localVarUrlObj),
1246
+ options: localVarRequestOptions,
1247
+ };
1248
+ },
1249
+ /**
1250
+ *
1251
+ * @summary Verify oauth token of a third party auth provider.
1252
+ * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1253
+ * @param {*} [options] Override http request option.
1254
+ * @throws {RequiredError}
1255
+ */
1256
+ thirdParty: async (thirdPartyOAuthRequest, options = {}) => {
1257
+ // verify required parameter 'thirdPartyOAuthRequest' is not null or undefined
1258
+ assertParamExists('thirdParty', 'thirdPartyOAuthRequest', thirdPartyOAuthRequest);
1259
+ const localVarPath = `/iam/v1/oauth/third_party`;
1260
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1261
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1262
+ let baseOptions;
1263
+ if (configuration) {
1264
+ baseOptions = configuration.baseOptions;
1265
+ }
1266
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1267
+ const localVarHeaderParameter = {};
1268
+ const localVarQueryParameter = {};
1269
+ // authentication pk required
1270
+ // http bearer authentication required
1271
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1272
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1273
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1274
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1275
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1276
+ localVarRequestOptions.data = serializeDataIfNeeded(thirdPartyOAuthRequest, localVarRequestOptions, configuration);
1277
+ return {
1278
+ url: toPathString(localVarUrlObj),
1279
+ options: localVarRequestOptions,
1280
+ };
1281
+ },
1282
+ /**
1283
+ *
1284
+ * @summary Unlink OAuth account
1285
+ * @param {UnlinkRequest} unlinkRequest
1286
+ * @param {*} [options] Override http request option.
1287
+ * @throws {RequiredError}
1288
+ */
1289
+ unlinkOAuth: async (unlinkRequest, options = {}) => {
1290
+ // verify required parameter 'unlinkRequest' is not null or undefined
1291
+ assertParamExists('unlinkOAuth', 'unlinkRequest', unlinkRequest);
1292
+ const localVarPath = `/iam/v1/oauth/unlink`;
1293
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1294
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1295
+ let baseOptions;
1296
+ if (configuration) {
1297
+ baseOptions = configuration.baseOptions;
1298
+ }
1299
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1300
+ const localVarHeaderParameter = {};
1301
+ const localVarQueryParameter = {};
1302
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1303
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1304
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1305
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1306
+ localVarRequestOptions.data = serializeDataIfNeeded(unlinkRequest, localVarRequestOptions, configuration);
1307
+ return {
1308
+ url: toPathString(localVarUrlObj),
1309
+ options: localVarRequestOptions,
1310
+ };
1311
+ },
1312
+ /**
1313
+ *
1314
+ * @summary Unlink external wallet.
1315
+ * @param {SIWERequest} sIWERequest
1316
+ * @param {*} [options] Override http request option.
1317
+ * @throws {RequiredError}
1318
+ */
1319
+ unlinkSIWE: async (sIWERequest, options = {}) => {
1320
+ // verify required parameter 'sIWERequest' is not null or undefined
1321
+ assertParamExists('unlinkSIWE', 'sIWERequest', sIWERequest);
1322
+ const localVarPath = `/iam/v1/siwe/unlink`;
1323
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1324
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1325
+ let baseOptions;
1326
+ if (configuration) {
1327
+ baseOptions = configuration.baseOptions;
1328
+ }
1329
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1330
+ const localVarHeaderParameter = {};
1331
+ const localVarQueryParameter = {};
1332
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1333
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1334
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1335
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1336
+ localVarRequestOptions.data = serializeDataIfNeeded(sIWERequest, localVarRequestOptions, configuration);
1337
+ return {
1338
+ url: toPathString(localVarUrlObj),
1339
+ options: localVarRequestOptions,
1340
+ };
1341
+ },
1342
+ /**
1343
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1344
+ * @summary Retrieve player by token.
1345
+ * @param {OAuthProvider} provider OAuth provider
1346
+ * @param {OAuthRequest} oAuthRequest
1347
+ * @param {*} [options] Override http request option.
1348
+ * @deprecated
1349
+ * @throws {RequiredError}
1350
+ */
1351
+ verifyOAuth: async (provider, oAuthRequest, options = {}) => {
1352
+ // verify required parameter 'provider' is not null or undefined
1353
+ assertParamExists('verifyOAuth', 'provider', provider);
1354
+ // verify required parameter 'oAuthRequest' is not null or undefined
1355
+ assertParamExists('verifyOAuth', 'oAuthRequest', oAuthRequest);
1356
+ const localVarPath = `/iam/v1/oauth/{provider}/verify`
1357
+ .replace(`{${"provider"}}`, encodeURIComponent(String(provider)));
1358
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1359
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1360
+ let baseOptions;
1361
+ if (configuration) {
1362
+ baseOptions = configuration.baseOptions;
1363
+ }
1364
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1365
+ const localVarHeaderParameter = {};
1366
+ const localVarQueryParameter = {};
1367
+ // authentication sk required
1368
+ // http bearer authentication required
1369
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1370
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1371
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1372
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1373
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1374
+ localVarRequestOptions.data = serializeDataIfNeeded(oAuthRequest, localVarRequestOptions, configuration);
1375
+ return {
1376
+ url: toPathString(localVarUrlObj),
1377
+ options: localVarRequestOptions,
1378
+ };
1379
+ },
1380
+ /**
1381
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1382
+ * @summary Retrieve player by oauth token.
1383
+ * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
1384
+ * @param {*} [options] Override http request option.
1385
+ * @throws {RequiredError}
1386
+ */
1387
+ verifyOAuthToken: async (authenticateOAuthRequest, options = {}) => {
1388
+ // verify required parameter 'authenticateOAuthRequest' is not null or undefined
1389
+ assertParamExists('verifyOAuthToken', 'authenticateOAuthRequest', authenticateOAuthRequest);
1390
+ const localVarPath = `/iam/v1/oauth/verify`;
1391
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1392
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1393
+ let baseOptions;
1394
+ if (configuration) {
1395
+ baseOptions = configuration.baseOptions;
1396
+ }
1397
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1398
+ const localVarHeaderParameter = {};
1399
+ const localVarQueryParameter = {};
1400
+ // authentication sk required
1401
+ // http bearer authentication required
1402
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1403
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1404
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1405
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1406
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1407
+ localVarRequestOptions.data = serializeDataIfNeeded(authenticateOAuthRequest, localVarRequestOptions, configuration);
1408
+ return {
1409
+ url: toPathString(localVarUrlObj),
1410
+ options: localVarRequestOptions,
1411
+ };
1412
+ },
1413
+ };
1414
+ };
1415
+ /**
1416
+ * AuthenticationApi - functional programming interface
1417
+ * @export
1418
+ */
1419
+ const AuthenticationApiFp = function (configuration) {
1420
+ const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration);
1421
+ return {
1422
+ /**
1423
+ *
1424
+ * @summary Authenticate player with oauth token.
1425
+ * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
1426
+ * @param {*} [options] Override http request option.
1427
+ * @throws {RequiredError}
1428
+ */
1429
+ async authenticateOAuth(authenticateOAuthRequest, options) {
1430
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateOAuth(authenticateOAuthRequest, options);
1431
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1432
+ },
1433
+ /**
1434
+ *
1435
+ * @summary Authenticate player with SIWE
1436
+ * @param {SIWEAuthenticateRequest} sIWEAuthenticateRequest
1437
+ * @param {*} [options] Override http request option.
1438
+ * @throws {RequiredError}
1439
+ */
1440
+ async authenticateSIWE(sIWEAuthenticateRequest, options) {
1441
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateSIWE(sIWEAuthenticateRequest, options);
1442
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1443
+ },
1444
+ /**
1445
+ * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1446
+ * @summary Authorize player with token.
1447
+ * @param {OAuthProvider} provider OAuth provider
1448
+ * @param {OAuthRequest} oAuthRequest
1449
+ * @param {*} [options] Override http request option.
1450
+ * @deprecated
1451
+ * @throws {RequiredError}
1452
+ */
1453
+ async authorizeWithOAuthToken(provider, oAuthRequest, options) {
1454
+ const localVarAxiosArgs = await localVarAxiosParamCreator.authorizeWithOAuthToken(provider, oAuthRequest, options);
1455
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1456
+ },
1457
+ /**
1458
+ * Get the jwks.json file. You can use the jwks.json file to verify the signature of a JWT token issued by Openfort Auth.
1459
+ * @summary Get the jwks.json file.
1460
+ * @param {string} publishableKey Specifies the project publishable key (starts with pk_).
1461
+ * @param {*} [options] Override http request option.
1462
+ * @throws {RequiredError}
1463
+ */
1464
+ async getJwks(publishableKey, options) {
1465
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getJwks(publishableKey, options);
1466
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1467
+ },
1468
+ /**
1469
+ *
1470
+ * @summary Initialize OAuth.
1471
+ * @param {OAuthInitRequest} oAuthInitRequest
1472
+ * @param {*} [options] Override http request option.
1473
+ * @throws {RequiredError}
1474
+ */
1475
+ async initOAuth(oAuthInitRequest, options) {
1476
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initOAuth(oAuthInitRequest, options);
1477
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1478
+ },
1479
+ /**
1480
+ * Create a challenge to link external wallet to the player.
1481
+ * @summary Initialize SIWE.
1482
+ * @param {SIWERequest} sIWERequest
1483
+ * @param {*} [options] Override http request option.
1484
+ * @throws {RequiredError}
1485
+ */
1486
+ async initSIWE(sIWERequest, options) {
1487
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initSIWE(sIWERequest, options);
1488
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1489
+ },
1490
+ /**
1491
+ *
1492
+ * @summary Link external wallet.
1493
+ * @param {SIWEAuthenticateRequest} sIWEAuthenticateRequest
1494
+ * @param {*} [options] Override http request option.
1495
+ * @throws {RequiredError}
1496
+ */
1497
+ async linkSIWE(sIWEAuthenticateRequest, options) {
1498
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkSIWE(sIWEAuthenticateRequest, options);
1499
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1500
+ },
1501
+ /**
1502
+ * Authenticate a player based on email and password.
1503
+ * @summary Email and password login.
1504
+ * @param {LoginRequest} loginRequest
1505
+ * @param {*} [options] Override http request option.
1506
+ * @throws {RequiredError}
1507
+ */
1508
+ async loginEmailPassword(loginRequest, options) {
1509
+ const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, options);
1510
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1511
+ },
1512
+ /**
1513
+ * When using Openfort Auth, the endpoint logs out the player.
1514
+ * @summary Log out a player.
1515
+ * @param {LogoutRequest} logoutRequest
1516
+ * @param {*} [options] Override http request option.
1517
+ * @throws {RequiredError}
1518
+ */
1519
+ async logout(logoutRequest, options) {
1520
+ const localVarAxiosArgs = await localVarAxiosParamCreator.logout(logoutRequest, options);
1521
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1522
+ },
1523
+ /**
1524
+ *
1525
+ * @param {*} [options] Override http request option.
1526
+ * @throws {RequiredError}
1527
+ */
1528
+ async me(options) {
1529
+ const localVarAxiosArgs = await localVarAxiosParamCreator.me(options);
1530
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1531
+ },
1532
+ /**
1533
+ * Get or create a new session for the player based on the refresh token.
1534
+ * @summary Refresh or create auth session.
1535
+ * @param {RefreshTokenRequest} refreshTokenRequest
1536
+ * @param {*} [options] Override http request option.
1537
+ * @throws {RequiredError}
1538
+ */
1539
+ async refresh(refreshTokenRequest, options) {
1540
+ const localVarAxiosArgs = await localVarAxiosParamCreator.refresh(refreshTokenRequest, options);
1541
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1542
+ },
1543
+ /**
1544
+ * Create and authenticate a player based on email and password.
1545
+ * @summary Email and password signup.
1546
+ * @param {SignupRequest} signupRequest
1547
+ * @param {*} [options] Override http request option.
1548
+ * @throws {RequiredError}
1549
+ */
1550
+ async signupEmailPassword(signupRequest, options) {
1551
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signupEmailPassword(signupRequest, options);
1552
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1553
+ },
1554
+ /**
1555
+ *
1556
+ * @summary Verify oauth token of a third party auth provider.
1557
+ * @param {ThirdPartyOAuthRequest} thirdPartyOAuthRequest
1558
+ * @param {*} [options] Override http request option.
1559
+ * @throws {RequiredError}
1560
+ */
1561
+ async thirdParty(thirdPartyOAuthRequest, options) {
1562
+ const localVarAxiosArgs = await localVarAxiosParamCreator.thirdParty(thirdPartyOAuthRequest, options);
1563
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1564
+ },
1565
+ /**
1566
+ *
1567
+ * @summary Unlink OAuth account
1568
+ * @param {UnlinkRequest} unlinkRequest
1569
+ * @param {*} [options] Override http request option.
1570
+ * @throws {RequiredError}
1571
+ */
1572
+ async unlinkOAuth(unlinkRequest, options) {
1573
+ const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkOAuth(unlinkRequest, options);
1574
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1575
+ },
1576
+ /**
1577
+ *
1578
+ * @summary Unlink external wallet.
1579
+ * @param {SIWERequest} sIWERequest
1580
+ * @param {*} [options] Override http request option.
1581
+ * @throws {RequiredError}
1582
+ */
1583
+ async unlinkSIWE(sIWERequest, options) {
1584
+ const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkSIWE(sIWERequest, options);
1585
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1586
+ },
1587
+ /**
1588
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1589
+ * @summary Retrieve player by token.
1590
+ * @param {OAuthProvider} provider OAuth provider
1591
+ * @param {OAuthRequest} oAuthRequest
1592
+ * @param {*} [options] Override http request option.
1593
+ * @deprecated
1594
+ * @throws {RequiredError}
1595
+ */
1596
+ async verifyOAuth(provider, oAuthRequest, options) {
1597
+ const localVarAxiosArgs = await localVarAxiosParamCreator.verifyOAuth(provider, oAuthRequest, options);
1598
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1599
+ },
1600
+ /**
1601
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1602
+ * @summary Retrieve player by oauth token.
1603
+ * @param {AuthenticateOAuthRequest} authenticateOAuthRequest
1604
+ * @param {*} [options] Override http request option.
1605
+ * @throws {RequiredError}
1606
+ */
1607
+ async verifyOAuthToken(authenticateOAuthRequest, options) {
1608
+ const localVarAxiosArgs = await localVarAxiosParamCreator.verifyOAuthToken(authenticateOAuthRequest, options);
1609
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1610
+ },
1611
+ };
1612
+ };
1613
+ /**
1614
+ * AuthenticationApi - object-oriented interface
1615
+ * @export
1616
+ * @class AuthenticationApi
1617
+ * @extends {BaseAPI}
1618
+ */
1619
+ class AuthenticationApi extends BaseAPI {
1620
+ /**
1621
+ *
1622
+ * @summary Authenticate player with oauth token.
1623
+ * @param {AuthenticationApiAuthenticateOAuthRequest} requestParameters Request parameters.
1624
+ * @param {*} [options] Override http request option.
1625
+ * @throws {RequiredError}
1626
+ * @memberof AuthenticationApi
1627
+ */
1628
+ authenticateOAuth(requestParameters, options) {
1629
+ return AuthenticationApiFp(this.configuration).authenticateOAuth(requestParameters.authenticateOAuthRequest, options).then((request) => request(this.axios, this.basePath));
1630
+ }
1631
+ /**
1632
+ *
1633
+ * @summary Authenticate player with SIWE
1634
+ * @param {AuthenticationApiAuthenticateSIWERequest} requestParameters Request parameters.
1635
+ * @param {*} [options] Override http request option.
1636
+ * @throws {RequiredError}
1637
+ * @memberof AuthenticationApi
1638
+ */
1639
+ authenticateSIWE(requestParameters, options) {
1640
+ return AuthenticationApiFp(this.configuration).authenticateSIWE(requestParameters.sIWEAuthenticateRequest, options).then((request) => request(this.axios, this.basePath));
1641
+ }
1642
+ /**
1643
+ * The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.
1644
+ * @summary Authorize player with token.
1645
+ * @param {AuthenticationApiAuthorizeWithOAuthTokenRequest} requestParameters Request parameters.
1646
+ * @param {*} [options] Override http request option.
1647
+ * @deprecated
1648
+ * @throws {RequiredError}
1649
+ * @memberof AuthenticationApi
1650
+ */
1651
+ authorizeWithOAuthToken(requestParameters, options) {
1652
+ return AuthenticationApiFp(this.configuration).authorizeWithOAuthToken(requestParameters.provider, requestParameters.oAuthRequest, options).then((request) => request(this.axios, this.basePath));
1653
+ }
1654
+ /**
1655
+ * Get the jwks.json file. You can use the jwks.json file to verify the signature of a JWT token issued by Openfort Auth.
1656
+ * @summary Get the jwks.json file.
1657
+ * @param {AuthenticationApiGetJwksRequest} requestParameters Request parameters.
1658
+ * @param {*} [options] Override http request option.
1659
+ * @throws {RequiredError}
1660
+ * @memberof AuthenticationApi
1661
+ */
1662
+ getJwks(requestParameters, options) {
1663
+ return AuthenticationApiFp(this.configuration).getJwks(requestParameters.publishableKey, options).then((request) => request(this.axios, this.basePath));
1664
+ }
1665
+ /**
1666
+ *
1667
+ * @summary Initialize OAuth.
1668
+ * @param {AuthenticationApiInitOAuthRequest} requestParameters Request parameters.
1669
+ * @param {*} [options] Override http request option.
1670
+ * @throws {RequiredError}
1671
+ * @memberof AuthenticationApi
1672
+ */
1673
+ initOAuth(requestParameters, options) {
1674
+ return AuthenticationApiFp(this.configuration).initOAuth(requestParameters.oAuthInitRequest, options).then((request) => request(this.axios, this.basePath));
1675
+ }
1676
+ /**
1677
+ * Create a challenge to link external wallet to the player.
1678
+ * @summary Initialize SIWE.
1679
+ * @param {AuthenticationApiInitSIWERequest} requestParameters Request parameters.
1680
+ * @param {*} [options] Override http request option.
1681
+ * @throws {RequiredError}
1682
+ * @memberof AuthenticationApi
1683
+ */
1684
+ initSIWE(requestParameters, options) {
1685
+ return AuthenticationApiFp(this.configuration).initSIWE(requestParameters.sIWERequest, options).then((request) => request(this.axios, this.basePath));
1686
+ }
1687
+ /**
1688
+ *
1689
+ * @summary Link external wallet.
1690
+ * @param {AuthenticationApiLinkSIWERequest} requestParameters Request parameters.
1691
+ * @param {*} [options] Override http request option.
1692
+ * @throws {RequiredError}
1693
+ * @memberof AuthenticationApi
1694
+ */
1695
+ linkSIWE(requestParameters, options) {
1696
+ return AuthenticationApiFp(this.configuration).linkSIWE(requestParameters.sIWEAuthenticateRequest, options).then((request) => request(this.axios, this.basePath));
1697
+ }
1698
+ /**
1699
+ * Authenticate a player based on email and password.
1700
+ * @summary Email and password login.
1701
+ * @param {AuthenticationApiLoginEmailPasswordRequest} requestParameters Request parameters.
1702
+ * @param {*} [options] Override http request option.
1703
+ * @throws {RequiredError}
1704
+ * @memberof AuthenticationApi
1705
+ */
1706
+ loginEmailPassword(requestParameters, options) {
1707
+ return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, options).then((request) => request(this.axios, this.basePath));
1708
+ }
1709
+ /**
1710
+ * When using Openfort Auth, the endpoint logs out the player.
1711
+ * @summary Log out a player.
1712
+ * @param {AuthenticationApiLogoutRequest} requestParameters Request parameters.
1713
+ * @param {*} [options] Override http request option.
1714
+ * @throws {RequiredError}
1715
+ * @memberof AuthenticationApi
1716
+ */
1717
+ logout(requestParameters, options) {
1718
+ return AuthenticationApiFp(this.configuration).logout(requestParameters.logoutRequest, options).then((request) => request(this.axios, this.basePath));
1719
+ }
1720
+ /**
1721
+ *
1722
+ * @param {*} [options] Override http request option.
1723
+ * @throws {RequiredError}
1724
+ * @memberof AuthenticationApi
1725
+ */
1726
+ me(options) {
1727
+ return AuthenticationApiFp(this.configuration).me(options).then((request) => request(this.axios, this.basePath));
1728
+ }
1729
+ /**
1730
+ * Get or create a new session for the player based on the refresh token.
1731
+ * @summary Refresh or create auth session.
1732
+ * @param {AuthenticationApiRefreshRequest} requestParameters Request parameters.
1733
+ * @param {*} [options] Override http request option.
1734
+ * @throws {RequiredError}
1735
+ * @memberof AuthenticationApi
1736
+ */
1737
+ refresh(requestParameters, options) {
1738
+ return AuthenticationApiFp(this.configuration).refresh(requestParameters.refreshTokenRequest, options).then((request) => request(this.axios, this.basePath));
1739
+ }
1740
+ /**
1741
+ * Create and authenticate a player based on email and password.
1742
+ * @summary Email and password signup.
1743
+ * @param {AuthenticationApiSignupEmailPasswordRequest} requestParameters Request parameters.
1744
+ * @param {*} [options] Override http request option.
1745
+ * @throws {RequiredError}
1746
+ * @memberof AuthenticationApi
1747
+ */
1748
+ signupEmailPassword(requestParameters, options) {
1749
+ return AuthenticationApiFp(this.configuration).signupEmailPassword(requestParameters.signupRequest, options).then((request) => request(this.axios, this.basePath));
1750
+ }
1751
+ /**
1752
+ *
1753
+ * @summary Verify oauth token of a third party auth provider.
1754
+ * @param {AuthenticationApiThirdPartyRequest} requestParameters Request parameters.
1755
+ * @param {*} [options] Override http request option.
1756
+ * @throws {RequiredError}
1757
+ * @memberof AuthenticationApi
1758
+ */
1759
+ thirdParty(requestParameters, options) {
1760
+ return AuthenticationApiFp(this.configuration).thirdParty(requestParameters.thirdPartyOAuthRequest, options).then((request) => request(this.axios, this.basePath));
1761
+ }
1762
+ /**
1763
+ *
1764
+ * @summary Unlink OAuth account
1765
+ * @param {AuthenticationApiUnlinkOAuthRequest} requestParameters Request parameters.
1766
+ * @param {*} [options] Override http request option.
1767
+ * @throws {RequiredError}
1768
+ * @memberof AuthenticationApi
1769
+ */
1770
+ unlinkOAuth(requestParameters, options) {
1771
+ return AuthenticationApiFp(this.configuration).unlinkOAuth(requestParameters.unlinkRequest, options).then((request) => request(this.axios, this.basePath));
1772
+ }
1773
+ /**
1774
+ *
1775
+ * @summary Unlink external wallet.
1776
+ * @param {AuthenticationApiUnlinkSIWERequest} requestParameters Request parameters.
1777
+ * @param {*} [options] Override http request option.
1778
+ * @throws {RequiredError}
1779
+ * @memberof AuthenticationApi
1780
+ */
1781
+ unlinkSIWE(requestParameters, options) {
1782
+ return AuthenticationApiFp(this.configuration).unlinkSIWE(requestParameters.sIWERequest, options).then((request) => request(this.axios, this.basePath));
1783
+ }
1784
+ /**
1785
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1786
+ * @summary Retrieve player by token.
1787
+ * @param {AuthenticationApiVerifyOAuthRequest} requestParameters Request parameters.
1788
+ * @param {*} [options] Override http request option.
1789
+ * @deprecated
1790
+ * @throws {RequiredError}
1791
+ * @memberof AuthenticationApi
1792
+ */
1793
+ verifyOAuth(requestParameters, options) {
1794
+ return AuthenticationApiFp(this.configuration).verifyOAuth(requestParameters.provider, requestParameters.oAuthRequest, options).then((request) => request(this.axios, this.basePath));
1795
+ }
1796
+ /**
1797
+ * The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player. Returns the latest 10 transaction intents for the player.
1798
+ * @summary Retrieve player by oauth token.
1799
+ * @param {AuthenticationApiVerifyOAuthTokenRequest} requestParameters Request parameters.
1800
+ * @param {*} [options] Override http request option.
1801
+ * @throws {RequiredError}
1802
+ * @memberof AuthenticationApi
1803
+ */
1804
+ verifyOAuthToken(requestParameters, options) {
1805
+ return AuthenticationApiFp(this.configuration).verifyOAuthToken(requestParameters.authenticateOAuthRequest, options).then((request) => request(this.axios, this.basePath));
1806
+ }
1807
+ }
1808
+
1809
+ /* tslint:disable */
1810
+ /* eslint-disable */
1811
+ /**
1812
+ * Openfort API
1813
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
1814
+ *
1815
+ * The version of the OpenAPI document: 1.0.0
1816
+ * Contact: founders@openfort.xyz
1817
+ *
1818
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1819
+ * https://openapi-generator.tech
1820
+ * Do not edit the class manually.
1821
+ */
1822
+ /**
1823
+ * SessionsApi - axios parameter creator
1824
+ * @export
1825
+ */
1826
+ const SessionsApiAxiosParamCreator = function (configuration) {
1827
+ return {
1828
+ /**
1829
+ * Creates a Session.
1830
+ * @summary Create a session key.
1831
+ * @param {CreateSessionRequest} createSessionRequest
1832
+ * @param {*} [options] Override http request option.
1833
+ * @throws {RequiredError}
1834
+ */
1835
+ createSession: async (createSessionRequest, options = {}) => {
1836
+ // verify required parameter 'createSessionRequest' is not null or undefined
1837
+ assertParamExists('createSession', 'createSessionRequest', createSessionRequest);
1838
+ const localVarPath = `/v1/sessions`;
1839
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1840
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1841
+ let baseOptions;
1842
+ if (configuration) {
1843
+ baseOptions = configuration.baseOptions;
1844
+ }
1845
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1846
+ const localVarHeaderParameter = {};
1847
+ const localVarQueryParameter = {};
1848
+ // authentication sk required
1849
+ // http bearer authentication required
1850
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1851
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1852
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1853
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1854
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1855
+ localVarRequestOptions.data = serializeDataIfNeeded(createSessionRequest, localVarRequestOptions, configuration);
1856
+ return {
1857
+ url: toPathString(localVarUrlObj),
1858
+ options: localVarRequestOptions,
1859
+ };
1860
+ },
1861
+ /**
1862
+ * Returns a list of Sessions. Returns the latest 10 transaction intents for each session.
1863
+ * @summary List session keys of a player.
1864
+ * @param {string} player The player ID (starts with pla_)
1865
+ * @param {number} [limit] Specifies the maximum number of records to return.
1866
+ * @param {number} [skip] Specifies the offset for the first records to return.
1867
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
1868
+ * @param {Array<SessionResponseExpandable>} [expand] Specifies the fields to expand in the response.
1869
+ * @param {*} [options] Override http request option.
1870
+ * @throws {RequiredError}
1871
+ */
1872
+ getPlayerSessions: async (player, limit, skip, order, expand, options = {}) => {
1873
+ // verify required parameter 'player' is not null or undefined
1874
+ assertParamExists('getPlayerSessions', 'player', player);
1875
+ const localVarPath = `/v1/sessions`;
1876
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1877
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1878
+ let baseOptions;
1879
+ if (configuration) {
1880
+ baseOptions = configuration.baseOptions;
1881
+ }
1882
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1883
+ const localVarHeaderParameter = {};
1884
+ const localVarQueryParameter = {};
1885
+ // authentication sk required
1886
+ // http bearer authentication required
1887
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1888
+ if (limit !== undefined) {
1889
+ localVarQueryParameter['limit'] = limit;
1890
+ }
1891
+ if (skip !== undefined) {
1892
+ localVarQueryParameter['skip'] = skip;
1893
+ }
1894
+ if (order !== undefined) {
1895
+ localVarQueryParameter['order'] = order;
1896
+ }
1897
+ if (player !== undefined) {
1898
+ localVarQueryParameter['player'] = player;
1899
+ }
1900
+ if (expand) {
1901
+ localVarQueryParameter['expand'] = expand;
1902
+ }
1903
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1904
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1905
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1906
+ return {
1907
+ url: toPathString(localVarUrlObj),
1908
+ options: localVarRequestOptions,
1909
+ };
1910
+ },
1911
+ /**
1912
+ * Retrieves the details of a Session that has previously been created. Returns the latest 10 transaction intents that used this session.
1913
+ * @summary Returns a player session by session id
1914
+ * @param {string} id Specifies the unique session ID (starts with ses_).
1915
+ * @param {Array<SessionResponseExpandable>} [expand] Specifies the fields to expand.
1916
+ * @param {*} [options] Override http request option.
1917
+ * @throws {RequiredError}
1918
+ */
1919
+ getSession: async (id, expand, options = {}) => {
1920
+ // verify required parameter 'id' is not null or undefined
1921
+ assertParamExists('getSession', 'id', id);
1922
+ const localVarPath = `/v1/sessions/{id}`
1923
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1924
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1925
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1926
+ let baseOptions;
1927
+ if (configuration) {
1928
+ baseOptions = configuration.baseOptions;
1929
+ }
1930
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1931
+ const localVarHeaderParameter = {};
1932
+ const localVarQueryParameter = {};
1933
+ // authentication sk required
1934
+ // http bearer authentication required
1935
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1936
+ if (expand) {
1937
+ localVarQueryParameter['expand'] = expand;
1938
+ }
1939
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1940
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1941
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1942
+ return {
1943
+ url: toPathString(localVarUrlObj),
1944
+ options: localVarRequestOptions,
1945
+ };
1946
+ },
1947
+ /**
1948
+ *
1949
+ * @summary Revoke the session session key.
1950
+ * @param {RevokeSessionRequest} revokeSessionRequest
1951
+ * @param {*} [options] Override http request option.
1952
+ * @throws {RequiredError}
1953
+ */
1954
+ revokeSession: async (revokeSessionRequest, options = {}) => {
1955
+ // verify required parameter 'revokeSessionRequest' is not null or undefined
1956
+ assertParamExists('revokeSession', 'revokeSessionRequest', revokeSessionRequest);
1957
+ const localVarPath = `/v1/sessions/revoke`;
1958
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1959
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1960
+ let baseOptions;
1961
+ if (configuration) {
1962
+ baseOptions = configuration.baseOptions;
1963
+ }
1964
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
1965
+ const localVarHeaderParameter = {};
1966
+ const localVarQueryParameter = {};
1967
+ // authentication sk required
1968
+ // http bearer authentication required
1969
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1970
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1971
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1972
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1973
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1974
+ localVarRequestOptions.data = serializeDataIfNeeded(revokeSessionRequest, localVarRequestOptions, configuration);
1975
+ return {
1976
+ url: toPathString(localVarUrlObj),
1977
+ options: localVarRequestOptions,
1978
+ };
1979
+ },
1980
+ /**
1981
+ *
1982
+ * @summary Send signed userOperationHash to create session.
1983
+ * @param {string} id Specifies the unique session ID (starts with ses_).
1984
+ * @param {SignatureRequest} signatureRequest
1985
+ * @param {*} [options] Override http request option.
1986
+ * @throws {RequiredError}
1987
+ */
1988
+ signatureSession: async (id, signatureRequest, options = {}) => {
1989
+ // verify required parameter 'id' is not null or undefined
1990
+ assertParamExists('signatureSession', 'id', id);
1991
+ // verify required parameter 'signatureRequest' is not null or undefined
1992
+ assertParamExists('signatureSession', 'signatureRequest', signatureRequest);
1993
+ const localVarPath = `/v1/sessions/{id}/signature`
1994
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1995
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1996
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1997
+ let baseOptions;
1998
+ if (configuration) {
1999
+ baseOptions = configuration.baseOptions;
2000
+ }
2001
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
2002
+ const localVarHeaderParameter = {};
2003
+ const localVarQueryParameter = {};
2004
+ // authentication sk required
2005
+ // http bearer authentication required
2006
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2007
+ // authentication pk required
2008
+ // http bearer authentication required
2009
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2010
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2011
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2012
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2013
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2014
+ localVarRequestOptions.data = serializeDataIfNeeded(signatureRequest, localVarRequestOptions, configuration);
2015
+ return {
2016
+ url: toPathString(localVarUrlObj),
2017
+ options: localVarRequestOptions,
2018
+ };
2019
+ },
2020
+ };
2021
+ };
2022
+ /**
2023
+ * SessionsApi - functional programming interface
2024
+ * @export
2025
+ */
2026
+ const SessionsApiFp = function (configuration) {
2027
+ const localVarAxiosParamCreator = SessionsApiAxiosParamCreator(configuration);
2028
+ return {
2029
+ /**
2030
+ * Creates a Session.
2031
+ * @summary Create a session key.
2032
+ * @param {CreateSessionRequest} createSessionRequest
2033
+ * @param {*} [options] Override http request option.
2034
+ * @throws {RequiredError}
2035
+ */
2036
+ async createSession(createSessionRequest, options) {
2037
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createSession(createSessionRequest, options);
2038
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2039
+ },
2040
+ /**
2041
+ * Returns a list of Sessions. Returns the latest 10 transaction intents for each session.
2042
+ * @summary List session keys of a player.
2043
+ * @param {string} player The player ID (starts with pla_)
2044
+ * @param {number} [limit] Specifies the maximum number of records to return.
2045
+ * @param {number} [skip] Specifies the offset for the first records to return.
2046
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
2047
+ * @param {Array<SessionResponseExpandable>} [expand] Specifies the fields to expand in the response.
2048
+ * @param {*} [options] Override http request option.
2049
+ * @throws {RequiredError}
2050
+ */
2051
+ async getPlayerSessions(player, limit, skip, order, expand, options) {
2052
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPlayerSessions(player, limit, skip, order, expand, options);
2053
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2054
+ },
2055
+ /**
2056
+ * Retrieves the details of a Session that has previously been created. Returns the latest 10 transaction intents that used this session.
2057
+ * @summary Returns a player session by session id
2058
+ * @param {string} id Specifies the unique session ID (starts with ses_).
2059
+ * @param {Array<SessionResponseExpandable>} [expand] Specifies the fields to expand.
2060
+ * @param {*} [options] Override http request option.
2061
+ * @throws {RequiredError}
2062
+ */
2063
+ async getSession(id, expand, options) {
2064
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSession(id, expand, options);
2065
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2066
+ },
2067
+ /**
2068
+ *
2069
+ * @summary Revoke the session session key.
2070
+ * @param {RevokeSessionRequest} revokeSessionRequest
2071
+ * @param {*} [options] Override http request option.
2072
+ * @throws {RequiredError}
2073
+ */
2074
+ async revokeSession(revokeSessionRequest, options) {
2075
+ const localVarAxiosArgs = await localVarAxiosParamCreator.revokeSession(revokeSessionRequest, options);
2076
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2077
+ },
2078
+ /**
2079
+ *
2080
+ * @summary Send signed userOperationHash to create session.
2081
+ * @param {string} id Specifies the unique session ID (starts with ses_).
2082
+ * @param {SignatureRequest} signatureRequest
2083
+ * @param {*} [options] Override http request option.
2084
+ * @throws {RequiredError}
2085
+ */
2086
+ async signatureSession(id, signatureRequest, options) {
2087
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signatureSession(id, signatureRequest, options);
2088
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2089
+ },
2090
+ };
2091
+ };
2092
+ /**
2093
+ * SessionsApi - object-oriented interface
2094
+ * @export
2095
+ * @class SessionsApi
2096
+ * @extends {BaseAPI}
2097
+ */
2098
+ class SessionsApi extends BaseAPI {
2099
+ /**
2100
+ * Creates a Session.
2101
+ * @summary Create a session key.
2102
+ * @param {SessionsApiCreateSessionRequest} requestParameters Request parameters.
2103
+ * @param {*} [options] Override http request option.
2104
+ * @throws {RequiredError}
2105
+ * @memberof SessionsApi
2106
+ */
2107
+ createSession(requestParameters, options) {
2108
+ return SessionsApiFp(this.configuration).createSession(requestParameters.createSessionRequest, options).then((request) => request(this.axios, this.basePath));
2109
+ }
2110
+ /**
2111
+ * Returns a list of Sessions. Returns the latest 10 transaction intents for each session.
2112
+ * @summary List session keys of a player.
2113
+ * @param {SessionsApiGetPlayerSessionsRequest} requestParameters Request parameters.
2114
+ * @param {*} [options] Override http request option.
2115
+ * @throws {RequiredError}
2116
+ * @memberof SessionsApi
2117
+ */
2118
+ getPlayerSessions(requestParameters, options) {
2119
+ return SessionsApiFp(this.configuration).getPlayerSessions(requestParameters.player, requestParameters.limit, requestParameters.skip, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
2120
+ }
2121
+ /**
2122
+ * Retrieves the details of a Session that has previously been created. Returns the latest 10 transaction intents that used this session.
2123
+ * @summary Returns a player session by session id
2124
+ * @param {SessionsApiGetSessionRequest} requestParameters Request parameters.
2125
+ * @param {*} [options] Override http request option.
2126
+ * @throws {RequiredError}
2127
+ * @memberof SessionsApi
2128
+ */
2129
+ getSession(requestParameters, options) {
2130
+ return SessionsApiFp(this.configuration).getSession(requestParameters.id, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
2131
+ }
2132
+ /**
2133
+ *
2134
+ * @summary Revoke the session session key.
2135
+ * @param {SessionsApiRevokeSessionRequest} requestParameters Request parameters.
2136
+ * @param {*} [options] Override http request option.
2137
+ * @throws {RequiredError}
2138
+ * @memberof SessionsApi
2139
+ */
2140
+ revokeSession(requestParameters, options) {
2141
+ return SessionsApiFp(this.configuration).revokeSession(requestParameters.revokeSessionRequest, options).then((request) => request(this.axios, this.basePath));
2142
+ }
2143
+ /**
2144
+ *
2145
+ * @summary Send signed userOperationHash to create session.
2146
+ * @param {SessionsApiSignatureSessionRequest} requestParameters Request parameters.
2147
+ * @param {*} [options] Override http request option.
2148
+ * @throws {RequiredError}
2149
+ * @memberof SessionsApi
2150
+ */
2151
+ signatureSession(requestParameters, options) {
2152
+ return SessionsApiFp(this.configuration).signatureSession(requestParameters.id, requestParameters.signatureRequest, options).then((request) => request(this.axios, this.basePath));
2153
+ }
2154
+ }
2155
+
2156
+ /* tslint:disable */
2157
+ /* eslint-disable */
2158
+ /**
2159
+ * Openfort API
2160
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
2161
+ *
2162
+ * The version of the OpenAPI document: 1.0.0
2163
+ * Contact: founders@openfort.xyz
2164
+ *
2165
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2166
+ * https://openapi-generator.tech
2167
+ * Do not edit the class manually.
2168
+ */
2169
+ /**
2170
+ * TransactionIntentsApi - axios parameter creator
2171
+ * @export
2172
+ */
2173
+ const TransactionIntentsApiAxiosParamCreator = function (configuration) {
2174
+ return {
2175
+ /**
2176
+ * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2177
+ * @summary Create a transaction intent object.
2178
+ * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2179
+ * @param {*} [options] Override http request option.
2180
+ * @throws {RequiredError}
2181
+ */
2182
+ createTransactionIntent: async (createTransactionIntentRequest, options = {}) => {
2183
+ // verify required parameter 'createTransactionIntentRequest' is not null or undefined
2184
+ assertParamExists('createTransactionIntent', 'createTransactionIntentRequest', createTransactionIntentRequest);
2185
+ const localVarPath = `/v1/transaction_intents`;
2186
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2187
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2188
+ let baseOptions;
2189
+ if (configuration) {
2190
+ baseOptions = configuration.baseOptions;
2191
+ }
2192
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
2193
+ const localVarHeaderParameter = {};
2194
+ const localVarQueryParameter = {};
2195
+ // authentication sk required
2196
+ // http bearer authentication required
2197
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2198
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2199
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2200
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2201
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2202
+ localVarRequestOptions.data = serializeDataIfNeeded(createTransactionIntentRequest, localVarRequestOptions, configuration);
2203
+ return {
2204
+ url: toPathString(localVarUrlObj),
2205
+ options: localVarRequestOptions,
2206
+ };
2207
+ },
2208
+ /**
2209
+ * Estimate the gas cost of broadcasting a TransactionIntent. This is a simulation, it does not send the transaction on-chain. If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.
2210
+ * @summary Estimate gas cost of creating a transaction
2211
+ * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2212
+ * @param {*} [options] Override http request option.
2213
+ * @throws {RequiredError}
2214
+ */
2215
+ estimateTransactionIntentCost: async (createTransactionIntentRequest, options = {}) => {
2216
+ // verify required parameter 'createTransactionIntentRequest' is not null or undefined
2217
+ assertParamExists('estimateTransactionIntentCost', 'createTransactionIntentRequest', createTransactionIntentRequest);
2218
+ const localVarPath = `/v1/transaction_intents/estimate_gas_cost`;
2219
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2220
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2221
+ let baseOptions;
2222
+ if (configuration) {
2223
+ baseOptions = configuration.baseOptions;
2224
+ }
2225
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
2226
+ const localVarHeaderParameter = {};
2227
+ const localVarQueryParameter = {};
2228
+ // authentication sk required
2229
+ // http bearer authentication required
2230
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2231
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2232
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2233
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2234
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2235
+ localVarRequestOptions.data = serializeDataIfNeeded(createTransactionIntentRequest, localVarRequestOptions, configuration);
2236
+ return {
2237
+ url: toPathString(localVarUrlObj),
2238
+ options: localVarRequestOptions,
2239
+ };
2240
+ },
2241
+ /**
2242
+ * Retrieves the details of a TransactionIntent that has previously been created.
2243
+ * @summary Get a transaction intent object.
2244
+ * @param {string} id Specifies the unique transaction intent ID (starts with tin_).
2245
+ * @param {Array<TransactionIntentResponseExpandable>} [expand] Specifies the expandable fields.
2246
+ * @param {*} [options] Override http request option.
2247
+ * @throws {RequiredError}
2248
+ */
2249
+ getTransactionIntent: async (id, expand, options = {}) => {
2250
+ // verify required parameter 'id' is not null or undefined
2251
+ assertParamExists('getTransactionIntent', 'id', id);
2252
+ const localVarPath = `/v1/transaction_intents/{id}`
2253
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
2254
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2255
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2256
+ let baseOptions;
2257
+ if (configuration) {
2258
+ baseOptions = configuration.baseOptions;
2259
+ }
2260
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
2261
+ const localVarHeaderParameter = {};
2262
+ const localVarQueryParameter = {};
2263
+ // authentication sk required
2264
+ // http bearer authentication required
2265
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2266
+ if (expand) {
2267
+ localVarQueryParameter['expand'] = expand;
2268
+ }
2269
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2270
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2271
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2272
+ return {
2273
+ url: toPathString(localVarUrlObj),
2274
+ options: localVarRequestOptions,
2275
+ };
2276
+ },
2277
+ /**
2278
+ * Returns a list of TransactionIntents.
2279
+ * @summary List transaction intents.
2280
+ * @param {number} [limit] Specifies the maximum number of records to return.
2281
+ * @param {number} [skip] Specifies the offset for the first records to return.
2282
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
2283
+ * @param {Array<TransactionIntentResponseExpandable>} [expand] Specifies the fields to expand in the response.
2284
+ * @param {number} [chainId] The chain ID. Must be a [supported chain](/chains).
2285
+ * @param {Array<string>} [account] Filter by account ID or developer account (starts with acc_ or dac_ respectively).
2286
+ * @param {Array<string>} [player] Filter by player ID (starts with pla_).
2287
+ * @param {number} [status] Filter by successful (1) or failed (0) transaction intents.
2288
+ * @param {Array<string>} [policy] Filter by policy ID (starts with pol_).
2289
+ * @param {*} [options] Override http request option.
2290
+ * @throws {RequiredError}
2291
+ */
2292
+ getTransactionIntents: async (limit, skip, order, expand, chainId, account, player, status, policy, options = {}) => {
2293
+ const localVarPath = `/v1/transaction_intents`;
2294
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2295
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2296
+ let baseOptions;
2297
+ if (configuration) {
2298
+ baseOptions = configuration.baseOptions;
2299
+ }
2300
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
2301
+ const localVarHeaderParameter = {};
2302
+ const localVarQueryParameter = {};
2303
+ // authentication sk required
2304
+ // http bearer authentication required
2305
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2306
+ if (limit !== undefined) {
2307
+ localVarQueryParameter['limit'] = limit;
2308
+ }
2309
+ if (skip !== undefined) {
2310
+ localVarQueryParameter['skip'] = skip;
2311
+ }
2312
+ if (order !== undefined) {
2313
+ localVarQueryParameter['order'] = order;
2314
+ }
2315
+ if (expand) {
2316
+ localVarQueryParameter['expand'] = expand;
2317
+ }
2318
+ if (chainId !== undefined) {
2319
+ localVarQueryParameter['chainId'] = chainId;
2320
+ }
2321
+ if (account) {
2322
+ localVarQueryParameter['account'] = account;
2323
+ }
2324
+ if (player) {
2325
+ localVarQueryParameter['player'] = player;
2326
+ }
2327
+ if (status !== undefined) {
2328
+ localVarQueryParameter['status'] = status;
2329
+ }
2330
+ if (policy) {
2331
+ localVarQueryParameter['policy'] = policy;
2332
+ }
2333
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2334
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2335
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2336
+ return {
2337
+ url: toPathString(localVarUrlObj),
2338
+ options: localVarRequestOptions,
2339
+ };
2340
+ },
2341
+ /**
2342
+ * Broadcasts a signed TransactionIntent to the blockchain. Use this endpoint to send the signed `userOperationHash`. Openfort will then put it on-chain.
2343
+ * @summary Send a signed transaction userOperationHash.
2344
+ * @param {string} id Specifies the unique transaction intent ID (starts with tin_).
2345
+ * @param {SignatureRequest} signatureRequest
2346
+ * @param {*} [options] Override http request option.
2347
+ * @throws {RequiredError}
2348
+ */
2349
+ signature: async (id, signatureRequest, options = {}) => {
2350
+ // verify required parameter 'id' is not null or undefined
2351
+ assertParamExists('signature', 'id', id);
2352
+ // verify required parameter 'signatureRequest' is not null or undefined
2353
+ assertParamExists('signature', 'signatureRequest', signatureRequest);
2354
+ const localVarPath = `/v1/transaction_intents/{id}/signature`
2355
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
2356
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2357
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2358
+ let baseOptions;
2359
+ if (configuration) {
2360
+ baseOptions = configuration.baseOptions;
2361
+ }
2362
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
2363
+ const localVarHeaderParameter = {};
2364
+ const localVarQueryParameter = {};
2365
+ // authentication sk required
2366
+ // http bearer authentication required
2367
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2368
+ // authentication pk required
2369
+ // http bearer authentication required
2370
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
2371
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2372
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2373
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2374
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2375
+ localVarRequestOptions.data = serializeDataIfNeeded(signatureRequest, localVarRequestOptions, configuration);
2376
+ return {
2377
+ url: toPathString(localVarUrlObj),
2378
+ options: localVarRequestOptions,
2379
+ };
2380
+ },
2381
+ };
2382
+ };
2383
+ /**
2384
+ * TransactionIntentsApi - functional programming interface
2385
+ * @export
2386
+ */
2387
+ const TransactionIntentsApiFp = function (configuration) {
2388
+ const localVarAxiosParamCreator = TransactionIntentsApiAxiosParamCreator(configuration);
2389
+ return {
2390
+ /**
2391
+ * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2392
+ * @summary Create a transaction intent object.
2393
+ * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2394
+ * @param {*} [options] Override http request option.
2395
+ * @throws {RequiredError}
2396
+ */
2397
+ async createTransactionIntent(createTransactionIntentRequest, options) {
2398
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTransactionIntent(createTransactionIntentRequest, options);
2399
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2400
+ },
2401
+ /**
2402
+ * Estimate the gas cost of broadcasting a TransactionIntent. This is a simulation, it does not send the transaction on-chain. If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.
2403
+ * @summary Estimate gas cost of creating a transaction
2404
+ * @param {CreateTransactionIntentRequest} createTransactionIntentRequest
2405
+ * @param {*} [options] Override http request option.
2406
+ * @throws {RequiredError}
2407
+ */
2408
+ async estimateTransactionIntentCost(createTransactionIntentRequest, options) {
2409
+ const localVarAxiosArgs = await localVarAxiosParamCreator.estimateTransactionIntentCost(createTransactionIntentRequest, options);
2410
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2411
+ },
2412
+ /**
2413
+ * Retrieves the details of a TransactionIntent that has previously been created.
2414
+ * @summary Get a transaction intent object.
2415
+ * @param {string} id Specifies the unique transaction intent ID (starts with tin_).
2416
+ * @param {Array<TransactionIntentResponseExpandable>} [expand] Specifies the expandable fields.
2417
+ * @param {*} [options] Override http request option.
2418
+ * @throws {RequiredError}
2419
+ */
2420
+ async getTransactionIntent(id, expand, options) {
2421
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionIntent(id, expand, options);
2422
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2423
+ },
2424
+ /**
2425
+ * Returns a list of TransactionIntents.
2426
+ * @summary List transaction intents.
2427
+ * @param {number} [limit] Specifies the maximum number of records to return.
2428
+ * @param {number} [skip] Specifies the offset for the first records to return.
2429
+ * @param {SortOrder} [order] Specifies the order in which to sort the results.
2430
+ * @param {Array<TransactionIntentResponseExpandable>} [expand] Specifies the fields to expand in the response.
2431
+ * @param {number} [chainId] The chain ID. Must be a [supported chain](/chains).
2432
+ * @param {Array<string>} [account] Filter by account ID or developer account (starts with acc_ or dac_ respectively).
2433
+ * @param {Array<string>} [player] Filter by player ID (starts with pla_).
2434
+ * @param {number} [status] Filter by successful (1) or failed (0) transaction intents.
2435
+ * @param {Array<string>} [policy] Filter by policy ID (starts with pol_).
2436
+ * @param {*} [options] Override http request option.
2437
+ * @throws {RequiredError}
2438
+ */
2439
+ async getTransactionIntents(limit, skip, order, expand, chainId, account, player, status, policy, options) {
2440
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionIntents(limit, skip, order, expand, chainId, account, player, status, policy, options);
2441
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2442
+ },
2443
+ /**
2444
+ * Broadcasts a signed TransactionIntent to the blockchain. Use this endpoint to send the signed `userOperationHash`. Openfort will then put it on-chain.
2445
+ * @summary Send a signed transaction userOperationHash.
2446
+ * @param {string} id Specifies the unique transaction intent ID (starts with tin_).
2447
+ * @param {SignatureRequest} signatureRequest
2448
+ * @param {*} [options] Override http request option.
2449
+ * @throws {RequiredError}
2450
+ */
2451
+ async signature(id, signatureRequest, options) {
2452
+ const localVarAxiosArgs = await localVarAxiosParamCreator.signature(id, signatureRequest, options);
2453
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2454
+ },
2455
+ };
2456
+ };
2457
+ /**
2458
+ * TransactionIntentsApi - object-oriented interface
2459
+ * @export
2460
+ * @class TransactionIntentsApi
2461
+ * @extends {BaseAPI}
2462
+ */
2463
+ class TransactionIntentsApi extends BaseAPI {
2464
+ /**
2465
+ * Creates a TransactionIntent. A pending TransactionIntent has the `response` attribute as undefined. After the TransactionIntent is created and broadcasted to the blockchain, `response` will be populated with the transaction hash and a status (1 success, 0 fail). When using a non-custodial account, a `nextAction` attribute is returned with the `userOperationHash` that must be signed by the owner of the account.
2466
+ * @summary Create a transaction intent object.
2467
+ * @param {TransactionIntentsApiCreateTransactionIntentRequest} requestParameters Request parameters.
2468
+ * @param {*} [options] Override http request option.
2469
+ * @throws {RequiredError}
2470
+ * @memberof TransactionIntentsApi
2471
+ */
2472
+ createTransactionIntent(requestParameters, options) {
2473
+ return TransactionIntentsApiFp(this.configuration).createTransactionIntent(requestParameters.createTransactionIntentRequest, options).then((request) => request(this.axios, this.basePath));
2474
+ }
2475
+ /**
2476
+ * Estimate the gas cost of broadcasting a TransactionIntent. This is a simulation, it does not send the transaction on-chain. If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field `estimatedTXGasFeeToken` is returned with the estimated amount of tokens that will be used.
2477
+ * @summary Estimate gas cost of creating a transaction
2478
+ * @param {TransactionIntentsApiEstimateTransactionIntentCostRequest} requestParameters Request parameters.
2479
+ * @param {*} [options] Override http request option.
2480
+ * @throws {RequiredError}
2481
+ * @memberof TransactionIntentsApi
2482
+ */
2483
+ estimateTransactionIntentCost(requestParameters, options) {
2484
+ return TransactionIntentsApiFp(this.configuration).estimateTransactionIntentCost(requestParameters.createTransactionIntentRequest, options).then((request) => request(this.axios, this.basePath));
2485
+ }
2486
+ /**
2487
+ * Retrieves the details of a TransactionIntent that has previously been created.
2488
+ * @summary Get a transaction intent object.
2489
+ * @param {TransactionIntentsApiGetTransactionIntentRequest} requestParameters Request parameters.
2490
+ * @param {*} [options] Override http request option.
2491
+ * @throws {RequiredError}
2492
+ * @memberof TransactionIntentsApi
2493
+ */
2494
+ getTransactionIntent(requestParameters, options) {
2495
+ return TransactionIntentsApiFp(this.configuration).getTransactionIntent(requestParameters.id, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
2496
+ }
2497
+ /**
2498
+ * Returns a list of TransactionIntents.
2499
+ * @summary List transaction intents.
2500
+ * @param {TransactionIntentsApiGetTransactionIntentsRequest} requestParameters Request parameters.
2501
+ * @param {*} [options] Override http request option.
2502
+ * @throws {RequiredError}
2503
+ * @memberof TransactionIntentsApi
2504
+ */
2505
+ getTransactionIntents(requestParameters = {}, options) {
2506
+ return TransactionIntentsApiFp(this.configuration).getTransactionIntents(requestParameters.limit, requestParameters.skip, requestParameters.order, requestParameters.expand, requestParameters.chainId, requestParameters.account, requestParameters.player, requestParameters.status, requestParameters.policy, options).then((request) => request(this.axios, this.basePath));
2507
+ }
2508
+ /**
2509
+ * Broadcasts a signed TransactionIntent to the blockchain. Use this endpoint to send the signed `userOperationHash`. Openfort will then put it on-chain.
2510
+ * @summary Send a signed transaction userOperationHash.
2511
+ * @param {TransactionIntentsApiSignatureRequest} requestParameters Request parameters.
2512
+ * @param {*} [options] Override http request option.
2513
+ * @throws {RequiredError}
2514
+ * @memberof TransactionIntentsApi
2515
+ */
2516
+ signature(requestParameters, options) {
2517
+ return TransactionIntentsApiFp(this.configuration).signature(requestParameters.id, requestParameters.signatureRequest, options).then((request) => request(this.axios, this.basePath));
2518
+ }
2519
+ }
2520
+
2521
+ /* tslint:disable */
2522
+ /* eslint-disable */
2523
+ /**
2524
+ * Openfort API
2525
+ * Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
2526
+ *
2527
+ * The version of the OpenAPI document: 1.0.0
2528
+ * Contact: founders@openfort.xyz
2529
+ *
2530
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2531
+ * https://openapi-generator.tech
2532
+ * Do not edit the class manually.
2533
+ */
2534
+ class Configuration {
2535
+ /**
2536
+ * parameter for apiKey security
2537
+ * @param name security name
2538
+ * @memberof Configuration
2539
+ */
2540
+ apiKey;
2541
+ /**
2542
+ * parameter for basic security
2543
+ *
2544
+ * @type {string}
2545
+ * @memberof Configuration
2546
+ */
2547
+ username;
2548
+ /**
2549
+ * parameter for basic security
2550
+ *
2551
+ * @type {string}
2552
+ * @memberof Configuration
2553
+ */
2554
+ password;
2555
+ /**
2556
+ * parameter for oauth2 security
2557
+ * @param name security name
2558
+ * @param scopes oauth2 scope
2559
+ * @memberof Configuration
2560
+ */
2561
+ accessToken;
2562
+ /**
2563
+ * override base path
2564
+ *
2565
+ * @type {string}
2566
+ * @memberof Configuration
2567
+ */
2568
+ basePath;
2569
+ /**
2570
+ * base options for axios calls
2571
+ *
2572
+ * @type {any}
2573
+ * @memberof Configuration
2574
+ */
2575
+ baseOptions;
2576
+ /**
2577
+ * The FormData constructor that will be used to create multipart form data
2578
+ * requests. You can inject this here so that execution environments that
2579
+ * do not support the FormData class can still run the generated client.
2580
+ *
2581
+ * @type {new () => FormData}
2582
+ */
2583
+ formDataCtor;
2584
+ constructor(param = {}) {
2585
+ this.apiKey = param.apiKey;
2586
+ this.username = param.username;
2587
+ this.password = param.password;
2588
+ this.accessToken = param.accessToken;
2589
+ this.basePath = param.basePath;
2590
+ this.baseOptions = param.baseOptions;
2591
+ this.formDataCtor = param.formDataCtor;
2592
+ }
2593
+ /**
2594
+ * Check if the given MIME is a JSON MIME.
2595
+ * JSON MIME examples:
2596
+ * application/json
2597
+ * application/json; charset=UTF8
2598
+ * APPLICATION/JSON
2599
+ * application/vnd.company+json
2600
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
2601
+ * @return True if the given MIME is JSON, false otherwise.
2602
+ */
2603
+ isJsonMime(mime) {
2604
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
2605
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
2606
+ }
2607
+ }
2608
+
2609
+ class BackendApiClients {
2610
+ config;
2611
+ transactionIntentsApi;
2612
+ accountsApi;
2613
+ sessionsApi;
2614
+ authenticationApi;
2615
+ constructor(config) {
2616
+ this.config = config;
2617
+ this.transactionIntentsApi = new TransactionIntentsApi(config.backend);
2618
+ this.accountsApi = new AccountsApi(config.backend);
2619
+ this.sessionsApi = new SessionsApi(config.backend);
2620
+ this.authenticationApi = new AuthenticationApi(config.backend);
2621
+ }
2622
+ }
2623
+
2624
+ const createConfig = ({ basePath, accessToken, }) => {
2625
+ if (!basePath.trim()) {
2626
+ throw Error('basePath can not be empty');
2627
+ }
2628
+ const apiConfigOptions = {
2629
+ basePath,
2630
+ accessToken,
2631
+ };
2632
+ return new Configuration(apiConfigOptions);
2633
+ };
2634
+
59
2635
  var OpenfortErrorType;
60
2636
  (function (OpenfortErrorType) {
61
2637
  OpenfortErrorType["AUTHENTICATION_ERROR"] = "AUTHENTICATION_ERROR";
@@ -126,7 +2702,7 @@ class SDKConfiguration {
126
2702
  this.iframeUrl = overrides.iframeUrl;
127
2703
  this.shieldUrl = overrides.shieldUrl;
128
2704
  this.openfortAPIConfig = {
129
- backend: openapiClients.createConfig({
2705
+ backend: createConfig({
130
2706
  basePath: overrides.backendUrl,
131
2707
  accessToken: baseConfiguration.publishableKey,
132
2708
  }),
@@ -137,7 +2713,7 @@ class SDKConfiguration {
137
2713
  this.iframeUrl = 'https://iframe.openfort.xyz';
138
2714
  this.shieldUrl = 'https://shield.openfort.xyz';
139
2715
  this.openfortAPIConfig = {
140
- backend: openapiClients.createConfig({
2716
+ backend: createConfig({
141
2717
  basePath: 'https://api.openfort.xyz',
142
2718
  accessToken: baseConfiguration.publishableKey,
143
2719
  }),
@@ -1146,7 +3722,7 @@ class Openfort {
1146
3722
  iframeManager;
1147
3723
  constructor(sdkConfiguration) {
1148
3724
  this.config = new SDKConfiguration(sdkConfiguration);
1149
- this.backendApiClients = new openapiClients.BackendApiClients(this.config.openfortAPIConfig);
3725
+ this.backendApiClients = new BackendApiClients(this.config.openfortAPIConfig);
1150
3726
  this.authManager = new AuthManager(this.config, this.backendApiClients);
1151
3727
  this.instanceManager = new InstanceManager(new SessionStorage(), new LocalStorage(), new LocalStorage(), this.authManager);
1152
3728
  this.iframeManager = new IframeManager(this.config);