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