@chainstream-io/sdk 0.1.8 → 0.1.9
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 +73 -74
- 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 +119 -118
- package/dist/esm/stream/stream.js +36 -34
- package/dist/index.js +99 -96
- package/dist/openapi/apis/BlockchainApi.js +69 -48
- package/dist/openapi/apis/DefiSolanaMoonshotApi.js +74 -53
- package/dist/openapi/apis/DefiSolanaPumpfunApi.js +45 -28
- package/dist/openapi/apis/DexApi.js +217 -184
- package/dist/openapi/apis/DexPoolApi.js +49 -32
- package/dist/openapi/apis/EndpointApi.js +220 -179
- package/dist/openapi/apis/IpfsApi.js +44 -27
- package/dist/openapi/apis/JobsApi.js +72 -51
- package/dist/openapi/apis/RankingApi.js +306 -273
- package/dist/openapi/apis/RedPacketApi.js +305 -260
- package/dist/openapi/apis/TokenApi.js +1182 -1089
- package/dist/openapi/apis/TradeApi.js +256 -227
- package/dist/openapi/apis/TransactionApi.js +49 -32
- package/dist/openapi/apis/WalletApi.js +159 -130
- package/dist/openapi/apis/WatchlistApi.js +49 -32
- package/dist/openapi/apis/index.js +31 -15
- package/dist/openapi/index.js +19 -3
- package/dist/openapi/models/BlockchainDTO.js +12 -5
- package/dist/openapi/models/BlockchainLatestBlockDTO.js +12 -5
- package/dist/openapi/models/BooleanResultDTO.js +12 -5
- package/dist/openapi/models/CalculatePnlInput.js +12 -5
- package/dist/openapi/models/Candle.js +15 -8
- package/dist/openapi/models/ClaimRedPacketInput.js +12 -5
- package/dist/openapi/models/CreateEndpointInput.js +12 -5
- package/dist/openapi/models/CreateRedPacketInput.js +12 -5
- package/dist/openapi/models/CreateRedPacketReply.js +12 -5
- package/dist/openapi/models/CreateTokenInput.js +14 -6
- package/dist/openapi/models/CreateTokenReply.js +12 -5
- package/dist/openapi/models/DexDTO.js +12 -5
- package/dist/openapi/models/DexPage.js +15 -8
- package/dist/openapi/models/DexPoolDTO.js +12 -5
- package/dist/openapi/models/EndpointListResponse.js +15 -8
- package/dist/openapi/models/EndpointOperationResponse.js +12 -5
- package/dist/openapi/models/EndpointResponse.js +12 -5
- package/dist/openapi/models/EndpointSecretResponse.js +12 -5
- package/dist/openapi/models/FilterCondition.js +14 -6
- package/dist/openapi/models/GainersAndLosersDTO.js +12 -5
- package/dist/openapi/models/GainersAndLosersPage.js +15 -8
- package/dist/openapi/models/JobDTO.js +12 -5
- package/dist/openapi/models/JobStreamingDTO.js +12 -5
- package/dist/openapi/models/Link.js +14 -6
- package/dist/openapi/models/MoonshotCreateTokenInput.js +18 -10
- package/dist/openapi/models/MoonshotCreateTokenReply.js +12 -5
- package/dist/openapi/models/MoonshotSubmitCreateToken200Response.js +12 -5
- package/dist/openapi/models/MoonshotSubmitCreateTokenInput.js +12 -5
- package/dist/openapi/models/PumpCreateTokenInput.js +15 -7
- package/dist/openapi/models/PumpCreateTokenReply.js +12 -5
- package/dist/openapi/models/QuoteResponse.js +12 -5
- package/dist/openapi/models/RedPacketClaimDTO.js +14 -6
- package/dist/openapi/models/RedPacketClaimsPage.js +15 -8
- package/dist/openapi/models/RedPacketDTO.js +14 -6
- package/dist/openapi/models/RedPacketReply.js +12 -5
- package/dist/openapi/models/RedPacketSendTxInput.js +12 -5
- package/dist/openapi/models/RedPacketSendTxResponse.js +12 -5
- package/dist/openapi/models/RedPacketsPage.js +15 -8
- package/dist/openapi/models/Resolution.js +17 -9
- package/dist/openapi/models/SendTxInput.js +14 -6
- package/dist/openapi/models/SendTxResponse.js +12 -5
- package/dist/openapi/models/SwapInput.js +15 -7
- package/dist/openapi/models/SwapReply.js +12 -5
- package/dist/openapi/models/SwapRouteInput.js +15 -7
- package/dist/openapi/models/SwapRouteResponse.js +15 -8
- package/dist/openapi/models/Token.js +30 -23
- package/dist/openapi/models/TokenCreationDTO.js +14 -6
- package/dist/openapi/models/TokenCreationPage.js +15 -8
- package/dist/openapi/models/TokenCreatorsDTO.js +12 -5
- package/dist/openapi/models/TokenExtraDTO.js +12 -5
- package/dist/openapi/models/TokenHolder.js +12 -5
- package/dist/openapi/models/TokenHolderPage.js +15 -8
- package/dist/openapi/models/TokenListPage.js +15 -8
- package/dist/openapi/models/TokenMarketData.js +12 -5
- package/dist/openapi/models/TokenMetadata.js +21 -14
- package/dist/openapi/models/TokenPage.js +15 -8
- package/dist/openapi/models/TokenPriceDTO.js +12 -5
- package/dist/openapi/models/TokenPricePage.js +15 -8
- package/dist/openapi/models/TokenSocialMediasDTO.js +12 -5
- package/dist/openapi/models/TokenStat.js +12 -5
- package/dist/openapi/models/TopTradersDTO.js +12 -5
- package/dist/openapi/models/TopTradersPage.js +15 -8
- package/dist/openapi/models/TradeDetailDTO.js +12 -5
- package/dist/openapi/models/TradeEvent.js +15 -8
- package/dist/openapi/models/TradePage.js +15 -8
- package/dist/openapi/models/TradeType.js +17 -9
- package/dist/openapi/models/UpdateEndpointInput.js +12 -5
- package/dist/openapi/models/WalletBalanceDetailDTO.js +12 -5
- package/dist/openapi/models/WalletBalancesDTO.js +15 -8
- package/dist/openapi/models/WalletPnlDTO.js +12 -5
- package/dist/openapi/models/index.js +86 -70
- package/dist/openapi/runtime.js +153 -136
- package/dist/stream/index.js +19 -3
- package/dist/stream/stream.fields.js +11 -5
- package/dist/stream/stream.js +45 -39
- package/dist/stream/stream.model.js +13 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @chainstream-io/sdk@0.1.
|
|
1
|
+
## @chainstream-io/sdk@0.1.9
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @chainstream-io/sdk@0.1.
|
|
39
|
+
npm install @chainstream-io/sdk@0.1.9 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/esm/index.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { StreamApi } from "./stream";
|
|
2
11
|
import { DexApi, Configuration, TransactionApi, DefiSolanaMoonshotApi, DefiSolanaPumpfunApi, DexPoolApi, TokenApi, RankingApi, TradeApi, WalletApi, RedPacketApi, IpfsApi, WatchlistApi, BlockchainApi, JobsApi, } from "./openapi";
|
|
3
12
|
import { EventSourcePolyfill } from "event-source-polyfill";
|
|
4
13
|
export const LIB_VERSION = "0.1.5";
|
|
5
14
|
class UserAgentMiddleware {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
context.init.headers
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
context.init.headers
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
pre(context) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (!context.init.headers) {
|
|
18
|
+
context.init.headers = {};
|
|
19
|
+
}
|
|
20
|
+
if (context.init.headers instanceof Headers) {
|
|
21
|
+
context.init.headers.set("User-Agent", `dex/${LIB_VERSION}/javascript`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
context.init.headers["User-Agent"] = `dex/${LIB_VERSION}/javascript`;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
post(context) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
16
30
|
}
|
|
17
|
-
async post(context) { }
|
|
18
31
|
}
|
|
19
32
|
export class DexClient {
|
|
20
|
-
requestCtx;
|
|
21
|
-
_configuration;
|
|
22
|
-
dex;
|
|
23
|
-
dexpool;
|
|
24
|
-
token;
|
|
25
|
-
wallet;
|
|
26
|
-
trade;
|
|
27
|
-
ranking;
|
|
28
|
-
transaction;
|
|
29
|
-
moonshot;
|
|
30
|
-
pumpfun;
|
|
31
|
-
stream;
|
|
32
|
-
redPacket;
|
|
33
|
-
ipfs;
|
|
34
|
-
blockchain;
|
|
35
|
-
watchlist;
|
|
36
|
-
jobs;
|
|
37
33
|
constructor(accessToken, options = {}) {
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const baseUrl = (_a = options.serverUrl) !== null && _a !== void 0 ? _a : "https://api-dex.chainstream.io";
|
|
36
|
+
const streamUrl = (_b = options.streamUrl) !== null && _b !== void 0 ? _b : "wss://realtime-dex.chainstream.io/connection/websocket";
|
|
41
37
|
const tokenProvider = typeof accessToken === "string"
|
|
42
38
|
? {
|
|
43
39
|
getToken: () => accessToken,
|
|
@@ -47,11 +43,11 @@ export class DexClient {
|
|
|
47
43
|
const config = new Configuration({
|
|
48
44
|
basePath: baseUrl,
|
|
49
45
|
middleware: [new UserAgentMiddleware()],
|
|
50
|
-
accessToken:
|
|
46
|
+
accessToken: () => __awaiter(this, void 0, void 0, function* () {
|
|
51
47
|
return typeof accessToken === "string"
|
|
52
48
|
? accessToken
|
|
53
|
-
:
|
|
54
|
-
},
|
|
49
|
+
: yield accessToken.getToken();
|
|
50
|
+
}),
|
|
55
51
|
headers: {
|
|
56
52
|
"User-Agent": `dex/${LIB_VERSION}/javascript`,
|
|
57
53
|
},
|
|
@@ -74,52 +70,55 @@ export class DexClient {
|
|
|
74
70
|
this.jobs = new JobsApi(config);
|
|
75
71
|
this.stream.connect();
|
|
76
72
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
73
|
+
waitForJob(jobId_1) {
|
|
74
|
+
return __awaiter(this, arguments, void 0, function* (jobId, timeout = 60000) {
|
|
75
|
+
const accessToken = typeof this.requestCtx.accessToken === "string"
|
|
76
|
+
? this.requestCtx.accessToken
|
|
77
|
+
: yield this.requestCtx.accessToken.getToken();
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
const sse = new EventSourcePolyfill(`${this.requestCtx.baseUrl}/jobs/${jobId}/streaming`, {
|
|
80
|
+
headers: {
|
|
81
|
+
Authorization: `Bearer ${accessToken}`,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const timeoutId = setTimeout(() => {
|
|
85
|
+
sse.close();
|
|
86
|
+
reject(new Error(`Job ${jobId} timed out after ${timeout}ms`));
|
|
87
|
+
}, timeout);
|
|
88
|
+
sse.onmessage = (event) => {
|
|
89
|
+
try {
|
|
90
|
+
console.log("event.data: ", event.data);
|
|
91
|
+
const data = JSON.parse(event.data);
|
|
92
|
+
if (data.status === "error") {
|
|
93
|
+
sse.close();
|
|
94
|
+
reject(new Error(`Error: ${data.message}`));
|
|
95
|
+
}
|
|
96
|
+
else if (data.status === "completed") {
|
|
97
|
+
clearTimeout(timeoutId);
|
|
98
|
+
sse.close();
|
|
99
|
+
resolve(data);
|
|
100
|
+
}
|
|
98
101
|
}
|
|
99
|
-
|
|
102
|
+
catch (e) {
|
|
100
103
|
clearTimeout(timeoutId);
|
|
101
104
|
sse.close();
|
|
102
|
-
|
|
105
|
+
reject(new Error("Error parsing event data"));
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
sse.onopen = () => {
|
|
109
|
+
console.log("SSE connection opened");
|
|
110
|
+
};
|
|
111
|
+
sse.onerror = (error) => {
|
|
112
|
+
var _a;
|
|
113
|
+
if ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes("No activity within")) {
|
|
114
|
+
console.log("SSE reconnecting due to inactivity...");
|
|
115
|
+
return;
|
|
103
116
|
}
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
117
|
clearTimeout(timeoutId);
|
|
107
118
|
sse.close();
|
|
108
|
-
reject(new Error(
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
sse.onopen = () => {
|
|
112
|
-
console.log("SSE connection opened");
|
|
113
|
-
};
|
|
114
|
-
sse.onerror = (error) => {
|
|
115
|
-
if (error.message?.includes("No activity within")) {
|
|
116
|
-
console.log("SSE reconnecting due to inactivity...");
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
clearTimeout(timeoutId);
|
|
120
|
-
sse.close();
|
|
121
|
-
reject(new Error(`Error in SSE connection: ${error}`));
|
|
122
|
-
};
|
|
119
|
+
reject(new Error(`Error in SSE connection: ${error}`));
|
|
120
|
+
};
|
|
121
|
+
});
|
|
123
122
|
});
|
|
124
123
|
}
|
|
125
124
|
}
|
|
@@ -11,6 +11,15 @@
|
|
|
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
|
+
};
|
|
14
23
|
import * as runtime from '../runtime';
|
|
15
24
|
import { BlockchainDTOFromJSON, BlockchainLatestBlockDTOFromJSON, } from '../models/index';
|
|
16
25
|
/**
|
|
@@ -21,67 +30,75 @@ export class BlockchainApi extends runtime.BaseAPI {
|
|
|
21
30
|
* CONTROLLER.GET_LATEST_BLOCK.DESCRIPTION
|
|
22
31
|
* CONTROLLER.GET_LATEST_BLOCK.SUMMARY
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
getLatestBlockRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['chain'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getLatestBlock().');
|
|
37
|
+
}
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
41
|
+
const token = this.configuration.accessToken;
|
|
42
|
+
const tokenString = yield token("bearer", []);
|
|
43
|
+
if (tokenString) {
|
|
44
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
let urlPath = `/v1/blockchain/{chain}/latest_block`;
|
|
48
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
49
|
+
const response = yield this.request({
|
|
50
|
+
path: urlPath,
|
|
51
|
+
method: 'GET',
|
|
52
|
+
headers: headerParameters,
|
|
53
|
+
query: queryParameters,
|
|
54
|
+
}, initOverrides);
|
|
55
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BlockchainLatestBlockDTOFromJSON(jsonValue));
|
|
56
|
+
});
|
|
46
57
|
}
|
|
47
58
|
/**
|
|
48
59
|
* CONTROLLER.GET_LATEST_BLOCK.DESCRIPTION
|
|
49
60
|
* CONTROLLER.GET_LATEST_BLOCK.SUMMARY
|
|
50
61
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
getLatestBlock(requestParameters, initOverrides) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const response = yield this.getLatestBlockRaw(requestParameters, initOverrides);
|
|
65
|
+
return yield response.value();
|
|
66
|
+
});
|
|
54
67
|
}
|
|
55
68
|
/**
|
|
56
69
|
* CONTROLLER.GET_SUPPORTED_BLOCKCHAINS.DESCRIPTION
|
|
57
70
|
* CONTROLLER.GET_SUPPORTED_BLOCKCHAINS.SUMMARY
|
|
58
71
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
getSupportedBlockchainsRaw(initOverrides) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const queryParameters = {};
|
|
75
|
+
const headerParameters = {};
|
|
76
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
77
|
+
const token = this.configuration.accessToken;
|
|
78
|
+
const tokenString = yield token("bearer", []);
|
|
79
|
+
if (tokenString) {
|
|
80
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
81
|
+
}
|
|
67
82
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
let urlPath = `/v1/blockchain`;
|
|
84
|
+
const response = yield this.request({
|
|
85
|
+
path: urlPath,
|
|
86
|
+
method: 'GET',
|
|
87
|
+
headers: headerParameters,
|
|
88
|
+
query: queryParameters,
|
|
89
|
+
}, initOverrides);
|
|
90
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(BlockchainDTOFromJSON));
|
|
91
|
+
});
|
|
77
92
|
}
|
|
78
93
|
/**
|
|
79
94
|
* CONTROLLER.GET_SUPPORTED_BLOCKCHAINS.DESCRIPTION
|
|
80
95
|
* CONTROLLER.GET_SUPPORTED_BLOCKCHAINS.SUMMARY
|
|
81
96
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
getSupportedBlockchains(initOverrides) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const response = yield this.getSupportedBlockchainsRaw(initOverrides);
|
|
100
|
+
return yield response.value();
|
|
101
|
+
});
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
104
|
/**
|
|
@@ -11,6 +11,15 @@
|
|
|
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
|
+
};
|
|
14
23
|
import * as runtime from '../runtime';
|
|
15
24
|
import { MoonshotCreateTokenInputToJSON, MoonshotCreateTokenReplyFromJSON, MoonshotSubmitCreateToken200ResponseFromJSON, MoonshotSubmitCreateTokenInputToJSON, } from '../models/index';
|
|
16
25
|
/**
|
|
@@ -21,72 +30,80 @@ export class DefiSolanaMoonshotApi extends runtime.BaseAPI {
|
|
|
21
30
|
* CONTROLLER.MOONSHOT.CREATE_TOKEN.DESCRIPTION
|
|
22
31
|
* CONTROLLER.MOONSHOT.CREATE_TOKEN.SUMMARY
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const queryParameters = {};
|
|
29
|
-
const headerParameters = {};
|
|
30
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
31
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
32
|
-
const token = this.configuration.accessToken;
|
|
33
|
-
const tokenString = await token("bearer", []);
|
|
34
|
-
if (tokenString) {
|
|
35
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
33
|
+
moonshotCreateTokenRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['moonshotCreateTokenInput'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('moonshotCreateTokenInput', 'Required parameter "moonshotCreateTokenInput" was null or undefined when calling moonshotCreateToken().');
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
41
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
42
|
+
const token = this.configuration.accessToken;
|
|
43
|
+
const tokenString = yield token("bearer", []);
|
|
44
|
+
if (tokenString) {
|
|
45
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
let urlPath = `/v1/solana/moonshot/create`;
|
|
49
|
+
const response = yield this.request({
|
|
50
|
+
path: urlPath,
|
|
51
|
+
method: 'POST',
|
|
52
|
+
headers: headerParameters,
|
|
53
|
+
query: queryParameters,
|
|
54
|
+
body: MoonshotCreateTokenInputToJSON(requestParameters['moonshotCreateTokenInput']),
|
|
55
|
+
}, initOverrides);
|
|
56
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MoonshotCreateTokenReplyFromJSON(jsonValue));
|
|
57
|
+
});
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
60
|
* CONTROLLER.MOONSHOT.CREATE_TOKEN.DESCRIPTION
|
|
50
61
|
* CONTROLLER.MOONSHOT.CREATE_TOKEN.SUMMARY
|
|
51
62
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
moonshotCreateToken(requestParameters, initOverrides) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const response = yield this.moonshotCreateTokenRaw(requestParameters, initOverrides);
|
|
66
|
+
return yield response.value();
|
|
67
|
+
});
|
|
55
68
|
}
|
|
56
69
|
/**
|
|
57
70
|
* CONTROLLER.MOONSHOT.SUBMIT_CREATE_TOKEN.DESCRIPTION
|
|
58
71
|
* CONTROLLER.MOONSHOT.SUBMIT_CREATE_TOKEN.SUMMARY
|
|
59
72
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
moonshotSubmitCreateTokenRaw(requestParameters, initOverrides) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
if (requestParameters['moonshotSubmitCreateTokenInput'] == null) {
|
|
76
|
+
throw new runtime.RequiredError('moonshotSubmitCreateTokenInput', 'Required parameter "moonshotSubmitCreateTokenInput" was null or undefined when calling moonshotSubmitCreateToken().');
|
|
77
|
+
}
|
|
78
|
+
const queryParameters = {};
|
|
79
|
+
const headerParameters = {};
|
|
80
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
81
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
82
|
+
const token = this.configuration.accessToken;
|
|
83
|
+
const tokenString = yield token("bearer", []);
|
|
84
|
+
if (tokenString) {
|
|
85
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
86
|
+
}
|
|
72
87
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
let urlPath = `/v1/solana/moonshot/submitCreateToken`;
|
|
89
|
+
const response = yield this.request({
|
|
90
|
+
path: urlPath,
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: headerParameters,
|
|
93
|
+
query: queryParameters,
|
|
94
|
+
body: MoonshotSubmitCreateTokenInputToJSON(requestParameters['moonshotSubmitCreateTokenInput']),
|
|
95
|
+
}, initOverrides);
|
|
96
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MoonshotSubmitCreateToken200ResponseFromJSON(jsonValue));
|
|
97
|
+
});
|
|
83
98
|
}
|
|
84
99
|
/**
|
|
85
100
|
* CONTROLLER.MOONSHOT.SUBMIT_CREATE_TOKEN.DESCRIPTION
|
|
86
101
|
* CONTROLLER.MOONSHOT.SUBMIT_CREATE_TOKEN.SUMMARY
|
|
87
102
|
*/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
moonshotSubmitCreateToken(requestParameters, initOverrides) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const response = yield this.moonshotSubmitCreateTokenRaw(requestParameters, initOverrides);
|
|
106
|
+
return yield response.value();
|
|
107
|
+
});
|
|
91
108
|
}
|
|
92
109
|
}
|
|
@@ -11,6 +11,15 @@
|
|
|
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
|
+
};
|
|
14
23
|
import * as runtime from '../runtime';
|
|
15
24
|
import { PumpCreateTokenInputToJSON, PumpCreateTokenReplyFromJSON, } from '../models/index';
|
|
16
25
|
/**
|
|
@@ -21,36 +30,40 @@ export class DefiSolanaPumpfunApi extends runtime.BaseAPI {
|
|
|
21
30
|
* CONTROLLER.PUMPFUN.CREATE_TOKEN.DESCRIPTION
|
|
22
31
|
* CONTROLLER.PUMPFUN.CREATE_TOKEN.SUMMARY
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const queryParameters = {};
|
|
29
|
-
const headerParameters = {};
|
|
30
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
31
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
32
|
-
const token = this.configuration.accessToken;
|
|
33
|
-
const tokenString = await token("bearer", []);
|
|
34
|
-
if (tokenString) {
|
|
35
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
33
|
+
pumpfunCreateTokenRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['pumpCreateTokenInput'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('pumpCreateTokenInput', 'Required parameter "pumpCreateTokenInput" was null or undefined when calling pumpfunCreateToken().');
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
41
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
42
|
+
const token = this.configuration.accessToken;
|
|
43
|
+
const tokenString = yield token("bearer", []);
|
|
44
|
+
if (tokenString) {
|
|
45
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
let urlPath = `/v1/solana/pumpfun/create`;
|
|
49
|
+
const response = yield this.request({
|
|
50
|
+
path: urlPath,
|
|
51
|
+
method: 'POST',
|
|
52
|
+
headers: headerParameters,
|
|
53
|
+
query: queryParameters,
|
|
54
|
+
body: PumpCreateTokenInputToJSON(requestParameters['pumpCreateTokenInput']),
|
|
55
|
+
}, initOverrides);
|
|
56
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PumpCreateTokenReplyFromJSON(jsonValue));
|
|
57
|
+
});
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
60
|
* CONTROLLER.PUMPFUN.CREATE_TOKEN.DESCRIPTION
|
|
50
61
|
* CONTROLLER.PUMPFUN.CREATE_TOKEN.SUMMARY
|
|
51
62
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
pumpfunCreateToken(requestParameters, initOverrides) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const response = yield this.pumpfunCreateTokenRaw(requestParameters, initOverrides);
|
|
66
|
+
return yield response.value();
|
|
67
|
+
});
|
|
55
68
|
}
|
|
56
69
|
}
|