@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,267 +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 { DepositAddress } from '../model/depositAddress';
|
|
20
|
-
import { ErrorResponse } from '../model/errorResponse';
|
|
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 DepositAddressesApiApiKeys {
|
|
34
|
-
ApiKeyAuth,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export class DepositAddressesApi {
|
|
40
|
-
protected _basePath = defaultBasePath;
|
|
41
|
-
protected _defaultHeaders : any = {};
|
|
42
|
-
protected _useQuerystring : boolean = false;
|
|
43
|
-
|
|
44
|
-
protected authentications = {
|
|
45
|
-
'default': <Authentication>new JWTAuth('your_api_key', 'your_private_key'),
|
|
46
|
-
'bearerTokenAuth': new HttpBearerAuth(),
|
|
47
|
-
'ApiKeyAuth': new ApiKeyAuth('header', 'x-api-key'),
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
protected interceptors: Interceptor[] = [];
|
|
51
|
-
|
|
52
|
-
constructor(basePath?: string);
|
|
53
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
54
|
-
if (password) {
|
|
55
|
-
if (basePath) {
|
|
56
|
-
this.basePath = basePath;
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
if (basePathOrUsername) {
|
|
60
|
-
this.basePath = basePathOrUsername
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
set useQuerystring(value: boolean) {
|
|
66
|
-
this._useQuerystring = value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
set basePath(basePath: string) {
|
|
70
|
-
this._basePath = basePath;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
74
|
-
this._defaultHeaders = defaultHeaders;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get defaultHeaders() {
|
|
78
|
-
return this._defaultHeaders;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
get basePath() {
|
|
82
|
-
return this._basePath;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
86
|
-
this.authentications.default = auth;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public setApiKey(key: DepositAddressesApiApiKeys, value: string) {
|
|
90
|
-
(this.authentications as any)[DepositAddressesApiApiKeys[key]].apiKey = value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
set accessToken(accessToken: string | (() => string)) {
|
|
94
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
98
|
-
this.interceptors.push(interceptor);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @summary Get deposit address by asset
|
|
104
|
-
* @param asset Asset to fetch the deposit address for
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
public async getDepositAddressByAsset (asset: Asset, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: DepositAddress, status: number }> {
|
|
112
|
-
|
|
113
|
-
const localVarPath = this.basePath + '/depositAddresses/{asset}'
|
|
114
|
-
.replace('{' + 'asset' + '}', encodeURIComponent(String(asset)));
|
|
115
|
-
|
|
116
|
-
let localVarQueryParameters: any = {};
|
|
117
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
118
|
-
const produces = ['application/json'];
|
|
119
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
120
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
121
|
-
} else {
|
|
122
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
123
|
-
}
|
|
124
|
-
let localVarFormParams: any = {};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// Verify required parameter 'asset' is not null or undefined
|
|
128
|
-
if (asset === null || asset === undefined) {
|
|
129
|
-
throw new Error('Required parameter "asset" was null or undefined when calling getDepositAddressByAsset.');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
139
|
-
|
|
140
|
-
let localVarUseFormData = false;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
145
|
-
method: 'GET',
|
|
146
|
-
qs: localVarQueryParameters,
|
|
147
|
-
headers: localVarHeaderParams,
|
|
148
|
-
uri: localVarPath,
|
|
149
|
-
useQuerystring: this._useQuerystring,
|
|
150
|
-
json: true,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
let authenticationPromise = Promise.resolve();
|
|
154
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
155
|
-
|
|
156
|
-
let interceptorPromise = authenticationPromise;
|
|
157
|
-
for (const interceptor of this.interceptors) {
|
|
158
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return interceptorPromise.then(() => {
|
|
162
|
-
if (Object.keys(localVarFormParams).length) {
|
|
163
|
-
if (localVarUseFormData) {
|
|
164
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
165
|
-
} else {
|
|
166
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return new Promise<{ body: DepositAddress, status: number }>((resolve, reject) => {
|
|
170
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
171
|
-
if (error) {
|
|
172
|
-
console.error('API call error:', error);
|
|
173
|
-
reject(error);
|
|
174
|
-
} else {
|
|
175
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
176
|
-
body = ObjectSerializer.deserialize(body, "DepositAddress");
|
|
177
|
-
resolve({ body: body, status: response.statusCode });
|
|
178
|
-
} else {
|
|
179
|
-
console.error('API response error:', response.statusCode);
|
|
180
|
-
resolve({ body: body, status: response.statusCode });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
} )
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
*
|
|
189
|
-
* @summary List deposit addresses assigned to the account
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
public async listDepositAddresses (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ body: Array<DepositAddress>, status: number }> {
|
|
197
|
-
|
|
198
|
-
const localVarPath = this.basePath + '/depositAddresses';
|
|
199
|
-
|
|
200
|
-
let localVarQueryParameters: any = {};
|
|
201
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
202
|
-
const produces = ['application/json'];
|
|
203
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
204
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
205
|
-
} else {
|
|
206
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
207
|
-
}
|
|
208
|
-
let localVarFormParams: any = {};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
219
|
-
|
|
220
|
-
let localVarUseFormData = false;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
225
|
-
method: 'GET',
|
|
226
|
-
qs: localVarQueryParameters,
|
|
227
|
-
headers: localVarHeaderParams,
|
|
228
|
-
uri: localVarPath,
|
|
229
|
-
useQuerystring: this._useQuerystring,
|
|
230
|
-
json: true,
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
let authenticationPromise = Promise.resolve();
|
|
234
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
235
|
-
|
|
236
|
-
let interceptorPromise = authenticationPromise;
|
|
237
|
-
for (const interceptor of this.interceptors) {
|
|
238
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return interceptorPromise.then(() => {
|
|
242
|
-
if (Object.keys(localVarFormParams).length) {
|
|
243
|
-
if (localVarUseFormData) {
|
|
244
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
245
|
-
} else {
|
|
246
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return new Promise<{ body: Array<DepositAddress>, status: number }>((resolve, reject) => {
|
|
250
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
251
|
-
if (error) {
|
|
252
|
-
console.error('API call error:', error);
|
|
253
|
-
reject(error);
|
|
254
|
-
} else {
|
|
255
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
256
|
-
body = ObjectSerializer.deserialize(body, "Array<DepositAddress>");
|
|
257
|
-
resolve({ body: body, status: response.statusCode });
|
|
258
|
-
} else {
|
|
259
|
-
console.error('API response error:', response.statusCode);
|
|
260
|
-
resolve({ body: body, status: response.statusCode });
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
} )
|
|
266
|
-
}
|
|
267
|
-
}
|
|
@@ -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
|
-
}
|