@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,364 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Northstake
|
|
4
|
-
* Northstake api
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ManagedUsersOrdersApi = exports.ManagedUsersOrdersApiApiKeys = void 0;
|
|
18
|
-
const request_1 = __importDefault(require("request"));
|
|
19
|
-
const models_1 = require("../model/models");
|
|
20
|
-
const models_2 = require("../model/models");
|
|
21
|
-
let defaultBasePath = 'https://api.northstake.dk/v1';
|
|
22
|
-
// ===============================================
|
|
23
|
-
// This file is autogenerated - Please do not edit
|
|
24
|
-
// ===============================================
|
|
25
|
-
var ManagedUsersOrdersApiApiKeys;
|
|
26
|
-
(function (ManagedUsersOrdersApiApiKeys) {
|
|
27
|
-
ManagedUsersOrdersApiApiKeys[ManagedUsersOrdersApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
|
|
28
|
-
})(ManagedUsersOrdersApiApiKeys || (exports.ManagedUsersOrdersApiApiKeys = ManagedUsersOrdersApiApiKeys = {}));
|
|
29
|
-
class ManagedUsersOrdersApi {
|
|
30
|
-
constructor(basePathOrUsername, password, basePath) {
|
|
31
|
-
this._basePath = defaultBasePath;
|
|
32
|
-
this._defaultHeaders = {};
|
|
33
|
-
this._useQuerystring = false;
|
|
34
|
-
this.authentications = {
|
|
35
|
-
'default': new models_2.JWTAuth('your_api_key', 'your_private_key'),
|
|
36
|
-
'bearerTokenAuth': new models_2.HttpBearerAuth(),
|
|
37
|
-
'ApiKeyAuth': new models_2.ApiKeyAuth('header', 'x-api-key'),
|
|
38
|
-
};
|
|
39
|
-
this.interceptors = [];
|
|
40
|
-
if (password) {
|
|
41
|
-
if (basePath) {
|
|
42
|
-
this.basePath = basePath;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
if (basePathOrUsername) {
|
|
47
|
-
this.basePath = basePathOrUsername;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
set useQuerystring(value) {
|
|
52
|
-
this._useQuerystring = value;
|
|
53
|
-
}
|
|
54
|
-
set basePath(basePath) {
|
|
55
|
-
this._basePath = basePath;
|
|
56
|
-
}
|
|
57
|
-
set defaultHeaders(defaultHeaders) {
|
|
58
|
-
this._defaultHeaders = defaultHeaders;
|
|
59
|
-
}
|
|
60
|
-
get defaultHeaders() {
|
|
61
|
-
return this._defaultHeaders;
|
|
62
|
-
}
|
|
63
|
-
get basePath() {
|
|
64
|
-
return this._basePath;
|
|
65
|
-
}
|
|
66
|
-
setDefaultAuthentication(auth) {
|
|
67
|
-
this.authentications.default = auth;
|
|
68
|
-
}
|
|
69
|
-
setApiKey(key, value) {
|
|
70
|
-
this.authentications[ManagedUsersOrdersApiApiKeys[key]].apiKey = value;
|
|
71
|
-
}
|
|
72
|
-
set accessToken(accessToken) {
|
|
73
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
74
|
-
}
|
|
75
|
-
addInterceptor(interceptor) {
|
|
76
|
-
this.interceptors.push(interceptor);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @summary Cancel a submitted order by ID for a particular managed user
|
|
81
|
-
* @param userId
|
|
82
|
-
* @param orderId
|
|
83
|
-
*/
|
|
84
|
-
async cancelOrderForUser(userId, orderId, options = { headers: {} }) {
|
|
85
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/orders/{orderId}'
|
|
86
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
|
|
87
|
-
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
|
88
|
-
let localVarQueryParameters = {};
|
|
89
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
90
|
-
const produces = ['application/json'];
|
|
91
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
92
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
96
|
-
}
|
|
97
|
-
let localVarFormParams = {};
|
|
98
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
99
|
-
if (userId === null || userId === undefined) {
|
|
100
|
-
throw new Error('Required parameter "userId" was null or undefined when calling cancelOrderForUser.');
|
|
101
|
-
}
|
|
102
|
-
// Verify required parameter 'orderId' is not null or undefined
|
|
103
|
-
if (orderId === null || orderId === undefined) {
|
|
104
|
-
throw new Error('Required parameter "orderId" was null or undefined when calling cancelOrderForUser.');
|
|
105
|
-
}
|
|
106
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
107
|
-
let localVarUseFormData = false;
|
|
108
|
-
let localVarRequestOptions = {
|
|
109
|
-
method: 'DELETE',
|
|
110
|
-
qs: localVarQueryParameters,
|
|
111
|
-
headers: localVarHeaderParams,
|
|
112
|
-
uri: localVarPath,
|
|
113
|
-
useQuerystring: this._useQuerystring,
|
|
114
|
-
json: true,
|
|
115
|
-
};
|
|
116
|
-
let authenticationPromise = Promise.resolve();
|
|
117
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
118
|
-
let interceptorPromise = authenticationPromise;
|
|
119
|
-
for (const interceptor of this.interceptors) {
|
|
120
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
121
|
-
}
|
|
122
|
-
return interceptorPromise.then(() => {
|
|
123
|
-
if (Object.keys(localVarFormParams).length) {
|
|
124
|
-
if (localVarUseFormData) {
|
|
125
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return new Promise((resolve, reject) => {
|
|
132
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
133
|
-
if (error) {
|
|
134
|
-
console.error('API call error:', error);
|
|
135
|
-
reject(error);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
139
|
-
resolve({ body: body, status: response.statusCode });
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
console.error('API response error:', response.statusCode);
|
|
143
|
-
resolve({ body: body, status: response.statusCode });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* This endpoint allows the client to create a staking, unstaking, or withdrawal order on behalf of a managed user. One key feature of this endpoint is the ability to include an optional `validatorKey` field when creating a staking order. ### Including a Validator Key (Ethereum only) By including a `validatorKey` in the staking order, the client specifies a pre-generated and signed Ethereum validator key that should be used for the staking transaction. This key must meet all required security and operational standards, as it will be directly used for staking on the Ethereum blockchain. The `validatorKey` object includes cryptographic details such as the keystore information, public key, and the cryptographic path. Including this key is beneficial for users who prefer to maintain a level of control over their staking operations and ensure that their specific validators are utilized. ### Without a Validator Key If no `validatorKey` is provided, Northstake handles the staking operation internally. This process requires that the managed user\'s account must have sufficient balance in their deposit account to cover the staking transaction and any associated fees. In this case, Northstake will generate the necessary validator keys, handle the cryptographic operations, and ensure the validator is registered correctly on the blockchain. ### Usage Scenarios - **With Validator Key**: Ensures that a specific, pre-approved validator key is used, providing transparency and control to the user. - **Without Validator Key**: Ideal for users who prefer a hands-off approach, allowing Northstake to manage the technical and operational complexities of staking on their behalf. Clients are advised to ensure that all provided validator keys are secure and generated according to best security practices. Improper handling or exposure of validator keys can lead to significant security risks, including loss of staked assets.
|
|
152
|
-
* @summary Create an order on behalf of a managed user
|
|
153
|
-
* @param userId
|
|
154
|
-
* @param order
|
|
155
|
-
*/
|
|
156
|
-
async createOrderForUser(userId, order, options = { headers: {} }) {
|
|
157
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/orders'
|
|
158
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
159
|
-
let localVarQueryParameters = {};
|
|
160
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
161
|
-
const produces = ['application/json'];
|
|
162
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
163
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
167
|
-
}
|
|
168
|
-
let localVarFormParams = {};
|
|
169
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
170
|
-
if (userId === null || userId === undefined) {
|
|
171
|
-
throw new Error('Required parameter "userId" was null or undefined when calling createOrderForUser.');
|
|
172
|
-
}
|
|
173
|
-
// Verify required parameter 'order' is not null or undefined
|
|
174
|
-
if (order === null || order === undefined) {
|
|
175
|
-
throw new Error('Required parameter "order" was null or undefined when calling createOrderForUser.');
|
|
176
|
-
}
|
|
177
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
178
|
-
let localVarUseFormData = false;
|
|
179
|
-
let localVarRequestOptions = {
|
|
180
|
-
method: 'POST',
|
|
181
|
-
qs: localVarQueryParameters,
|
|
182
|
-
headers: localVarHeaderParams,
|
|
183
|
-
uri: localVarPath,
|
|
184
|
-
useQuerystring: this._useQuerystring,
|
|
185
|
-
json: true,
|
|
186
|
-
body: models_1.ObjectSerializer.serialize(order, "Order")
|
|
187
|
-
};
|
|
188
|
-
let authenticationPromise = Promise.resolve();
|
|
189
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
190
|
-
let interceptorPromise = authenticationPromise;
|
|
191
|
-
for (const interceptor of this.interceptors) {
|
|
192
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
193
|
-
}
|
|
194
|
-
return interceptorPromise.then(() => {
|
|
195
|
-
if (Object.keys(localVarFormParams).length) {
|
|
196
|
-
if (localVarUseFormData) {
|
|
197
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return new Promise((resolve, reject) => {
|
|
204
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
205
|
-
if (error) {
|
|
206
|
-
console.error('API call error:', error);
|
|
207
|
-
reject(error);
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
211
|
-
body = models_1.ObjectSerializer.deserialize(body, "OrderDocument");
|
|
212
|
-
resolve({ body: body, status: response.statusCode });
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
console.error('API response error:', response.statusCode);
|
|
216
|
-
resolve({ body: body, status: response.statusCode });
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
*
|
|
225
|
-
* @summary Get all orders for a particular managed user
|
|
226
|
-
* @param userId
|
|
227
|
-
*/
|
|
228
|
-
async getAllOrdersForUser(userId, options = { headers: {} }) {
|
|
229
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/orders'
|
|
230
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
231
|
-
let localVarQueryParameters = {};
|
|
232
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
233
|
-
const produces = ['application/json'];
|
|
234
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
235
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
239
|
-
}
|
|
240
|
-
let localVarFormParams = {};
|
|
241
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
242
|
-
if (userId === null || userId === undefined) {
|
|
243
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getAllOrdersForUser.');
|
|
244
|
-
}
|
|
245
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
246
|
-
let localVarUseFormData = false;
|
|
247
|
-
let localVarRequestOptions = {
|
|
248
|
-
method: 'GET',
|
|
249
|
-
qs: localVarQueryParameters,
|
|
250
|
-
headers: localVarHeaderParams,
|
|
251
|
-
uri: localVarPath,
|
|
252
|
-
useQuerystring: this._useQuerystring,
|
|
253
|
-
json: true,
|
|
254
|
-
};
|
|
255
|
-
let authenticationPromise = Promise.resolve();
|
|
256
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
257
|
-
let interceptorPromise = authenticationPromise;
|
|
258
|
-
for (const interceptor of this.interceptors) {
|
|
259
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
260
|
-
}
|
|
261
|
-
return interceptorPromise.then(() => {
|
|
262
|
-
if (Object.keys(localVarFormParams).length) {
|
|
263
|
-
if (localVarUseFormData) {
|
|
264
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return new Promise((resolve, reject) => {
|
|
271
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
272
|
-
if (error) {
|
|
273
|
-
console.error('API call error:', error);
|
|
274
|
-
reject(error);
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
278
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<OrderDocument>");
|
|
279
|
-
resolve({ body: body, status: response.statusCode });
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
console.error('API response error:', response.statusCode);
|
|
283
|
-
resolve({ body: body, status: response.statusCode });
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
292
|
-
* @summary Get details of an order by ID for a particular managed user
|
|
293
|
-
* @param userId
|
|
294
|
-
* @param orderId
|
|
295
|
-
*/
|
|
296
|
-
async getOrderDetailsForUser(userId, orderId, options = { headers: {} }) {
|
|
297
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/orders/{orderId}'
|
|
298
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
|
|
299
|
-
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
|
300
|
-
let localVarQueryParameters = {};
|
|
301
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
302
|
-
const produces = ['application/json'];
|
|
303
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
304
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
308
|
-
}
|
|
309
|
-
let localVarFormParams = {};
|
|
310
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
311
|
-
if (userId === null || userId === undefined) {
|
|
312
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getOrderDetailsForUser.');
|
|
313
|
-
}
|
|
314
|
-
// Verify required parameter 'orderId' is not null or undefined
|
|
315
|
-
if (orderId === null || orderId === undefined) {
|
|
316
|
-
throw new Error('Required parameter "orderId" was null or undefined when calling getOrderDetailsForUser.');
|
|
317
|
-
}
|
|
318
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
319
|
-
let localVarUseFormData = false;
|
|
320
|
-
let localVarRequestOptions = {
|
|
321
|
-
method: 'GET',
|
|
322
|
-
qs: localVarQueryParameters,
|
|
323
|
-
headers: localVarHeaderParams,
|
|
324
|
-
uri: localVarPath,
|
|
325
|
-
useQuerystring: this._useQuerystring,
|
|
326
|
-
json: true,
|
|
327
|
-
};
|
|
328
|
-
let authenticationPromise = Promise.resolve();
|
|
329
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
330
|
-
let interceptorPromise = authenticationPromise;
|
|
331
|
-
for (const interceptor of this.interceptors) {
|
|
332
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
333
|
-
}
|
|
334
|
-
return interceptorPromise.then(() => {
|
|
335
|
-
if (Object.keys(localVarFormParams).length) {
|
|
336
|
-
if (localVarUseFormData) {
|
|
337
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return new Promise((resolve, reject) => {
|
|
344
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
345
|
-
if (error) {
|
|
346
|
-
console.error('API call error:', error);
|
|
347
|
-
reject(error);
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
351
|
-
body = models_1.ObjectSerializer.deserialize(body, "OrderDocument");
|
|
352
|
-
resolve({ body: body, status: response.statusCode });
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
console.error('API response error:', response.statusCode);
|
|
356
|
-
resolve({ body: body, status: response.statusCode });
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
exports.ManagedUsersOrdersApi = ManagedUsersOrdersApi;
|
|
@@ -1,51 +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
|
-
import { PortfolioEntity } from '../model/portfolioEntity';
|
|
13
|
-
import { Authentication, Interceptor } from '../model/models';
|
|
14
|
-
import { HttpBearerAuth, ApiKeyAuth } from '../model/models';
|
|
15
|
-
export declare enum ManagedUsersPortfolioApiApiKeys {
|
|
16
|
-
ApiKeyAuth = 0
|
|
17
|
-
}
|
|
18
|
-
export declare class ManagedUsersPortfolioApi {
|
|
19
|
-
protected _basePath: string;
|
|
20
|
-
protected _defaultHeaders: any;
|
|
21
|
-
protected _useQuerystring: boolean;
|
|
22
|
-
protected authentications: {
|
|
23
|
-
default: Authentication;
|
|
24
|
-
bearerTokenAuth: HttpBearerAuth;
|
|
25
|
-
ApiKeyAuth: ApiKeyAuth;
|
|
26
|
-
};
|
|
27
|
-
protected interceptors: Interceptor[];
|
|
28
|
-
constructor(basePath?: string);
|
|
29
|
-
set useQuerystring(value: boolean);
|
|
30
|
-
set basePath(basePath: string);
|
|
31
|
-
set defaultHeaders(defaultHeaders: any);
|
|
32
|
-
get defaultHeaders(): any;
|
|
33
|
-
get basePath(): string;
|
|
34
|
-
setDefaultAuthentication(auth: Authentication): void;
|
|
35
|
-
setApiKey(key: ManagedUsersPortfolioApiApiKeys, value: string): void;
|
|
36
|
-
set accessToken(accessToken: string | (() => string));
|
|
37
|
-
addInterceptor(interceptor: Interceptor): void;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @summary Portfolio overview for a managed user
|
|
41
|
-
* @param userId
|
|
42
|
-
*/
|
|
43
|
-
getPortfolioForUser(userId: string, options?: {
|
|
44
|
-
headers: {
|
|
45
|
-
[name: string]: string;
|
|
46
|
-
};
|
|
47
|
-
}): Promise<{
|
|
48
|
-
body: Array<PortfolioEntity>;
|
|
49
|
-
status: number;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Northstake
|
|
4
|
-
* Northstake api
|
|
5
|
-
*
|
|
6
|
-
* The version of the OpenAPI document: 1.0
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
-
* https://openapi-generator.tech
|
|
11
|
-
* Do not edit the class manually.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ManagedUsersPortfolioApi = exports.ManagedUsersPortfolioApiApiKeys = void 0;
|
|
18
|
-
const request_1 = __importDefault(require("request"));
|
|
19
|
-
const models_1 = require("../model/models");
|
|
20
|
-
const models_2 = require("../model/models");
|
|
21
|
-
let defaultBasePath = 'https://api.northstake.dk/v1';
|
|
22
|
-
// ===============================================
|
|
23
|
-
// This file is autogenerated - Please do not edit
|
|
24
|
-
// ===============================================
|
|
25
|
-
var ManagedUsersPortfolioApiApiKeys;
|
|
26
|
-
(function (ManagedUsersPortfolioApiApiKeys) {
|
|
27
|
-
ManagedUsersPortfolioApiApiKeys[ManagedUsersPortfolioApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
|
|
28
|
-
})(ManagedUsersPortfolioApiApiKeys || (exports.ManagedUsersPortfolioApiApiKeys = ManagedUsersPortfolioApiApiKeys = {}));
|
|
29
|
-
class ManagedUsersPortfolioApi {
|
|
30
|
-
constructor(basePathOrUsername, password, basePath) {
|
|
31
|
-
this._basePath = defaultBasePath;
|
|
32
|
-
this._defaultHeaders = {};
|
|
33
|
-
this._useQuerystring = false;
|
|
34
|
-
this.authentications = {
|
|
35
|
-
'default': new models_2.JWTAuth('your_api_key', 'your_private_key'),
|
|
36
|
-
'bearerTokenAuth': new models_2.HttpBearerAuth(),
|
|
37
|
-
'ApiKeyAuth': new models_2.ApiKeyAuth('header', 'x-api-key'),
|
|
38
|
-
};
|
|
39
|
-
this.interceptors = [];
|
|
40
|
-
if (password) {
|
|
41
|
-
if (basePath) {
|
|
42
|
-
this.basePath = basePath;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
if (basePathOrUsername) {
|
|
47
|
-
this.basePath = basePathOrUsername;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
set useQuerystring(value) {
|
|
52
|
-
this._useQuerystring = value;
|
|
53
|
-
}
|
|
54
|
-
set basePath(basePath) {
|
|
55
|
-
this._basePath = basePath;
|
|
56
|
-
}
|
|
57
|
-
set defaultHeaders(defaultHeaders) {
|
|
58
|
-
this._defaultHeaders = defaultHeaders;
|
|
59
|
-
}
|
|
60
|
-
get defaultHeaders() {
|
|
61
|
-
return this._defaultHeaders;
|
|
62
|
-
}
|
|
63
|
-
get basePath() {
|
|
64
|
-
return this._basePath;
|
|
65
|
-
}
|
|
66
|
-
setDefaultAuthentication(auth) {
|
|
67
|
-
this.authentications.default = auth;
|
|
68
|
-
}
|
|
69
|
-
setApiKey(key, value) {
|
|
70
|
-
this.authentications[ManagedUsersPortfolioApiApiKeys[key]].apiKey = value;
|
|
71
|
-
}
|
|
72
|
-
set accessToken(accessToken) {
|
|
73
|
-
this.authentications.bearerTokenAuth.accessToken = accessToken;
|
|
74
|
-
}
|
|
75
|
-
addInterceptor(interceptor) {
|
|
76
|
-
this.interceptors.push(interceptor);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @summary Portfolio overview for a managed user
|
|
81
|
-
* @param userId
|
|
82
|
-
*/
|
|
83
|
-
async getPortfolioForUser(userId, options = { headers: {} }) {
|
|
84
|
-
const localVarPath = this.basePath + '/managedUsers/{userId}/portfolio'
|
|
85
|
-
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
|
|
86
|
-
let localVarQueryParameters = {};
|
|
87
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
88
|
-
const produces = ['application/json'];
|
|
89
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
90
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
94
|
-
}
|
|
95
|
-
let localVarFormParams = {};
|
|
96
|
-
// Verify required parameter 'userId' is not null or undefined
|
|
97
|
-
if (userId === null || userId === undefined) {
|
|
98
|
-
throw new Error('Required parameter "userId" was null or undefined when calling getPortfolioForUser.');
|
|
99
|
-
}
|
|
100
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
101
|
-
let localVarUseFormData = false;
|
|
102
|
-
let localVarRequestOptions = {
|
|
103
|
-
method: 'GET',
|
|
104
|
-
qs: localVarQueryParameters,
|
|
105
|
-
headers: localVarHeaderParams,
|
|
106
|
-
uri: localVarPath,
|
|
107
|
-
useQuerystring: this._useQuerystring,
|
|
108
|
-
json: true,
|
|
109
|
-
};
|
|
110
|
-
let authenticationPromise = Promise.resolve();
|
|
111
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
112
|
-
let interceptorPromise = authenticationPromise;
|
|
113
|
-
for (const interceptor of this.interceptors) {
|
|
114
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
115
|
-
}
|
|
116
|
-
return interceptorPromise.then(() => {
|
|
117
|
-
if (Object.keys(localVarFormParams).length) {
|
|
118
|
-
if (localVarUseFormData) {
|
|
119
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return new Promise((resolve, reject) => {
|
|
126
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
127
|
-
if (error) {
|
|
128
|
-
console.error('API call error:', error);
|
|
129
|
-
reject(error);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
133
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<PortfolioEntity>");
|
|
134
|
-
resolve({ body: body, status: response.statusCode });
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
console.error('API response error:', response.statusCode);
|
|
138
|
-
resolve({ body: body, status: response.statusCode });
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.ManagedUsersPortfolioApi = ManagedUsersPortfolioApi;
|
|
@@ -1,68 +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
|
-
import { Asset } from '../model/asset';
|
|
13
|
-
import { TransactionEventType } from '../model/transactionEventType';
|
|
14
|
-
import { TransactionsforUser } from '../model/transactionsforUser';
|
|
15
|
-
import { Authentication, Interceptor } from '../model/models';
|
|
16
|
-
import { HttpBearerAuth, ApiKeyAuth } from '../model/models';
|
|
17
|
-
export declare enum ManagedUsersTransactionsApiApiKeys {
|
|
18
|
-
ApiKeyAuth = 0
|
|
19
|
-
}
|
|
20
|
-
export interface ManagedUsersTransactionsApiParams {
|
|
21
|
-
userId: string;
|
|
22
|
-
startDate?: string;
|
|
23
|
-
endDate?: string;
|
|
24
|
-
type?: TransactionEventType;
|
|
25
|
-
asset?: Asset;
|
|
26
|
-
page?: number;
|
|
27
|
-
limit?: number;
|
|
28
|
-
}
|
|
29
|
-
export declare class ManagedUsersTransactionsApi {
|
|
30
|
-
protected _basePath: string;
|
|
31
|
-
protected _defaultHeaders: any;
|
|
32
|
-
protected _useQuerystring: boolean;
|
|
33
|
-
protected authentications: {
|
|
34
|
-
default: Authentication;
|
|
35
|
-
bearerTokenAuth: HttpBearerAuth;
|
|
36
|
-
ApiKeyAuth: ApiKeyAuth;
|
|
37
|
-
};
|
|
38
|
-
protected interceptors: Interceptor[];
|
|
39
|
-
constructor(basePath?: string);
|
|
40
|
-
set useQuerystring(value: boolean);
|
|
41
|
-
set basePath(basePath: string);
|
|
42
|
-
set defaultHeaders(defaultHeaders: any);
|
|
43
|
-
get defaultHeaders(): any;
|
|
44
|
-
get basePath(): string;
|
|
45
|
-
setDefaultAuthentication(auth: Authentication): void;
|
|
46
|
-
setApiKey(key: ManagedUsersTransactionsApiApiKeys, value: string): void;
|
|
47
|
-
set accessToken(accessToken: string | (() => string));
|
|
48
|
-
addInterceptor(interceptor: Interceptor): void;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @summary Get transactions for a managed user
|
|
52
|
-
* @param userId
|
|
53
|
-
* @param startDate Start date for filtering transaction statistics
|
|
54
|
-
* @param endDate End date for filtering transaction statistics
|
|
55
|
-
* @param type Type of transaction (e.g., deposit, withdrawal)
|
|
56
|
-
* @param asset Asset type (e.g., ETH, SOL)
|
|
57
|
-
* @param page Transaction list page number
|
|
58
|
-
* @param limit Number of transactions to return per page
|
|
59
|
-
*/
|
|
60
|
-
getTransactionsForUser(params: ManagedUsersTransactionsApiParams, options?: {
|
|
61
|
-
headers: {
|
|
62
|
-
[name: string]: string;
|
|
63
|
-
};
|
|
64
|
-
}): Promise<{
|
|
65
|
-
body: TransactionsforUser;
|
|
66
|
-
status: number;
|
|
67
|
-
}>;
|
|
68
|
-
}
|