@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
|
@@ -0,0 +1,167 @@
|
|
|
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 { GetDepositAddressesForManagedUser200Response } from '../model/getDepositAddressesForManagedUser200Response';
|
|
20
|
+
|
|
21
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
23
|
+
|
|
24
|
+
import { HttpError, RequestFile } from './apis';
|
|
25
|
+
|
|
26
|
+
let defaultBasePath = '/v1';
|
|
27
|
+
|
|
28
|
+
// ===============================================
|
|
29
|
+
// This file is autogenerated - Please do not edit
|
|
30
|
+
// ===============================================
|
|
31
|
+
|
|
32
|
+
export enum StakingPartnerManagedUsersDepositAddressesApiApiKeys {
|
|
33
|
+
ApiKeyAuth,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class StakingPartnerManagedUsersDepositAddressesApi {
|
|
37
|
+
protected _basePath = defaultBasePath;
|
|
38
|
+
protected _defaultHeaders : any = {};
|
|
39
|
+
protected _useQuerystring : boolean = false;
|
|
40
|
+
|
|
41
|
+
protected authentications = {
|
|
42
|
+
'default': new JWTAuth('your_api_key', 'your_private_key'),
|
|
43
|
+
'bearerTokenAuth': new HttpBearerAuth(),
|
|
44
|
+
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected interceptors: Interceptor[] = [];
|
|
48
|
+
|
|
49
|
+
constructor(basePath?: string);
|
|
50
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
51
|
+
if (password) {
|
|
52
|
+
if (basePath) {
|
|
53
|
+
this.basePath = basePath;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (basePathOrUsername) {
|
|
57
|
+
this.basePath = basePathOrUsername
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set useQuerystring(value: boolean) {
|
|
63
|
+
this._useQuerystring = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set basePath(basePath: string) {
|
|
67
|
+
this._basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
71
|
+
this._defaultHeaders = defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get defaultHeaders() {
|
|
75
|
+
return this._defaultHeaders;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get basePath() {
|
|
79
|
+
return this._basePath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setDefaultAuthentication(auth: JWTAuth ) {
|
|
83
|
+
this.authentications.default = auth;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private setApiKey(key: StakingPartnerManagedUsersDepositAddressesApiApiKeys, value: string) {
|
|
87
|
+
(this.authentications as any)[StakingPartnerManagedUsersDepositAddressesApiApiKeys[key]].apiKey = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
91
|
+
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private addInterceptor(interceptor: Interceptor) {
|
|
95
|
+
this.interceptors.push(interceptor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @summary Get deposit addresses for a managed user
|
|
101
|
+
* @param userId The ID of the managed user
|
|
102
|
+
*/
|
|
103
|
+
public async getDepositAddressesForManagedUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetDepositAddressesForManagedUser200Response; }> {
|
|
104
|
+
const localVarPath = this.basePath + '/stakingPartner/managedUsers/{userId}/depositAddresses'
|
|
105
|
+
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
106
|
+
let localVarQueryParameters: any = {};
|
|
107
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
108
|
+
const produces = ['application/json'];
|
|
109
|
+
// give precedence to 'application/json'
|
|
110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
111
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
112
|
+
} else {
|
|
113
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
114
|
+
}
|
|
115
|
+
let localVarFormParams: any = {};
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'userId' is not null or undefined
|
|
118
|
+
if (userId === null || userId === undefined) {
|
|
119
|
+
throw new Error('Required parameter userId was null or undefined when calling getDepositAddressesForManagedUser.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
123
|
+
|
|
124
|
+
let localVarUseFormData = false;
|
|
125
|
+
|
|
126
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
127
|
+
method: 'GET',
|
|
128
|
+
qs: localVarQueryParameters,
|
|
129
|
+
headers: localVarHeaderParams,
|
|
130
|
+
uri: localVarPath,
|
|
131
|
+
useQuerystring: this._useQuerystring,
|
|
132
|
+
json: true,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let authenticationPromise = Promise.resolve();
|
|
136
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
137
|
+
|
|
138
|
+
let interceptorPromise = authenticationPromise;
|
|
139
|
+
for (const interceptor of this.interceptors) {
|
|
140
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return interceptorPromise.then(() => {
|
|
144
|
+
if (Object.keys(localVarFormParams).length) {
|
|
145
|
+
if (localVarUseFormData) {
|
|
146
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
147
|
+
} else {
|
|
148
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return new Promise<{ response: http.IncomingMessage; body: GetDepositAddressesForManagedUser200Response; }>((resolve, reject) => {
|
|
152
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
153
|
+
if (error) {
|
|
154
|
+
reject(error);
|
|
155
|
+
} else {
|
|
156
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
+
body = ObjectSerializer.deserialize(body, "GetDepositAddressesForManagedUser200Response");
|
|
158
|
+
resolve({ response: response, body: body });
|
|
159
|
+
} else {
|
|
160
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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 { PortfolioEntity } from '../model/portfolioEntity';
|
|
20
|
+
|
|
21
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
23
|
+
|
|
24
|
+
import { HttpError, RequestFile } from './apis';
|
|
25
|
+
|
|
26
|
+
let defaultBasePath = '/v1';
|
|
27
|
+
|
|
28
|
+
// ===============================================
|
|
29
|
+
// This file is autogenerated - Please do not edit
|
|
30
|
+
// ===============================================
|
|
31
|
+
|
|
32
|
+
export enum StakingPartnerManagedUsersPortfolioApiApiKeys {
|
|
33
|
+
ApiKeyAuth,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class StakingPartnerManagedUsersPortfolioApi {
|
|
37
|
+
protected _basePath = defaultBasePath;
|
|
38
|
+
protected _defaultHeaders : any = {};
|
|
39
|
+
protected _useQuerystring : boolean = false;
|
|
40
|
+
|
|
41
|
+
protected authentications = {
|
|
42
|
+
'default': new JWTAuth('your_api_key', 'your_private_key'),
|
|
43
|
+
'bearerTokenAuth': new HttpBearerAuth(),
|
|
44
|
+
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected interceptors: Interceptor[] = [];
|
|
48
|
+
|
|
49
|
+
constructor(basePath?: string);
|
|
50
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
51
|
+
if (password) {
|
|
52
|
+
if (basePath) {
|
|
53
|
+
this.basePath = basePath;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (basePathOrUsername) {
|
|
57
|
+
this.basePath = basePathOrUsername
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set useQuerystring(value: boolean) {
|
|
63
|
+
this._useQuerystring = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set basePath(basePath: string) {
|
|
67
|
+
this._basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
71
|
+
this._defaultHeaders = defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get defaultHeaders() {
|
|
75
|
+
return this._defaultHeaders;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get basePath() {
|
|
79
|
+
return this._basePath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setDefaultAuthentication(auth: JWTAuth ) {
|
|
83
|
+
this.authentications.default = auth;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private setApiKey(key: StakingPartnerManagedUsersPortfolioApiApiKeys, value: string) {
|
|
87
|
+
(this.authentications as any)[StakingPartnerManagedUsersPortfolioApiApiKeys[key]].apiKey = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
91
|
+
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private addInterceptor(interceptor: Interceptor) {
|
|
95
|
+
this.interceptors.push(interceptor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @summary Account portfolio overview for staking partner\'s managed user
|
|
101
|
+
* @param userId
|
|
102
|
+
*/
|
|
103
|
+
public async getPortfolioForManagedUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<PortfolioEntity>; }> {
|
|
104
|
+
const localVarPath = this.basePath + '/stakingPartner/managedUsers/{userId}/portfolio'
|
|
105
|
+
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
106
|
+
let localVarQueryParameters: any = {};
|
|
107
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
108
|
+
const produces = ['application/json'];
|
|
109
|
+
// give precedence to 'application/json'
|
|
110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
111
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
112
|
+
} else {
|
|
113
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
114
|
+
}
|
|
115
|
+
let localVarFormParams: any = {};
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'userId' is not null or undefined
|
|
118
|
+
if (userId === null || userId === undefined) {
|
|
119
|
+
throw new Error('Required parameter userId was null or undefined when calling getPortfolioForManagedUser.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
123
|
+
|
|
124
|
+
let localVarUseFormData = false;
|
|
125
|
+
|
|
126
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
127
|
+
method: 'GET',
|
|
128
|
+
qs: localVarQueryParameters,
|
|
129
|
+
headers: localVarHeaderParams,
|
|
130
|
+
uri: localVarPath,
|
|
131
|
+
useQuerystring: this._useQuerystring,
|
|
132
|
+
json: true,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let authenticationPromise = Promise.resolve();
|
|
136
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
137
|
+
|
|
138
|
+
let interceptorPromise = authenticationPromise;
|
|
139
|
+
for (const interceptor of this.interceptors) {
|
|
140
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return interceptorPromise.then(() => {
|
|
144
|
+
if (Object.keys(localVarFormParams).length) {
|
|
145
|
+
if (localVarUseFormData) {
|
|
146
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
147
|
+
} else {
|
|
148
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<PortfolioEntity>; }>((resolve, reject) => {
|
|
152
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
153
|
+
if (error) {
|
|
154
|
+
reject(error);
|
|
155
|
+
} else {
|
|
156
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
+
body = ObjectSerializer.deserialize(body, "Array<PortfolioEntity>");
|
|
158
|
+
resolve({ response: response, body: body });
|
|
159
|
+
} else {
|
|
160
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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 { TransactionStat } from '../model/transactionStat';
|
|
20
|
+
|
|
21
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
23
|
+
|
|
24
|
+
import { HttpError, RequestFile } from './apis';
|
|
25
|
+
|
|
26
|
+
let defaultBasePath = '/v1';
|
|
27
|
+
|
|
28
|
+
// ===============================================
|
|
29
|
+
// This file is autogenerated - Please do not edit
|
|
30
|
+
// ===============================================
|
|
31
|
+
|
|
32
|
+
export enum StakingPartnerManagedUsersStatsApiApiKeys {
|
|
33
|
+
ApiKeyAuth,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class StakingPartnerManagedUsersStatsApi {
|
|
37
|
+
protected _basePath = defaultBasePath;
|
|
38
|
+
protected _defaultHeaders : any = {};
|
|
39
|
+
protected _useQuerystring : boolean = false;
|
|
40
|
+
|
|
41
|
+
protected authentications = {
|
|
42
|
+
'default': new JWTAuth('your_api_key', 'your_private_key'),
|
|
43
|
+
'bearerTokenAuth': new HttpBearerAuth(),
|
|
44
|
+
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected interceptors: Interceptor[] = [];
|
|
48
|
+
|
|
49
|
+
constructor(basePath?: string);
|
|
50
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
51
|
+
if (password) {
|
|
52
|
+
if (basePath) {
|
|
53
|
+
this.basePath = basePath;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (basePathOrUsername) {
|
|
57
|
+
this.basePath = basePathOrUsername
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set useQuerystring(value: boolean) {
|
|
63
|
+
this._useQuerystring = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set basePath(basePath: string) {
|
|
67
|
+
this._basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
71
|
+
this._defaultHeaders = defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get defaultHeaders() {
|
|
75
|
+
return this._defaultHeaders;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get basePath() {
|
|
79
|
+
return this._basePath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setDefaultAuthentication(auth: JWTAuth ) {
|
|
83
|
+
this.authentications.default = auth;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private setApiKey(key: StakingPartnerManagedUsersStatsApiApiKeys, value: string) {
|
|
87
|
+
(this.authentications as any)[StakingPartnerManagedUsersStatsApiApiKeys[key]].apiKey = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
91
|
+
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private addInterceptor(interceptor: Interceptor) {
|
|
95
|
+
this.interceptors.push(interceptor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @summary Get transaction statistics for a managed user
|
|
101
|
+
* @param userId
|
|
102
|
+
*/
|
|
103
|
+
public async getTransactionStatsForManagedUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<TransactionStat>; }> {
|
|
104
|
+
const localVarPath = this.basePath + '/stakingPartner/managedUsers/{userId}/stats/transactions'
|
|
105
|
+
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
106
|
+
let localVarQueryParameters: any = {};
|
|
107
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
108
|
+
const produces = ['application/json'];
|
|
109
|
+
// give precedence to 'application/json'
|
|
110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
111
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
112
|
+
} else {
|
|
113
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
114
|
+
}
|
|
115
|
+
let localVarFormParams: any = {};
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'userId' is not null or undefined
|
|
118
|
+
if (userId === null || userId === undefined) {
|
|
119
|
+
throw new Error('Required parameter userId was null or undefined when calling getTransactionStatsForManagedUser.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
123
|
+
|
|
124
|
+
let localVarUseFormData = false;
|
|
125
|
+
|
|
126
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
127
|
+
method: 'GET',
|
|
128
|
+
qs: localVarQueryParameters,
|
|
129
|
+
headers: localVarHeaderParams,
|
|
130
|
+
uri: localVarPath,
|
|
131
|
+
useQuerystring: this._useQuerystring,
|
|
132
|
+
json: true,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let authenticationPromise = Promise.resolve();
|
|
136
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
137
|
+
|
|
138
|
+
let interceptorPromise = authenticationPromise;
|
|
139
|
+
for (const interceptor of this.interceptors) {
|
|
140
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return interceptorPromise.then(() => {
|
|
144
|
+
if (Object.keys(localVarFormParams).length) {
|
|
145
|
+
if (localVarUseFormData) {
|
|
146
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
147
|
+
} else {
|
|
148
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<TransactionStat>; }>((resolve, reject) => {
|
|
152
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
153
|
+
if (error) {
|
|
154
|
+
reject(error);
|
|
155
|
+
} else {
|
|
156
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
+
body = ObjectSerializer.deserialize(body, "Array<TransactionStat>");
|
|
158
|
+
resolve({ response: response, body: body });
|
|
159
|
+
} else {
|
|
160
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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 { ValidatorInfo } from '../model/validatorInfo';
|
|
20
|
+
|
|
21
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
23
|
+
|
|
24
|
+
import { HttpError, RequestFile } from './apis';
|
|
25
|
+
|
|
26
|
+
let defaultBasePath = '/v1';
|
|
27
|
+
|
|
28
|
+
// ===============================================
|
|
29
|
+
// This file is autogenerated - Please do not edit
|
|
30
|
+
// ===============================================
|
|
31
|
+
|
|
32
|
+
export enum StakingPartnerManagedUsersValidatorsApiApiKeys {
|
|
33
|
+
ApiKeyAuth,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class StakingPartnerManagedUsersValidatorsApi {
|
|
37
|
+
protected _basePath = defaultBasePath;
|
|
38
|
+
protected _defaultHeaders : any = {};
|
|
39
|
+
protected _useQuerystring : boolean = false;
|
|
40
|
+
|
|
41
|
+
protected authentications = {
|
|
42
|
+
'default': new JWTAuth('your_api_key', 'your_private_key'),
|
|
43
|
+
'bearerTokenAuth': new HttpBearerAuth(),
|
|
44
|
+
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected interceptors: Interceptor[] = [];
|
|
48
|
+
|
|
49
|
+
constructor(basePath?: string);
|
|
50
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
51
|
+
if (password) {
|
|
52
|
+
if (basePath) {
|
|
53
|
+
this.basePath = basePath;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (basePathOrUsername) {
|
|
57
|
+
this.basePath = basePathOrUsername
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set useQuerystring(value: boolean) {
|
|
63
|
+
this._useQuerystring = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set basePath(basePath: string) {
|
|
67
|
+
this._basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
71
|
+
this._defaultHeaders = defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get defaultHeaders() {
|
|
75
|
+
return this._defaultHeaders;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get basePath() {
|
|
79
|
+
return this._basePath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setDefaultAuthentication(auth: JWTAuth ) {
|
|
83
|
+
this.authentications.default = auth;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private setApiKey(key: StakingPartnerManagedUsersValidatorsApiApiKeys, value: string) {
|
|
87
|
+
(this.authentications as any)[StakingPartnerManagedUsersValidatorsApiApiKeys[key]].apiKey = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
91
|
+
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private addInterceptor(interceptor: Interceptor) {
|
|
95
|
+
this.interceptors.push(interceptor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @summary Get all validators associated with the managed user
|
|
101
|
+
* @param userId
|
|
102
|
+
*/
|
|
103
|
+
public async getValidatorsForManagedUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ValidatorInfo>; }> {
|
|
104
|
+
const localVarPath = this.basePath + '/stakingPartner/managedUsers/{userId}/validators'
|
|
105
|
+
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
106
|
+
let localVarQueryParameters: any = {};
|
|
107
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
108
|
+
const produces = ['application/json'];
|
|
109
|
+
// give precedence to 'application/json'
|
|
110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
111
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
112
|
+
} else {
|
|
113
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
114
|
+
}
|
|
115
|
+
let localVarFormParams: any = {};
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'userId' is not null or undefined
|
|
118
|
+
if (userId === null || userId === undefined) {
|
|
119
|
+
throw new Error('Required parameter userId was null or undefined when calling getValidatorsForManagedUser.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
123
|
+
|
|
124
|
+
let localVarUseFormData = false;
|
|
125
|
+
|
|
126
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
127
|
+
method: 'GET',
|
|
128
|
+
qs: localVarQueryParameters,
|
|
129
|
+
headers: localVarHeaderParams,
|
|
130
|
+
uri: localVarPath,
|
|
131
|
+
useQuerystring: this._useQuerystring,
|
|
132
|
+
json: true,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let authenticationPromise = Promise.resolve();
|
|
136
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
137
|
+
|
|
138
|
+
let interceptorPromise = authenticationPromise;
|
|
139
|
+
for (const interceptor of this.interceptors) {
|
|
140
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return interceptorPromise.then(() => {
|
|
144
|
+
if (Object.keys(localVarFormParams).length) {
|
|
145
|
+
if (localVarUseFormData) {
|
|
146
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
147
|
+
} else {
|
|
148
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<ValidatorInfo>; }>((resolve, reject) => {
|
|
152
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
153
|
+
if (error) {
|
|
154
|
+
reject(error);
|
|
155
|
+
} else {
|
|
156
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
+
body = ObjectSerializer.deserialize(body, "Array<ValidatorInfo>");
|
|
158
|
+
resolve({ response: response, body: body });
|
|
159
|
+
} else {
|
|
160
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|