@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/dist/api/ordersApi.js
DELETED
|
@@ -1,333 +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.OrdersApi = exports.OrdersApiApiKeys = 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 OrdersApiApiKeys;
|
|
26
|
-
(function (OrdersApiApiKeys) {
|
|
27
|
-
OrdersApiApiKeys[OrdersApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
|
|
28
|
-
})(OrdersApiApiKeys || (exports.OrdersApiApiKeys = OrdersApiApiKeys = {}));
|
|
29
|
-
class OrdersApi {
|
|
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[OrdersApiApiKeys[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
|
|
81
|
-
* @param orderId Unique identifier for the order
|
|
82
|
-
*/
|
|
83
|
-
async cancelOrderById(orderId, options = { headers: {} }) {
|
|
84
|
-
const localVarPath = this.basePath + '/orders/{orderId}'
|
|
85
|
-
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
|
86
|
-
let localVarQueryParameters = {};
|
|
87
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
88
|
-
let localVarFormParams = {};
|
|
89
|
-
// Verify required parameter 'orderId' is not null or undefined
|
|
90
|
-
if (orderId === null || orderId === undefined) {
|
|
91
|
-
throw new Error('Required parameter "orderId" was null or undefined when calling cancelOrderById.');
|
|
92
|
-
}
|
|
93
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
94
|
-
let localVarUseFormData = false;
|
|
95
|
-
let localVarRequestOptions = {
|
|
96
|
-
method: 'DELETE',
|
|
97
|
-
qs: localVarQueryParameters,
|
|
98
|
-
headers: localVarHeaderParams,
|
|
99
|
-
uri: localVarPath,
|
|
100
|
-
useQuerystring: this._useQuerystring,
|
|
101
|
-
json: true,
|
|
102
|
-
};
|
|
103
|
-
let authenticationPromise = Promise.resolve();
|
|
104
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
105
|
-
let interceptorPromise = authenticationPromise;
|
|
106
|
-
for (const interceptor of this.interceptors) {
|
|
107
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
108
|
-
}
|
|
109
|
-
return interceptorPromise.then(() => {
|
|
110
|
-
if (Object.keys(localVarFormParams).length) {
|
|
111
|
-
if (localVarUseFormData) {
|
|
112
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return new Promise((resolve, reject) => {
|
|
119
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
120
|
-
if (error) {
|
|
121
|
-
console.error('API call error:', error);
|
|
122
|
-
reject(error);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
126
|
-
resolve({ body: body, status: response.statusCode });
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
console.error('API response error:', response.statusCode);
|
|
130
|
-
resolve({ body: body, status: response.statusCode });
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* This endpoint allows the client to create staking, unstaking, or withdrawal orders. One key feature of this endpoint is the ability to include an optional `validatorKey` field when creating a staking order. ### Including a Validator Key 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. ### Without a Validator Key If no `validatorKey` is provided, the client must specify the amount to stake. Northstake handles the staking operation internally, requiring the managed user\'s account to have sufficient balance to cover the transaction and any associated fees.
|
|
139
|
-
* @summary Create a new order
|
|
140
|
-
* @param order
|
|
141
|
-
*/
|
|
142
|
-
async createNewOrder(order, options = { headers: {} }) {
|
|
143
|
-
const localVarPath = this.basePath + '/orders';
|
|
144
|
-
let localVarQueryParameters = {};
|
|
145
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
146
|
-
const produces = ['application/json'];
|
|
147
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
148
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
152
|
-
}
|
|
153
|
-
let localVarFormParams = {};
|
|
154
|
-
// Verify required parameter 'order' is not null or undefined
|
|
155
|
-
if (order === null || order === undefined) {
|
|
156
|
-
throw new Error('Required parameter "order" was null or undefined when calling createNewOrder.');
|
|
157
|
-
}
|
|
158
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
159
|
-
let localVarUseFormData = false;
|
|
160
|
-
let localVarRequestOptions = {
|
|
161
|
-
method: 'POST',
|
|
162
|
-
qs: localVarQueryParameters,
|
|
163
|
-
headers: localVarHeaderParams,
|
|
164
|
-
uri: localVarPath,
|
|
165
|
-
useQuerystring: this._useQuerystring,
|
|
166
|
-
json: true,
|
|
167
|
-
body: models_1.ObjectSerializer.serialize(order, "Order")
|
|
168
|
-
};
|
|
169
|
-
let authenticationPromise = Promise.resolve();
|
|
170
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
171
|
-
let interceptorPromise = authenticationPromise;
|
|
172
|
-
for (const interceptor of this.interceptors) {
|
|
173
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
174
|
-
}
|
|
175
|
-
return interceptorPromise.then(() => {
|
|
176
|
-
if (Object.keys(localVarFormParams).length) {
|
|
177
|
-
if (localVarUseFormData) {
|
|
178
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return new Promise((resolve, reject) => {
|
|
185
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
186
|
-
if (error) {
|
|
187
|
-
console.error('API call error:', error);
|
|
188
|
-
reject(error);
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
192
|
-
body = models_1.ObjectSerializer.deserialize(body, "OrderDocument");
|
|
193
|
-
resolve({ body: body, status: response.statusCode });
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
console.error('API response error:', response.statusCode);
|
|
197
|
-
resolve({ body: body, status: response.statusCode });
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
206
|
-
* @summary Get order details by order ID
|
|
207
|
-
* @param orderId Unique identifier for the order
|
|
208
|
-
*/
|
|
209
|
-
async getOrderDetailsById(orderId, options = { headers: {} }) {
|
|
210
|
-
const localVarPath = this.basePath + '/orders/{orderId}'
|
|
211
|
-
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
|
212
|
-
let localVarQueryParameters = {};
|
|
213
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
214
|
-
const produces = ['application/json'];
|
|
215
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
216
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
220
|
-
}
|
|
221
|
-
let localVarFormParams = {};
|
|
222
|
-
// Verify required parameter 'orderId' is not null or undefined
|
|
223
|
-
if (orderId === null || orderId === undefined) {
|
|
224
|
-
throw new Error('Required parameter "orderId" was null or undefined when calling getOrderDetailsById.');
|
|
225
|
-
}
|
|
226
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
227
|
-
let localVarUseFormData = false;
|
|
228
|
-
let localVarRequestOptions = {
|
|
229
|
-
method: 'GET',
|
|
230
|
-
qs: localVarQueryParameters,
|
|
231
|
-
headers: localVarHeaderParams,
|
|
232
|
-
uri: localVarPath,
|
|
233
|
-
useQuerystring: this._useQuerystring,
|
|
234
|
-
json: true,
|
|
235
|
-
};
|
|
236
|
-
let authenticationPromise = Promise.resolve();
|
|
237
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
238
|
-
let interceptorPromise = authenticationPromise;
|
|
239
|
-
for (const interceptor of this.interceptors) {
|
|
240
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
241
|
-
}
|
|
242
|
-
return interceptorPromise.then(() => {
|
|
243
|
-
if (Object.keys(localVarFormParams).length) {
|
|
244
|
-
if (localVarUseFormData) {
|
|
245
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return new Promise((resolve, reject) => {
|
|
252
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
253
|
-
if (error) {
|
|
254
|
-
console.error('API call error:', error);
|
|
255
|
-
reject(error);
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
259
|
-
body = models_1.ObjectSerializer.deserialize(body, "OrderDocument");
|
|
260
|
-
resolve({ body: body, status: response.statusCode });
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
console.error('API response error:', response.statusCode);
|
|
264
|
-
resolve({ body: body, status: response.statusCode });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
*
|
|
273
|
-
* @summary Get a list of all orders
|
|
274
|
-
*/
|
|
275
|
-
async listAllOrders(options = { headers: {} }) {
|
|
276
|
-
const localVarPath = this.basePath + '/orders';
|
|
277
|
-
let localVarQueryParameters = {};
|
|
278
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
279
|
-
const produces = ['application/json'];
|
|
280
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
281
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
285
|
-
}
|
|
286
|
-
let localVarFormParams = {};
|
|
287
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
288
|
-
let localVarUseFormData = false;
|
|
289
|
-
let localVarRequestOptions = {
|
|
290
|
-
method: 'GET',
|
|
291
|
-
qs: localVarQueryParameters,
|
|
292
|
-
headers: localVarHeaderParams,
|
|
293
|
-
uri: localVarPath,
|
|
294
|
-
useQuerystring: this._useQuerystring,
|
|
295
|
-
json: true,
|
|
296
|
-
};
|
|
297
|
-
let authenticationPromise = Promise.resolve();
|
|
298
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
299
|
-
let interceptorPromise = authenticationPromise;
|
|
300
|
-
for (const interceptor of this.interceptors) {
|
|
301
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
302
|
-
}
|
|
303
|
-
return interceptorPromise.then(() => {
|
|
304
|
-
if (Object.keys(localVarFormParams).length) {
|
|
305
|
-
if (localVarUseFormData) {
|
|
306
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return new Promise((resolve, reject) => {
|
|
313
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
314
|
-
if (error) {
|
|
315
|
-
console.error('API call error:', error);
|
|
316
|
-
reject(error);
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
320
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<OrderDocument>");
|
|
321
|
-
resolve({ body: body, status: response.statusCode });
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
console.error('API response error:', response.statusCode);
|
|
325
|
-
resolve({ body: body, status: response.statusCode });
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
exports.OrdersApi = OrdersApi;
|
|
@@ -1,50 +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 PortfolioApiApiKeys {
|
|
16
|
-
ApiKeyAuth = 0
|
|
17
|
-
}
|
|
18
|
-
export declare class PortfolioApi {
|
|
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: PortfolioApiApiKeys, value: string): void;
|
|
36
|
-
set accessToken(accessToken: string | (() => string));
|
|
37
|
-
addInterceptor(interceptor: Interceptor): void;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @summary Account portfolio overview
|
|
41
|
-
*/
|
|
42
|
-
getPortfolio(options?: {
|
|
43
|
-
headers: {
|
|
44
|
-
[name: string]: string;
|
|
45
|
-
};
|
|
46
|
-
}): Promise<{
|
|
47
|
-
body: Array<PortfolioEntity>;
|
|
48
|
-
status: number;
|
|
49
|
-
}>;
|
|
50
|
-
}
|
package/dist/api/portfolioApi.js
DELETED
|
@@ -1,140 +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.PortfolioApi = exports.PortfolioApiApiKeys = 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 PortfolioApiApiKeys;
|
|
26
|
-
(function (PortfolioApiApiKeys) {
|
|
27
|
-
PortfolioApiApiKeys[PortfolioApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
|
|
28
|
-
})(PortfolioApiApiKeys || (exports.PortfolioApiApiKeys = PortfolioApiApiKeys = {}));
|
|
29
|
-
class PortfolioApi {
|
|
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[PortfolioApiApiKeys[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 Account portfolio overview
|
|
81
|
-
*/
|
|
82
|
-
async getPortfolio(options = { headers: {} }) {
|
|
83
|
-
const localVarPath = this.basePath + '/portfolio';
|
|
84
|
-
let localVarQueryParameters = {};
|
|
85
|
-
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
86
|
-
const produces = ['application/json'];
|
|
87
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
88
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
92
|
-
}
|
|
93
|
-
let localVarFormParams = {};
|
|
94
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
95
|
-
let localVarUseFormData = false;
|
|
96
|
-
let localVarRequestOptions = {
|
|
97
|
-
method: 'GET',
|
|
98
|
-
qs: localVarQueryParameters,
|
|
99
|
-
headers: localVarHeaderParams,
|
|
100
|
-
uri: localVarPath,
|
|
101
|
-
useQuerystring: this._useQuerystring,
|
|
102
|
-
json: true,
|
|
103
|
-
};
|
|
104
|
-
let authenticationPromise = Promise.resolve();
|
|
105
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
106
|
-
let interceptorPromise = authenticationPromise;
|
|
107
|
-
for (const interceptor of this.interceptors) {
|
|
108
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
109
|
-
}
|
|
110
|
-
return interceptorPromise.then(() => {
|
|
111
|
-
if (Object.keys(localVarFormParams).length) {
|
|
112
|
-
if (localVarUseFormData) {
|
|
113
|
-
localVarRequestOptions.formData = localVarFormParams;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return new Promise((resolve, reject) => {
|
|
120
|
-
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
121
|
-
if (error) {
|
|
122
|
-
console.error('API call error:', error);
|
|
123
|
-
reject(error);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
127
|
-
body = models_1.ObjectSerializer.deserialize(body, "Array<PortfolioEntity>");
|
|
128
|
-
resolve({ body: body, status: response.statusCode });
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
console.error('API response error:', response.statusCode);
|
|
132
|
-
resolve({ body: body, status: response.statusCode });
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.PortfolioApi = PortfolioApi;
|
|
@@ -1,66 +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 { GetTransactionsResponse } from '../model/getTransactionsResponse';
|
|
14
|
-
import { TransactionEventType } from '../model/transactionEventType';
|
|
15
|
-
import { Authentication, Interceptor } from '../model/models';
|
|
16
|
-
import { HttpBearerAuth, ApiKeyAuth } from '../model/models';
|
|
17
|
-
export declare enum TransactionsApiApiKeys {
|
|
18
|
-
ApiKeyAuth = 0
|
|
19
|
-
}
|
|
20
|
-
export interface TransactionsApiParams {
|
|
21
|
-
startDate?: string;
|
|
22
|
-
endDate?: string;
|
|
23
|
-
type?: TransactionEventType;
|
|
24
|
-
asset?: Asset;
|
|
25
|
-
page?: number;
|
|
26
|
-
limit?: number;
|
|
27
|
-
}
|
|
28
|
-
export declare class TransactionsApi {
|
|
29
|
-
protected _basePath: string;
|
|
30
|
-
protected _defaultHeaders: any;
|
|
31
|
-
protected _useQuerystring: boolean;
|
|
32
|
-
protected authentications: {
|
|
33
|
-
default: Authentication;
|
|
34
|
-
bearerTokenAuth: HttpBearerAuth;
|
|
35
|
-
ApiKeyAuth: ApiKeyAuth;
|
|
36
|
-
};
|
|
37
|
-
protected interceptors: Interceptor[];
|
|
38
|
-
constructor(basePath?: string);
|
|
39
|
-
set useQuerystring(value: boolean);
|
|
40
|
-
set basePath(basePath: string);
|
|
41
|
-
set defaultHeaders(defaultHeaders: any);
|
|
42
|
-
get defaultHeaders(): any;
|
|
43
|
-
get basePath(): string;
|
|
44
|
-
setDefaultAuthentication(auth: Authentication): void;
|
|
45
|
-
setApiKey(key: TransactionsApiApiKeys, value: string): void;
|
|
46
|
-
set accessToken(accessToken: string | (() => string));
|
|
47
|
-
addInterceptor(interceptor: Interceptor): void;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @summary Get transactions
|
|
51
|
-
* @param startDate Start date for filtering transaction statistics
|
|
52
|
-
* @param endDate End date for filtering transaction statistics
|
|
53
|
-
* @param type Type of transaction (e.g., deposit, withdrawal)
|
|
54
|
-
* @param asset Asset type (e.g., ETH, SOL)
|
|
55
|
-
* @param page Transaction list page number
|
|
56
|
-
* @param limit Number of transactions to return per page
|
|
57
|
-
*/
|
|
58
|
-
getTransactions(params?: TransactionsApiParams, options?: {
|
|
59
|
-
headers: {
|
|
60
|
-
[name: string]: string;
|
|
61
|
-
};
|
|
62
|
-
}): Promise<{
|
|
63
|
-
body: GetTransactionsResponse;
|
|
64
|
-
status: number;
|
|
65
|
-
}>;
|
|
66
|
-
}
|