@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.
Files changed (130) hide show
  1. package/.openapi-generator/FILES +6 -36
  2. package/.openapi-generator/VERSION +1 -1
  3. package/api/apis.ts +3 -23
  4. package/api/{managedUsersApi.ts → smartContractsApi.ts} +118 -53
  5. package/api.ts +9 -69
  6. package/dist/api/apis.d.ts +3 -23
  7. package/dist/api/apis.js +3 -23
  8. package/dist/api/smartContractsApi.d.ts +125 -0
  9. package/dist/api/{managedUsersApi.js → smartContractsApi.js} +90 -49
  10. package/dist/api.d.ts +7 -47
  11. package/dist/api.js +8 -58
  12. package/dist/model/{getTransactionsResponse.d.ts → getSmartContractInternalTransactions200Response.d.ts} +7 -7
  13. package/dist/model/{transactionsforUser.js → getSmartContractInternalTransactions200Response.js} +11 -11
  14. package/dist/model/{allManagedUsersResponse.d.ts → getSmartContractMinedBlocks200Response.d.ts} +4 -4
  15. package/dist/model/{allManagedUsersResponse.js → getSmartContractMinedBlocks200Response.js} +9 -9
  16. package/dist/model/{transactionsforUser.d.ts → getSmartContractTransactions200Response.d.ts} +5 -5
  17. package/dist/model/{getTransactionsResponse.js → getSmartContractTransactions200Response.js} +10 -10
  18. package/dist/model/{stakeStep.d.ts → internalTransaction.d.ts} +9 -7
  19. package/dist/model/internalTransaction.js +58 -0
  20. package/dist/model/{managedUser.d.ts → minedBlock.d.ts} +8 -6
  21. package/dist/model/minedBlock.js +43 -0
  22. package/dist/model/models.d.ts +5 -25
  23. package/dist/model/models.js +15 -67
  24. package/dist/model/transaction.d.ts +40 -17
  25. package/dist/model/transaction.js +74 -17
  26. package/dist/model/webhookPayloadData.d.ts +2 -10
  27. package/dist/model/webhookPayloadData.js +2 -12
  28. package/model/{transactionsforUser.ts → getSmartContractInternalTransactions200Response.ts} +13 -13
  29. package/model/{allManagedUsersResponse.ts → getSmartContractMinedBlocks200Response.ts} +8 -8
  30. package/model/{getTransactionsResponse.ts → getSmartContractTransactions200Response.ts} +10 -10
  31. package/model/internalTransaction.ts +70 -0
  32. package/model/{depositAddress.ts → minedBlock.ts} +19 -13
  33. package/model/models.ts +17 -114
  34. package/model/transaction.ts +114 -31
  35. package/model/webhookPayloadData.ts +4 -23
  36. package/package.json +1 -1
  37. package/api/depositAddressesApi.ts +0 -267
  38. package/api/managedUsersDepositAddressesApi.ts +0 -186
  39. package/api/managedUsersLinkedWalletsApi.ts +0 -369
  40. package/api/managedUsersOrdersApi.ts +0 -462
  41. package/api/managedUsersPortfolioApi.ts +0 -186
  42. package/api/managedUsersTransactionsApi.ts +0 -222
  43. package/api/managedUsersValidatorsApi.ts +0 -302
  44. package/api/ordersApi.ts +0 -432
  45. package/api/portfolioApi.ts +0 -180
  46. package/api/transactionsApi.ts +0 -215
  47. package/dist/api/depositAddressesApi.d.ts +0 -64
  48. package/dist/api/depositAddressesApi.js +0 -207
  49. package/dist/api/managedUsersApi.d.ts +0 -94
  50. package/dist/api/managedUsersDepositAddressesApi.d.ts +0 -51
  51. package/dist/api/managedUsersDepositAddressesApi.js +0 -146
  52. package/dist/api/managedUsersLinkedWalletsApi.d.ts +0 -80
  53. package/dist/api/managedUsersLinkedWalletsApi.js +0 -290
  54. package/dist/api/managedUsersOrdersApi.d.ts +0 -94
  55. package/dist/api/managedUsersOrdersApi.js +0 -364
  56. package/dist/api/managedUsersPortfolioApi.d.ts +0 -51
  57. package/dist/api/managedUsersPortfolioApi.js +0 -146
  58. package/dist/api/managedUsersTransactionsApi.d.ts +0 -68
  59. package/dist/api/managedUsersTransactionsApi.js +0 -170
  60. package/dist/api/managedUsersValidatorsApi.d.ts +0 -78
  61. package/dist/api/managedUsersValidatorsApi.js +0 -233
  62. package/dist/api/ordersApi.d.ts +0 -90
  63. package/dist/api/ordersApi.js +0 -333
  64. package/dist/api/portfolioApi.d.ts +0 -50
  65. package/dist/api/portfolioApi.js +0 -140
  66. package/dist/api/transactionsApi.d.ts +0 -66
  67. package/dist/api/transactionsApi.js +0 -164
  68. package/dist/model/addLinkedWalletForUserRequest.d.ts +0 -29
  69. package/dist/model/addLinkedWalletForUserRequest.js +0 -33
  70. package/dist/model/createManagedUserRequest.d.ts +0 -25
  71. package/dist/model/createManagedUserRequest.js +0 -28
  72. package/dist/model/depositAddress.d.ts +0 -35
  73. package/dist/model/depositAddress.js +0 -36
  74. package/dist/model/depositAddressesForUserResponse.d.ts +0 -27
  75. package/dist/model/depositAddressesForUserResponse.js +0 -33
  76. package/dist/model/managedUser.js +0 -36
  77. package/dist/model/managedUserDetails.d.ts +0 -31
  78. package/dist/model/managedUserDetails.js +0 -41
  79. package/dist/model/order.d.ts +0 -42
  80. package/dist/model/order.js +0 -48
  81. package/dist/model/orderDocument.d.ts +0 -50
  82. package/dist/model/orderDocument.js +0 -71
  83. package/dist/model/orderDocumentSteps.d.ts +0 -30
  84. package/dist/model/orderDocumentSteps.js +0 -33
  85. package/dist/model/orderType.d.ts +0 -15
  86. package/dist/model/orderType.js +0 -13
  87. package/dist/model/orderUpdatePayload.d.ts +0 -36
  88. package/dist/model/orderUpdatePayload.js +0 -38
  89. package/dist/model/portfolioEntity.d.ts +0 -33
  90. package/dist/model/portfolioEntity.js +0 -41
  91. package/dist/model/stakeStep.js +0 -33
  92. package/dist/model/stakeStepElement.d.ts +0 -30
  93. package/dist/model/stakeStepElement.js +0 -33
  94. package/dist/model/stepStatus.d.ts +0 -15
  95. package/dist/model/stepStatus.js +0 -13
  96. package/dist/model/transactionEventType.d.ts +0 -15
  97. package/dist/model/transactionEventType.js +0 -13
  98. package/dist/model/unstakeStep.d.ts +0 -32
  99. package/dist/model/unstakeStep.js +0 -33
  100. package/dist/model/unstakeStepElement.d.ts +0 -30
  101. package/dist/model/unstakeStepElement.js +0 -33
  102. package/dist/model/unstakeStepType.d.ts +0 -15
  103. package/dist/model/unstakeStepType.js +0 -13
  104. package/dist/model/withdrawalStep.d.ts +0 -32
  105. package/dist/model/withdrawalStep.js +0 -33
  106. package/dist/model/withdrawalStepElement.d.ts +0 -30
  107. package/dist/model/withdrawalStepElement.js +0 -33
  108. package/dist/model/withdrawalStepType.d.ts +0 -15
  109. package/dist/model/withdrawalStepType.js +0 -13
  110. package/model/addLinkedWalletForUserRequest.ts +0 -40
  111. package/model/createManagedUserRequest.ts +0 -31
  112. package/model/depositAddressesForUserResponse.ts +0 -38
  113. package/model/managedUser.ts +0 -40
  114. package/model/managedUserDetails.ts +0 -47
  115. package/model/order.ts +0 -68
  116. package/model/orderDocument.ts +0 -106
  117. package/model/orderDocumentSteps.ts +0 -44
  118. package/model/orderType.ts +0 -21
  119. package/model/orderUpdatePayload.ts +0 -52
  120. package/model/portfolioEntity.ts +0 -49
  121. package/model/stakeStep.ts +0 -43
  122. package/model/stakeStepElement.ts +0 -41
  123. package/model/stepStatus.ts +0 -21
  124. package/model/transactionEventType.ts +0 -23
  125. package/model/unstakeStep.ts +0 -43
  126. package/model/unstakeStepElement.ts +0 -41
  127. package/model/unstakeStepType.ts +0 -32
  128. package/model/withdrawalStep.ts +0 -43
  129. package/model/withdrawalStepElement.ts +0 -41
  130. package/model/withdrawalStepType.ts +0 -24
@@ -1,170 +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.ManagedUsersTransactionsApi = exports.ManagedUsersTransactionsApiApiKeys = 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 ManagedUsersTransactionsApiApiKeys;
26
- (function (ManagedUsersTransactionsApiApiKeys) {
27
- ManagedUsersTransactionsApiApiKeys[ManagedUsersTransactionsApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
28
- })(ManagedUsersTransactionsApiApiKeys || (exports.ManagedUsersTransactionsApiApiKeys = ManagedUsersTransactionsApiApiKeys = {}));
29
- class ManagedUsersTransactionsApi {
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[ManagedUsersTransactionsApiApiKeys[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 Get transactions for a managed user
81
- * @param userId
82
- * @param startDate Start date for filtering transaction statistics
83
- * @param endDate End date for filtering transaction statistics
84
- * @param type Type of transaction (e.g., deposit, withdrawal)
85
- * @param asset Asset type (e.g., ETH, SOL)
86
- * @param page Transaction list page number
87
- * @param limit Number of transactions to return per page
88
- */
89
- async getTransactionsForUser(params, options = { headers: {} }) {
90
- const localVarPath = this.basePath + '/managedUsers/{userId}/transactions'
91
- .replace('{' + 'userId' + '}', encodeURIComponent(String(params === null || params === void 0 ? void 0 : params.userId)));
92
- let localVarQueryParameters = {};
93
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
94
- const produces = ['application/json'];
95
- if (produces.indexOf('application/json') >= 0) {
96
- localVarHeaderParams.Accept = 'application/json';
97
- }
98
- else {
99
- localVarHeaderParams.Accept = produces.join(',');
100
- }
101
- let localVarFormParams = {};
102
- // Verify required parameter 'userId' is not null or undefined
103
- if ((params === null || params === void 0 ? void 0 : params.userId) === null || (params === null || params === void 0 ? void 0 : params.userId) === undefined) {
104
- throw new Error('Required parameter "userId" was null or undefined when calling getTransactionsForUser.');
105
- }
106
- if ((params === null || params === void 0 ? void 0 : params.startDate) !== undefined) {
107
- localVarQueryParameters['startDate'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.startDate, "string");
108
- }
109
- if ((params === null || params === void 0 ? void 0 : params.endDate) !== undefined) {
110
- localVarQueryParameters['endDate'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.endDate, "string");
111
- }
112
- if ((params === null || params === void 0 ? void 0 : params.type) !== undefined) {
113
- localVarQueryParameters['type'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.type, "TransactionEventType");
114
- }
115
- if ((params === null || params === void 0 ? void 0 : params.asset) !== undefined) {
116
- localVarQueryParameters['asset'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.asset, "Asset");
117
- }
118
- if ((params === null || params === void 0 ? void 0 : params.page) !== undefined) {
119
- localVarQueryParameters['page'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.page, "number");
120
- }
121
- if ((params === null || params === void 0 ? void 0 : params.limit) !== undefined) {
122
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.limit, "number");
123
- }
124
- Object.assign(localVarHeaderParams, options.headers);
125
- let localVarUseFormData = false;
126
- let localVarRequestOptions = {
127
- method: 'GET',
128
- qs: localVarQueryParameters,
129
- headers: localVarHeaderParams,
130
- uri: localVarPath,
131
- useQuerystring: this._useQuerystring,
132
- json: true,
133
- };
134
- let authenticationPromise = Promise.resolve();
135
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
136
- let interceptorPromise = authenticationPromise;
137
- for (const interceptor of this.interceptors) {
138
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
139
- }
140
- return interceptorPromise.then(() => {
141
- if (Object.keys(localVarFormParams).length) {
142
- if (localVarUseFormData) {
143
- localVarRequestOptions.formData = localVarFormParams;
144
- }
145
- else {
146
- localVarRequestOptions.form = localVarFormParams;
147
- }
148
- }
149
- return new Promise((resolve, reject) => {
150
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
151
- if (error) {
152
- console.error('API call error:', error);
153
- reject(error);
154
- }
155
- else {
156
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
157
- body = models_1.ObjectSerializer.deserialize(body, "TransactionsforUser");
158
- resolve({ body: body, status: response.statusCode });
159
- }
160
- else {
161
- console.error('API response error:', response.statusCode);
162
- resolve({ body: body, status: response.statusCode });
163
- }
164
- }
165
- });
166
- });
167
- });
168
- }
169
- }
170
- exports.ManagedUsersTransactionsApi = ManagedUsersTransactionsApi;
@@ -1,78 +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 { GetWithdrawalsResponse } from '../model/getWithdrawalsResponse';
13
- import { ValidatorInfo } from '../model/validatorInfo';
14
- import { Authentication, Interceptor } from '../model/models';
15
- import { HttpBearerAuth, ApiKeyAuth } from '../model/models';
16
- export declare enum ManagedUsersValidatorsApiApiKeys {
17
- ApiKeyAuth = 0
18
- }
19
- export interface ManagedUsersValidatorsApiParams {
20
- userId: string;
21
- startDate?: string;
22
- endDate?: string;
23
- page?: number;
24
- limit?: number;
25
- validatorIndices?: string;
26
- }
27
- export declare class ManagedUsersValidatorsApi {
28
- protected _basePath: string;
29
- protected _defaultHeaders: any;
30
- protected _useQuerystring: boolean;
31
- protected authentications: {
32
- default: Authentication;
33
- bearerTokenAuth: HttpBearerAuth;
34
- ApiKeyAuth: ApiKeyAuth;
35
- };
36
- protected interceptors: Interceptor[];
37
- constructor(basePath?: string);
38
- set useQuerystring(value: boolean);
39
- set basePath(basePath: string);
40
- set defaultHeaders(defaultHeaders: any);
41
- get defaultHeaders(): any;
42
- get basePath(): string;
43
- setDefaultAuthentication(auth: Authentication): void;
44
- setApiKey(key: ManagedUsersValidatorsApiApiKeys, value: string): void;
45
- set accessToken(accessToken: string | (() => string));
46
- addInterceptor(interceptor: Interceptor): void;
47
- /**
48
- * Retrieves a paginated list of validator withdrawals for a specific managed user. The endpoint supports filtering by start and end date, page number, and limit. Additionally, it allows filtering by validator indices.
49
- * @summary Get a list of validator withdrawals for a managed user
50
- * @param userId
51
- * @param startDate Start date for filtering withdrawal statistics
52
- * @param endDate End date for filtering withdrawal statistics
53
- * @param page Withdrawal list page number
54
- * @param limit Number of withdrawals to return per page
55
- * @param validatorIndices Comma-separated list of validator indices to filter withdrawals (e.g., \&quot;123,456,789\&quot;)
56
- */
57
- getValidatorWithdrawalsForUser(params?: ManagedUsersValidatorsApiParams, options?: {
58
- headers: {
59
- [name: string]: string;
60
- };
61
- }): Promise<{
62
- body: GetWithdrawalsResponse;
63
- status: number;
64
- }>;
65
- /**
66
- *
67
- * @summary Get all validators associated with the managed user
68
- * @param userId
69
- */
70
- getValidatorsForUser(userId: string, options?: {
71
- headers: {
72
- [name: string]: string;
73
- };
74
- }): Promise<{
75
- body: Array<ValidatorInfo>;
76
- status: number;
77
- }>;
78
- }
@@ -1,233 +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.ManagedUsersValidatorsApi = exports.ManagedUsersValidatorsApiApiKeys = 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 ManagedUsersValidatorsApiApiKeys;
26
- (function (ManagedUsersValidatorsApiApiKeys) {
27
- ManagedUsersValidatorsApiApiKeys[ManagedUsersValidatorsApiApiKeys["ApiKeyAuth"] = 0] = "ApiKeyAuth";
28
- })(ManagedUsersValidatorsApiApiKeys || (exports.ManagedUsersValidatorsApiApiKeys = ManagedUsersValidatorsApiApiKeys = {}));
29
- class ManagedUsersValidatorsApi {
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[ManagedUsersValidatorsApiApiKeys[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
- * Retrieves a paginated list of validator withdrawals for a specific managed user. The endpoint supports filtering by start and end date, page number, and limit. Additionally, it allows filtering by validator indices.
80
- * @summary Get a list of validator withdrawals for a managed user
81
- * @param userId
82
- * @param startDate Start date for filtering withdrawal statistics
83
- * @param endDate End date for filtering withdrawal statistics
84
- * @param page Withdrawal list page number
85
- * @param limit Number of withdrawals to return per page
86
- * @param validatorIndices Comma-separated list of validator indices to filter withdrawals (e.g., \&quot;123,456,789\&quot;)
87
- */
88
- async getValidatorWithdrawalsForUser(params, options = { headers: {} }) {
89
- const localVarPath = this.basePath + '/managedUsers/{userId}/validators/withdrawals'
90
- .replace('{' + 'userId' + '}', encodeURIComponent(String(params === null || params === void 0 ? void 0 : params.userId)));
91
- let localVarQueryParameters = {};
92
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
93
- const produces = ['application/json'];
94
- if (produces.indexOf('application/json') >= 0) {
95
- localVarHeaderParams.Accept = 'application/json';
96
- }
97
- else {
98
- localVarHeaderParams.Accept = produces.join(',');
99
- }
100
- let localVarFormParams = {};
101
- // Verify required parameter 'userId' is not null or undefined
102
- if ((params === null || params === void 0 ? void 0 : params.userId) === null || (params === null || params === void 0 ? void 0 : params.userId) === undefined) {
103
- throw new Error('Required parameter "userId" was null or undefined when calling getValidatorWithdrawalsForUser.');
104
- }
105
- if ((params === null || params === void 0 ? void 0 : params.startDate) !== undefined) {
106
- localVarQueryParameters['start_date'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.startDate, "string");
107
- }
108
- if ((params === null || params === void 0 ? void 0 : params.endDate) !== undefined) {
109
- localVarQueryParameters['end_date'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.endDate, "string");
110
- }
111
- if ((params === null || params === void 0 ? void 0 : params.page) !== undefined) {
112
- localVarQueryParameters['page'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.page, "number");
113
- }
114
- if ((params === null || params === void 0 ? void 0 : params.limit) !== undefined) {
115
- localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.limit, "number");
116
- }
117
- if ((params === null || params === void 0 ? void 0 : params.validatorIndices) !== undefined) {
118
- localVarQueryParameters['validator_indices'] = models_1.ObjectSerializer.serialize(params === null || params === void 0 ? void 0 : params.validatorIndices, "string");
119
- }
120
- Object.assign(localVarHeaderParams, options.headers);
121
- let localVarUseFormData = false;
122
- let localVarRequestOptions = {
123
- method: 'GET',
124
- qs: localVarQueryParameters,
125
- headers: localVarHeaderParams,
126
- uri: localVarPath,
127
- useQuerystring: this._useQuerystring,
128
- json: true,
129
- };
130
- let authenticationPromise = Promise.resolve();
131
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
132
- let interceptorPromise = authenticationPromise;
133
- for (const interceptor of this.interceptors) {
134
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
135
- }
136
- return interceptorPromise.then(() => {
137
- if (Object.keys(localVarFormParams).length) {
138
- if (localVarUseFormData) {
139
- localVarRequestOptions.formData = localVarFormParams;
140
- }
141
- else {
142
- localVarRequestOptions.form = localVarFormParams;
143
- }
144
- }
145
- return new Promise((resolve, reject) => {
146
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
147
- if (error) {
148
- console.error('API call error:', error);
149
- reject(error);
150
- }
151
- else {
152
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
153
- body = models_1.ObjectSerializer.deserialize(body, "GetWithdrawalsResponse");
154
- resolve({ body: body, status: response.statusCode });
155
- }
156
- else {
157
- console.error('API response error:', response.statusCode);
158
- resolve({ body: body, status: response.statusCode });
159
- }
160
- }
161
- });
162
- });
163
- });
164
- }
165
- /**
166
- *
167
- * @summary Get all validators associated with the managed user
168
- * @param userId
169
- */
170
- async getValidatorsForUser(userId, options = { headers: {} }) {
171
- const localVarPath = this.basePath + '/managedUsers/{userId}/validators'
172
- .replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
173
- let localVarQueryParameters = {};
174
- let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
175
- const produces = ['application/json'];
176
- if (produces.indexOf('application/json') >= 0) {
177
- localVarHeaderParams.Accept = 'application/json';
178
- }
179
- else {
180
- localVarHeaderParams.Accept = produces.join(',');
181
- }
182
- let localVarFormParams = {};
183
- // Verify required parameter 'userId' is not null or undefined
184
- if (userId === null || userId === undefined) {
185
- throw new Error('Required parameter "userId" was null or undefined when calling getValidatorsForUser.');
186
- }
187
- Object.assign(localVarHeaderParams, options.headers);
188
- let localVarUseFormData = false;
189
- let localVarRequestOptions = {
190
- method: 'GET',
191
- qs: localVarQueryParameters,
192
- headers: localVarHeaderParams,
193
- uri: localVarPath,
194
- useQuerystring: this._useQuerystring,
195
- json: true,
196
- };
197
- let authenticationPromise = Promise.resolve();
198
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
199
- let interceptorPromise = authenticationPromise;
200
- for (const interceptor of this.interceptors) {
201
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
202
- }
203
- return interceptorPromise.then(() => {
204
- if (Object.keys(localVarFormParams).length) {
205
- if (localVarUseFormData) {
206
- localVarRequestOptions.formData = localVarFormParams;
207
- }
208
- else {
209
- localVarRequestOptions.form = localVarFormParams;
210
- }
211
- }
212
- return new Promise((resolve, reject) => {
213
- (0, request_1.default)(localVarRequestOptions, (error, response, body) => {
214
- if (error) {
215
- console.error('API call error:', error);
216
- reject(error);
217
- }
218
- else {
219
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
220
- body = models_1.ObjectSerializer.deserialize(body, "Array<ValidatorInfo>");
221
- resolve({ body: body, status: response.statusCode });
222
- }
223
- else {
224
- console.error('API response error:', response.statusCode);
225
- resolve({ body: body, status: response.statusCode });
226
- }
227
- }
228
- });
229
- });
230
- });
231
- }
232
- }
233
- exports.ManagedUsersValidatorsApi = ManagedUsersValidatorsApi;
@@ -1,90 +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 { Order } from '../model/order';
13
- import { OrderDocument } from '../model/orderDocument';
14
- import { Authentication, Interceptor } from '../model/models';
15
- import { HttpBearerAuth, ApiKeyAuth } from '../model/models';
16
- export declare enum OrdersApiApiKeys {
17
- ApiKeyAuth = 0
18
- }
19
- export declare class OrdersApi {
20
- protected _basePath: string;
21
- protected _defaultHeaders: any;
22
- protected _useQuerystring: boolean;
23
- protected authentications: {
24
- default: Authentication;
25
- bearerTokenAuth: HttpBearerAuth;
26
- ApiKeyAuth: ApiKeyAuth;
27
- };
28
- protected interceptors: Interceptor[];
29
- constructor(basePath?: string);
30
- set useQuerystring(value: boolean);
31
- set basePath(basePath: string);
32
- set defaultHeaders(defaultHeaders: any);
33
- get defaultHeaders(): any;
34
- get basePath(): string;
35
- setDefaultAuthentication(auth: Authentication): void;
36
- setApiKey(key: OrdersApiApiKeys, value: string): void;
37
- set accessToken(accessToken: string | (() => string));
38
- addInterceptor(interceptor: Interceptor): void;
39
- /**
40
- *
41
- * @summary Cancel a submitted order
42
- * @param orderId Unique identifier for the order
43
- */
44
- cancelOrderById(orderId: string, options?: {
45
- headers: {
46
- [name: string]: string;
47
- };
48
- }): Promise<{
49
- body: any;
50
- status: number;
51
- }>;
52
- /**
53
- * 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.
54
- * @summary Create a new order
55
- * @param order
56
- */
57
- createNewOrder(order: Order, options?: {
58
- headers: {
59
- [name: string]: string;
60
- };
61
- }): Promise<{
62
- body: OrderDocument;
63
- status: number;
64
- }>;
65
- /**
66
- *
67
- * @summary Get order details by order ID
68
- * @param orderId Unique identifier for the order
69
- */
70
- getOrderDetailsById(orderId: string, options?: {
71
- headers: {
72
- [name: string]: string;
73
- };
74
- }): Promise<{
75
- body: OrderDocument;
76
- status: number;
77
- }>;
78
- /**
79
- *
80
- * @summary Get a list of all orders
81
- */
82
- listAllOrders(options?: {
83
- headers: {
84
- [name: string]: string;
85
- };
86
- }): Promise<{
87
- body: Array<OrderDocument>;
88
- status: number;
89
- }>;
90
- }