@northstake/northstakeapi 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +23 -15
- package/api/apis.ts +17 -9
- package/api/northstake.ts +47 -23
- package/api/portfolioApi.ts +4 -4
- package/api/stakingPartnerManagedUsersApi.ts +0 -279
- package/api/stakingPartnerManagedUsersDepositAddressesApi.ts +167 -0
- package/api/stakingPartnerManagedUsersPortfolioApi.ts +167 -0
- package/api/stakingPartnerManagedUsersStatsApi.ts +167 -0
- package/api/stakingPartnerManagedUsersValidatorsApi.ts +167 -0
- package/api/statsApi.ts +0 -73
- package/api/{rfqMarketPlaceBuyersApi.ts → validatorMarketplaceBuyersApi.ts} +31 -21
- package/api/{rfqMarketPlaceSellersApi.ts → validatorMarketplaceSellersApi.ts} +68 -60
- package/api/{rfqMarketPlaceWebhooksApi.ts → validatorMarketplaceWebhooksApi.ts} +7 -7
- package/api/validatorsApi.ts +172 -0
- package/dist/api/apis.d.ts +17 -9
- package/dist/api/apis.js +17 -9
- package/dist/api/northstake.d.ts +16 -8
- package/dist/api/northstake.js +32 -16
- package/dist/api/portfolioApi.d.ts +2 -2
- package/dist/api/portfolioApi.js +1 -1
- package/dist/api/stakingPartnerManagedUsersApi.d.ts +0 -55
- package/dist/api/stakingPartnerManagedUsersApi.js +0 -264
- package/dist/api/stakingPartnerManagedUsersDepositAddressesApi.d.ts +53 -0
- package/dist/api/stakingPartnerManagedUsersDepositAddressesApi.js +146 -0
- package/dist/api/stakingPartnerManagedUsersPortfolioApi.d.ts +53 -0
- package/dist/api/stakingPartnerManagedUsersPortfolioApi.js +146 -0
- package/dist/api/stakingPartnerManagedUsersStatsApi.d.ts +53 -0
- package/dist/api/stakingPartnerManagedUsersStatsApi.js +146 -0
- package/dist/api/{stakingPartnerValidatorKeysApi.d.ts → stakingPartnerManagedUsersValidatorsApi.d.ts} +5 -31
- package/dist/api/stakingPartnerManagedUsersValidatorsApi.js +146 -0
- package/dist/api/statsApi.d.ts +0 -15
- package/dist/api/statsApi.js +0 -68
- package/dist/api/{rfqMarketPlaceBuyersApi.d.ts → validatorMarketplaceBuyersApi.d.ts} +11 -10
- package/dist/api/{rfqMarketPlaceBuyersApi.js → validatorMarketplaceBuyersApi.js} +32 -24
- package/dist/api/{rfqMarketPlaceSellersApi.d.ts → validatorMarketplaceSellersApi.d.ts} +27 -26
- package/dist/api/{rfqMarketPlaceSellersApi.js → validatorMarketplaceSellersApi.js} +64 -57
- package/dist/api/{rfqMarketPlaceWebhooksApi.d.ts → validatorMarketplaceWebhooksApi.d.ts} +2 -2
- package/dist/api/{rfqMarketPlaceWebhooksApi.js → validatorMarketplaceWebhooksApi.js} +11 -11
- package/dist/api/validatorsApi.d.ts +56 -0
- package/dist/api/validatorsApi.js +148 -0
- package/dist/model/{createRFQDocumentForSellerRequest.d.ts → createRFQDocumentRequest.d.ts} +1 -1
- package/dist/model/{createRFQDocumentForSellerRequest.js → createRFQDocumentRequest.js} +6 -6
- package/dist/model/{registerRewardRecipientSettlementRequestInner.d.ts → exitEstimateBase.d.ts} +3 -3
- package/dist/model/exitEstimateBase.js +33 -0
- package/dist/model/{exitEstimate.d.ts → exitEstimateSeller.d.ts} +2 -2
- package/dist/model/{exitEstimate.js → exitEstimateSeller.js} +10 -10
- package/dist/model/models.d.ts +15 -11
- package/dist/model/models.js +45 -33
- package/dist/model/{getRewardsStatistics200ResponseInner.d.ts → portfolioEntity.d.ts} +7 -6
- package/dist/model/portfolioEntity.js +38 -0
- package/dist/model/rFQDocumentBase.d.ts +4 -3
- package/dist/model/rFQDocumentBase.js +3 -8
- package/dist/model/rFQDocumentBuyer.d.ts +7 -4
- package/dist/model/rFQDocumentBuyer.js +8 -8
- package/dist/model/{rFQDocumentBaseValidatorsInner.d.ts → rFQDocumentBuyerAllOfValidators.d.ts} +3 -3
- package/dist/model/{rFQDocumentBaseValidatorsInner.js → rFQDocumentBuyerAllOfValidators.js} +9 -9
- package/dist/model/rFQDocumentSeller.d.ts +8 -4
- package/dist/model/rFQDocumentSeller.js +16 -11
- package/dist/model/rFQDocumentSellerAllOfValidators.d.ts +28 -0
- package/dist/model/rFQDocumentSellerAllOfValidators.js +38 -0
- package/dist/model/rFQDocumentStatusEnum.d.ts +17 -0
- package/dist/model/rFQDocumentStatusEnum.js +21 -0
- package/dist/model/{acceptBidForRFQDocumentRequest.d.ts → rejectQuoteForRFQDocumentRequest.d.ts} +1 -1
- package/dist/model/{acceptBidForRFQDocumentRequest.js → rejectQuoteForRFQDocumentRequest.js} +6 -6
- package/dist/model/settlementStepEscrowPayment.d.ts +1 -0
- package/dist/model/settlementStepEscrowPayment.js +5 -0
- package/dist/model/settlementStepEscrowReleased.d.ts +2 -0
- package/dist/model/settlementStepEscrowReleased.js +10 -0
- package/dist/model/{settlementStepRewardRecipientSettlementInner.d.ts → settlementStepWithdrawalRecipientSettlementInner.d.ts} +1 -1
- package/dist/model/{settlementStepRewardRecipientSettlementInner.js → settlementStepWithdrawalRecipientSettlementInner.js} +6 -6
- package/dist/model/settlementSteps.d.ts +2 -2
- package/dist/model/settlementSteps.js +3 -3
- package/dist/model/stakeStep.d.ts +1 -1
- package/dist/model/stepStatus.d.ts +1 -1
- package/dist/model/stepStatus.js +1 -1
- package/dist/model/submitQuoteForRFQDocumentRequest.d.ts +25 -0
- package/dist/model/submitQuoteForRFQDocumentRequest.js +28 -0
- package/dist/model/tokenEnum.d.ts +1 -3
- package/dist/model/tokenEnum.js +1 -3
- package/dist/model/unstakeStep.d.ts +1 -1
- package/dist/model/unstakeStepType.d.ts +1 -1
- package/dist/model/unstakeStepType.js +1 -1
- package/dist/model/validatorContractTypeEnum.d.ts +15 -0
- package/dist/model/validatorContractTypeEnum.js +19 -0
- package/dist/model/validatorInfo.d.ts +6 -1
- package/dist/model/validatorInfo.js +17 -2
- package/dist/model/{portfolioTableRow.d.ts → validatorInfoValidatorType.d.ts} +6 -10
- package/dist/model/validatorInfoValidatorType.js +33 -0
- package/dist/model/validatorInfoValidatorTypeContract.d.ts +29 -0
- package/dist/model/validatorInfoValidatorTypeContract.js +33 -0
- package/dist/model/validatorKeyHolderEnum.d.ts +15 -0
- package/dist/model/validatorKeyHolderEnum.js +19 -0
- package/dist/model/webhookPayloadRFQAvailable.d.ts +2 -2
- package/dist/model/webhookPayloadRFQAvailable.js +1 -1
- package/dist/model/webhookPayloadRFQEscrowReleasedDetails.d.ts +1 -0
- package/dist/model/webhookPayloadRFQEscrowReleasedDetails.js +5 -0
- package/dist/model/webhookPayloadRFQValidatorWithdrawalChange.d.ts +2 -2
- package/dist/model/webhookPayloadRFQValidatorWithdrawalChange.js +1 -1
- package/dist/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.d.ts → webhookPayloadRFQValidatorWithdrawalChangeDetails.d.ts} +1 -2
- package/dist/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.js → webhookPayloadRFQValidatorWithdrawalChangeDetails.js} +6 -11
- package/dist/model/withdrawalStep.d.ts +1 -1
- package/dist/model/withdrawalStepType.d.ts +1 -1
- package/dist/model/withdrawalStepType.js +1 -1
- package/model/{createRFQDocumentForSellerRequest.ts → createRFQDocumentRequest.ts} +2 -2
- package/model/exitEstimateBase.ts +37 -0
- package/model/{exitEstimate.ts → exitEstimateSeller.ts} +7 -7
- package/model/models.ts +45 -33
- package/model/portfolioEntity.ts +46 -0
- package/model/rFQDocumentBase.ts +7 -11
- package/model/rFQDocumentBuyer.ts +15 -12
- package/model/{rFQDocumentBaseValidatorsInner.ts → rFQDocumentBuyerAllOfValidators.ts} +7 -7
- package/model/rFQDocumentSeller.ts +24 -15
- package/model/{registerRewardRecipientSettlementRequestInner.ts → rFQDocumentSellerAllOfValidators.ts} +15 -8
- package/model/rFQDocumentStatusEnum.ts +20 -0
- package/model/{acceptBidForRFQDocumentRequest.ts → rejectQuoteForRFQDocumentRequest.ts} +2 -2
- package/model/settlementStepEscrowPayment.ts +6 -0
- package/model/settlementStepEscrowReleased.ts +12 -0
- package/model/{settlementStepRewardRecipientSettlementInner.ts → settlementStepWithdrawalRecipientSettlementInner.ts} +2 -2
- package/model/settlementSteps.ts +5 -5
- package/model/stakeStep.ts +1 -1
- package/model/stepStatus.ts +1 -1
- package/model/{rFQMarketPlaceMetadata.ts → submitQuoteForRFQDocumentRequest.ts} +5 -17
- package/model/tokenEnum.ts +1 -3
- package/model/unstakeStep.ts +1 -1
- package/model/unstakeStepType.ts +1 -1
- package/model/validatorContractTypeEnum.ts +18 -0
- package/model/validatorInfo.ts +23 -3
- package/model/validatorInfoValidatorType.ts +41 -0
- package/model/validatorInfoValidatorTypeContract.ts +40 -0
- package/model/validatorKeyHolderEnum.ts +18 -0
- package/model/webhookPayloadRFQAvailable.ts +3 -3
- package/model/webhookPayloadRFQEscrowReleasedDetails.ts +6 -0
- package/model/webhookPayloadRFQValidatorWithdrawalChange.ts +3 -3
- package/model/{webhookPayloadRFQValidatorWithdrawalChangeDetailsInner.ts → webhookPayloadRFQValidatorWithdrawalChangeDetails.ts} +2 -8
- package/model/withdrawalStep.ts +1 -1
- package/model/withdrawalStepType.ts +1 -1
- package/package.json +1 -1
- package/api/stakingPartnerValidatorKeysApi.ts +0 -292
- package/dist/api/stakingPartnerValidatorKeysApi.js +0 -265
- package/dist/model/getRewardsStatistics200ResponseInner.js +0 -48
- package/dist/model/getValidatorKeys200ResponseInner.d.ts +0 -40
- package/dist/model/getValidatorKeys200ResponseInner.js +0 -43
- package/dist/model/portfolioTableRow.js +0 -58
- package/dist/model/rFQMarketPlaceMetadata.d.ts +0 -32
- package/dist/model/rFQMarketPlaceMetadata.js +0 -33
- package/dist/model/registerRewardRecipientSettlementRequestInner.js +0 -33
- package/model/getRewardsStatistics200ResponseInner.ts +0 -55
- package/model/getValidatorKeys200ResponseInner.ts +0 -61
- package/model/portfolioTableRow.ts +0 -70
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
import { RequestFile } from './models';
|
|
14
14
|
|
|
15
|
-
export class
|
|
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
|
|
34
|
+
return WebhookPayloadRFQValidatorWithdrawalChangeDetails.attributeTypeMap;
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
37
|
|
package/model/withdrawalStep.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { WithdrawalStepType } from './withdrawalStepType';
|
|
|
16
16
|
export class WithdrawalStep {
|
|
17
17
|
'type'?: WithdrawalStepType;
|
|
18
18
|
/**
|
|
19
|
-
* The timestamp when
|
|
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
|
|
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,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
|
-
}
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Northstake
|
|
4
|
-
* Northstake api.
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.StakingPartnerValidatorKeysApi = exports.StakingPartnerValidatorKeysApiApiKeys = void 0;
|
|
18
|
-
const request_1 = __importDefault(require("request"));
|
|
19
|
-
const models_1 = require("../model/models");
|
|
20
|
-
const models_2 = require("../model/models");
|
|
21
|
-
const apis_1 = require("./apis");
|
|
22
|
-
let defaultBasePath = '/v1';
|
|
23
|
-
// ===============================================
|
|
24
|
-
// This file is autogenerated - Please do not edit
|
|
25
|
-
// ===============================================
|
|
26
|
-
var StakingPartnerValidatorKeysApiApiKeys;
|
|
27
|
-
(function (StakingPartnerValidatorKeysApiApiKeys) {
|
|
28
|
-
StakingPartnerValidatorKeysApiApiKeys[StakingPartnerValidatorKeysApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
|
|
29
|
-
})(StakingPartnerValidatorKeysApiApiKeys || (exports.StakingPartnerValidatorKeysApiApiKeys = StakingPartnerValidatorKeysApiApiKeys = {}));
|
|
30
|
-
class StakingPartnerValidatorKeysApi {
|
|
31
|
-
constructor(basePathOrUsername, password, basePath) {
|
|
32
|
-
this._basePath = defaultBasePath;
|
|
33
|
-
this._defaultHeaders = {};
|
|
34
|
-
this._useQuerystring = false;
|
|
35
|
-
this.authentications = {
|
|
36
|
-
'default': new models_2.JWTAuth('your_api_key', 'your_private_key'),
|
|
37
|
-
'bearerTokenAuth': new models_2.HttpBearerAuth(),
|
|
38
|
-
'ApiKeyAuth': new models_2.ApiKeyAuth('header', 'x-api-key'),
|
|
39
|
-
};
|
|
40
|
-
this.interceptors = [];
|
|
41
|
-
if (password) {
|
|
42
|
-
if (basePath) {
|
|
43
|
-
this.basePath = basePath;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
if (basePathOrUsername) {
|
|
48
|
-
this.basePath = basePathOrUsername;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
set useQuerystring(value) {
|
|
53
|
-
this._useQuerystring = value;
|
|
54
|
-
}
|
|
55
|
-
set basePath(basePath) {
|
|
56
|
-
this._basePath = basePath;
|
|
57
|
-
}
|
|
58
|
-
set defaultHeaders(defaultHeaders) {
|
|
59
|
-
this._defaultHeaders = defaultHeaders;
|
|
60
|
-
}
|
|
61
|
-
get defaultHeaders() {
|
|
62
|
-
return this._defaultHeaders;
|
|
63
|
-
}
|
|
64
|
-
get basePath() {
|
|
65
|
-
return this._basePath;
|
|
66
|
-
}
|
|
67
|
-
setDefaultAuthentication(auth) {
|
|
68
|
-
this.authentications.default = auth;
|
|
69
|
-
}
|
|
70
|
-
setApiKey(key, value) {
|
|
71
|
-
this.authentications[StakingPartnerValidatorKeysApiApiKeys[key]].apiKey = value;
|
|
72
|
-
}
|
|
73
|
-
set accessToken(accessToken) {
|
|
74
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
75
|
-
}
|
|
76
|
-
addInterceptor(interceptor) {
|
|
77
|
-
this.interceptors.push(interceptor);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @summary Submit a pregenerated/external validator key to Northstake for non-custodial staking
|
|
82
|
-
* @param validatorKey
|
|
83
|
-
*/
|
|
84
|
-
async createValidatorKey(validatorKey, options = { headers: {} }) {
|
|
85
|
-
const localVarPath = this.basePath + '/stakingPartner/validatorKeys/';
|
|
86
|
-
let localVarQueryParameters = {};
|
|
87
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
88
|
-
const produces = ['application/json'];
|
|
89
|
-
// give precedence to 'application/json'
|
|
90
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
91
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
95
|
-
}
|
|
96
|
-
let localVarFormParams = {};
|
|
97
|
-
// verify required parameter 'validatorKey' is not null or undefined
|
|
98
|
-
if (validatorKey === null || validatorKey === undefined) {
|
|
99
|
-
throw new Error('Required parameter validatorKey was null or undefined when calling createValidatorKey.');
|
|
100
|
-
}
|
|
101
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
102
|
-
let localVarUseFormData = false;
|
|
103
|
-
let localVarRequestOptions = {
|
|
104
|
-
method: 'POST',
|
|
105
|
-
qs: localVarQueryParameters,
|
|
106
|
-
headers: localVarHeaderParams,
|
|
107
|
-
uri: localVarPath,
|
|
108
|
-
useQuerystring: this._useQuerystring,
|
|
109
|
-
json: true,
|
|
110
|
-
body: models_1.ObjectSerializer.serialize(validatorKey, "ValidatorKey")
|
|
111
|
-
};
|
|
112
|
-
let authenticationPromise = Promise.resolve();
|
|
113
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
114
|
-
let interceptorPromise = authenticationPromise;
|
|
115
|
-
for (const interceptor of this.interceptors) {
|
|
116
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
117
|
-
}
|
|
118
|
-
return interceptorPromise.then(() => {
|
|
119
|
-
if (Object.keys(localVarFormParams).length) {
|
|
120
|
-
if (localVarUseFormData) {
|
|
121
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return new Promise((resolve, reject) => {
|
|
128
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
129
|
-
if (error) {
|
|
130
|
-
reject(error);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
134
|
-
resolve({ response: response, body: body });
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* @summary Get all validators associated with the staking partner
|
|
147
|
-
*/
|
|
148
|
-
async getAllValidators(options = { headers: {} }) {
|
|
149
|
-
const localVarPath = this.basePath + '/stakingPartner/validators';
|
|
150
|
-
let localVarQueryParameters = {};
|
|
151
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
152
|
-
const produces = ['application/json'];
|
|
153
|
-
// give precedence to 'application/json'
|
|
154
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
155
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
159
|
-
}
|
|
160
|
-
let localVarFormParams = {};
|
|
161
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
162
|
-
let localVarUseFormData = false;
|
|
163
|
-
let localVarRequestOptions = {
|
|
164
|
-
method: 'GET',
|
|
165
|
-
qs: localVarQueryParameters,
|
|
166
|
-
headers: localVarHeaderParams,
|
|
167
|
-
uri: localVarPath,
|
|
168
|
-
useQuerystring: this._useQuerystring,
|
|
169
|
-
json: true,
|
|
170
|
-
};
|
|
171
|
-
let authenticationPromise = Promise.resolve();
|
|
172
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
173
|
-
let interceptorPromise = authenticationPromise;
|
|
174
|
-
for (const interceptor of this.interceptors) {
|
|
175
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
176
|
-
}
|
|
177
|
-
return interceptorPromise.then(() => {
|
|
178
|
-
if (Object.keys(localVarFormParams).length) {
|
|
179
|
-
if (localVarUseFormData) {
|
|
180
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return new Promise((resolve, reject) => {
|
|
187
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
188
|
-
if (error) {
|
|
189
|
-
reject(error);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
193
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<ValidatorInfo>");
|
|
194
|
-
resolve({ response: response, body: body });
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
206
|
-
* @summary Get a list of pregenerated/external validator keys held by Northstake for the stakingPartner
|
|
207
|
-
*/
|
|
208
|
-
async getValidatorKeys(options = { headers: {} }) {
|
|
209
|
-
const localVarPath = this.basePath + '/stakingPartner/validatorKeys/';
|
|
210
|
-
let localVarQueryParameters = {};
|
|
211
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
212
|
-
const produces = ['application/json'];
|
|
213
|
-
// give precedence to 'application/json'
|
|
214
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
215
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
219
|
-
}
|
|
220
|
-
let localVarFormParams = {};
|
|
221
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
222
|
-
let localVarUseFormData = false;
|
|
223
|
-
let localVarRequestOptions = {
|
|
224
|
-
method: 'GET',
|
|
225
|
-
qs: localVarQueryParameters,
|
|
226
|
-
headers: localVarHeaderParams,
|
|
227
|
-
uri: localVarPath,
|
|
228
|
-
useQuerystring: this._useQuerystring,
|
|
229
|
-
json: true,
|
|
230
|
-
};
|
|
231
|
-
let authenticationPromise = Promise.resolve();
|
|
232
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
233
|
-
let interceptorPromise = authenticationPromise;
|
|
234
|
-
for (const interceptor of this.interceptors) {
|
|
235
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
236
|
-
}
|
|
237
|
-
return interceptorPromise.then(() => {
|
|
238
|
-
if (Object.keys(localVarFormParams).length) {
|
|
239
|
-
if (localVarUseFormData) {
|
|
240
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return new Promise((resolve, reject) => {
|
|
247
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
248
|
-
if (error) {
|
|
249
|
-
reject(error);
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
253
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<GetValidatorKeys200ResponseInner>");
|
|
254
|
-
resolve({ response: response, body: body });
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
exports.StakingPartnerValidatorKeysApi = StakingPartnerValidatorKeysApi;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Northstake
|
|
4
|
-
* Northstake api.
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.GetRewardsStatistics200ResponseInner = void 0;
|
|
15
|
-
class GetRewardsStatistics200ResponseInner {
|
|
16
|
-
static getAttributeTypeMap() {
|
|
17
|
-
return GetRewardsStatistics200ResponseInner.attributeTypeMap;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.GetRewardsStatistics200ResponseInner = GetRewardsStatistics200ResponseInner;
|
|
21
|
-
GetRewardsStatistics200ResponseInner.discriminator = undefined;
|
|
22
|
-
GetRewardsStatistics200ResponseInner.attributeTypeMap = [
|
|
23
|
-
{
|
|
24
|
-
"name": "date",
|
|
25
|
-
"baseName": "date",
|
|
26
|
-
"type": "string"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "amount",
|
|
30
|
-
"baseName": "amount",
|
|
31
|
-
"type": "number"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "currency",
|
|
35
|
-
"baseName": "currency",
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "stakePool",
|
|
40
|
-
"baseName": "stakePool",
|
|
41
|
-
"type": "string"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "transactionId",
|
|
45
|
-
"baseName": "transactionId",
|
|
46
|
-
"type": "string"
|
|
47
|
-
}
|
|
48
|
-
];
|