@northstake/northstakeapi 1.0.24 → 1.0.26
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 +6 -36
- package/.openapi-generator/VERSION +1 -1
- package/api/apis.ts +3 -23
- package/api/{managedUsersApi.ts → smartContractsApi.ts} +118 -53
- package/api.ts +9 -69
- package/dist/api/apis.d.ts +3 -23
- package/dist/api/apis.js +3 -23
- package/dist/api/smartContractsApi.d.ts +125 -0
- package/dist/api/{managedUsersApi.js → smartContractsApi.js} +90 -49
- package/dist/api.d.ts +7 -47
- package/dist/api.js +8 -58
- package/dist/model/{getTransactionsResponse.d.ts → getSmartContractInternalTransactions200Response.d.ts} +7 -7
- package/dist/model/{transactionsforUser.js → getSmartContractInternalTransactions200Response.js} +11 -11
- package/dist/model/{allManagedUsersResponse.d.ts → getSmartContractMinedBlocks200Response.d.ts} +4 -4
- package/dist/model/{allManagedUsersResponse.js → getSmartContractMinedBlocks200Response.js} +9 -9
- package/dist/model/{transactionsforUser.d.ts → getSmartContractTransactions200Response.d.ts} +5 -5
- package/dist/model/{getTransactionsResponse.js → getSmartContractTransactions200Response.js} +10 -10
- package/dist/model/{stakeStep.d.ts → internalTransaction.d.ts} +9 -7
- package/dist/model/internalTransaction.js +58 -0
- package/dist/model/{managedUser.d.ts → minedBlock.d.ts} +8 -6
- package/dist/model/minedBlock.js +43 -0
- package/dist/model/models.d.ts +5 -25
- package/dist/model/models.js +15 -67
- package/dist/model/transaction.d.ts +40 -17
- package/dist/model/transaction.js +74 -17
- package/dist/model/webhookPayloadData.d.ts +2 -10
- package/dist/model/webhookPayloadData.js +2 -12
- package/model/{transactionsforUser.ts → getSmartContractInternalTransactions200Response.ts} +13 -13
- package/model/{allManagedUsersResponse.ts → getSmartContractMinedBlocks200Response.ts} +8 -8
- package/model/{getTransactionsResponse.ts → getSmartContractTransactions200Response.ts} +10 -10
- package/model/internalTransaction.ts +70 -0
- package/model/{depositAddress.ts → minedBlock.ts} +19 -13
- package/model/models.ts +17 -114
- package/model/transaction.ts +114 -31
- package/model/webhookPayloadData.ts +4 -23
- package/package.json +1 -1
- package/api/depositAddressesApi.ts +0 -267
- package/api/managedUsersDepositAddressesApi.ts +0 -186
- package/api/managedUsersLinkedWalletsApi.ts +0 -369
- package/api/managedUsersOrdersApi.ts +0 -462
- package/api/managedUsersPortfolioApi.ts +0 -186
- package/api/managedUsersTransactionsApi.ts +0 -222
- package/api/managedUsersValidatorsApi.ts +0 -302
- package/api/ordersApi.ts +0 -432
- package/api/portfolioApi.ts +0 -180
- package/api/transactionsApi.ts +0 -215
- package/dist/api/depositAddressesApi.d.ts +0 -64
- package/dist/api/depositAddressesApi.js +0 -207
- package/dist/api/managedUsersApi.d.ts +0 -94
- package/dist/api/managedUsersDepositAddressesApi.d.ts +0 -51
- package/dist/api/managedUsersDepositAddressesApi.js +0 -146
- package/dist/api/managedUsersLinkedWalletsApi.d.ts +0 -80
- package/dist/api/managedUsersLinkedWalletsApi.js +0 -290
- package/dist/api/managedUsersOrdersApi.d.ts +0 -94
- package/dist/api/managedUsersOrdersApi.js +0 -364
- package/dist/api/managedUsersPortfolioApi.d.ts +0 -51
- package/dist/api/managedUsersPortfolioApi.js +0 -146
- package/dist/api/managedUsersTransactionsApi.d.ts +0 -68
- package/dist/api/managedUsersTransactionsApi.js +0 -170
- package/dist/api/managedUsersValidatorsApi.d.ts +0 -78
- package/dist/api/managedUsersValidatorsApi.js +0 -233
- package/dist/api/ordersApi.d.ts +0 -90
- package/dist/api/ordersApi.js +0 -333
- package/dist/api/portfolioApi.d.ts +0 -50
- package/dist/api/portfolioApi.js +0 -140
- package/dist/api/transactionsApi.d.ts +0 -66
- package/dist/api/transactionsApi.js +0 -164
- package/dist/model/addLinkedWalletForUserRequest.d.ts +0 -29
- package/dist/model/addLinkedWalletForUserRequest.js +0 -33
- package/dist/model/createManagedUserRequest.d.ts +0 -25
- package/dist/model/createManagedUserRequest.js +0 -28
- package/dist/model/depositAddress.d.ts +0 -35
- package/dist/model/depositAddress.js +0 -36
- package/dist/model/depositAddressesForUserResponse.d.ts +0 -27
- package/dist/model/depositAddressesForUserResponse.js +0 -33
- package/dist/model/managedUser.js +0 -36
- package/dist/model/managedUserDetails.d.ts +0 -31
- package/dist/model/managedUserDetails.js +0 -41
- package/dist/model/order.d.ts +0 -42
- package/dist/model/order.js +0 -48
- package/dist/model/orderDocument.d.ts +0 -50
- package/dist/model/orderDocument.js +0 -71
- package/dist/model/orderDocumentSteps.d.ts +0 -30
- package/dist/model/orderDocumentSteps.js +0 -33
- package/dist/model/orderType.d.ts +0 -15
- package/dist/model/orderType.js +0 -13
- package/dist/model/orderUpdatePayload.d.ts +0 -36
- package/dist/model/orderUpdatePayload.js +0 -38
- package/dist/model/portfolioEntity.d.ts +0 -33
- package/dist/model/portfolioEntity.js +0 -41
- package/dist/model/stakeStep.js +0 -33
- package/dist/model/stakeStepElement.d.ts +0 -30
- package/dist/model/stakeStepElement.js +0 -33
- package/dist/model/stepStatus.d.ts +0 -15
- package/dist/model/stepStatus.js +0 -13
- package/dist/model/transactionEventType.d.ts +0 -15
- package/dist/model/transactionEventType.js +0 -13
- package/dist/model/unstakeStep.d.ts +0 -32
- package/dist/model/unstakeStep.js +0 -33
- package/dist/model/unstakeStepElement.d.ts +0 -30
- package/dist/model/unstakeStepElement.js +0 -33
- package/dist/model/unstakeStepType.d.ts +0 -15
- package/dist/model/unstakeStepType.js +0 -13
- package/dist/model/withdrawalStep.d.ts +0 -32
- package/dist/model/withdrawalStep.js +0 -33
- package/dist/model/withdrawalStepElement.d.ts +0 -30
- package/dist/model/withdrawalStepElement.js +0 -33
- package/dist/model/withdrawalStepType.d.ts +0 -15
- package/dist/model/withdrawalStepType.js +0 -13
- package/model/addLinkedWalletForUserRequest.ts +0 -40
- package/model/createManagedUserRequest.ts +0 -31
- package/model/depositAddressesForUserResponse.ts +0 -38
- package/model/managedUser.ts +0 -40
- package/model/managedUserDetails.ts +0 -47
- package/model/order.ts +0 -68
- package/model/orderDocument.ts +0 -106
- package/model/orderDocumentSteps.ts +0 -44
- package/model/orderType.ts +0 -21
- package/model/orderUpdatePayload.ts +0 -52
- package/model/portfolioEntity.ts +0 -49
- package/model/stakeStep.ts +0 -43
- package/model/stakeStepElement.ts +0 -41
- package/model/stepStatus.ts +0 -21
- package/model/transactionEventType.ts +0 -23
- package/model/unstakeStep.ts +0 -43
- package/model/unstakeStepElement.ts +0 -41
- package/model/unstakeStepType.ts +0 -32
- package/model/withdrawalStep.ts +0 -43
- package/model/withdrawalStepElement.ts +0 -41
- package/model/withdrawalStepType.ts +0 -24
|
@@ -1,222 +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 { Asset } from '../model/asset';
|
|
19
|
-
import { ErrorResponse } from '../model/errorResponse';
|
|
20
|
-
import { TransactionEventType } from '../model/transactionEventType';
|
|
21
|
-
import { TransactionsforUser } from '../model/transactionsforUser';
|
|
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 = 'https://api.northstake.dk/v1';
|
|
29
|
-
|
|
30
|
-
// ===============================================
|
|
31
|
-
// This file is autogenerated - Please do not edit
|
|
32
|
-
// ===============================================
|
|
33
|
-
|
|
34
|
-
export enum ManagedUsersTransactionsApiApiKeys {
|
|
35
|
-
ApiKeyAuth,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// If vendorExtensions.x-packageParams is true, use a single object to pass parameters
|
|
40
|
-
export interface ManagedUsersTransactionsApiParams {
|
|
41
|
-
userId: string;
|
|
42
|
-
startDate?: string;
|
|
43
|
-
endDate?: string;
|
|
44
|
-
type?: TransactionEventType;
|
|
45
|
-
asset?: Asset;
|
|
46
|
-
page?: number;
|
|
47
|
-
limit?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class ManagedUsersTransactionsApi {
|
|
51
|
-
protected _basePath = defaultBasePath;
|
|
52
|
-
protected _defaultHeaders : any = {};
|
|
53
|
-
protected _useQuerystring : boolean = false;
|
|
54
|
-
|
|
55
|
-
protected authentications = {
|
|
56
|
-
'default': <Authentication>new JWTAuth('your_api_key', 'your_private_key'),
|
|
57
|
-
'bearerTokenAuth': new HttpBearerAuth(),
|
|
58
|
-
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
protected interceptors: Interceptor[] = [];
|
|
62
|
-
|
|
63
|
-
constructor(basePath?: string);
|
|
64
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
65
|
-
if (password) {
|
|
66
|
-
if (basePath) {
|
|
67
|
-
this.basePath = basePath;
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
if (basePathOrUsername) {
|
|
71
|
-
this.basePath = basePathOrUsername
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
set useQuerystring(value: boolean) {
|
|
77
|
-
this._useQuerystring = value;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
set basePath(basePath: string) {
|
|
81
|
-
this._basePath = basePath;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
85
|
-
this._defaultHeaders = defaultHeaders;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
get defaultHeaders() {
|
|
89
|
-
return this._defaultHeaders;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get basePath() {
|
|
93
|
-
return this._basePath;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
97
|
-
this.authentications.default = auth;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public setApiKey(key: ManagedUsersTransactionsApiApiKeys, value: string) {
|
|
101
|
-
(this.authentications as any)[ManagedUsersTransactionsApiApiKeys[key]].apiKey = value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
set accessToken(accessToken: string | (() => string)) {
|
|
105
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
109
|
-
this.interceptors.push(interceptor);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
* @summary Get transactions for a managed user
|
|
115
|
-
* @param userId
|
|
116
|
-
* @param startDate Start date for filtering transaction statistics
|
|
117
|
-
* @param endDate End date for filtering transaction statistics
|
|
118
|
-
* @param type Type of transaction (e.g., deposit, withdrawal)
|
|
119
|
-
* @param asset Asset type (e.g., ETH, SOL)
|
|
120
|
-
* @param page Transaction list page number
|
|
121
|
-
* @param limit Number of transactions to return per page
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
public async getTransactionsForUser(params: ManagedUsersTransactionsApiParams, options: { headers: { [name: string]: string } } = { headers: {} }): Promise<{ body: TransactionsforUser, status: number }> {
|
|
129
|
-
|
|
130
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/transactions'
|
|
131
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(params?.userId)));
|
|
132
|
-
|
|
133
|
-
let localVarQueryParameters: any = {};
|
|
134
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
135
|
-
const produces = ['application/json'];
|
|
136
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
137
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
138
|
-
} else {
|
|
139
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
140
|
-
}
|
|
141
|
-
let localVarFormParams: any = {};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
145
|
-
if (params?.userId === null || params?.userId === undefined) {
|
|
146
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getTransactionsForUser.');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (params?.startDate !== undefined) {
|
|
152
|
-
localVarQueryParameters['startDate'] = ObjectSerializer.serialize(params?.startDate, "string");
|
|
153
|
-
}
|
|
154
|
-
if (params?.endDate !== undefined) {
|
|
155
|
-
localVarQueryParameters['endDate'] = ObjectSerializer.serialize(params?.endDate, "string");
|
|
156
|
-
}
|
|
157
|
-
if (params?.type !== undefined) {
|
|
158
|
-
localVarQueryParameters['type'] = ObjectSerializer.serialize(params?.type, "TransactionEventType");
|
|
159
|
-
}
|
|
160
|
-
if (params?.asset !== undefined) {
|
|
161
|
-
localVarQueryParameters['asset'] = ObjectSerializer.serialize(params?.asset, "Asset");
|
|
162
|
-
}
|
|
163
|
-
if (params?.page !== undefined) {
|
|
164
|
-
localVarQueryParameters['page'] = ObjectSerializer.serialize(params?.page, "number");
|
|
165
|
-
}
|
|
166
|
-
if (params?.limit !== undefined) {
|
|
167
|
-
localVarQueryParameters['limit'] = ObjectSerializer.serialize(params?.limit, "number");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
174
|
-
|
|
175
|
-
let localVarUseFormData = false;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
180
|
-
method: 'GET',
|
|
181
|
-
qs: localVarQueryParameters,
|
|
182
|
-
headers: localVarHeaderParams,
|
|
183
|
-
uri: localVarPath,
|
|
184
|
-
useQuerystring: this._useQuerystring,
|
|
185
|
-
json: true,
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
let authenticationPromise = Promise.resolve();
|
|
189
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
190
|
-
|
|
191
|
-
let interceptorPromise = authenticationPromise;
|
|
192
|
-
for (const interceptor of this.interceptors) {
|
|
193
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return interceptorPromise.then(() => {
|
|
197
|
-
if (Object.keys(localVarFormParams).length) {
|
|
198
|
-
if (localVarUseFormData) {
|
|
199
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
200
|
-
} else {
|
|
201
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return new Promise<{ body: TransactionsforUser, status: number }>((resolve, reject) => {
|
|
205
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
206
|
-
if (error) {
|
|
207
|
-
console.error('API call error:', error);
|
|
208
|
-
reject(error);
|
|
209
|
-
} else {
|
|
210
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
211
|
-
body = ObjectSerializer.deserialize(body, "TransactionsforUser");
|
|
212
|
-
resolve({ body: body, status: response.statusCode });
|
|
213
|
-
} else {
|
|
214
|
-
console.error('API response error:', response.statusCode);
|
|
215
|
-
resolve({ body: body, status: response.statusCode });
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
} )
|
|
221
|
-
}
|
|
222
|
-
}
|
|
@@ -1,302 +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 { GetWithdrawalsResponse } from '../model/getWithdrawalsResponse';
|
|
20
|
-
import { ValidatorInfo } from '../model/validatorInfo';
|
|
21
|
-
|
|
22
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
23
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
24
|
-
|
|
25
|
-
import { HttpError, RequestFile } from './apis';
|
|
26
|
-
|
|
27
|
-
let defaultBasePath = 'https://api.northstake.dk/v1';
|
|
28
|
-
|
|
29
|
-
// ===============================================
|
|
30
|
-
// This file is autogenerated - Please do not edit
|
|
31
|
-
// ===============================================
|
|
32
|
-
|
|
33
|
-
export enum ManagedUsersValidatorsApiApiKeys {
|
|
34
|
-
ApiKeyAuth,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// If vendorExtensions.x-packageParams is true, use a single object to pass parameters
|
|
39
|
-
export interface ManagedUsersValidatorsApiParams {
|
|
40
|
-
userId: string;
|
|
41
|
-
startDate?: string;
|
|
42
|
-
endDate?: string;
|
|
43
|
-
page?: number;
|
|
44
|
-
limit?: number;
|
|
45
|
-
validatorIndices?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class ManagedUsersValidatorsApi {
|
|
49
|
-
protected _basePath = defaultBasePath;
|
|
50
|
-
protected _defaultHeaders : any = {};
|
|
51
|
-
protected _useQuerystring : boolean = false;
|
|
52
|
-
|
|
53
|
-
protected authentications = {
|
|
54
|
-
'default': <Authentication>new JWTAuth('your_api_key', 'your_private_key'),
|
|
55
|
-
'bearerTokenAuth': new HttpBearerAuth(),
|
|
56
|
-
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
protected interceptors: Interceptor[] = [];
|
|
60
|
-
|
|
61
|
-
constructor(basePath?: string);
|
|
62
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
63
|
-
if (password) {
|
|
64
|
-
if (basePath) {
|
|
65
|
-
this.basePath = basePath;
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
if (basePathOrUsername) {
|
|
69
|
-
this.basePath = basePathOrUsername
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
set useQuerystring(value: boolean) {
|
|
75
|
-
this._useQuerystring = value;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set basePath(basePath: string) {
|
|
79
|
-
this._basePath = basePath;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
83
|
-
this._defaultHeaders = defaultHeaders;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
get defaultHeaders() {
|
|
87
|
-
return this._defaultHeaders;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
get basePath() {
|
|
91
|
-
return this._basePath;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
95
|
-
this.authentications.default = auth;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public setApiKey(key: ManagedUsersValidatorsApiApiKeys, value: string) {
|
|
99
|
-
(this.authentications as any)[ManagedUsersValidatorsApiApiKeys[key]].apiKey = value;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
set accessToken(accessToken: string | (() => string)) {
|
|
103
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
107
|
-
this.interceptors.push(interceptor);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves a paginated list of validator withdrawals for a specific managed user. The endpoint supports filtering by start and end date, page number, and limit. Additionally, it allows filtering by validator indices.
|
|
112
|
-
* @summary Get a list of validator withdrawals for a managed user
|
|
113
|
-
* @param userId
|
|
114
|
-
* @param startDate Start date for filtering withdrawal statistics
|
|
115
|
-
* @param endDate End date for filtering withdrawal statistics
|
|
116
|
-
* @param page Withdrawal list page number
|
|
117
|
-
* @param limit Number of withdrawals to return per page
|
|
118
|
-
* @param validatorIndices Comma-separated list of validator indices to filter withdrawals (e.g., \"123,456,789\")
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
public async getValidatorWithdrawalsForUser(params?: ManagedUsersValidatorsApiParams, options: { headers: { [name: string]: string } } = { headers: {} }): Promise<{ body: GetWithdrawalsResponse, status: number }> {
|
|
126
|
-
|
|
127
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/validators/withdrawals'
|
|
128
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(params?.userId)));
|
|
129
|
-
|
|
130
|
-
let localVarQueryParameters: any = {};
|
|
131
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
132
|
-
const produces = ['application/json'];
|
|
133
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
134
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
135
|
-
} else {
|
|
136
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
137
|
-
}
|
|
138
|
-
let localVarFormParams: any = {};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
142
|
-
if (params?.userId === null || params?.userId === undefined) {
|
|
143
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getValidatorWithdrawalsForUser.');
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (params?.startDate !== undefined) {
|
|
149
|
-
localVarQueryParameters['start_date'] = ObjectSerializer.serialize(params?.startDate, "string");
|
|
150
|
-
}
|
|
151
|
-
if (params?.endDate !== undefined) {
|
|
152
|
-
localVarQueryParameters['end_date'] = ObjectSerializer.serialize(params?.endDate, "string");
|
|
153
|
-
}
|
|
154
|
-
if (params?.page !== undefined) {
|
|
155
|
-
localVarQueryParameters['page'] = ObjectSerializer.serialize(params?.page, "number");
|
|
156
|
-
}
|
|
157
|
-
if (params?.limit !== undefined) {
|
|
158
|
-
localVarQueryParameters['limit'] = ObjectSerializer.serialize(params?.limit, "number");
|
|
159
|
-
}
|
|
160
|
-
if (params?.validatorIndices !== undefined) {
|
|
161
|
-
localVarQueryParameters['validator_indices'] = ObjectSerializer.serialize(params?.validatorIndices, "string");
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
168
|
-
|
|
169
|
-
let localVarUseFormData = false;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
174
|
-
method: 'GET',
|
|
175
|
-
qs: localVarQueryParameters,
|
|
176
|
-
headers: localVarHeaderParams,
|
|
177
|
-
uri: localVarPath,
|
|
178
|
-
useQuerystring: this._useQuerystring,
|
|
179
|
-
json: true,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
let authenticationPromise = Promise.resolve();
|
|
183
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
184
|
-
|
|
185
|
-
let interceptorPromise = authenticationPromise;
|
|
186
|
-
for (const interceptor of this.interceptors) {
|
|
187
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return interceptorPromise.then(() => {
|
|
191
|
-
if (Object.keys(localVarFormParams).length) {
|
|
192
|
-
if (localVarUseFormData) {
|
|
193
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
194
|
-
} else {
|
|
195
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return new Promise<{ body: GetWithdrawalsResponse, status: number }>((resolve, reject) => {
|
|
199
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
200
|
-
if (error) {
|
|
201
|
-
console.error('API call error:', error);
|
|
202
|
-
reject(error);
|
|
203
|
-
} else {
|
|
204
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
205
|
-
body = ObjectSerializer.deserialize(body, "GetWithdrawalsResponse");
|
|
206
|
-
resolve({ body: body, status: response.statusCode });
|
|
207
|
-
} else {
|
|
208
|
-
console.error('API response error:', response.statusCode);
|
|
209
|
-
resolve({ body: body, status: response.statusCode });
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
} )
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
*
|
|
218
|
-
* @summary Get all validators associated with the managed user
|
|
219
|
-
* @param userId
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
public async getValidatorsForUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: Array<ValidatorInfo>, status: number }> {
|
|
227
|
-
|
|
228
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/validators'
|
|
229
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
230
|
-
|
|
231
|
-
let localVarQueryParameters: any = {};
|
|
232
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
233
|
-
const produces = ['application/json'];
|
|
234
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
235
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
236
|
-
} else {
|
|
237
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
238
|
-
}
|
|
239
|
-
let localVarFormParams: any = {};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
243
|
-
if (userId === null || userId === undefined) {
|
|
244
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getValidatorsForUser.');
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
254
|
-
|
|
255
|
-
let localVarUseFormData = false;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
260
|
-
method: 'GET',
|
|
261
|
-
qs: localVarQueryParameters,
|
|
262
|
-
headers: localVarHeaderParams,
|
|
263
|
-
uri: localVarPath,
|
|
264
|
-
useQuerystring: this._useQuerystring,
|
|
265
|
-
json: true,
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
let authenticationPromise = Promise.resolve();
|
|
269
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
270
|
-
|
|
271
|
-
let interceptorPromise = authenticationPromise;
|
|
272
|
-
for (const interceptor of this.interceptors) {
|
|
273
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return interceptorPromise.then(() => {
|
|
277
|
-
if (Object.keys(localVarFormParams).length) {
|
|
278
|
-
if (localVarUseFormData) {
|
|
279
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
280
|
-
} else {
|
|
281
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return new Promise<{ body: Array<ValidatorInfo>, status: number }>((resolve, reject) => {
|
|
285
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
286
|
-
if (error) {
|
|
287
|
-
console.error('API call error:', error);
|
|
288
|
-
reject(error);
|
|
289
|
-
} else {
|
|
290
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
291
|
-
body = ObjectSerializer.deserialize(body, "Array<ValidatorInfo>");
|
|
292
|
-
resolve({ body: body, status: response.statusCode });
|
|
293
|
-
} else {
|
|
294
|
-
console.error('API response error:', response.statusCode);
|
|
295
|
-
resolve({ body: body, status: response.statusCode });
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
} )
|
|
301
|
-
}
|
|
302
|
-
}
|