@northstake/northstakeapi 1.0.31 → 1.0.32

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.
@@ -1 +1 @@
1
- 7.11.0-SNAPSHOT
1
+ 7.12.0-SNAPSHOT
@@ -386,5 +386,90 @@ export class ValidatorsApi {
386
386
  });
387
387
  });
388
388
  } )
389
+ }
390
+ /**
391
+ *
392
+ * @summary Submit an exit for a validator
393
+ * @param validatorIndex Validator index to submit the exit for
394
+ */
395
+
396
+
397
+
398
+
399
+
400
+ public async submitValidatorExit (validatorIndex: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: any, status: number }> {
401
+
402
+ const localVarPath = this.basePath + '/validators/{validator_index}/submitExit'
403
+ .replace('{' + 'validator_index' + '}', encodeURIComponent(String(validatorIndex)));
404
+
405
+ let localVarQueryParameters: any = {};
406
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
407
+ const produces = ['application/json'];
408
+ if (produces.indexOf('application/json') >= 0) {
409
+ localVarHeaderParams.Accept = 'application/json';
410
+ } else {
411
+ localVarHeaderParams.Accept = produces.join(',');
412
+ }
413
+ let localVarFormParams: any = {};
414
+
415
+
416
+ // Verify required parameter 'validatorIndex' is not null or undefined
417
+ if (validatorIndex === null || validatorIndex === undefined) {
418
+ throw new Error('Required parameter "validatorIndex" was null or undefined when calling submitValidatorExit.');
419
+ }
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+ (<any>Object).assign(localVarHeaderParams, options.headers);
428
+
429
+ let localVarUseFormData = false;
430
+
431
+
432
+
433
+ let localVarRequestOptions: localVarRequest.Options = {
434
+ method: 'POST',
435
+ qs: localVarQueryParameters,
436
+ headers: localVarHeaderParams,
437
+ uri: localVarPath,
438
+ useQuerystring: this._useQuerystring,
439
+ json: true,
440
+ };
441
+
442
+ let authenticationPromise = Promise.resolve();
443
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
444
+
445
+ let interceptorPromise = authenticationPromise;
446
+ for (const interceptor of this.interceptors) {
447
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
448
+ }
449
+
450
+ return interceptorPromise.then(() => {
451
+ if (Object.keys(localVarFormParams).length) {
452
+ if (localVarUseFormData) {
453
+ (<any>localVarRequestOptions).formData = localVarFormParams;
454
+ } else {
455
+ localVarRequestOptions.form = localVarFormParams;
456
+ }
457
+ }
458
+ return new Promise<{ body: any, status: number }>((resolve, reject) => {
459
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
460
+ if (error) {
461
+ console.error('API call error:', error);
462
+ reject(error);
463
+ } else {
464
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
465
+ resolve({ body: body, status: response.statusCode });
466
+ } else {
467
+ console.error('API response error:', response.statusCode);
468
+ resolve({ body: body, status: response.statusCode });
469
+ }
470
+ }
471
+ });
472
+ });
473
+ } )
389
474
  }
390
475
  }
@@ -91,4 +91,17 @@ export declare class ValidatorsApi {
91
91
  body: Array<ValidatorInfo>;
92
92
  status: number;
93
93
  }>;
94
+ /**
95
+ *
96
+ * @summary Submit an exit for a validator
97
+ * @param validatorIndex Validator index to submit the exit for
98
+ */
99
+ submitValidatorExit(validatorIndex: number, options?: {
100
+ headers: {
101
+ [name: string]: string;
102
+ };
103
+ }): Promise<{
104
+ body: any;
105
+ status: number;
106
+ }>;
94
107
  }
@@ -296,5 +296,71 @@ class ValidatorsApi {
296
296
  });
297
297
  });
298
298
  }
299
+ /**
300
+ *
301
+ * @summary Submit an exit for a validator
302
+ * @param validatorIndex Validator index to submit the exit for
303
+ */
304
+ async submitValidatorExit(validatorIndex, options = { headers: {} }) {
305
+ const localVarPath = this.basePath + '/validators/{validator_index}/submitExit'
306
+ .replace('{' + 'validator_index' + '}', encodeURIComponent(String(validatorIndex)));
307
+ let localVarQueryParameters = {};
308
+ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
309
+ const produces = ['application/json'];
310
+ if (produces.indexOf('application/json') >= 0) {
311
+ localVarHeaderParams.Accept = 'application/json';
312
+ }
313
+ else {
314
+ localVarHeaderParams.Accept = produces.join(',');
315
+ }
316
+ let localVarFormParams = {};
317
+ // Verify required parameter 'validatorIndex' is not null or undefined
318
+ if (validatorIndex === null || validatorIndex === undefined) {
319
+ throw new Error('Required parameter "validatorIndex" was null or undefined when calling submitValidatorExit.');
320
+ }
321
+ Object.assign(localVarHeaderParams, options.headers);
322
+ let localVarUseFormData = false;
323
+ let localVarRequestOptions = {
324
+ method: 'POST',
325
+ qs: localVarQueryParameters,
326
+ headers: localVarHeaderParams,
327
+ uri: localVarPath,
328
+ useQuerystring: this._useQuerystring,
329
+ json: true,
330
+ };
331
+ let authenticationPromise = Promise.resolve();
332
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
333
+ let interceptorPromise = authenticationPromise;
334
+ for (const interceptor of this.interceptors) {
335
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
336
+ }
337
+ return interceptorPromise.then(() => {
338
+ if (Object.keys(localVarFormParams).length) {
339
+ if (localVarUseFormData) {
340
+ localVarRequestOptions.formData = localVarFormParams;
341
+ }
342
+ else {
343
+ localVarRequestOptions.form = localVarFormParams;
344
+ }
345
+ }
346
+ return new Promise((resolve, reject) => {
347
+ (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
348
+ if (error) {
349
+ console.error('API call error:', error);
350
+ reject(error);
351
+ }
352
+ else {
353
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
354
+ resolve({ body: body, status: response.statusCode });
355
+ }
356
+ else {
357
+ console.error('API response error:', response.statusCode);
358
+ resolve({ body: body, status: response.statusCode });
359
+ }
360
+ }
361
+ });
362
+ });
363
+ });
364
+ }
299
365
  }
300
366
  exports.ValidatorsApi = ValidatorsApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northstake/northstakeapi",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "Northstake SDK",
5
5
  "main": "dist/api.js",
6
6
  "types": "dist/api.d.ts",
@@ -21,7 +21,7 @@
21
21
  "author": "Northstake build process <buildadmin@northstake.dk>",
22
22
  "license": "ISC",
23
23
  "devDependencies": {
24
- "@types/node": "^22.10.1",
25
- "typescript": "^5.7.2"
24
+ "@types/node": "^22.10.10",
25
+ "typescript": "^5.7.3"
26
26
  }
27
27
  }