@northstake/northstakeapi 1.0.23 → 1.0.25
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 +3 -37
- package/api/{managedUsersLinkedWalletsApi.ts → accountApiKeysApi.ts} +32 -55
- package/api/apis.ts +3 -23
- package/api.ts +6 -70
- package/dist/api/{depositAddressesApi.d.ts → accountApiKeysApi.d.ts} +25 -12
- package/dist/api/{managedUsersLinkedWalletsApi.js → accountApiKeysApi.js} +32 -56
- package/dist/api/apis.d.ts +3 -23
- package/dist/api/apis.js +3 -23
- package/dist/api.d.ts +4 -48
- package/dist/api.js +5 -59
- package/dist/model/apiKey.d.ts +54 -0
- package/dist/model/apiKey.js +53 -0
- package/dist/model/{transactionsforUser.d.ts → generateApiKeyRequest.d.ts} +14 -9
- package/dist/model/generateApiKeyRequest.js +43 -0
- package/dist/model/models.d.ts +2 -26
- package/dist/model/models.js +8 -70
- package/dist/model/validatorWithdrawal.d.ts +1 -0
- package/dist/model/validatorWithdrawal.js +5 -0
- package/dist/model/webhookPayloadData.d.ts +2 -10
- package/dist/model/webhookPayloadData.js +2 -12
- package/model/apiKey.ts +88 -0
- package/model/generateApiKeyRequest.ts +66 -0
- package/model/models.ts +9 -124
- package/model/validatorWithdrawal.ts +6 -0
- package/model/webhookPayloadData.ts +4 -23
- package/package.json +2 -2
- package/api/depositAddressesApi.ts +0 -267
- package/api/managedUsersApi.ts +0 -448
- package/api/managedUsersDepositAddressesApi.ts +0 -186
- 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.js +0 -207
- package/dist/api/managedUsersApi.d.ts +0 -94
- package/dist/api/managedUsersApi.js +0 -348
- 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/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/allManagedUsersResponse.d.ts +0 -38
- package/dist/model/allManagedUsersResponse.js +0 -43
- 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/getTransactionsResponse.d.ts +0 -38
- package/dist/model/getTransactionsResponse.js +0 -43
- package/dist/model/managedUser.d.ts +0 -29
- 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.d.ts +0 -32
- 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/transaction.d.ts +0 -49
- package/dist/model/transaction.js +0 -56
- package/dist/model/transactionEventType.d.ts +0 -15
- package/dist/model/transactionEventType.js +0 -13
- package/dist/model/transactionsforUser.js +0 -43
- 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/allManagedUsersResponse.ts +0 -59
- package/model/createManagedUserRequest.ts +0 -31
- package/model/depositAddress.ts +0 -46
- package/model/depositAddressesForUserResponse.ts +0 -38
- package/model/getTransactionsResponse.ts +0 -59
- 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/transaction.ts +0 -80
- package/model/transactionEventType.ts +0 -23
- package/model/transactionsforUser.ts +0 -59
- 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
package/api/managedUsersApi.ts
DELETED
|
@@ -1,448 +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 { AllManagedUsersResponse } from '../model/allManagedUsersResponse';
|
|
19
|
-
import { CreateManagedUserRequest } from '../model/createManagedUserRequest';
|
|
20
|
-
import { ErrorResponse } from '../model/errorResponse';
|
|
21
|
-
import { ManagedUser } from '../model/managedUser';
|
|
22
|
-
import { ManagedUserDetails } from '../model/managedUserDetails';
|
|
23
|
-
|
|
24
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
25
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, JWTAuth } from '../model/models';
|
|
26
|
-
|
|
27
|
-
import { HttpError, RequestFile } from './apis';
|
|
28
|
-
|
|
29
|
-
let defaultBasePath = 'https://api.northstake.dk/v1';
|
|
30
|
-
|
|
31
|
-
// ===============================================
|
|
32
|
-
// This file is autogenerated - Please do not edit
|
|
33
|
-
// ===============================================
|
|
34
|
-
|
|
35
|
-
export enum ManagedUsersApiApiKeys {
|
|
36
|
-
ApiKeyAuth,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export class ManagedUsersApi {
|
|
42
|
-
protected _basePath = defaultBasePath;
|
|
43
|
-
protected _defaultHeaders : any = {};
|
|
44
|
-
protected _useQuerystring : boolean = false;
|
|
45
|
-
|
|
46
|
-
protected authentications = {
|
|
47
|
-
'default': <Authentication>new JWTAuth('your_api_key', 'your_private_key'),
|
|
48
|
-
'bearerTokenAuth': new HttpBearerAuth(),
|
|
49
|
-
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
protected interceptors: Interceptor[] = [];
|
|
53
|
-
|
|
54
|
-
constructor(basePath?: string);
|
|
55
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
56
|
-
if (password) {
|
|
57
|
-
if (basePath) {
|
|
58
|
-
this.basePath = basePath;
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
if (basePathOrUsername) {
|
|
62
|
-
this.basePath = basePathOrUsername
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
set useQuerystring(value: boolean) {
|
|
68
|
-
this._useQuerystring = value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
set basePath(basePath: string) {
|
|
72
|
-
this._basePath = basePath;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
76
|
-
this._defaultHeaders = defaultHeaders;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
get defaultHeaders() {
|
|
80
|
-
return this._defaultHeaders;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
get basePath() {
|
|
84
|
-
return this._basePath;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
88
|
-
this.authentications.default = auth;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public setApiKey(key: ManagedUsersApiApiKeys, value: string) {
|
|
92
|
-
(this.authentications as any)[ManagedUsersApiApiKeys[key]].apiKey = value;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
set accessToken(accessToken: string | (() => string)) {
|
|
96
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
100
|
-
this.interceptors.push(interceptor);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Create a new Northstake user managed by the account
|
|
105
|
-
* @summary Create a managed user
|
|
106
|
-
* @param createManagedUserRequest
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
public async createUser (createManagedUserRequest: CreateManagedUserRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: ManagedUser, status: number }> {
|
|
114
|
-
|
|
115
|
-
const localVarPath = this.basePath + '/managedUsers';
|
|
116
|
-
|
|
117
|
-
let localVarQueryParameters: any = {};
|
|
118
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
119
|
-
const produces = ['application/json'];
|
|
120
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
121
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
122
|
-
} else {
|
|
123
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
124
|
-
}
|
|
125
|
-
let localVarFormParams: any = {};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// Verify required parameter 'createManagedUserRequest' is not null or undefined
|
|
129
|
-
if (createManagedUserRequest === null || createManagedUserRequest === undefined) {
|
|
130
|
-
throw new Error('Required parameter "createManagedUserRequest" was null or undefined when calling createUser.');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
140
|
-
|
|
141
|
-
let localVarUseFormData = false;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
146
|
-
method: 'POST',
|
|
147
|
-
qs: localVarQueryParameters,
|
|
148
|
-
headers: localVarHeaderParams,
|
|
149
|
-
uri: localVarPath,
|
|
150
|
-
useQuerystring: this._useQuerystring,
|
|
151
|
-
json: true,
|
|
152
|
-
body: ObjectSerializer.serialize(createManagedUserRequest, "CreateManagedUserRequest")
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
let authenticationPromise = Promise.resolve();
|
|
156
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
157
|
-
|
|
158
|
-
let interceptorPromise = authenticationPromise;
|
|
159
|
-
for (const interceptor of this.interceptors) {
|
|
160
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return interceptorPromise.then(() => {
|
|
164
|
-
if (Object.keys(localVarFormParams).length) {
|
|
165
|
-
if (localVarUseFormData) {
|
|
166
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
167
|
-
} else {
|
|
168
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return new Promise<{ body: ManagedUser, status: number }>((resolve, reject) => {
|
|
172
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
173
|
-
if (error) {
|
|
174
|
-
console.error('API call error:', error);
|
|
175
|
-
reject(error);
|
|
176
|
-
} else {
|
|
177
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
178
|
-
body = ObjectSerializer.deserialize(body, "ManagedUser");
|
|
179
|
-
resolve({ body: body, status: response.statusCode });
|
|
180
|
-
} else {
|
|
181
|
-
console.error('API response error:', response.statusCode);
|
|
182
|
-
resolve({ body: body, status: response.statusCode });
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
} )
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
*
|
|
191
|
-
* @summary Delete a managed user
|
|
192
|
-
* @param userId
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
public async deleteUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: any, status: number }> {
|
|
200
|
-
|
|
201
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}'
|
|
202
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
203
|
-
|
|
204
|
-
let localVarQueryParameters: any = {};
|
|
205
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
206
|
-
const produces = ['application/json'];
|
|
207
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
208
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
209
|
-
} else {
|
|
210
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
211
|
-
}
|
|
212
|
-
let localVarFormParams: any = {};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
216
|
-
if (userId === null || userId === undefined) {
|
|
217
|
-
throw new Error('Required parameter "userId" was null or undefined when calling deleteUser.');
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
227
|
-
|
|
228
|
-
let localVarUseFormData = false;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
233
|
-
method: 'DELETE',
|
|
234
|
-
qs: localVarQueryParameters,
|
|
235
|
-
headers: localVarHeaderParams,
|
|
236
|
-
uri: localVarPath,
|
|
237
|
-
useQuerystring: this._useQuerystring,
|
|
238
|
-
json: true,
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
let authenticationPromise = Promise.resolve();
|
|
242
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
243
|
-
|
|
244
|
-
let interceptorPromise = authenticationPromise;
|
|
245
|
-
for (const interceptor of this.interceptors) {
|
|
246
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return interceptorPromise.then(() => {
|
|
250
|
-
if (Object.keys(localVarFormParams).length) {
|
|
251
|
-
if (localVarUseFormData) {
|
|
252
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
253
|
-
} else {
|
|
254
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return new Promise<{ body: any, status: number }>((resolve, reject) => {
|
|
258
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
259
|
-
if (error) {
|
|
260
|
-
console.error('API call error:', error);
|
|
261
|
-
reject(error);
|
|
262
|
-
} else {
|
|
263
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
264
|
-
resolve({ body: body, status: response.statusCode });
|
|
265
|
-
} else {
|
|
266
|
-
console.error('API response error:', response.statusCode);
|
|
267
|
-
resolve({ body: body, status: response.statusCode });
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
} )
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
*
|
|
276
|
-
* @summary Get information for a specific user managed by the account
|
|
277
|
-
* @param userId
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
public async getUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: ManagedUserDetails, status: number }> {
|
|
285
|
-
|
|
286
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}'
|
|
287
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
288
|
-
|
|
289
|
-
let localVarQueryParameters: any = {};
|
|
290
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
291
|
-
const produces = ['application/json'];
|
|
292
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
293
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
294
|
-
} else {
|
|
295
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
296
|
-
}
|
|
297
|
-
let localVarFormParams: any = {};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
301
|
-
if (userId === null || userId === undefined) {
|
|
302
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getUser.');
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
312
|
-
|
|
313
|
-
let localVarUseFormData = false;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
318
|
-
method: 'GET',
|
|
319
|
-
qs: localVarQueryParameters,
|
|
320
|
-
headers: localVarHeaderParams,
|
|
321
|
-
uri: localVarPath,
|
|
322
|
-
useQuerystring: this._useQuerystring,
|
|
323
|
-
json: true,
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
let authenticationPromise = Promise.resolve();
|
|
327
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
328
|
-
|
|
329
|
-
let interceptorPromise = authenticationPromise;
|
|
330
|
-
for (const interceptor of this.interceptors) {
|
|
331
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return interceptorPromise.then(() => {
|
|
335
|
-
if (Object.keys(localVarFormParams).length) {
|
|
336
|
-
if (localVarUseFormData) {
|
|
337
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
338
|
-
} else {
|
|
339
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
return new Promise<{ body: ManagedUserDetails, status: number }>((resolve, reject) => {
|
|
343
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
344
|
-
if (error) {
|
|
345
|
-
console.error('API call error:', error);
|
|
346
|
-
reject(error);
|
|
347
|
-
} else {
|
|
348
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
349
|
-
body = ObjectSerializer.deserialize(body, "ManagedUserDetails");
|
|
350
|
-
resolve({ body: body, status: response.statusCode });
|
|
351
|
-
} else {
|
|
352
|
-
console.error('API response error:', response.statusCode);
|
|
353
|
-
resolve({ body: body, status: response.statusCode });
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
} )
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
*
|
|
362
|
-
* @summary Get all users managed by the account
|
|
363
|
-
* @param page Page number of the managed users list
|
|
364
|
-
* @param limit Number of managed users to return per page
|
|
365
|
-
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
public async getUsers (page?: number, limit?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: AllManagedUsersResponse, status: number }> {
|
|
372
|
-
|
|
373
|
-
const localVarPath = this.basePath + '/managedUsers';
|
|
374
|
-
|
|
375
|
-
let localVarQueryParameters: any = {};
|
|
376
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
377
|
-
const produces = ['application/json'];
|
|
378
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
379
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
380
|
-
} else {
|
|
381
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
382
|
-
}
|
|
383
|
-
let localVarFormParams: any = {};
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (page !== undefined) {
|
|
390
|
-
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
391
|
-
}
|
|
392
|
-
if (limit !== undefined) {
|
|
393
|
-
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
400
|
-
|
|
401
|
-
let localVarUseFormData = false;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
406
|
-
method: 'GET',
|
|
407
|
-
qs: localVarQueryParameters,
|
|
408
|
-
headers: localVarHeaderParams,
|
|
409
|
-
uri: localVarPath,
|
|
410
|
-
useQuerystring: this._useQuerystring,
|
|
411
|
-
json: true,
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
let authenticationPromise = Promise.resolve();
|
|
415
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
416
|
-
|
|
417
|
-
let interceptorPromise = authenticationPromise;
|
|
418
|
-
for (const interceptor of this.interceptors) {
|
|
419
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
return interceptorPromise.then(() => {
|
|
423
|
-
if (Object.keys(localVarFormParams).length) {
|
|
424
|
-
if (localVarUseFormData) {
|
|
425
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
426
|
-
} else {
|
|
427
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return new Promise<{ body: AllManagedUsersResponse, status: number }>((resolve, reject) => {
|
|
431
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
432
|
-
if (error) {
|
|
433
|
-
console.error('API call error:', error);
|
|
434
|
-
reject(error);
|
|
435
|
-
} else {
|
|
436
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
437
|
-
body = ObjectSerializer.deserialize(body, "AllManagedUsersResponse");
|
|
438
|
-
resolve({ body: body, status: response.statusCode });
|
|
439
|
-
} else {
|
|
440
|
-
console.error('API response error:', response.statusCode);
|
|
441
|
-
resolve({ body: body, status: response.statusCode });
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
} )
|
|
447
|
-
}
|
|
448
|
-
}
|
|
@@ -1,186 +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 { DepositAddressesForUserResponse } from '../model/depositAddressesForUserResponse';
|
|
19
|
-
import { ErrorResponse } from '../model/errorResponse';
|
|
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 = 'https://api.northstake.dk/v1';
|
|
27
|
-
|
|
28
|
-
// ===============================================
|
|
29
|
-
// This file is autogenerated - Please do not edit
|
|
30
|
-
// ===============================================
|
|
31
|
-
|
|
32
|
-
export enum ManagedUsersDepositAddressesApiApiKeys {
|
|
33
|
-
ApiKeyAuth,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export class ManagedUsersDepositAddressesApi {
|
|
39
|
-
protected _basePath = defaultBasePath;
|
|
40
|
-
protected _defaultHeaders : any = {};
|
|
41
|
-
protected _useQuerystring : boolean = false;
|
|
42
|
-
|
|
43
|
-
protected authentications = {
|
|
44
|
-
'default': <Authentication>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: Authentication) {
|
|
85
|
-
this.authentications.default = auth;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public setApiKey(key: ManagedUsersDepositAddressesApiApiKeys, value: string) {
|
|
89
|
-
(this.authentications as any)[ManagedUsersDepositAddressesApiApiKeys[key]].apiKey = value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
set accessToken(accessToken: string | (() => string)) {
|
|
93
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
97
|
-
this.interceptors.push(interceptor);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
* @summary Get deposit addresses for a managed user
|
|
103
|
-
* @param userId The unique identifier of the managed user
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
public async getDepositAddressesForUser (userId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: DepositAddressesForUserResponse, status: number }> {
|
|
111
|
-
|
|
112
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/depositAddresses'
|
|
113
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
114
|
-
|
|
115
|
-
let localVarQueryParameters: any = {};
|
|
116
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
117
|
-
const produces = ['application/json'];
|
|
118
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
119
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
120
|
-
} else {
|
|
121
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
122
|
-
}
|
|
123
|
-
let localVarFormParams: any = {};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
127
|
-
if (userId === null || userId === undefined) {
|
|
128
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getDepositAddressesForUser.');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
138
|
-
|
|
139
|
-
let localVarUseFormData = false;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
144
|
-
method: 'GET',
|
|
145
|
-
qs: localVarQueryParameters,
|
|
146
|
-
headers: localVarHeaderParams,
|
|
147
|
-
uri: localVarPath,
|
|
148
|
-
useQuerystring: this._useQuerystring,
|
|
149
|
-
json: true,
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
let authenticationPromise = Promise.resolve();
|
|
153
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
154
|
-
|
|
155
|
-
let interceptorPromise = authenticationPromise;
|
|
156
|
-
for (const interceptor of this.interceptors) {
|
|
157
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return interceptorPromise.then(() => {
|
|
161
|
-
if (Object.keys(localVarFormParams).length) {
|
|
162
|
-
if (localVarUseFormData) {
|
|
163
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
164
|
-
} else {
|
|
165
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return new Promise<{ body: DepositAddressesForUserResponse, status: number }>((resolve, reject) => {
|
|
169
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
170
|
-
if (error) {
|
|
171
|
-
console.error('API call error:', error);
|
|
172
|
-
reject(error);
|
|
173
|
-
} else {
|
|
174
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
175
|
-
body = ObjectSerializer.deserialize(body, "DepositAddressesForUserResponse");
|
|
176
|
-
resolve({ body: body, status: response.statusCode });
|
|
177
|
-
} else {
|
|
178
|
-
console.error('API response error:', response.statusCode);
|
|
179
|
-
resolve({ body: body, status: response.statusCode });
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
} )
|
|
185
|
-
}
|
|
186
|
-
}
|