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