@chainstream-io/sdk 0.1.7 → 0.1.8

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 (114) hide show
  1. package/README.md +2 -2
  2. package/dist/esm/index.js +74 -73
  3. package/dist/esm/openapi/apis/BlockchainApi.js +44 -61
  4. package/dist/esm/openapi/apis/DefiSolanaMoonshotApi.js +50 -67
  5. package/dist/esm/openapi/apis/DefiSolanaPumpfunApi.js +25 -38
  6. package/dist/esm/openapi/apis/DexApi.js +176 -205
  7. package/dist/esm/openapi/apis/DexPoolApi.js +28 -41
  8. package/dist/esm/openapi/apis/EndpointApi.js +175 -212
  9. package/dist/esm/openapi/apis/IpfsApi.js +25 -38
  10. package/dist/esm/openapi/apis/JobsApi.js +48 -65
  11. package/dist/esm/openapi/apis/RankingApi.js +249 -278
  12. package/dist/esm/openapi/apis/RedPacketApi.js +253 -294
  13. package/dist/esm/openapi/apis/TokenApi.js +1056 -1145
  14. package/dist/esm/openapi/apis/TradeApi.js +208 -233
  15. package/dist/esm/openapi/apis/TransactionApi.js +29 -42
  16. package/dist/esm/openapi/apis/WalletApi.js +123 -148
  17. package/dist/esm/openapi/apis/WatchlistApi.js +28 -41
  18. package/dist/esm/openapi/runtime.js +118 -119
  19. package/dist/esm/stream/stream.js +34 -36
  20. package/dist/index.js +96 -99
  21. package/dist/openapi/apis/BlockchainApi.js +48 -69
  22. package/dist/openapi/apis/DefiSolanaMoonshotApi.js +53 -74
  23. package/dist/openapi/apis/DefiSolanaPumpfunApi.js +28 -45
  24. package/dist/openapi/apis/DexApi.js +184 -217
  25. package/dist/openapi/apis/DexPoolApi.js +32 -49
  26. package/dist/openapi/apis/EndpointApi.js +179 -220
  27. package/dist/openapi/apis/IpfsApi.js +27 -44
  28. package/dist/openapi/apis/JobsApi.js +51 -72
  29. package/dist/openapi/apis/RankingApi.js +273 -306
  30. package/dist/openapi/apis/RedPacketApi.js +260 -305
  31. package/dist/openapi/apis/TokenApi.js +1089 -1182
  32. package/dist/openapi/apis/TradeApi.js +227 -256
  33. package/dist/openapi/apis/TransactionApi.js +32 -49
  34. package/dist/openapi/apis/WalletApi.js +130 -159
  35. package/dist/openapi/apis/WatchlistApi.js +32 -49
  36. package/dist/openapi/apis/index.js +15 -31
  37. package/dist/openapi/index.js +3 -19
  38. package/dist/openapi/models/BlockchainDTO.js +5 -12
  39. package/dist/openapi/models/BlockchainLatestBlockDTO.js +5 -12
  40. package/dist/openapi/models/BooleanResultDTO.js +5 -12
  41. package/dist/openapi/models/CalculatePnlInput.js +5 -12
  42. package/dist/openapi/models/Candle.js +8 -15
  43. package/dist/openapi/models/ClaimRedPacketInput.js +5 -12
  44. package/dist/openapi/models/CreateEndpointInput.js +5 -12
  45. package/dist/openapi/models/CreateRedPacketInput.js +5 -12
  46. package/dist/openapi/models/CreateRedPacketReply.js +5 -12
  47. package/dist/openapi/models/CreateTokenInput.js +6 -14
  48. package/dist/openapi/models/CreateTokenReply.js +5 -12
  49. package/dist/openapi/models/DexDTO.js +5 -12
  50. package/dist/openapi/models/DexPage.js +8 -15
  51. package/dist/openapi/models/DexPoolDTO.js +5 -12
  52. package/dist/openapi/models/EndpointListResponse.js +8 -15
  53. package/dist/openapi/models/EndpointOperationResponse.js +5 -12
  54. package/dist/openapi/models/EndpointResponse.js +5 -12
  55. package/dist/openapi/models/EndpointSecretResponse.js +5 -12
  56. package/dist/openapi/models/FilterCondition.js +6 -14
  57. package/dist/openapi/models/GainersAndLosersDTO.js +5 -12
  58. package/dist/openapi/models/GainersAndLosersPage.js +8 -15
  59. package/dist/openapi/models/JobDTO.js +5 -12
  60. package/dist/openapi/models/JobStreamingDTO.js +5 -12
  61. package/dist/openapi/models/Link.js +6 -14
  62. package/dist/openapi/models/MoonshotCreateTokenInput.js +10 -18
  63. package/dist/openapi/models/MoonshotCreateTokenReply.js +5 -12
  64. package/dist/openapi/models/MoonshotSubmitCreateToken200Response.js +5 -12
  65. package/dist/openapi/models/MoonshotSubmitCreateTokenInput.js +5 -12
  66. package/dist/openapi/models/PumpCreateTokenInput.js +7 -15
  67. package/dist/openapi/models/PumpCreateTokenReply.js +5 -12
  68. package/dist/openapi/models/QuoteResponse.js +5 -12
  69. package/dist/openapi/models/RedPacketClaimDTO.js +6 -14
  70. package/dist/openapi/models/RedPacketClaimsPage.js +8 -15
  71. package/dist/openapi/models/RedPacketDTO.js +6 -14
  72. package/dist/openapi/models/RedPacketReply.js +5 -12
  73. package/dist/openapi/models/RedPacketSendTxInput.js +5 -12
  74. package/dist/openapi/models/RedPacketSendTxResponse.js +5 -12
  75. package/dist/openapi/models/RedPacketsPage.js +8 -15
  76. package/dist/openapi/models/Resolution.js +9 -17
  77. package/dist/openapi/models/SendTxInput.js +6 -14
  78. package/dist/openapi/models/SendTxResponse.js +5 -12
  79. package/dist/openapi/models/SwapInput.js +7 -15
  80. package/dist/openapi/models/SwapReply.js +5 -12
  81. package/dist/openapi/models/SwapRouteInput.js +7 -15
  82. package/dist/openapi/models/SwapRouteResponse.js +8 -15
  83. package/dist/openapi/models/Token.js +23 -30
  84. package/dist/openapi/models/TokenCreationDTO.js +6 -14
  85. package/dist/openapi/models/TokenCreationPage.js +8 -15
  86. package/dist/openapi/models/TokenCreatorsDTO.js +5 -12
  87. package/dist/openapi/models/TokenExtraDTO.js +5 -12
  88. package/dist/openapi/models/TokenHolder.js +5 -12
  89. package/dist/openapi/models/TokenHolderPage.js +8 -15
  90. package/dist/openapi/models/TokenListPage.js +8 -15
  91. package/dist/openapi/models/TokenMarketData.js +5 -12
  92. package/dist/openapi/models/TokenMetadata.js +14 -21
  93. package/dist/openapi/models/TokenPage.js +8 -15
  94. package/dist/openapi/models/TokenPriceDTO.js +5 -12
  95. package/dist/openapi/models/TokenPricePage.js +8 -15
  96. package/dist/openapi/models/TokenSocialMediasDTO.js +5 -12
  97. package/dist/openapi/models/TokenStat.js +5 -12
  98. package/dist/openapi/models/TopTradersDTO.js +5 -12
  99. package/dist/openapi/models/TopTradersPage.js +8 -15
  100. package/dist/openapi/models/TradeDetailDTO.js +5 -12
  101. package/dist/openapi/models/TradeEvent.js +8 -15
  102. package/dist/openapi/models/TradePage.js +8 -15
  103. package/dist/openapi/models/TradeType.js +9 -17
  104. package/dist/openapi/models/UpdateEndpointInput.js +5 -12
  105. package/dist/openapi/models/WalletBalanceDetailDTO.js +5 -12
  106. package/dist/openapi/models/WalletBalancesDTO.js +8 -15
  107. package/dist/openapi/models/WalletPnlDTO.js +5 -12
  108. package/dist/openapi/models/index.js +70 -86
  109. package/dist/openapi/runtime.js +136 -153
  110. package/dist/stream/index.js +3 -19
  111. package/dist/stream/stream.fields.js +5 -11
  112. package/dist/stream/stream.js +39 -45
  113. package/dist/stream/stream.model.js +10 -13
  114. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /* tslint:disable */
3
2
  /* eslint-disable */
4
3
  /**
@@ -12,66 +11,50 @@
12
11
  * https://openapi-generator.tech
13
12
  * Do not edit the class manually.
14
13
  */
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.TransactionApi = void 0;
26
- const runtime = require("../runtime");
27
- const index_1 = require("../models/index");
14
+ import * as runtime from '../runtime';
15
+ import { SendTxInputToJSON, SendTxResponseFromJSON, } from '../models/index';
28
16
  /**
29
17
  *
30
18
  */
31
- class TransactionApi extends runtime.BaseAPI {
19
+ export class TransactionApi extends runtime.BaseAPI {
32
20
  /**
33
21
  * CONTROLLER.TRANSACTION.SEND.DESCRIPTION
34
22
  * CONTROLLER.TRANSACTION.SEND.SUMMARY
35
23
  */
36
- sendRaw(requestParameters, initOverrides) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- if (requestParameters['chain'] == null) {
39
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling send().');
24
+ async sendRaw(requestParameters, initOverrides) {
25
+ if (requestParameters['chain'] == null) {
26
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling send().');
27
+ }
28
+ if (requestParameters['sendTxInput'] == null) {
29
+ throw new runtime.RequiredError('sendTxInput', 'Required parameter "sendTxInput" was null or undefined when calling send().');
30
+ }
31
+ const queryParameters = {};
32
+ const headerParameters = {};
33
+ headerParameters['Content-Type'] = 'application/json';
34
+ if (this.configuration && this.configuration.accessToken) {
35
+ const token = this.configuration.accessToken;
36
+ const tokenString = await token("bearer", []);
37
+ if (tokenString) {
38
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
40
39
  }
41
- if (requestParameters['sendTxInput'] == null) {
42
- throw new runtime.RequiredError('sendTxInput', 'Required parameter "sendTxInput" was null or undefined when calling send().');
43
- }
44
- const queryParameters = {};
45
- const headerParameters = {};
46
- headerParameters['Content-Type'] = 'application/json';
47
- if (this.configuration && this.configuration.accessToken) {
48
- const token = this.configuration.accessToken;
49
- const tokenString = yield token("bearer", []);
50
- if (tokenString) {
51
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
52
- }
53
- }
54
- let urlPath = `/v1/transaction/{chain}/send`;
55
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
56
- const response = yield this.request({
57
- path: urlPath,
58
- method: 'POST',
59
- headers: headerParameters,
60
- query: queryParameters,
61
- body: (0, index_1.SendTxInputToJSON)(requestParameters['sendTxInput']),
62
- }, initOverrides);
63
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SendTxResponseFromJSON)(jsonValue));
64
- });
40
+ }
41
+ let urlPath = `/v1/transaction/{chain}/send`;
42
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
43
+ const response = await this.request({
44
+ path: urlPath,
45
+ method: 'POST',
46
+ headers: headerParameters,
47
+ query: queryParameters,
48
+ body: SendTxInputToJSON(requestParameters['sendTxInput']),
49
+ }, initOverrides);
50
+ return new runtime.JSONApiResponse(response, (jsonValue) => SendTxResponseFromJSON(jsonValue));
65
51
  }
66
52
  /**
67
53
  * CONTROLLER.TRANSACTION.SEND.DESCRIPTION
68
54
  * CONTROLLER.TRANSACTION.SEND.SUMMARY
69
55
  */
70
- send(requestParameters, initOverrides) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- const response = yield this.sendRaw(requestParameters, initOverrides);
73
- return yield response.value();
74
- });
56
+ async send(requestParameters, initOverrides) {
57
+ const response = await this.sendRaw(requestParameters, initOverrides);
58
+ return await response.value();
75
59
  }
76
60
  }
77
- exports.TransactionApi = TransactionApi;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /* tslint:disable */
3
2
  /* eslint-disable */
4
3
  /**
@@ -12,212 +11,184 @@
12
11
  * https://openapi-generator.tech
13
12
  * Do not edit the class manually.
14
13
  */
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.GetPnlStatsChainEnum = exports.GetPnlChainEnum = exports.GetBalanceChainEnum = exports.CalculatePnlChainEnum = exports.WalletApi = void 0;
26
- const runtime = require("../runtime");
27
- const index_1 = require("../models/index");
14
+ import * as runtime from '../runtime';
15
+ import { BooleanResultDTOFromJSON, CalculatePnlInputToJSON, WalletBalancesDTOFromJSON, WalletPnlDTOFromJSON, } from '../models/index';
28
16
  /**
29
17
  *
30
18
  */
31
- class WalletApi extends runtime.BaseAPI {
19
+ export class WalletApi extends runtime.BaseAPI {
32
20
  /**
33
21
  * CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
34
22
  * CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
35
23
  */
36
- calculatePnlRaw(requestParameters, initOverrides) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- if (requestParameters['chain'] == null) {
39
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling calculatePnl().');
40
- }
41
- if (requestParameters['walletAddress'] == null) {
42
- throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling calculatePnl().');
43
- }
44
- if (requestParameters['calculatePnlInput'] == null) {
45
- throw new runtime.RequiredError('calculatePnlInput', 'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().');
24
+ async calculatePnlRaw(requestParameters, initOverrides) {
25
+ if (requestParameters['chain'] == null) {
26
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling calculatePnl().');
27
+ }
28
+ if (requestParameters['walletAddress'] == null) {
29
+ throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling calculatePnl().');
30
+ }
31
+ if (requestParameters['calculatePnlInput'] == null) {
32
+ throw new runtime.RequiredError('calculatePnlInput', 'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().');
33
+ }
34
+ const queryParameters = {};
35
+ const headerParameters = {};
36
+ headerParameters['Content-Type'] = 'application/json';
37
+ if (this.configuration && this.configuration.accessToken) {
38
+ const token = this.configuration.accessToken;
39
+ const tokenString = await token("bearer", []);
40
+ if (tokenString) {
41
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
46
42
  }
47
- const queryParameters = {};
48
- const headerParameters = {};
49
- headerParameters['Content-Type'] = 'application/json';
50
- if (this.configuration && this.configuration.accessToken) {
51
- const token = this.configuration.accessToken;
52
- const tokenString = yield token("bearer", []);
53
- if (tokenString) {
54
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
55
- }
56
- }
57
- let urlPath = `/v1/wallet/{chain}/{walletAddress}/calculate-pnl`;
58
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
59
- urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
60
- const response = yield this.request({
61
- path: urlPath,
62
- method: 'POST',
63
- headers: headerParameters,
64
- query: queryParameters,
65
- body: (0, index_1.CalculatePnlInputToJSON)(requestParameters['calculatePnlInput']),
66
- }, initOverrides);
67
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BooleanResultDTOFromJSON)(jsonValue));
68
- });
43
+ }
44
+ let urlPath = `/v1/wallet/{chain}/{walletAddress}/calculate-pnl`;
45
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
46
+ urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
47
+ const response = await this.request({
48
+ path: urlPath,
49
+ method: 'POST',
50
+ headers: headerParameters,
51
+ query: queryParameters,
52
+ body: CalculatePnlInputToJSON(requestParameters['calculatePnlInput']),
53
+ }, initOverrides);
54
+ return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
69
55
  }
70
56
  /**
71
57
  * CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
72
58
  * CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
73
59
  */
74
- calculatePnl(requestParameters, initOverrides) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- const response = yield this.calculatePnlRaw(requestParameters, initOverrides);
77
- return yield response.value();
78
- });
60
+ async calculatePnl(requestParameters, initOverrides) {
61
+ const response = await this.calculatePnlRaw(requestParameters, initOverrides);
62
+ return await response.value();
79
63
  }
80
64
  /**
81
65
  * CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
82
66
  * CONTROLLER.WALLET.GET_BALANCES.SUMMARY
83
67
  */
84
- getBalanceRaw(requestParameters, initOverrides) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- if (requestParameters['chain'] == null) {
87
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getBalance().');
88
- }
89
- if (requestParameters['walletAddress'] == null) {
90
- throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getBalance().');
91
- }
92
- const queryParameters = {};
93
- if (requestParameters['tokenAddress'] != null) {
94
- queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
68
+ async getBalanceRaw(requestParameters, initOverrides) {
69
+ if (requestParameters['chain'] == null) {
70
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getBalance().');
71
+ }
72
+ if (requestParameters['walletAddress'] == null) {
73
+ throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getBalance().');
74
+ }
75
+ const queryParameters = {};
76
+ if (requestParameters['tokenAddress'] != null) {
77
+ queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
78
+ }
79
+ const headerParameters = {};
80
+ if (this.configuration && this.configuration.accessToken) {
81
+ const token = this.configuration.accessToken;
82
+ const tokenString = await token("bearer", []);
83
+ if (tokenString) {
84
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
95
85
  }
96
- const headerParameters = {};
97
- if (this.configuration && this.configuration.accessToken) {
98
- const token = this.configuration.accessToken;
99
- const tokenString = yield token("bearer", []);
100
- if (tokenString) {
101
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
102
- }
103
- }
104
- let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
105
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
106
- urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
107
- const response = yield this.request({
108
- path: urlPath,
109
- method: 'GET',
110
- headers: headerParameters,
111
- query: queryParameters,
112
- }, initOverrides);
113
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WalletBalancesDTOFromJSON)(jsonValue));
114
- });
86
+ }
87
+ let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
88
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
89
+ urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
90
+ const response = await this.request({
91
+ path: urlPath,
92
+ method: 'GET',
93
+ headers: headerParameters,
94
+ query: queryParameters,
95
+ }, initOverrides);
96
+ return new runtime.JSONApiResponse(response, (jsonValue) => WalletBalancesDTOFromJSON(jsonValue));
115
97
  }
116
98
  /**
117
99
  * CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
118
100
  * CONTROLLER.WALLET.GET_BALANCES.SUMMARY
119
101
  */
120
- getBalance(requestParameters, initOverrides) {
121
- return __awaiter(this, void 0, void 0, function* () {
122
- const response = yield this.getBalanceRaw(requestParameters, initOverrides);
123
- return yield response.value();
124
- });
102
+ async getBalance(requestParameters, initOverrides) {
103
+ const response = await this.getBalanceRaw(requestParameters, initOverrides);
104
+ return await response.value();
125
105
  }
126
106
  /**
127
107
  * CONTROLLER.WALLET.GET_PNL.DESCRIPTION
128
108
  * CONTROLLER.WALLET.GET_PNL.SUMMARY
129
109
  */
130
- getPnlRaw(requestParameters, initOverrides) {
131
- return __awaiter(this, void 0, void 0, function* () {
132
- if (requestParameters['chain'] == null) {
133
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnl().');
134
- }
135
- if (requestParameters['walletAddress'] == null) {
136
- throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnl().');
137
- }
138
- const queryParameters = {};
139
- if (requestParameters['tokenAddress'] != null) {
140
- queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
110
+ async getPnlRaw(requestParameters, initOverrides) {
111
+ if (requestParameters['chain'] == null) {
112
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnl().');
113
+ }
114
+ if (requestParameters['walletAddress'] == null) {
115
+ throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnl().');
116
+ }
117
+ const queryParameters = {};
118
+ if (requestParameters['tokenAddress'] != null) {
119
+ queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
120
+ }
121
+ const headerParameters = {};
122
+ if (this.configuration && this.configuration.accessToken) {
123
+ const token = this.configuration.accessToken;
124
+ const tokenString = await token("bearer", []);
125
+ if (tokenString) {
126
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
141
127
  }
142
- const headerParameters = {};
143
- if (this.configuration && this.configuration.accessToken) {
144
- const token = this.configuration.accessToken;
145
- const tokenString = yield token("bearer", []);
146
- if (tokenString) {
147
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
148
- }
149
- }
150
- let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
151
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
152
- urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
153
- const response = yield this.request({
154
- path: urlPath,
155
- method: 'GET',
156
- headers: headerParameters,
157
- query: queryParameters,
158
- }, initOverrides);
159
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WalletPnlDTOFromJSON));
160
- });
128
+ }
129
+ let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
130
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
131
+ urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
132
+ const response = await this.request({
133
+ path: urlPath,
134
+ method: 'GET',
135
+ headers: headerParameters,
136
+ query: queryParameters,
137
+ }, initOverrides);
138
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
161
139
  }
162
140
  /**
163
141
  * CONTROLLER.WALLET.GET_PNL.DESCRIPTION
164
142
  * CONTROLLER.WALLET.GET_PNL.SUMMARY
165
143
  */
166
- getPnl(requestParameters, initOverrides) {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- const response = yield this.getPnlRaw(requestParameters, initOverrides);
169
- return yield response.value();
170
- });
144
+ async getPnl(requestParameters, initOverrides) {
145
+ const response = await this.getPnlRaw(requestParameters, initOverrides);
146
+ return await response.value();
171
147
  }
172
148
  /**
173
149
  * CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
174
150
  * CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
175
151
  */
176
- getPnlStatsRaw(requestParameters, initOverrides) {
177
- return __awaiter(this, void 0, void 0, function* () {
178
- if (requestParameters['chain'] == null) {
179
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnlStats().');
180
- }
181
- if (requestParameters['walletAddress'] == null) {
182
- throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnlStats().');
183
- }
184
- const queryParameters = {};
185
- const headerParameters = {};
186
- if (this.configuration && this.configuration.accessToken) {
187
- const token = this.configuration.accessToken;
188
- const tokenString = yield token("bearer", []);
189
- if (tokenString) {
190
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
191
- }
152
+ async getPnlStatsRaw(requestParameters, initOverrides) {
153
+ if (requestParameters['chain'] == null) {
154
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnlStats().');
155
+ }
156
+ if (requestParameters['walletAddress'] == null) {
157
+ throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnlStats().');
158
+ }
159
+ const queryParameters = {};
160
+ const headerParameters = {};
161
+ if (this.configuration && this.configuration.accessToken) {
162
+ const token = this.configuration.accessToken;
163
+ const tokenString = await token("bearer", []);
164
+ if (tokenString) {
165
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
192
166
  }
193
- let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
194
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
195
- urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
196
- const response = yield this.request({
197
- path: urlPath,
198
- method: 'GET',
199
- headers: headerParameters,
200
- query: queryParameters,
201
- }, initOverrides);
202
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WalletPnlDTOFromJSON));
203
- });
167
+ }
168
+ let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
169
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
170
+ urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
171
+ const response = await this.request({
172
+ path: urlPath,
173
+ method: 'GET',
174
+ headers: headerParameters,
175
+ query: queryParameters,
176
+ }, initOverrides);
177
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
204
178
  }
205
179
  /**
206
180
  * CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
207
181
  * CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
208
182
  */
209
- getPnlStats(requestParameters, initOverrides) {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- const response = yield this.getPnlStatsRaw(requestParameters, initOverrides);
212
- return yield response.value();
213
- });
183
+ async getPnlStats(requestParameters, initOverrides) {
184
+ const response = await this.getPnlStatsRaw(requestParameters, initOverrides);
185
+ return await response.value();
214
186
  }
215
187
  }
216
- exports.WalletApi = WalletApi;
217
188
  /**
218
189
  * @export
219
190
  */
220
- exports.CalculatePnlChainEnum = {
191
+ export const CalculatePnlChainEnum = {
221
192
  Sol: 'sol',
222
193
  Base: 'base',
223
194
  Bsc: 'bsc',
@@ -232,7 +203,7 @@ exports.CalculatePnlChainEnum = {
232
203
  /**
233
204
  * @export
234
205
  */
235
- exports.GetBalanceChainEnum = {
206
+ export const GetBalanceChainEnum = {
236
207
  Sol: 'sol',
237
208
  Base: 'base',
238
209
  Bsc: 'bsc',
@@ -247,7 +218,7 @@ exports.GetBalanceChainEnum = {
247
218
  /**
248
219
  * @export
249
220
  */
250
- exports.GetPnlChainEnum = {
221
+ export const GetPnlChainEnum = {
251
222
  Sol: 'sol',
252
223
  Base: 'base',
253
224
  Bsc: 'bsc',
@@ -262,7 +233,7 @@ exports.GetPnlChainEnum = {
262
233
  /**
263
234
  * @export
264
235
  */
265
- exports.GetPnlStatsChainEnum = {
236
+ export const GetPnlStatsChainEnum = {
266
237
  Sol: 'sol',
267
238
  Base: 'base',
268
239
  Bsc: 'bsc',
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /* tslint:disable */
3
2
  /* eslint-disable */
4
3
  /**
@@ -12,72 +11,56 @@
12
11
  * https://openapi-generator.tech
13
12
  * Do not edit the class manually.
14
13
  */
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.WatchlistAddChainEnum = exports.WatchlistApi = void 0;
26
- const runtime = require("../runtime");
27
- const index_1 = require("../models/index");
14
+ import * as runtime from '../runtime';
15
+ import { BooleanResultDTOFromJSON, } from '../models/index';
28
16
  /**
29
17
  *
30
18
  */
31
- class WatchlistApi extends runtime.BaseAPI {
19
+ export class WatchlistApi extends runtime.BaseAPI {
32
20
  /**
33
21
  * CONTROLLER.WATCHLIST.ADD.DESCRIPTION
34
22
  * CONTROLLER.WATCHLIST.ADD.SUMMARY
35
23
  */
36
- watchlistAddRaw(requestParameters, initOverrides) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- if (requestParameters['chain'] == null) {
39
- throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling watchlistAdd().');
40
- }
41
- if (requestParameters['walletAddress'] == null) {
42
- throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().');
43
- }
44
- const queryParameters = {};
45
- const headerParameters = {};
46
- if (this.configuration && this.configuration.accessToken) {
47
- const token = this.configuration.accessToken;
48
- const tokenString = yield token("bearer", []);
49
- if (tokenString) {
50
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
51
- }
24
+ async watchlistAddRaw(requestParameters, initOverrides) {
25
+ if (requestParameters['chain'] == null) {
26
+ throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling watchlistAdd().');
27
+ }
28
+ if (requestParameters['walletAddress'] == null) {
29
+ throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().');
30
+ }
31
+ const queryParameters = {};
32
+ const headerParameters = {};
33
+ if (this.configuration && this.configuration.accessToken) {
34
+ const token = this.configuration.accessToken;
35
+ const tokenString = await token("bearer", []);
36
+ if (tokenString) {
37
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
52
38
  }
53
- let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
54
- urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
55
- urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
56
- const response = yield this.request({
57
- path: urlPath,
58
- method: 'POST',
59
- headers: headerParameters,
60
- query: queryParameters,
61
- }, initOverrides);
62
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BooleanResultDTOFromJSON)(jsonValue));
63
- });
39
+ }
40
+ let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
41
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
42
+ urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
43
+ const response = await this.request({
44
+ path: urlPath,
45
+ method: 'POST',
46
+ headers: headerParameters,
47
+ query: queryParameters,
48
+ }, initOverrides);
49
+ return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
64
50
  }
65
51
  /**
66
52
  * CONTROLLER.WATCHLIST.ADD.DESCRIPTION
67
53
  * CONTROLLER.WATCHLIST.ADD.SUMMARY
68
54
  */
69
- watchlistAdd(requestParameters, initOverrides) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- const response = yield this.watchlistAddRaw(requestParameters, initOverrides);
72
- return yield response.value();
73
- });
55
+ async watchlistAdd(requestParameters, initOverrides) {
56
+ const response = await this.watchlistAddRaw(requestParameters, initOverrides);
57
+ return await response.value();
74
58
  }
75
59
  }
76
- exports.WatchlistApi = WatchlistApi;
77
60
  /**
78
61
  * @export
79
62
  */
80
- exports.WatchlistAddChainEnum = {
63
+ export const WatchlistAddChainEnum = {
81
64
  Sol: 'sol',
82
65
  Base: 'base',
83
66
  Bsc: 'bsc',