@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,490 +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
|
-
CreateTokenInput,
|
|
19
|
-
CreateTokenReply,
|
|
20
|
-
DexPage,
|
|
21
|
-
QuoteResponse,
|
|
22
|
-
SwapInput,
|
|
23
|
-
SwapReply,
|
|
24
|
-
SwapRouteInput,
|
|
25
|
-
SwapRouteResponse,
|
|
26
|
-
} from '../models/index';
|
|
27
|
-
import {
|
|
28
|
-
CreateTokenInputFromJSON,
|
|
29
|
-
CreateTokenInputToJSON,
|
|
30
|
-
CreateTokenReplyFromJSON,
|
|
31
|
-
CreateTokenReplyToJSON,
|
|
32
|
-
DexPageFromJSON,
|
|
33
|
-
DexPageToJSON,
|
|
34
|
-
QuoteResponseFromJSON,
|
|
35
|
-
QuoteResponseToJSON,
|
|
36
|
-
SwapInputFromJSON,
|
|
37
|
-
SwapInputToJSON,
|
|
38
|
-
SwapReplyFromJSON,
|
|
39
|
-
SwapReplyToJSON,
|
|
40
|
-
SwapRouteInputFromJSON,
|
|
41
|
-
SwapRouteInputToJSON,
|
|
42
|
-
SwapRouteResponseFromJSON,
|
|
43
|
-
SwapRouteResponseToJSON,
|
|
44
|
-
} from '../models/index';
|
|
45
|
-
|
|
46
|
-
export interface CreateTokenRequest {
|
|
47
|
-
chain: CreateTokenChainEnum;
|
|
48
|
-
createTokenInput: CreateTokenInput;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ListDexRequest {
|
|
52
|
-
chains?: Array<string>;
|
|
53
|
-
limit?: number;
|
|
54
|
-
dexProgram?: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface QuoteRequest {
|
|
58
|
-
chain: QuoteChainEnum;
|
|
59
|
-
dex: QuoteDexEnum;
|
|
60
|
-
amount: string;
|
|
61
|
-
inputMint: string;
|
|
62
|
-
outputMint: string;
|
|
63
|
-
exactIn: boolean;
|
|
64
|
-
slippage: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface RouteRequest {
|
|
68
|
-
chain: RouteChainEnum;
|
|
69
|
-
swapRouteInput: SwapRouteInput;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface SwapRequest {
|
|
73
|
-
chain: SwapChainEnum;
|
|
74
|
-
swapInput: SwapInput;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
export class DexApi extends runtime.BaseAPI {
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* CONTROLLER.DEX.CREATE.DESCRIPTION
|
|
84
|
-
* CONTROLLER.DEX.CREATE.SUMMARY
|
|
85
|
-
*/
|
|
86
|
-
async createTokenRaw(requestParameters: CreateTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTokenReply>> {
|
|
87
|
-
if (requestParameters['chain'] == null) {
|
|
88
|
-
throw new runtime.RequiredError(
|
|
89
|
-
'chain',
|
|
90
|
-
'Required parameter "chain" was null or undefined when calling createToken().'
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (requestParameters['createTokenInput'] == null) {
|
|
95
|
-
throw new runtime.RequiredError(
|
|
96
|
-
'createTokenInput',
|
|
97
|
-
'Required parameter "createTokenInput" was null or undefined when calling createToken().'
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const queryParameters: any = {};
|
|
102
|
-
|
|
103
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
104
|
-
|
|
105
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
106
|
-
|
|
107
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
108
|
-
const token = this.configuration.accessToken;
|
|
109
|
-
const tokenString = await token("bearer", []);
|
|
110
|
-
|
|
111
|
-
if (tokenString) {
|
|
112
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let urlPath = `/v1/dex/{chain}/create`;
|
|
117
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
118
|
-
|
|
119
|
-
const response = await this.request({
|
|
120
|
-
path: urlPath,
|
|
121
|
-
method: 'POST',
|
|
122
|
-
headers: headerParameters,
|
|
123
|
-
query: queryParameters,
|
|
124
|
-
body: CreateTokenInputToJSON(requestParameters['createTokenInput']),
|
|
125
|
-
}, initOverrides);
|
|
126
|
-
|
|
127
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CreateTokenReplyFromJSON(jsonValue));
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* CONTROLLER.DEX.CREATE.DESCRIPTION
|
|
132
|
-
* CONTROLLER.DEX.CREATE.SUMMARY
|
|
133
|
-
*/
|
|
134
|
-
async createToken(requestParameters: CreateTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTokenReply> {
|
|
135
|
-
const response = await this.createTokenRaw(requestParameters, initOverrides);
|
|
136
|
-
return await response.value();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* CONTROLLER.DEX.LIST.DESCRIPTION
|
|
141
|
-
* CONTROLLER.DEX.LIST.SUMMARY
|
|
142
|
-
*/
|
|
143
|
-
async listDexRaw(requestParameters: ListDexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DexPage>> {
|
|
144
|
-
const queryParameters: any = {};
|
|
145
|
-
|
|
146
|
-
if (requestParameters['chains'] != null) {
|
|
147
|
-
queryParameters['chains'] = requestParameters['chains'];
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (requestParameters['limit'] != null) {
|
|
151
|
-
queryParameters['limit'] = requestParameters['limit'];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (requestParameters['dexProgram'] != null) {
|
|
155
|
-
queryParameters['dexProgram'] = requestParameters['dexProgram'];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
159
|
-
|
|
160
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
161
|
-
const token = this.configuration.accessToken;
|
|
162
|
-
const tokenString = await token("bearer", []);
|
|
163
|
-
|
|
164
|
-
if (tokenString) {
|
|
165
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
let urlPath = `/v1/dex`;
|
|
170
|
-
|
|
171
|
-
const response = await this.request({
|
|
172
|
-
path: urlPath,
|
|
173
|
-
method: 'GET',
|
|
174
|
-
headers: headerParameters,
|
|
175
|
-
query: queryParameters,
|
|
176
|
-
}, initOverrides);
|
|
177
|
-
|
|
178
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => DexPageFromJSON(jsonValue));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* CONTROLLER.DEX.LIST.DESCRIPTION
|
|
183
|
-
* CONTROLLER.DEX.LIST.SUMMARY
|
|
184
|
-
*/
|
|
185
|
-
async listDex(requestParameters: ListDexRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DexPage> {
|
|
186
|
-
const response = await this.listDexRaw(requestParameters, initOverrides);
|
|
187
|
-
return await response.value();
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* CONTROLLER.DEX.QUOTE.DESCRIPTION
|
|
192
|
-
* CONTROLLER.DEX.QUOTE.SUMMARY
|
|
193
|
-
*/
|
|
194
|
-
async quoteRaw(requestParameters: QuoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QuoteResponse>> {
|
|
195
|
-
if (requestParameters['chain'] == null) {
|
|
196
|
-
throw new runtime.RequiredError(
|
|
197
|
-
'chain',
|
|
198
|
-
'Required parameter "chain" was null or undefined when calling quote().'
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (requestParameters['dex'] == null) {
|
|
203
|
-
throw new runtime.RequiredError(
|
|
204
|
-
'dex',
|
|
205
|
-
'Required parameter "dex" was null or undefined when calling quote().'
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (requestParameters['amount'] == null) {
|
|
210
|
-
throw new runtime.RequiredError(
|
|
211
|
-
'amount',
|
|
212
|
-
'Required parameter "amount" was null or undefined when calling quote().'
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (requestParameters['inputMint'] == null) {
|
|
217
|
-
throw new runtime.RequiredError(
|
|
218
|
-
'inputMint',
|
|
219
|
-
'Required parameter "inputMint" was null or undefined when calling quote().'
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (requestParameters['outputMint'] == null) {
|
|
224
|
-
throw new runtime.RequiredError(
|
|
225
|
-
'outputMint',
|
|
226
|
-
'Required parameter "outputMint" was null or undefined when calling quote().'
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (requestParameters['exactIn'] == null) {
|
|
231
|
-
throw new runtime.RequiredError(
|
|
232
|
-
'exactIn',
|
|
233
|
-
'Required parameter "exactIn" was null or undefined when calling quote().'
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (requestParameters['slippage'] == null) {
|
|
238
|
-
throw new runtime.RequiredError(
|
|
239
|
-
'slippage',
|
|
240
|
-
'Required parameter "slippage" was null or undefined when calling quote().'
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
const queryParameters: any = {};
|
|
245
|
-
|
|
246
|
-
if (requestParameters['dex'] != null) {
|
|
247
|
-
queryParameters['dex'] = requestParameters['dex'];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (requestParameters['amount'] != null) {
|
|
251
|
-
queryParameters['amount'] = requestParameters['amount'];
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (requestParameters['inputMint'] != null) {
|
|
255
|
-
queryParameters['inputMint'] = requestParameters['inputMint'];
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (requestParameters['outputMint'] != null) {
|
|
259
|
-
queryParameters['outputMint'] = requestParameters['outputMint'];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (requestParameters['exactIn'] != null) {
|
|
263
|
-
queryParameters['exactIn'] = requestParameters['exactIn'];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (requestParameters['slippage'] != null) {
|
|
267
|
-
queryParameters['slippage'] = requestParameters['slippage'];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
271
|
-
|
|
272
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
273
|
-
const token = this.configuration.accessToken;
|
|
274
|
-
const tokenString = await token("bearer", []);
|
|
275
|
-
|
|
276
|
-
if (tokenString) {
|
|
277
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
let urlPath = `/v1/dex/{chain}/quote`;
|
|
282
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
283
|
-
|
|
284
|
-
const response = await this.request({
|
|
285
|
-
path: urlPath,
|
|
286
|
-
method: 'GET',
|
|
287
|
-
headers: headerParameters,
|
|
288
|
-
query: queryParameters,
|
|
289
|
-
}, initOverrides);
|
|
290
|
-
|
|
291
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => QuoteResponseFromJSON(jsonValue));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* CONTROLLER.DEX.QUOTE.DESCRIPTION
|
|
296
|
-
* CONTROLLER.DEX.QUOTE.SUMMARY
|
|
297
|
-
*/
|
|
298
|
-
async quote(requestParameters: QuoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QuoteResponse> {
|
|
299
|
-
const response = await this.quoteRaw(requestParameters, initOverrides);
|
|
300
|
-
return await response.value();
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* CONTROLLER.DEX.ROUTE.DESCRIPTION
|
|
305
|
-
* CONTROLLER.DEX.ROUTE.SUMMARY
|
|
306
|
-
*/
|
|
307
|
-
async routeRaw(requestParameters: RouteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SwapRouteResponse>> {
|
|
308
|
-
if (requestParameters['chain'] == null) {
|
|
309
|
-
throw new runtime.RequiredError(
|
|
310
|
-
'chain',
|
|
311
|
-
'Required parameter "chain" was null or undefined when calling route().'
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (requestParameters['swapRouteInput'] == null) {
|
|
316
|
-
throw new runtime.RequiredError(
|
|
317
|
-
'swapRouteInput',
|
|
318
|
-
'Required parameter "swapRouteInput" was null or undefined when calling route().'
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const queryParameters: any = {};
|
|
323
|
-
|
|
324
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
325
|
-
|
|
326
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
327
|
-
|
|
328
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
329
|
-
const token = this.configuration.accessToken;
|
|
330
|
-
const tokenString = await token("bearer", []);
|
|
331
|
-
|
|
332
|
-
if (tokenString) {
|
|
333
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
let urlPath = `/v1/dex/{chain}/route`;
|
|
338
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
339
|
-
|
|
340
|
-
const response = await this.request({
|
|
341
|
-
path: urlPath,
|
|
342
|
-
method: 'POST',
|
|
343
|
-
headers: headerParameters,
|
|
344
|
-
query: queryParameters,
|
|
345
|
-
body: SwapRouteInputToJSON(requestParameters['swapRouteInput']),
|
|
346
|
-
}, initOverrides);
|
|
347
|
-
|
|
348
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SwapRouteResponseFromJSON(jsonValue));
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* CONTROLLER.DEX.ROUTE.DESCRIPTION
|
|
353
|
-
* CONTROLLER.DEX.ROUTE.SUMMARY
|
|
354
|
-
*/
|
|
355
|
-
async route(requestParameters: RouteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SwapRouteResponse> {
|
|
356
|
-
const response = await this.routeRaw(requestParameters, initOverrides);
|
|
357
|
-
return await response.value();
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* CONTROLLER.DEX.SWAP.DESCRIPTION
|
|
362
|
-
* CONTROLLER.DEX.SWAP.SUMMARY
|
|
363
|
-
*/
|
|
364
|
-
async swapRaw(requestParameters: SwapRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SwapReply>> {
|
|
365
|
-
if (requestParameters['chain'] == null) {
|
|
366
|
-
throw new runtime.RequiredError(
|
|
367
|
-
'chain',
|
|
368
|
-
'Required parameter "chain" was null or undefined when calling swap().'
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
if (requestParameters['swapInput'] == null) {
|
|
373
|
-
throw new runtime.RequiredError(
|
|
374
|
-
'swapInput',
|
|
375
|
-
'Required parameter "swapInput" was null or undefined when calling swap().'
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
const queryParameters: any = {};
|
|
380
|
-
|
|
381
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
382
|
-
|
|
383
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
384
|
-
|
|
385
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
386
|
-
const token = this.configuration.accessToken;
|
|
387
|
-
const tokenString = await token("bearer", []);
|
|
388
|
-
|
|
389
|
-
if (tokenString) {
|
|
390
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
let urlPath = `/v1/dex/{chain}/swap`;
|
|
395
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
396
|
-
|
|
397
|
-
const response = await this.request({
|
|
398
|
-
path: urlPath,
|
|
399
|
-
method: 'POST',
|
|
400
|
-
headers: headerParameters,
|
|
401
|
-
query: queryParameters,
|
|
402
|
-
body: SwapInputToJSON(requestParameters['swapInput']),
|
|
403
|
-
}, initOverrides);
|
|
404
|
-
|
|
405
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SwapReplyFromJSON(jsonValue));
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* CONTROLLER.DEX.SWAP.DESCRIPTION
|
|
410
|
-
* CONTROLLER.DEX.SWAP.SUMMARY
|
|
411
|
-
*/
|
|
412
|
-
async swap(requestParameters: SwapRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SwapReply> {
|
|
413
|
-
const response = await this.swapRaw(requestParameters, initOverrides);
|
|
414
|
-
return await response.value();
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* @export
|
|
421
|
-
*/
|
|
422
|
-
export const CreateTokenChainEnum = {
|
|
423
|
-
Sol: 'sol',
|
|
424
|
-
Base: 'base',
|
|
425
|
-
Bsc: 'bsc',
|
|
426
|
-
Polygon: 'polygon',
|
|
427
|
-
Arbitrum: 'arbitrum',
|
|
428
|
-
Optimism: 'optimism',
|
|
429
|
-
Avalanche: 'avalanche',
|
|
430
|
-
Ethereum: 'ethereum',
|
|
431
|
-
Zksync: 'zksync',
|
|
432
|
-
Sui: 'sui'
|
|
433
|
-
} as const;
|
|
434
|
-
export type CreateTokenChainEnum = typeof CreateTokenChainEnum[keyof typeof CreateTokenChainEnum];
|
|
435
|
-
/**
|
|
436
|
-
* @export
|
|
437
|
-
*/
|
|
438
|
-
export const QuoteChainEnum = {
|
|
439
|
-
Sol: 'sol',
|
|
440
|
-
Base: 'base',
|
|
441
|
-
Bsc: 'bsc',
|
|
442
|
-
Polygon: 'polygon',
|
|
443
|
-
Arbitrum: 'arbitrum',
|
|
444
|
-
Optimism: 'optimism',
|
|
445
|
-
Avalanche: 'avalanche',
|
|
446
|
-
Ethereum: 'ethereum',
|
|
447
|
-
Zksync: 'zksync',
|
|
448
|
-
Sui: 'sui'
|
|
449
|
-
} as const;
|
|
450
|
-
export type QuoteChainEnum = typeof QuoteChainEnum[keyof typeof QuoteChainEnum];
|
|
451
|
-
/**
|
|
452
|
-
* @export
|
|
453
|
-
*/
|
|
454
|
-
export const QuoteDexEnum = {
|
|
455
|
-
Raydium: 'raydium',
|
|
456
|
-
Pumpfun: 'pumpfun'
|
|
457
|
-
} as const;
|
|
458
|
-
export type QuoteDexEnum = typeof QuoteDexEnum[keyof typeof QuoteDexEnum];
|
|
459
|
-
/**
|
|
460
|
-
* @export
|
|
461
|
-
*/
|
|
462
|
-
export const RouteChainEnum = {
|
|
463
|
-
Sol: 'sol',
|
|
464
|
-
Base: 'base',
|
|
465
|
-
Bsc: 'bsc',
|
|
466
|
-
Polygon: 'polygon',
|
|
467
|
-
Arbitrum: 'arbitrum',
|
|
468
|
-
Optimism: 'optimism',
|
|
469
|
-
Avalanche: 'avalanche',
|
|
470
|
-
Ethereum: 'ethereum',
|
|
471
|
-
Zksync: 'zksync',
|
|
472
|
-
Sui: 'sui'
|
|
473
|
-
} as const;
|
|
474
|
-
export type RouteChainEnum = typeof RouteChainEnum[keyof typeof RouteChainEnum];
|
|
475
|
-
/**
|
|
476
|
-
* @export
|
|
477
|
-
*/
|
|
478
|
-
export const SwapChainEnum = {
|
|
479
|
-
Sol: 'sol',
|
|
480
|
-
Base: 'base',
|
|
481
|
-
Bsc: 'bsc',
|
|
482
|
-
Polygon: 'polygon',
|
|
483
|
-
Arbitrum: 'arbitrum',
|
|
484
|
-
Optimism: 'optimism',
|
|
485
|
-
Avalanche: 'avalanche',
|
|
486
|
-
Ethereum: 'ethereum',
|
|
487
|
-
Zksync: 'zksync',
|
|
488
|
-
Sui: 'sui'
|
|
489
|
-
} as const;
|
|
490
|
-
export type SwapChainEnum = typeof SwapChainEnum[keyof typeof SwapChainEnum];
|
|
@@ -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
|
-
DexPoolDTO,
|
|
19
|
-
} from '../models/index';
|
|
20
|
-
import {
|
|
21
|
-
DexPoolDTOFromJSON,
|
|
22
|
-
DexPoolDTOToJSON,
|
|
23
|
-
} from '../models/index';
|
|
24
|
-
|
|
25
|
-
export interface GetDexpoolRequest {
|
|
26
|
-
chain: GetDexpoolChainEnum;
|
|
27
|
-
poolAddress: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
export class DexPoolApi extends runtime.BaseAPI {
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* CONTROLLER.DEXPOOL.GET.DESCRIPTION
|
|
37
|
-
* CONTROLLER.DEXPOOL.GET.SUMMARY
|
|
38
|
-
*/
|
|
39
|
-
async getDexpoolRaw(requestParameters: GetDexpoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DexPoolDTO>> {
|
|
40
|
-
if (requestParameters['chain'] == null) {
|
|
41
|
-
throw new runtime.RequiredError(
|
|
42
|
-
'chain',
|
|
43
|
-
'Required parameter "chain" was null or undefined when calling getDexpool().'
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (requestParameters['poolAddress'] == null) {
|
|
48
|
-
throw new runtime.RequiredError(
|
|
49
|
-
'poolAddress',
|
|
50
|
-
'Required parameter "poolAddress" was null or undefined when calling getDexpool().'
|
|
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/dexpools/{chain}/{poolAddress}`;
|
|
68
|
-
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
69
|
-
urlPath = urlPath.replace(`{${"poolAddress"}}`, encodeURIComponent(String(requestParameters['poolAddress'])));
|
|
70
|
-
|
|
71
|
-
const response = await this.request({
|
|
72
|
-
path: urlPath,
|
|
73
|
-
method: 'GET',
|
|
74
|
-
headers: headerParameters,
|
|
75
|
-
query: queryParameters,
|
|
76
|
-
}, initOverrides);
|
|
77
|
-
|
|
78
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => DexPoolDTOFromJSON(jsonValue));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* CONTROLLER.DEXPOOL.GET.DESCRIPTION
|
|
83
|
-
* CONTROLLER.DEXPOOL.GET.SUMMARY
|
|
84
|
-
*/
|
|
85
|
-
async getDexpool(requestParameters: GetDexpoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DexPoolDTO> {
|
|
86
|
-
const response = await this.getDexpoolRaw(requestParameters, initOverrides);
|
|
87
|
-
return await response.value();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @export
|
|
94
|
-
*/
|
|
95
|
-
export const GetDexpoolChainEnum = {
|
|
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 GetDexpoolChainEnum = typeof GetDexpoolChainEnum[keyof typeof GetDexpoolChainEnum];
|