@northstake/northstakeapi 1.0.7 → 1.0.9

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 (155) hide show
  1. package/.openapi-generator/FILES +25 -15
  2. package/api/apis.ts +17 -9
  3. package/api/northstake.ts +47 -23
  4. package/api/portfolioApi.ts +4 -4
  5. package/api/stakingPartnerManagedUsersApi.ts +0 -279
  6. package/api/stakingPartnerManagedUsersDepositAddressesApi.ts +167 -0
  7. package/api/stakingPartnerManagedUsersPortfolioApi.ts +167 -0
  8. package/api/stakingPartnerManagedUsersStatsApi.ts +167 -0
  9. package/api/stakingPartnerManagedUsersValidatorsApi.ts +167 -0
  10. package/api/statsApi.ts +0 -73
  11. package/api/{rfqMarketPlaceBuyersApi.ts → validatorMarketplaceBuyersApi.ts} +34 -21
  12. package/api/{rfqMarketPlaceSellersApi.ts → validatorMarketplaceSellersApi.ts} +69 -60
  13. package/api/{rfqMarketPlaceWebhooksApi.ts → validatorMarketplaceWebhooksApi.ts} +7 -7
  14. package/api/validatorsApi.ts +172 -0
  15. package/dist/api/apis.d.ts +17 -9
  16. package/dist/api/apis.js +17 -9
  17. package/dist/api/northstake.d.ts +16 -8
  18. package/dist/api/northstake.js +32 -16
  19. package/dist/api/portfolioApi.d.ts +2 -2
  20. package/dist/api/portfolioApi.js +1 -1
  21. package/dist/api/stakingPartnerManagedUsersApi.d.ts +0 -55
  22. package/dist/api/stakingPartnerManagedUsersApi.js +0 -264
  23. package/dist/api/stakingPartnerManagedUsersDepositAddressesApi.d.ts +53 -0
  24. package/dist/api/stakingPartnerManagedUsersDepositAddressesApi.js +146 -0
  25. package/dist/api/stakingPartnerManagedUsersPortfolioApi.d.ts +53 -0
  26. package/dist/api/stakingPartnerManagedUsersPortfolioApi.js +146 -0
  27. package/dist/api/stakingPartnerManagedUsersStatsApi.d.ts +53 -0
  28. package/dist/api/stakingPartnerManagedUsersStatsApi.js +146 -0
  29. package/dist/api/{stakingPartnerValidatorKeysApi.d.ts → stakingPartnerManagedUsersValidatorsApi.d.ts} +5 -31
  30. package/dist/api/stakingPartnerManagedUsersValidatorsApi.js +146 -0
  31. package/dist/api/statsApi.d.ts +0 -15
  32. package/dist/api/statsApi.js +0 -68
  33. package/dist/api/{rfqMarketPlaceBuyersApi.d.ts → validatorMarketplaceBuyersApi.d.ts} +12 -10
  34. package/dist/api/{rfqMarketPlaceBuyersApi.js → validatorMarketplaceBuyersApi.js} +36 -24
  35. package/dist/api/{rfqMarketPlaceSellersApi.d.ts → validatorMarketplaceSellersApi.d.ts} +28 -26
  36. package/dist/api/{rfqMarketPlaceSellersApi.js → validatorMarketplaceSellersApi.js} +64 -57
  37. package/dist/api/{rfqMarketPlaceWebhooksApi.d.ts → validatorMarketplaceWebhooksApi.d.ts} +2 -2
  38. package/dist/api/{rfqMarketPlaceWebhooksApi.js → validatorMarketplaceWebhooksApi.js} +11 -11
  39. package/dist/api/validatorsApi.d.ts +56 -0
  40. package/dist/api/validatorsApi.js +148 -0
  41. package/dist/model/{createRFQDocumentForSellerRequest.d.ts → createRFQDocumentRequest.d.ts} +1 -1
  42. package/dist/model/{createRFQDocumentForSellerRequest.js → createRFQDocumentRequest.js} +6 -6
  43. package/dist/model/{registerRewardRecipientSettlementRequestInner.d.ts → exitEstimateBase.d.ts} +3 -3
  44. package/dist/model/exitEstimateBase.js +33 -0
  45. package/dist/model/{exitEstimate.d.ts → exitEstimateSeller.d.ts} +2 -2
  46. package/dist/model/{exitEstimate.js → exitEstimateSeller.js} +10 -10
  47. package/dist/model/models.d.ts +17 -11
  48. package/dist/model/models.js +51 -33
  49. package/dist/model/{getRewardsStatistics200ResponseInner.d.ts → portfolioEntity.d.ts} +7 -6
  50. package/dist/model/portfolioEntity.js +38 -0
  51. package/dist/model/rFQDocumentBase.d.ts +6 -3
  52. package/dist/model/rFQDocumentBase.js +8 -8
  53. package/dist/model/rFQDocumentBuyer.d.ts +7 -4
  54. package/dist/model/rFQDocumentBuyer.js +8 -8
  55. package/dist/model/{rFQDocumentBaseValidatorsInner.d.ts → rFQDocumentBuyerAllOfValidators.d.ts} +3 -3
  56. package/dist/model/{rFQDocumentBaseValidatorsInner.js → rFQDocumentBuyerAllOfValidators.js} +9 -9
  57. package/dist/model/rFQDocumentBuyerStatusFilterEnum.d.ts +19 -0
  58. package/dist/model/rFQDocumentBuyerStatusFilterEnum.js +23 -0
  59. package/dist/model/rFQDocumentSeller.d.ts +8 -4
  60. package/dist/model/rFQDocumentSeller.js +18 -13
  61. package/dist/model/rFQDocumentSellerAllOfValidators.d.ts +28 -0
  62. package/dist/model/rFQDocumentSellerAllOfValidators.js +38 -0
  63. package/dist/model/rFQDocumentSellerStatusFilterEnum.d.ts +20 -0
  64. package/dist/model/rFQDocumentSellerStatusFilterEnum.js +24 -0
  65. package/dist/model/rFQDocumentStatusEnum.d.ts +17 -0
  66. package/dist/model/rFQDocumentStatusEnum.js +21 -0
  67. package/dist/model/{acceptBidForRFQDocumentRequest.d.ts → rejectQuoteForRFQDocumentRequest.d.ts} +1 -1
  68. package/dist/model/{acceptBidForRFQDocumentRequest.js → rejectQuoteForRFQDocumentRequest.js} +6 -6
  69. package/dist/model/settlementStepEscrowPayment.d.ts +1 -0
  70. package/dist/model/settlementStepEscrowPayment.js +5 -0
  71. package/dist/model/settlementStepEscrowReleased.d.ts +2 -0
  72. package/dist/model/settlementStepEscrowReleased.js +10 -0
  73. package/dist/model/{settlementStepRewardRecipientSettlementInner.d.ts → settlementStepWithdrawalRecipientSettlement.d.ts} +1 -2
  74. package/dist/model/{settlementStepRewardRecipientSettlementInner.js → settlementStepWithdrawalRecipientSettlement.js} +6 -11
  75. package/dist/model/settlementSteps.d.ts +2 -2
  76. package/dist/model/settlementSteps.js +3 -3
  77. package/dist/model/stakeStep.d.ts +1 -1
  78. package/dist/model/stepStatus.d.ts +1 -1
  79. package/dist/model/stepStatus.js +1 -1
  80. package/dist/model/submitQuoteForRFQDocumentRequest.d.ts +25 -0
  81. package/dist/model/submitQuoteForRFQDocumentRequest.js +28 -0
  82. package/dist/model/tokenEnum.d.ts +1 -3
  83. package/dist/model/tokenEnum.js +1 -3
  84. package/dist/model/unstakeStep.d.ts +1 -1
  85. package/dist/model/unstakeStepType.d.ts +1 -1
  86. package/dist/model/unstakeStepType.js +1 -1
  87. package/dist/model/validatorContractTypeEnum.d.ts +15 -0
  88. package/dist/model/validatorContractTypeEnum.js +19 -0
  89. package/dist/model/validatorInfo.d.ts +6 -1
  90. package/dist/model/validatorInfo.js +17 -2
  91. package/dist/model/{portfolioTableRow.d.ts → validatorInfoValidatorType.d.ts} +6 -10
  92. package/dist/model/validatorInfoValidatorType.js +33 -0
  93. package/dist/model/validatorInfoValidatorTypeContract.d.ts +29 -0
  94. package/dist/model/validatorInfoValidatorTypeContract.js +33 -0
  95. package/dist/model/validatorKeyHolderEnum.d.ts +15 -0
  96. package/dist/model/validatorKeyHolderEnum.js +19 -0
  97. package/dist/model/webhookPayloadRFQAvailable.d.ts +2 -2
  98. package/dist/model/webhookPayloadRFQAvailable.js +1 -1
  99. package/dist/model/webhookPayloadRFQEscrowReleasedDetails.d.ts +1 -0
  100. package/dist/model/webhookPayloadRFQEscrowReleasedDetails.js +5 -0
  101. package/dist/model/webhookPayloadRFQValidatorWithdrawalChange.d.ts +2 -2
  102. package/dist/model/webhookPayloadRFQValidatorWithdrawalChange.js +1 -1
  103. package/dist/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.d.ts → webhookPayloadRFQValidatorWithdrawalChangeDetails.d.ts} +1 -2
  104. package/dist/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.js → webhookPayloadRFQValidatorWithdrawalChangeDetails.js} +6 -11
  105. package/dist/model/withdrawalStep.d.ts +1 -1
  106. package/dist/model/withdrawalStepType.d.ts +1 -1
  107. package/dist/model/withdrawalStepType.js +1 -1
  108. package/model/{createRFQDocumentForSellerRequest.ts → createRFQDocumentRequest.ts} +2 -2
  109. package/model/exitEstimateBase.ts +37 -0
  110. package/model/{exitEstimate.ts → exitEstimateSeller.ts} +7 -7
  111. package/model/models.ts +51 -33
  112. package/model/portfolioEntity.ts +46 -0
  113. package/model/rFQDocumentBase.ts +14 -11
  114. package/model/rFQDocumentBuyer.ts +15 -12
  115. package/model/{rFQDocumentBaseValidatorsInner.ts → rFQDocumentBuyerAllOfValidators.ts} +7 -7
  116. package/model/rFQDocumentBuyerStatusFilterEnum.ts +22 -0
  117. package/model/rFQDocumentSeller.ts +26 -17
  118. package/model/{registerRewardRecipientSettlementRequestInner.ts → rFQDocumentSellerAllOfValidators.ts} +15 -8
  119. package/model/rFQDocumentSellerStatusFilterEnum.ts +23 -0
  120. package/model/rFQDocumentStatusEnum.ts +20 -0
  121. package/model/{acceptBidForRFQDocumentRequest.ts → rejectQuoteForRFQDocumentRequest.ts} +2 -2
  122. package/model/settlementStepEscrowPayment.ts +6 -0
  123. package/model/settlementStepEscrowReleased.ts +12 -0
  124. package/model/{settlementStepRewardRecipientSettlementInner.ts → settlementStepWithdrawalRecipientSettlement.ts} +2 -8
  125. package/model/settlementSteps.ts +5 -5
  126. package/model/stakeStep.ts +1 -1
  127. package/model/stepStatus.ts +1 -1
  128. package/model/{rFQMarketPlaceMetadata.ts → submitQuoteForRFQDocumentRequest.ts} +5 -17
  129. package/model/tokenEnum.ts +1 -3
  130. package/model/unstakeStep.ts +1 -1
  131. package/model/unstakeStepType.ts +1 -1
  132. package/model/validatorContractTypeEnum.ts +18 -0
  133. package/model/validatorInfo.ts +23 -3
  134. package/model/validatorInfoValidatorType.ts +41 -0
  135. package/model/validatorInfoValidatorTypeContract.ts +40 -0
  136. package/model/validatorKeyHolderEnum.ts +18 -0
  137. package/model/webhookPayloadRFQAvailable.ts +3 -3
  138. package/model/webhookPayloadRFQEscrowReleasedDetails.ts +6 -0
  139. package/model/webhookPayloadRFQValidatorWithdrawalChange.ts +3 -3
  140. package/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.ts → webhookPayloadRFQValidatorWithdrawalChangeDetails.ts} +2 -8
  141. package/model/withdrawalStep.ts +1 -1
  142. package/model/withdrawalStepType.ts +1 -1
  143. package/package.json +1 -1
  144. package/api/stakingPartnerValidatorKeysApi.ts +0 -292
  145. package/dist/api/stakingPartnerValidatorKeysApi.js +0 -265
  146. package/dist/model/getRewardsStatistics200ResponseInner.js +0 -48
  147. package/dist/model/getValidatorKeys200ResponseInner.d.ts +0 -40
  148. package/dist/model/getValidatorKeys200ResponseInner.js +0 -43
  149. package/dist/model/portfolioTableRow.js +0 -58
  150. package/dist/model/rFQMarketPlaceMetadata.d.ts +0 -32
  151. package/dist/model/rFQMarketPlaceMetadata.js +0 -33
  152. package/dist/model/registerRewardRecipientSettlementRequestInner.js +0 -33
  153. package/model/getRewardsStatistics200ResponseInner.ts +0 -55
  154. package/model/getValidatorKeys200ResponseInner.ts +0 -61
  155. package/model/portfolioTableRow.ts +0 -70
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Northstake
3
+ * Northstake api.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+ import { RequestFile } from './models';
14
+ import { ValidatorInfoValidatorTypeContract } from './validatorInfoValidatorTypeContract';
15
+ import { ValidatorKeyHolderEnum } from './validatorKeyHolderEnum';
16
+
17
+ export class ValidatorInfoValidatorType {
18
+ 'keyHolder'?: ValidatorKeyHolderEnum;
19
+ 'contract'?: ValidatorInfoValidatorTypeContract;
20
+
21
+ static discriminator: string | undefined = undefined;
22
+
23
+ static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
24
+ {
25
+ "name": "keyHolder",
26
+ "baseName": "key_holder",
27
+ "type": "ValidatorKeyHolderEnum"
28
+ },
29
+ {
30
+ "name": "contract",
31
+ "baseName": "contract",
32
+ "type": "ValidatorInfoValidatorTypeContract"
33
+ } ];
34
+
35
+ static getAttributeTypeMap() {
36
+ return ValidatorInfoValidatorType.attributeTypeMap;
37
+ }
38
+ }
39
+
40
+ export namespace ValidatorInfoValidatorType {
41
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Northstake
3
+ * Northstake api.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+ import { RequestFile } from './models';
14
+ import { ValidatorContractTypeEnum } from './validatorContractTypeEnum';
15
+
16
+ export class ValidatorInfoValidatorTypeContract {
17
+ 'address'?: string;
18
+ 'contractType'?: ValidatorContractTypeEnum;
19
+
20
+ static discriminator: string | undefined = undefined;
21
+
22
+ static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
23
+ {
24
+ "name": "address",
25
+ "baseName": "address",
26
+ "type": "string"
27
+ },
28
+ {
29
+ "name": "contractType",
30
+ "baseName": "contract_type",
31
+ "type": "ValidatorContractTypeEnum"
32
+ } ];
33
+
34
+ static getAttributeTypeMap() {
35
+ return ValidatorInfoValidatorTypeContract.attributeTypeMap;
36
+ }
37
+ }
38
+
39
+ export namespace ValidatorInfoValidatorTypeContract {
40
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Northstake
3
+ * Northstake api.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+ import { RequestFile } from './models';
14
+
15
+ export enum ValidatorKeyHolderEnum {
16
+ Northstake = <any> 'northstake',
17
+ SelfManaged = <any> 'self_managed'
18
+ }
@@ -11,13 +11,13 @@
11
11
  */
12
12
 
13
13
  import { RequestFile } from './models';
14
- import { RFQDocumentBase } from './rFQDocumentBase';
14
+ import { RFQDocumentBuyer } from './rFQDocumentBuyer';
15
15
  import { RFQWebhookEventType } from './rFQWebhookEventType';
16
16
 
17
17
  export class WebhookPayloadRFQAvailable {
18
18
  'documentId'?: string;
19
19
  'event'?: RFQWebhookEventType;
20
- 'details'?: RFQDocumentBase;
20
+ 'details'?: RFQDocumentBuyer;
21
21
 
22
22
  static discriminator: string | undefined = undefined;
23
23
 
@@ -35,7 +35,7 @@ export class WebhookPayloadRFQAvailable {
35
35
  {
36
36
  "name": "details",
37
37
  "baseName": "details",
38
- "type": "RFQDocumentBase"
38
+ "type": "RFQDocumentBuyer"
39
39
  } ];
40
40
 
41
41
  static getAttributeTypeMap() {
@@ -16,6 +16,7 @@ export class WebhookPayloadRFQEscrowReleasedDetails {
16
16
  'timestamp'?: Date;
17
17
  'transactionHash'?: string;
18
18
  'amount'?: number;
19
+ 'gasAmount'?: number;
19
20
 
20
21
  static discriminator: string | undefined = undefined;
21
22
 
@@ -34,6 +35,11 @@ export class WebhookPayloadRFQEscrowReleasedDetails {
34
35
  "name": "amount",
35
36
  "baseName": "amount",
36
37
  "type": "number"
38
+ },
39
+ {
40
+ "name": "gasAmount",
41
+ "baseName": "gas_amount",
42
+ "type": "number"
37
43
  } ];
38
44
 
39
45
  static getAttributeTypeMap() {
@@ -12,12 +12,12 @@
12
12
 
13
13
  import { RequestFile } from './models';
14
14
  import { RFQWebhookEventType } from './rFQWebhookEventType';
15
- import { WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner } from './webhookPayloadRFQValidatorWithdrawalChangeDetailsInner';
15
+ import { WebhookPayloadRFQValidatorWithdrawalChangeDetails } from './webhookPayloadRFQValidatorWithdrawalChangeDetails';
16
16
 
17
17
  export class WebhookPayloadRFQValidatorWithdrawalChange {
18
18
  'documentId'?: string;
19
19
  'event'?: RFQWebhookEventType;
20
- 'details'?: Array<WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner>;
20
+ 'details'?: WebhookPayloadRFQValidatorWithdrawalChangeDetails;
21
21
 
22
22
  static discriminator: string | undefined = undefined;
23
23
 
@@ -35,7 +35,7 @@ export class WebhookPayloadRFQValidatorWithdrawalChange {
35
35
  {
36
36
  "name": "details",
37
37
  "baseName": "details",
38
- "type": "Array<WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner>"
38
+ "type": "WebhookPayloadRFQValidatorWithdrawalChangeDetails"
39
39
  } ];
40
40
 
41
41
  static getAttributeTypeMap() {
@@ -12,10 +12,9 @@
12
12
 
13
13
  import { RequestFile } from './models';
14
14
 
15
- export class WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner {
15
+ export class WebhookPayloadRFQValidatorWithdrawalChangeDetails {
16
16
  'timestamp'?: Date;
17
17
  'transactionHash'?: string;
18
- 'validatorIndex'?: number;
19
18
 
20
19
  static discriminator: string | undefined = undefined;
21
20
 
@@ -29,15 +28,10 @@ export class WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner {
29
28
  "name": "transactionHash",
30
29
  "baseName": "transaction_hash",
31
30
  "type": "string"
32
- },
33
- {
34
- "name": "validatorIndex",
35
- "baseName": "validator_index",
36
- "type": "number"
37
31
  } ];
38
32
 
39
33
  static getAttributeTypeMap() {
40
- return WebhookPayloadRFQValidatorWithdrawalChangeDetailsInner.attributeTypeMap;
34
+ return WebhookPayloadRFQValidatorWithdrawalChangeDetails.attributeTypeMap;
41
35
  }
42
36
  }
43
37
 
@@ -16,7 +16,7 @@ import { WithdrawalStepType } from './withdrawalStepType';
16
16
  export class WithdrawalStep {
17
17
  'type'?: WithdrawalStepType;
18
18
  /**
19
- * The timestamp when the step was processed.
19
+ * The timestamp when withdrawal was processed.
20
20
  */
21
21
  'timestamp'?: Date;
22
22
 
@@ -13,7 +13,7 @@
13
13
  import { RequestFile } from './models';
14
14
 
15
15
  /**
16
- * Specifies the type of withdrawal step being performed.
16
+ * Specifies the status of the withdrawal process.
17
17
  */
18
18
  export enum WithdrawalStepType {
19
19
  PostgresReservedTokens = <any> 'postgres_reserved_tokens',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northstake/northstakeapi",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Northstake SDK",
5
5
  "main": "dist/api.js",
6
6
  "types": "dist/api.d.ts",
@@ -1,292 +0,0 @@
1
- /**
2
- * Northstake
3
- * Northstake api.
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
-
13
-
14
- import localVarRequest from 'request';
15
- import http from 'http';
16
-
17
- /* tslint:disable:no-unused-locals */
18
- import { ErrorResponse } from '../model/errorResponse';
19
- import { GetValidatorKeys200ResponseInner } from '../model/getValidatorKeys200ResponseInner';
20
- import { ValidatorInfo } from '../model/validatorInfo';
21
- import { ValidatorKey } from '../model/validatorKey';
22
-
23
- import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
24
- import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
25
-
26
- import { HttpError, RequestFile } from './apis';
27
-
28
- let defaultBasePath = '/v1';
29
-
30
- // ===============================================
31
- // This file is autogenerated - Please do not edit
32
- // ===============================================
33
-
34
- export enum StakingPartnerValidatorKeysApiApiKeys {
35
- ApiKeyAuth,
36
- }
37
-
38
- export class StakingPartnerValidatorKeysApi {
39
- protected _basePath = defaultBasePath;
40
- protected _defaultHeaders : any = {};
41
- protected _useQuerystring : boolean = false;
42
-
43
- protected authentications = {
44
- 'default': new JWTAuth('your_api_key', 'your_private_key'),
45
- 'bearerTokenAuth': new HttpBearerAuth(),
46
- 'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
47
- }
48
-
49
- protected interceptors: Interceptor[] = [];
50
-
51
- constructor(basePath?: string);
52
- constructor(basePathOrUsername: string, password?: string, basePath?: string) {
53
- if (password) {
54
- if (basePath) {
55
- this.basePath = basePath;
56
- }
57
- } else {
58
- if (basePathOrUsername) {
59
- this.basePath = basePathOrUsername
60
- }
61
- }
62
- }
63
-
64
- set useQuerystring(value: boolean) {
65
- this._useQuerystring = value;
66
- }
67
-
68
- set basePath(basePath: string) {
69
- this._basePath = basePath;
70
- }
71
-
72
- set defaultHeaders(defaultHeaders: any) {
73
- this._defaultHeaders = defaultHeaders;
74
- }
75
-
76
- get defaultHeaders() {
77
- return this._defaultHeaders;
78
- }
79
-
80
- get basePath() {
81
- return this._basePath;
82
- }
83
-
84
- public setDefaultAuthentication(auth: JWTAuth ) {
85
- this.authentications.default = auth;
86
- }
87
-
88
- private setApiKey(key: StakingPartnerValidatorKeysApiApiKeys, value: string) {
89
- (this.authentications as any)[StakingPartnerValidatorKeysApiApiKeys[key]].apiKey = value;
90
- }
91
-
92
- set accessToken(accessToken: string | (() => string)) {
93
- this.authentications.bearerTokenAuth.accessToken = accessToken;
94
- }
95
-
96
- private addInterceptor(interceptor: Interceptor) {
97
- this.interceptors.push(interceptor);
98
- }
99
-
100
- /**
101
- *
102
- * @summary Submit a pregenerated/external validator key to Northstake for non-custodial staking
103
- * @param validatorKey
104
- */
105
- public async createValidatorKey (validatorKey: ValidatorKey, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
106
- const localVarPath = this.basePath + '/stakingPartner/validatorKeys/';
107
- let localVarQueryParameters: any = {};
108
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
109
- const produces = ['application/json'];
110
- // give precedence to 'application/json'
111
- if (produces.indexOf('application/json') >= 0) {
112
- localVarHeaderParams.Accept = 'application/json';
113
- } else {
114
- localVarHeaderParams.Accept = produces.join(',');
115
- }
116
- let localVarFormParams: any = {};
117
-
118
- // verify required parameter 'validatorKey' is not null or undefined
119
- if (validatorKey === null || validatorKey === undefined) {
120
- throw new Error('Required parameter validatorKey was null or undefined when calling createValidatorKey.');
121
- }
122
-
123
- (<any>Object).assign(localVarHeaderParams, options.headers);
124
-
125
- let localVarUseFormData = false;
126
-
127
- let localVarRequestOptions: localVarRequest.Options = {
128
- method: 'POST',
129
- qs: localVarQueryParameters,
130
- headers: localVarHeaderParams,
131
- uri: localVarPath,
132
- useQuerystring: this._useQuerystring,
133
- json: true,
134
- body: ObjectSerializer.serialize(validatorKey, "ValidatorKey")
135
- };
136
-
137
- let authenticationPromise = Promise.resolve();
138
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
139
-
140
- let interceptorPromise = authenticationPromise;
141
- for (const interceptor of this.interceptors) {
142
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
143
- }
144
-
145
- return interceptorPromise.then(() => {
146
- if (Object.keys(localVarFormParams).length) {
147
- if (localVarUseFormData) {
148
- (<any>localVarRequestOptions).formData = localVarFormParams;
149
- } else {
150
- localVarRequestOptions.form = localVarFormParams;
151
- }
152
- }
153
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
154
- localVarRequest(localVarRequestOptions, (error, response, body) => {
155
- if (error) {
156
- reject(error);
157
- } else {
158
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
159
- resolve({ response: response, body: body });
160
- } else {
161
- reject(new HttpError(response, body, response.statusCode));
162
- }
163
- }
164
- });
165
- });
166
- });
167
- }
168
- /**
169
- *
170
- * @summary Get all validators associated with the staking partner
171
- */
172
- public async getAllValidators (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ValidatorInfo>; }> {
173
- const localVarPath = this.basePath + '/stakingPartner/validators';
174
- let localVarQueryParameters: any = {};
175
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
176
- const produces = ['application/json'];
177
- // give precedence to 'application/json'
178
- if (produces.indexOf('application/json') >= 0) {
179
- localVarHeaderParams.Accept = 'application/json';
180
- } else {
181
- localVarHeaderParams.Accept = produces.join(',');
182
- }
183
- let localVarFormParams: any = {};
184
-
185
- (<any>Object).assign(localVarHeaderParams, options.headers);
186
-
187
- let localVarUseFormData = false;
188
-
189
- let localVarRequestOptions: localVarRequest.Options = {
190
- method: 'GET',
191
- qs: localVarQueryParameters,
192
- headers: localVarHeaderParams,
193
- uri: localVarPath,
194
- useQuerystring: this._useQuerystring,
195
- json: true,
196
- };
197
-
198
- let authenticationPromise = Promise.resolve();
199
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
200
-
201
- let interceptorPromise = authenticationPromise;
202
- for (const interceptor of this.interceptors) {
203
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
204
- }
205
-
206
- return interceptorPromise.then(() => {
207
- if (Object.keys(localVarFormParams).length) {
208
- if (localVarUseFormData) {
209
- (<any>localVarRequestOptions).formData = localVarFormParams;
210
- } else {
211
- localVarRequestOptions.form = localVarFormParams;
212
- }
213
- }
214
- return new Promise<{ response: http.IncomingMessage; body: Array<ValidatorInfo>; }>((resolve, reject) => {
215
- localVarRequest(localVarRequestOptions, (error, response, body) => {
216
- if (error) {
217
- reject(error);
218
- } else {
219
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
220
- body = ObjectSerializer.deserialize(body, "Array<ValidatorInfo>");
221
- resolve({ response: response, body: body });
222
- } else {
223
- reject(new HttpError(response, body, response.statusCode));
224
- }
225
- }
226
- });
227
- });
228
- });
229
- }
230
- /**
231
- *
232
- * @summary Get a list of pregenerated/external validator keys held by Northstake for the stakingPartner
233
- */
234
- public async getValidatorKeys (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<GetValidatorKeys200ResponseInner>; }> {
235
- const localVarPath = this.basePath + '/stakingPartner/validatorKeys/';
236
- let localVarQueryParameters: any = {};
237
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
238
- const produces = ['application/json'];
239
- // give precedence to 'application/json'
240
- if (produces.indexOf('application/json') >= 0) {
241
- localVarHeaderParams.Accept = 'application/json';
242
- } else {
243
- localVarHeaderParams.Accept = produces.join(',');
244
- }
245
- let localVarFormParams: any = {};
246
-
247
- (<any>Object).assign(localVarHeaderParams, options.headers);
248
-
249
- let localVarUseFormData = false;
250
-
251
- let localVarRequestOptions: localVarRequest.Options = {
252
- method: 'GET',
253
- qs: localVarQueryParameters,
254
- headers: localVarHeaderParams,
255
- uri: localVarPath,
256
- useQuerystring: this._useQuerystring,
257
- json: true,
258
- };
259
-
260
- let authenticationPromise = Promise.resolve();
261
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
262
-
263
- let interceptorPromise = authenticationPromise;
264
- for (const interceptor of this.interceptors) {
265
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
266
- }
267
-
268
- return interceptorPromise.then(() => {
269
- if (Object.keys(localVarFormParams).length) {
270
- if (localVarUseFormData) {
271
- (<any>localVarRequestOptions).formData = localVarFormParams;
272
- } else {
273
- localVarRequestOptions.form = localVarFormParams;
274
- }
275
- }
276
- return new Promise<{ response: http.IncomingMessage; body: Array<GetValidatorKeys200ResponseInner>; }>((resolve, reject) => {
277
- localVarRequest(localVarRequestOptions, (error, response, body) => {
278
- if (error) {
279
- reject(error);
280
- } else {
281
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
282
- body = ObjectSerializer.deserialize(body, "Array<GetValidatorKeys200ResponseInner>");
283
- resolve({ response: response, body: body });
284
- } else {
285
- reject(new HttpError(response, body, response.statusCode));
286
- }
287
- }
288
- });
289
- });
290
- });
291
- }
292
- }