@chainstream-io/sdk 0.1.5 → 0.1.7
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 +46 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +76 -60
- package/dist/esm/openapi/apis/BlockchainApi.js +61 -44
- package/dist/esm/openapi/apis/DefiSolanaMoonshotApi.js +67 -50
- package/dist/esm/openapi/apis/DefiSolanaPumpfunApi.js +38 -25
- package/dist/esm/openapi/apis/DexApi.js +205 -176
- package/dist/esm/openapi/apis/DexPoolApi.js +41 -28
- package/dist/esm/openapi/apis/EndpointApi.js +212 -175
- package/dist/esm/openapi/apis/IpfsApi.js +38 -25
- package/dist/esm/openapi/apis/JobsApi.js +65 -48
- package/dist/esm/openapi/apis/RankingApi.js +278 -249
- package/dist/esm/openapi/apis/RedPacketApi.js +294 -253
- package/dist/esm/openapi/apis/TokenApi.js +1145 -1056
- package/dist/esm/openapi/apis/TradeApi.js +233 -208
- package/dist/esm/openapi/apis/TransactionApi.js +42 -29
- package/dist/esm/openapi/apis/WalletApi.js +148 -123
- package/dist/esm/openapi/apis/WatchlistApi.js +41 -28
- package/dist/esm/openapi/runtime.js +81 -69
- package/dist/esm/stream/index.d.ts +3 -0
- package/dist/esm/stream/index.js +3 -0
- package/dist/esm/{api → stream}/stream.js +36 -29
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -59
- package/dist/openapi/apis/BlockchainApi.js +62 -78
- package/dist/openapi/apis/DefiSolanaMoonshotApi.js +68 -84
- package/dist/openapi/apis/DefiSolanaPumpfunApi.js +39 -59
- package/dist/openapi/apis/DexApi.js +206 -210
- package/dist/openapi/apis/DexPoolApi.js +42 -62
- package/dist/openapi/apis/EndpointApi.js +213 -209
- package/dist/openapi/apis/IpfsApi.js +39 -59
- package/dist/openapi/apis/JobsApi.js +66 -82
- package/dist/openapi/apis/RankingApi.js +279 -283
- package/dist/openapi/apis/RedPacketApi.js +295 -287
- package/dist/openapi/apis/TokenApi.js +1146 -1090
- package/dist/openapi/apis/TradeApi.js +234 -242
- package/dist/openapi/apis/TransactionApi.js +43 -63
- package/dist/openapi/apis/WalletApi.js +149 -157
- package/dist/openapi/apis/WatchlistApi.js +42 -62
- package/dist/openapi/runtime.js +81 -69
- package/dist/stream/index.d.ts +3 -0
- package/dist/stream/index.js +19 -0
- package/dist/{api → stream}/stream.js +36 -29
- package/package.json +29 -26
- package/src/api/stream.fields.ts +0 -271
- package/src/api/stream.model.ts +0 -307
- package/src/api/stream.ts +0 -1086
- package/src/index.ts +0 -188
- package/src/openapi/apis/BlockchainApi.ts +0 -140
- package/src/openapi/apis/DefiSolanaMoonshotApi.ts +0 -145
- package/src/openapi/apis/DefiSolanaPumpfunApi.ts +0 -86
- package/src/openapi/apis/DexApi.ts +0 -490
- package/src/openapi/apis/DexPoolApi.ts +0 -107
- package/src/openapi/apis/EndpointApi.ts +0 -421
- package/src/openapi/apis/IpfsApi.ts +0 -66
- package/src/openapi/apis/JobsApi.ts +0 -135
- package/src/openapi/apis/RankingApi.ts +0 -939
- package/src/openapi/apis/RedPacketApi.ts +0 -621
- package/src/openapi/apis/TokenApi.ts +0 -2569
- package/src/openapi/apis/TradeApi.ts +0 -596
- package/src/openapi/apis/TransactionApi.ts +0 -95
- package/src/openapi/apis/WalletApi.ts +0 -365
- package/src/openapi/apis/WatchlistApi.ts +0 -107
- package/src/openapi/apis/index.ts +0 -17
- package/src/openapi/index.ts +0 -5
- package/src/openapi/models/BlockchainDTO.ts +0 -93
- package/src/openapi/models/BlockchainLatestBlockDTO.ts +0 -75
- package/src/openapi/models/BooleanResultDTO.ts +0 -66
- package/src/openapi/models/CalculatePnlInput.ts +0 -65
- package/src/openapi/models/Candle.ts +0 -130
- package/src/openapi/models/ClaimRedPacketInput.ts +0 -90
- package/src/openapi/models/CreateEndpointInput.ts +0 -121
- package/src/openapi/models/CreateRedPacketInput.ts +0 -124
- package/src/openapi/models/CreateRedPacketReply.ts +0 -75
- package/src/openapi/models/CreateTokenInput.ts +0 -139
- package/src/openapi/models/CreateTokenReply.ts +0 -75
- package/src/openapi/models/DexDTO.ts +0 -90
- package/src/openapi/models/DexPage.ts +0 -114
- package/src/openapi/models/DexPoolDTO.ts +0 -141
- package/src/openapi/models/EndpointListResponse.ts +0 -97
- package/src/openapi/models/EndpointOperationResponse.ts +0 -65
- package/src/openapi/models/EndpointResponse.ts +0 -145
- package/src/openapi/models/EndpointSecretResponse.ts +0 -65
- package/src/openapi/models/FilterCondition.ts +0 -135
- package/src/openapi/models/GainersAndLosersDTO.ts +0 -93
- package/src/openapi/models/GainersAndLosersPage.ts +0 -114
- package/src/openapi/models/JobDTO.ts +0 -75
- package/src/openapi/models/JobStreamingDTO.ts +0 -75
- package/src/openapi/models/Link.ts +0 -88
- package/src/openapi/models/MoonshotCreateTokenInput.ts +0 -182
- package/src/openapi/models/MoonshotCreateTokenReply.ts +0 -75
- package/src/openapi/models/MoonshotSubmitCreateToken200Response.ts +0 -73
- package/src/openapi/models/MoonshotSubmitCreateTokenInput.ts +0 -74
- package/src/openapi/models/PumpCreateTokenInput.ts +0 -180
- package/src/openapi/models/PumpCreateTokenReply.ts +0 -74
- package/src/openapi/models/QuoteResponse.ts +0 -105
- package/src/openapi/models/RedPacketClaimDTO.ts +0 -148
- package/src/openapi/models/RedPacketClaimsPage.ts +0 -110
- package/src/openapi/models/RedPacketDTO.ts +0 -229
- package/src/openapi/models/RedPacketReply.ts +0 -66
- package/src/openapi/models/RedPacketSendTxInput.ts +0 -66
- package/src/openapi/models/RedPacketSendTxResponse.ts +0 -66
- package/src/openapi/models/RedPacketsPage.ts +0 -110
- package/src/openapi/models/Resolution.ts +0 -61
- package/src/openapi/models/SendTxInput.ts +0 -93
- package/src/openapi/models/SendTxResponse.ts +0 -84
- package/src/openapi/models/SwapInput.ts +0 -157
- package/src/openapi/models/SwapReply.ts +0 -75
- package/src/openapi/models/SwapRouteInput.ts +0 -186
- package/src/openapi/models/SwapRouteResponse.ts +0 -101
- package/src/openapi/models/Token.ts +0 -251
- package/src/openapi/models/TokenCreationDTO.ts +0 -131
- package/src/openapi/models/TokenCreationPage.ts +0 -114
- package/src/openapi/models/TokenCreatorsDTO.ts +0 -81
- package/src/openapi/models/TokenExtraDTO.ts +0 -225
- package/src/openapi/models/TokenHolder.ts +0 -93
- package/src/openapi/models/TokenHolderPage.ts +0 -114
- package/src/openapi/models/TokenListPage.ts +0 -114
- package/src/openapi/models/TokenMarketData.ts +0 -190
- package/src/openapi/models/TokenMetadata.ts +0 -188
- package/src/openapi/models/TokenPage.ts +0 -122
- package/src/openapi/models/TokenPriceDTO.ts +0 -93
- package/src/openapi/models/TokenPricePage.ts +0 -114
- package/src/openapi/models/TokenSocialMediasDTO.ts +0 -161
- package/src/openapi/models/TokenStat.ts +0 -1152
- package/src/openapi/models/TopTradersDTO.ts +0 -164
- package/src/openapi/models/TopTradersPage.ts +0 -114
- package/src/openapi/models/TradeDetailDTO.ts +0 -282
- package/src/openapi/models/TradeEvent.ts +0 -184
- package/src/openapi/models/TradePage.ts +0 -114
- package/src/openapi/models/TradeType.ts +0 -53
- package/src/openapi/models/UpdateEndpointInput.ts +0 -129
- package/src/openapi/models/WalletBalanceDetailDTO.ts +0 -282
- package/src/openapi/models/WalletBalancesDTO.ts +0 -92
- package/src/openapi/models/WalletPnlDTO.ts +0 -264
- package/src/openapi/models/index.ts +0 -72
- package/src/openapi/runtime.ts +0 -432
- /package/dist/{api → esm/stream}/stream.d.ts +0 -0
- /package/dist/{api → esm/stream}/stream.fields.d.ts +0 -0
- /package/dist/esm/{api → stream}/stream.fields.js +0 -0
- /package/dist/{api → esm/stream}/stream.model.d.ts +0 -0
- /package/dist/esm/{api → stream}/stream.model.js +0 -0
- /package/dist/{esm/api → stream}/stream.d.ts +0 -0
- /package/dist/{esm/api → stream}/stream.fields.d.ts +0 -0
- /package/dist/{api → stream}/stream.fields.js +0 -0
- /package/dist/{esm/api → stream}/stream.model.d.ts +0 -0
- /package/dist/{api → stream}/stream.model.js +0 -0
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Dex Aggregator API
|
|
5
|
-
* Dex Aggregator API ⚡️
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact: ai@sx.ai
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import * as runtime from '../runtime';
|
|
17
|
-
import type {
|
|
18
|
-
BooleanResultDTO,
|
|
19
|
-
CalculatePnlInput,
|
|
20
|
-
WalletBalancesDTO,
|
|
21
|
-
WalletPnlDTO,
|
|
22
|
-
} from '../models/index';
|
|
23
|
-
import {
|
|
24
|
-
BooleanResultDTOFromJSON,
|
|
25
|
-
BooleanResultDTOToJSON,
|
|
26
|
-
CalculatePnlInputFromJSON,
|
|
27
|
-
CalculatePnlInputToJSON,
|
|
28
|
-
WalletBalancesDTOFromJSON,
|
|
29
|
-
WalletBalancesDTOToJSON,
|
|
30
|
-
WalletPnlDTOFromJSON,
|
|
31
|
-
WalletPnlDTOToJSON,
|
|
32
|
-
} from '../models/index';
|
|
33
|
-
|
|
34
|
-
export interface CalculatePnlRequest {
|
|
35
|
-
chain: CalculatePnlChainEnum;
|
|
36
|
-
walletAddress: string;
|
|
37
|
-
calculatePnlInput: CalculatePnlInput;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface GetBalanceRequest {
|
|
41
|
-
chain: GetBalanceChainEnum;
|
|
42
|
-
walletAddress: string;
|
|
43
|
-
tokenAddress?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface GetPnlRequest {
|
|
47
|
-
chain: GetPnlChainEnum;
|
|
48
|
-
walletAddress: string;
|
|
49
|
-
tokenAddress?: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface GetPnlStatsRequest {
|
|
53
|
-
chain: GetPnlStatsChainEnum;
|
|
54
|
-
walletAddress: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
export class WalletApi extends runtime.BaseAPI {
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
64
|
-
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
65
|
-
*/
|
|
66
|
-
async calculatePnlRaw(requestParameters: CalculatePnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BooleanResultDTO>> {
|
|
67
|
-
if (requestParameters['chain'] == null) {
|
|
68
|
-
throw new runtime.RequiredError(
|
|
69
|
-
'chain',
|
|
70
|
-
'Required parameter "chain" was null or undefined when calling calculatePnl().'
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (requestParameters['walletAddress'] == null) {
|
|
75
|
-
throw new runtime.RequiredError(
|
|
76
|
-
'walletAddress',
|
|
77
|
-
'Required parameter "walletAddress" was null or undefined when calling calculatePnl().'
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (requestParameters['calculatePnlInput'] == null) {
|
|
82
|
-
throw new runtime.RequiredError(
|
|
83
|
-
'calculatePnlInput',
|
|
84
|
-
'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().'
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const queryParameters: any = {};
|
|
89
|
-
|
|
90
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
91
|
-
|
|
92
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
93
|
-
|
|
94
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
95
|
-
const token = this.configuration.accessToken;
|
|
96
|
-
const tokenString = await token("bearer", []);
|
|
97
|
-
|
|
98
|
-
if (tokenString) {
|
|
99
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
let urlPath = `/v1/wallet/{chain}/{walletAddress}/calculate-pnl`;
|
|
104
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
105
|
-
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
106
|
-
|
|
107
|
-
const response = await this.request({
|
|
108
|
-
path: urlPath,
|
|
109
|
-
method: 'POST',
|
|
110
|
-
headers: headerParameters,
|
|
111
|
-
query: queryParameters,
|
|
112
|
-
body: CalculatePnlInputToJSON(requestParameters['calculatePnlInput']),
|
|
113
|
-
}, initOverrides);
|
|
114
|
-
|
|
115
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
120
|
-
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
121
|
-
*/
|
|
122
|
-
async calculatePnl(requestParameters: CalculatePnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BooleanResultDTO> {
|
|
123
|
-
const response = await this.calculatePnlRaw(requestParameters, initOverrides);
|
|
124
|
-
return await response.value();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
129
|
-
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
130
|
-
*/
|
|
131
|
-
async getBalanceRaw(requestParameters: GetBalanceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WalletBalancesDTO>> {
|
|
132
|
-
if (requestParameters['chain'] == null) {
|
|
133
|
-
throw new runtime.RequiredError(
|
|
134
|
-
'chain',
|
|
135
|
-
'Required parameter "chain" was null or undefined when calling getBalance().'
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (requestParameters['walletAddress'] == null) {
|
|
140
|
-
throw new runtime.RequiredError(
|
|
141
|
-
'walletAddress',
|
|
142
|
-
'Required parameter "walletAddress" was null or undefined when calling getBalance().'
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const queryParameters: any = {};
|
|
147
|
-
|
|
148
|
-
if (requestParameters['tokenAddress'] != null) {
|
|
149
|
-
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
153
|
-
|
|
154
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
155
|
-
const token = this.configuration.accessToken;
|
|
156
|
-
const tokenString = await token("bearer", []);
|
|
157
|
-
|
|
158
|
-
if (tokenString) {
|
|
159
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
|
|
164
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
165
|
-
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
166
|
-
|
|
167
|
-
const response = await this.request({
|
|
168
|
-
path: urlPath,
|
|
169
|
-
method: 'GET',
|
|
170
|
-
headers: headerParameters,
|
|
171
|
-
query: queryParameters,
|
|
172
|
-
}, initOverrides);
|
|
173
|
-
|
|
174
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => WalletBalancesDTOFromJSON(jsonValue));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
179
|
-
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
180
|
-
*/
|
|
181
|
-
async getBalance(requestParameters: GetBalanceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WalletBalancesDTO> {
|
|
182
|
-
const response = await this.getBalanceRaw(requestParameters, initOverrides);
|
|
183
|
-
return await response.value();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
188
|
-
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
189
|
-
*/
|
|
190
|
-
async getPnlRaw(requestParameters: GetPnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<WalletPnlDTO>>> {
|
|
191
|
-
if (requestParameters['chain'] == null) {
|
|
192
|
-
throw new runtime.RequiredError(
|
|
193
|
-
'chain',
|
|
194
|
-
'Required parameter "chain" was null or undefined when calling getPnl().'
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (requestParameters['walletAddress'] == null) {
|
|
199
|
-
throw new runtime.RequiredError(
|
|
200
|
-
'walletAddress',
|
|
201
|
-
'Required parameter "walletAddress" was null or undefined when calling getPnl().'
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
const queryParameters: any = {};
|
|
206
|
-
|
|
207
|
-
if (requestParameters['tokenAddress'] != null) {
|
|
208
|
-
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
212
|
-
|
|
213
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
214
|
-
const token = this.configuration.accessToken;
|
|
215
|
-
const tokenString = await token("bearer", []);
|
|
216
|
-
|
|
217
|
-
if (tokenString) {
|
|
218
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
|
|
223
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
224
|
-
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
225
|
-
|
|
226
|
-
const response = await this.request({
|
|
227
|
-
path: urlPath,
|
|
228
|
-
method: 'GET',
|
|
229
|
-
headers: headerParameters,
|
|
230
|
-
query: queryParameters,
|
|
231
|
-
}, initOverrides);
|
|
232
|
-
|
|
233
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
238
|
-
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
239
|
-
*/
|
|
240
|
-
async getPnl(requestParameters: GetPnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<WalletPnlDTO>> {
|
|
241
|
-
const response = await this.getPnlRaw(requestParameters, initOverrides);
|
|
242
|
-
return await response.value();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
247
|
-
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
248
|
-
*/
|
|
249
|
-
async getPnlStatsRaw(requestParameters: GetPnlStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<WalletPnlDTO>>> {
|
|
250
|
-
if (requestParameters['chain'] == null) {
|
|
251
|
-
throw new runtime.RequiredError(
|
|
252
|
-
'chain',
|
|
253
|
-
'Required parameter "chain" was null or undefined when calling getPnlStats().'
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
if (requestParameters['walletAddress'] == null) {
|
|
258
|
-
throw new runtime.RequiredError(
|
|
259
|
-
'walletAddress',
|
|
260
|
-
'Required parameter "walletAddress" was null or undefined when calling getPnlStats().'
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const queryParameters: any = {};
|
|
265
|
-
|
|
266
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
267
|
-
|
|
268
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
269
|
-
const token = this.configuration.accessToken;
|
|
270
|
-
const tokenString = await token("bearer", []);
|
|
271
|
-
|
|
272
|
-
if (tokenString) {
|
|
273
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
|
|
278
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
279
|
-
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
280
|
-
|
|
281
|
-
const response = await this.request({
|
|
282
|
-
path: urlPath,
|
|
283
|
-
method: 'GET',
|
|
284
|
-
headers: headerParameters,
|
|
285
|
-
query: queryParameters,
|
|
286
|
-
}, initOverrides);
|
|
287
|
-
|
|
288
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
293
|
-
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
294
|
-
*/
|
|
295
|
-
async getPnlStats(requestParameters: GetPnlStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<WalletPnlDTO>> {
|
|
296
|
-
const response = await this.getPnlStatsRaw(requestParameters, initOverrides);
|
|
297
|
-
return await response.value();
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* @export
|
|
304
|
-
*/
|
|
305
|
-
export const CalculatePnlChainEnum = {
|
|
306
|
-
Sol: 'sol',
|
|
307
|
-
Base: 'base',
|
|
308
|
-
Bsc: 'bsc',
|
|
309
|
-
Polygon: 'polygon',
|
|
310
|
-
Arbitrum: 'arbitrum',
|
|
311
|
-
Optimism: 'optimism',
|
|
312
|
-
Avalanche: 'avalanche',
|
|
313
|
-
Ethereum: 'ethereum',
|
|
314
|
-
Zksync: 'zksync',
|
|
315
|
-
Sui: 'sui'
|
|
316
|
-
} as const;
|
|
317
|
-
export type CalculatePnlChainEnum = typeof CalculatePnlChainEnum[keyof typeof CalculatePnlChainEnum];
|
|
318
|
-
/**
|
|
319
|
-
* @export
|
|
320
|
-
*/
|
|
321
|
-
export const GetBalanceChainEnum = {
|
|
322
|
-
Sol: 'sol',
|
|
323
|
-
Base: 'base',
|
|
324
|
-
Bsc: 'bsc',
|
|
325
|
-
Polygon: 'polygon',
|
|
326
|
-
Arbitrum: 'arbitrum',
|
|
327
|
-
Optimism: 'optimism',
|
|
328
|
-
Avalanche: 'avalanche',
|
|
329
|
-
Ethereum: 'ethereum',
|
|
330
|
-
Zksync: 'zksync',
|
|
331
|
-
Sui: 'sui'
|
|
332
|
-
} as const;
|
|
333
|
-
export type GetBalanceChainEnum = typeof GetBalanceChainEnum[keyof typeof GetBalanceChainEnum];
|
|
334
|
-
/**
|
|
335
|
-
* @export
|
|
336
|
-
*/
|
|
337
|
-
export const GetPnlChainEnum = {
|
|
338
|
-
Sol: 'sol',
|
|
339
|
-
Base: 'base',
|
|
340
|
-
Bsc: 'bsc',
|
|
341
|
-
Polygon: 'polygon',
|
|
342
|
-
Arbitrum: 'arbitrum',
|
|
343
|
-
Optimism: 'optimism',
|
|
344
|
-
Avalanche: 'avalanche',
|
|
345
|
-
Ethereum: 'ethereum',
|
|
346
|
-
Zksync: 'zksync',
|
|
347
|
-
Sui: 'sui'
|
|
348
|
-
} as const;
|
|
349
|
-
export type GetPnlChainEnum = typeof GetPnlChainEnum[keyof typeof GetPnlChainEnum];
|
|
350
|
-
/**
|
|
351
|
-
* @export
|
|
352
|
-
*/
|
|
353
|
-
export const GetPnlStatsChainEnum = {
|
|
354
|
-
Sol: 'sol',
|
|
355
|
-
Base: 'base',
|
|
356
|
-
Bsc: 'bsc',
|
|
357
|
-
Polygon: 'polygon',
|
|
358
|
-
Arbitrum: 'arbitrum',
|
|
359
|
-
Optimism: 'optimism',
|
|
360
|
-
Avalanche: 'avalanche',
|
|
361
|
-
Ethereum: 'ethereum',
|
|
362
|
-
Zksync: 'zksync',
|
|
363
|
-
Sui: 'sui'
|
|
364
|
-
} as const;
|
|
365
|
-
export type GetPnlStatsChainEnum = typeof GetPnlStatsChainEnum[keyof typeof GetPnlStatsChainEnum];
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Dex Aggregator API
|
|
5
|
-
* Dex Aggregator API ⚡️
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact: ai@sx.ai
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import * as runtime from '../runtime';
|
|
17
|
-
import type {
|
|
18
|
-
BooleanResultDTO,
|
|
19
|
-
} from '../models/index';
|
|
20
|
-
import {
|
|
21
|
-
BooleanResultDTOFromJSON,
|
|
22
|
-
BooleanResultDTOToJSON,
|
|
23
|
-
} from '../models/index';
|
|
24
|
-
|
|
25
|
-
export interface WatchlistAddRequest {
|
|
26
|
-
chain: WatchlistAddChainEnum;
|
|
27
|
-
walletAddress: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
export class WatchlistApi extends runtime.BaseAPI {
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
37
|
-
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
38
|
-
*/
|
|
39
|
-
async watchlistAddRaw(requestParameters: WatchlistAddRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BooleanResultDTO>> {
|
|
40
|
-
if (requestParameters['chain'] == null) {
|
|
41
|
-
throw new runtime.RequiredError(
|
|
42
|
-
'chain',
|
|
43
|
-
'Required parameter "chain" was null or undefined when calling watchlistAdd().'
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (requestParameters['walletAddress'] == null) {
|
|
48
|
-
throw new runtime.RequiredError(
|
|
49
|
-
'walletAddress',
|
|
50
|
-
'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().'
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const queryParameters: any = {};
|
|
55
|
-
|
|
56
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
57
|
-
|
|
58
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
59
|
-
const token = this.configuration.accessToken;
|
|
60
|
-
const tokenString = await token("bearer", []);
|
|
61
|
-
|
|
62
|
-
if (tokenString) {
|
|
63
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
|
|
68
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
69
|
-
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
70
|
-
|
|
71
|
-
const response = await this.request({
|
|
72
|
-
path: urlPath,
|
|
73
|
-
method: 'POST',
|
|
74
|
-
headers: headerParameters,
|
|
75
|
-
query: queryParameters,
|
|
76
|
-
}, initOverrides);
|
|
77
|
-
|
|
78
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
83
|
-
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
84
|
-
*/
|
|
85
|
-
async watchlistAdd(requestParameters: WatchlistAddRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BooleanResultDTO> {
|
|
86
|
-
const response = await this.watchlistAddRaw(requestParameters, initOverrides);
|
|
87
|
-
return await response.value();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @export
|
|
94
|
-
*/
|
|
95
|
-
export const WatchlistAddChainEnum = {
|
|
96
|
-
Sol: 'sol',
|
|
97
|
-
Base: 'base',
|
|
98
|
-
Bsc: 'bsc',
|
|
99
|
-
Polygon: 'polygon',
|
|
100
|
-
Arbitrum: 'arbitrum',
|
|
101
|
-
Optimism: 'optimism',
|
|
102
|
-
Avalanche: 'avalanche',
|
|
103
|
-
Ethereum: 'ethereum',
|
|
104
|
-
Zksync: 'zksync',
|
|
105
|
-
Sui: 'sui'
|
|
106
|
-
} as const;
|
|
107
|
-
export type WatchlistAddChainEnum = typeof WatchlistAddChainEnum[keyof typeof WatchlistAddChainEnum];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export * from './BlockchainApi';
|
|
4
|
-
export * from './DefiSolanaMoonshotApi';
|
|
5
|
-
export * from './DefiSolanaPumpfunApi';
|
|
6
|
-
export * from './DexApi';
|
|
7
|
-
export * from './DexPoolApi';
|
|
8
|
-
export * from './EndpointApi';
|
|
9
|
-
export * from './IpfsApi';
|
|
10
|
-
export * from './JobsApi';
|
|
11
|
-
export * from './RankingApi';
|
|
12
|
-
export * from './RedPacketApi';
|
|
13
|
-
export * from './TokenApi';
|
|
14
|
-
export * from './TradeApi';
|
|
15
|
-
export * from './TransactionApi';
|
|
16
|
-
export * from './WalletApi';
|
|
17
|
-
export * from './WatchlistApi';
|
package/src/openapi/index.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Dex Aggregator API
|
|
5
|
-
* Dex Aggregator API ⚡️
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact: ai@sx.ai
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { mapValues } from '../runtime';
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @export
|
|
19
|
-
* @interface BlockchainDTO
|
|
20
|
-
*/
|
|
21
|
-
export interface BlockchainDTO {
|
|
22
|
-
/**
|
|
23
|
-
* DTO.BLOCKCHAIN.SYMBOL
|
|
24
|
-
* @type {string}
|
|
25
|
-
* @memberof BlockchainDTO
|
|
26
|
-
*/
|
|
27
|
-
symbol: string;
|
|
28
|
-
/**
|
|
29
|
-
* DTO.BLOCKCHAIN.NAME
|
|
30
|
-
* @type {string}
|
|
31
|
-
* @memberof BlockchainDTO
|
|
32
|
-
*/
|
|
33
|
-
name: string;
|
|
34
|
-
/**
|
|
35
|
-
* DTO.BLOCKCHAIN.EXPLORER_URL
|
|
36
|
-
* @type {string}
|
|
37
|
-
* @memberof BlockchainDTO
|
|
38
|
-
*/
|
|
39
|
-
explorerUrl: string;
|
|
40
|
-
/**
|
|
41
|
-
* DTO.BLOCKCHAIN.CHAIN_ID
|
|
42
|
-
* @type {number}
|
|
43
|
-
* @memberof BlockchainDTO
|
|
44
|
-
*/
|
|
45
|
-
chainId: number;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Check if a given object implements the BlockchainDTO interface.
|
|
50
|
-
*/
|
|
51
|
-
export function instanceOfBlockchainDTO(value: object): value is BlockchainDTO {
|
|
52
|
-
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
53
|
-
if (!('name' in value) || value['name'] === undefined) return false;
|
|
54
|
-
if (!('explorerUrl' in value) || value['explorerUrl'] === undefined) return false;
|
|
55
|
-
if (!('chainId' in value) || value['chainId'] === undefined) return false;
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function BlockchainDTOFromJSON(json: any): BlockchainDTO {
|
|
60
|
-
return BlockchainDTOFromJSONTyped(json, false);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function BlockchainDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainDTO {
|
|
64
|
-
if (json == null) {
|
|
65
|
-
return json;
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
|
|
69
|
-
'symbol': json['symbol'],
|
|
70
|
-
'name': json['name'],
|
|
71
|
-
'explorerUrl': json['explorerUrl'],
|
|
72
|
-
'chainId': json['chainId'],
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function BlockchainDTOToJSON(json: any): BlockchainDTO {
|
|
77
|
-
return BlockchainDTOToJSONTyped(json, false);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function BlockchainDTOToJSONTyped(value?: BlockchainDTO | null, ignoreDiscriminator: boolean = false): any {
|
|
81
|
-
if (value == null) {
|
|
82
|
-
return value;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
|
|
87
|
-
'symbol': value['symbol'],
|
|
88
|
-
'name': value['name'],
|
|
89
|
-
'explorerUrl': value['explorerUrl'],
|
|
90
|
-
'chainId': value['chainId'],
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Dex Aggregator API
|
|
5
|
-
* Dex Aggregator API ⚡️
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact: ai@sx.ai
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { mapValues } from '../runtime';
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @export
|
|
19
|
-
* @interface BlockchainLatestBlockDTO
|
|
20
|
-
*/
|
|
21
|
-
export interface BlockchainLatestBlockDTO {
|
|
22
|
-
/**
|
|
23
|
-
* DTO.BLOCKCHAIN.LATEST_BLOCK.BLOCKHASH
|
|
24
|
-
* @type {string}
|
|
25
|
-
* @memberof BlockchainLatestBlockDTO
|
|
26
|
-
*/
|
|
27
|
-
blockhash: string;
|
|
28
|
-
/**
|
|
29
|
-
* DTO.BLOCKCHAIN.LATEST_BLOCK.LAST_VALID_BLOCK_HEIGHT
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof BlockchainLatestBlockDTO
|
|
32
|
-
*/
|
|
33
|
-
lastValidBlockHeight: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Check if a given object implements the BlockchainLatestBlockDTO interface.
|
|
38
|
-
*/
|
|
39
|
-
export function instanceOfBlockchainLatestBlockDTO(value: object): value is BlockchainLatestBlockDTO {
|
|
40
|
-
if (!('blockhash' in value) || value['blockhash'] === undefined) return false;
|
|
41
|
-
if (!('lastValidBlockHeight' in value) || value['lastValidBlockHeight'] === undefined) return false;
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function BlockchainLatestBlockDTOFromJSON(json: any): BlockchainLatestBlockDTO {
|
|
46
|
-
return BlockchainLatestBlockDTOFromJSONTyped(json, false);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function BlockchainLatestBlockDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainLatestBlockDTO {
|
|
50
|
-
if (json == null) {
|
|
51
|
-
return json;
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
|
|
55
|
-
'blockhash': json['blockhash'],
|
|
56
|
-
'lastValidBlockHeight': json['lastValidBlockHeight'],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function BlockchainLatestBlockDTOToJSON(json: any): BlockchainLatestBlockDTO {
|
|
61
|
-
return BlockchainLatestBlockDTOToJSONTyped(json, false);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function BlockchainLatestBlockDTOToJSONTyped(value?: BlockchainLatestBlockDTO | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
-
if (value == null) {
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
'blockhash': value['blockhash'],
|
|
72
|
-
'lastValidBlockHeight': value['lastValidBlockHeight'],
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|