@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* tslint:disable */
|
|
2
3
|
/* eslint-disable */
|
|
3
4
|
/**
|
|
@@ -11,50 +12,66 @@
|
|
|
11
12
|
* https://openapi-generator.tech
|
|
12
13
|
* Do not edit the class manually.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
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.TransactionApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
16
28
|
/**
|
|
17
29
|
*
|
|
18
30
|
*/
|
|
19
|
-
|
|
31
|
+
class TransactionApi extends runtime.BaseAPI {
|
|
20
32
|
/**
|
|
21
33
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
22
34
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
23
35
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (requestParameters['sendTxInput'] == null) {
|
|
29
|
-
throw new runtime.RequiredError('sendTxInput', 'Required parameter "sendTxInput" was null or undefined when calling send().');
|
|
30
|
-
}
|
|
31
|
-
const queryParameters = {};
|
|
32
|
-
const headerParameters = {};
|
|
33
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
34
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
35
|
-
const token = this.configuration.accessToken;
|
|
36
|
-
const tokenString = await token("bearer", []);
|
|
37
|
-
if (tokenString) {
|
|
38
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
36
|
+
sendRaw(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 send().');
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
if (requestParameters['sendTxInput'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('sendTxInput', 'Required parameter "sendTxInput" was null or undefined when calling send().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
47
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
48
|
+
const token = this.configuration.accessToken;
|
|
49
|
+
const tokenString = yield token("bearer", []);
|
|
50
|
+
if (tokenString) {
|
|
51
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
let urlPath = `/v1/transaction/{chain}/send`;
|
|
55
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
56
|
+
const response = yield this.request({
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
body: (0, index_1.SendTxInputToJSON)(requestParameters['sendTxInput']),
|
|
62
|
+
}, initOverrides);
|
|
63
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SendTxResponseFromJSON)(jsonValue));
|
|
64
|
+
});
|
|
51
65
|
}
|
|
52
66
|
/**
|
|
53
67
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
54
68
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
55
69
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
send(requestParameters, initOverrides) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const response = yield this.sendRaw(requestParameters, initOverrides);
|
|
73
|
+
return yield response.value();
|
|
74
|
+
});
|
|
59
75
|
}
|
|
60
76
|
}
|
|
77
|
+
exports.TransactionApi = TransactionApi;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* tslint:disable */
|
|
2
3
|
/* eslint-disable */
|
|
3
4
|
/**
|
|
@@ -11,184 +12,212 @@
|
|
|
11
12
|
* https://openapi-generator.tech
|
|
12
13
|
* Do not edit the class manually.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
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.GetPnlStatsChainEnum = exports.GetPnlChainEnum = exports.GetBalanceChainEnum = exports.CalculatePnlChainEnum = exports.WalletApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
16
28
|
/**
|
|
17
29
|
*
|
|
18
30
|
*/
|
|
19
|
-
|
|
31
|
+
class WalletApi extends runtime.BaseAPI {
|
|
20
32
|
/**
|
|
21
33
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
22
34
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
23
35
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const queryParameters = {};
|
|
35
|
-
const headerParameters = {};
|
|
36
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
37
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
38
|
-
const token = this.configuration.accessToken;
|
|
39
|
-
const tokenString = await token("bearer", []);
|
|
40
|
-
if (tokenString) {
|
|
41
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
36
|
+
calculatePnlRaw(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 calculatePnl().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['walletAddress'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling calculatePnl().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['calculatePnlInput'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('calculatePnlInput', 'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().');
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
const queryParameters = {};
|
|
48
|
+
const headerParameters = {};
|
|
49
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
50
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
51
|
+
const token = this.configuration.accessToken;
|
|
52
|
+
const tokenString = yield token("bearer", []);
|
|
53
|
+
if (tokenString) {
|
|
54
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/calculate-pnl`;
|
|
58
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
59
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
60
|
+
const response = yield this.request({
|
|
61
|
+
path: urlPath,
|
|
62
|
+
method: 'POST',
|
|
63
|
+
headers: headerParameters,
|
|
64
|
+
query: queryParameters,
|
|
65
|
+
body: (0, index_1.CalculatePnlInputToJSON)(requestParameters['calculatePnlInput']),
|
|
66
|
+
}, initOverrides);
|
|
67
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BooleanResultDTOFromJSON)(jsonValue));
|
|
68
|
+
});
|
|
55
69
|
}
|
|
56
70
|
/**
|
|
57
71
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
58
72
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
59
73
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
calculatePnl(requestParameters, initOverrides) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const response = yield this.calculatePnlRaw(requestParameters, initOverrides);
|
|
77
|
+
return yield response.value();
|
|
78
|
+
});
|
|
63
79
|
}
|
|
64
80
|
/**
|
|
65
81
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
66
82
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
67
83
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const headerParameters = {};
|
|
80
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
81
|
-
const token = this.configuration.accessToken;
|
|
82
|
-
const tokenString = await token("bearer", []);
|
|
83
|
-
if (tokenString) {
|
|
84
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
84
|
+
getBalanceRaw(requestParameters, initOverrides) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
if (requestParameters['chain'] == null) {
|
|
87
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getBalance().');
|
|
88
|
+
}
|
|
89
|
+
if (requestParameters['walletAddress'] == null) {
|
|
90
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getBalance().');
|
|
91
|
+
}
|
|
92
|
+
const queryParameters = {};
|
|
93
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
94
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
85
95
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
const headerParameters = {};
|
|
97
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
98
|
+
const token = this.configuration.accessToken;
|
|
99
|
+
const tokenString = yield token("bearer", []);
|
|
100
|
+
if (tokenString) {
|
|
101
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
|
|
105
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
106
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
107
|
+
const response = yield this.request({
|
|
108
|
+
path: urlPath,
|
|
109
|
+
method: 'GET',
|
|
110
|
+
headers: headerParameters,
|
|
111
|
+
query: queryParameters,
|
|
112
|
+
}, initOverrides);
|
|
113
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WalletBalancesDTOFromJSON)(jsonValue));
|
|
114
|
+
});
|
|
97
115
|
}
|
|
98
116
|
/**
|
|
99
117
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
100
118
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
101
119
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
getBalance(requestParameters, initOverrides) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const response = yield this.getBalanceRaw(requestParameters, initOverrides);
|
|
123
|
+
return yield response.value();
|
|
124
|
+
});
|
|
105
125
|
}
|
|
106
126
|
/**
|
|
107
127
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
108
128
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
109
129
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const headerParameters = {};
|
|
122
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
123
|
-
const token = this.configuration.accessToken;
|
|
124
|
-
const tokenString = await token("bearer", []);
|
|
125
|
-
if (tokenString) {
|
|
126
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
130
|
+
getPnlRaw(requestParameters, initOverrides) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
if (requestParameters['chain'] == null) {
|
|
133
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnl().');
|
|
134
|
+
}
|
|
135
|
+
if (requestParameters['walletAddress'] == null) {
|
|
136
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnl().');
|
|
137
|
+
}
|
|
138
|
+
const queryParameters = {};
|
|
139
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
140
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
127
141
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
const headerParameters = {};
|
|
143
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
144
|
+
const token = this.configuration.accessToken;
|
|
145
|
+
const tokenString = yield token("bearer", []);
|
|
146
|
+
if (tokenString) {
|
|
147
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
|
|
151
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
152
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
153
|
+
const response = yield this.request({
|
|
154
|
+
path: urlPath,
|
|
155
|
+
method: 'GET',
|
|
156
|
+
headers: headerParameters,
|
|
157
|
+
query: queryParameters,
|
|
158
|
+
}, initOverrides);
|
|
159
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WalletPnlDTOFromJSON));
|
|
160
|
+
});
|
|
139
161
|
}
|
|
140
162
|
/**
|
|
141
163
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
142
164
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
143
165
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
getPnl(requestParameters, initOverrides) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const response = yield this.getPnlRaw(requestParameters, initOverrides);
|
|
169
|
+
return yield response.value();
|
|
170
|
+
});
|
|
147
171
|
}
|
|
148
172
|
/**
|
|
149
173
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
150
174
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
151
175
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
getPnlStatsRaw(requestParameters, initOverrides) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
if (requestParameters['chain'] == null) {
|
|
179
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnlStats().');
|
|
180
|
+
}
|
|
181
|
+
if (requestParameters['walletAddress'] == null) {
|
|
182
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnlStats().');
|
|
183
|
+
}
|
|
184
|
+
const queryParameters = {};
|
|
185
|
+
const headerParameters = {};
|
|
186
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
187
|
+
const token = this.configuration.accessToken;
|
|
188
|
+
const tokenString = yield token("bearer", []);
|
|
189
|
+
if (tokenString) {
|
|
190
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
191
|
+
}
|
|
166
192
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
193
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
|
|
194
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
195
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
196
|
+
const response = yield this.request({
|
|
197
|
+
path: urlPath,
|
|
198
|
+
method: 'GET',
|
|
199
|
+
headers: headerParameters,
|
|
200
|
+
query: queryParameters,
|
|
201
|
+
}, initOverrides);
|
|
202
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WalletPnlDTOFromJSON));
|
|
203
|
+
});
|
|
178
204
|
}
|
|
179
205
|
/**
|
|
180
206
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
181
207
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
182
208
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
209
|
+
getPnlStats(requestParameters, initOverrides) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
const response = yield this.getPnlStatsRaw(requestParameters, initOverrides);
|
|
212
|
+
return yield response.value();
|
|
213
|
+
});
|
|
186
214
|
}
|
|
187
215
|
}
|
|
216
|
+
exports.WalletApi = WalletApi;
|
|
188
217
|
/**
|
|
189
218
|
* @export
|
|
190
219
|
*/
|
|
191
|
-
|
|
220
|
+
exports.CalculatePnlChainEnum = {
|
|
192
221
|
Sol: 'sol',
|
|
193
222
|
Base: 'base',
|
|
194
223
|
Bsc: 'bsc',
|
|
@@ -203,7 +232,7 @@ export const CalculatePnlChainEnum = {
|
|
|
203
232
|
/**
|
|
204
233
|
* @export
|
|
205
234
|
*/
|
|
206
|
-
|
|
235
|
+
exports.GetBalanceChainEnum = {
|
|
207
236
|
Sol: 'sol',
|
|
208
237
|
Base: 'base',
|
|
209
238
|
Bsc: 'bsc',
|
|
@@ -218,7 +247,7 @@ export const GetBalanceChainEnum = {
|
|
|
218
247
|
/**
|
|
219
248
|
* @export
|
|
220
249
|
*/
|
|
221
|
-
|
|
250
|
+
exports.GetPnlChainEnum = {
|
|
222
251
|
Sol: 'sol',
|
|
223
252
|
Base: 'base',
|
|
224
253
|
Bsc: 'bsc',
|
|
@@ -233,7 +262,7 @@ export const GetPnlChainEnum = {
|
|
|
233
262
|
/**
|
|
234
263
|
* @export
|
|
235
264
|
*/
|
|
236
|
-
|
|
265
|
+
exports.GetPnlStatsChainEnum = {
|
|
237
266
|
Sol: 'sol',
|
|
238
267
|
Base: 'base',
|
|
239
268
|
Bsc: 'bsc',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* tslint:disable */
|
|
2
3
|
/* eslint-disable */
|
|
3
4
|
/**
|
|
@@ -11,56 +12,72 @@
|
|
|
11
12
|
* https://openapi-generator.tech
|
|
12
13
|
* Do not edit the class manually.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
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.WatchlistAddChainEnum = exports.WatchlistApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
16
28
|
/**
|
|
17
29
|
*
|
|
18
30
|
*/
|
|
19
|
-
|
|
31
|
+
class WatchlistApi extends runtime.BaseAPI {
|
|
20
32
|
/**
|
|
21
33
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
22
34
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
23
35
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
watchlistAddRaw(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 watchlistAdd().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['walletAddress'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
47
|
+
const token = this.configuration.accessToken;
|
|
48
|
+
const tokenString = yield token("bearer", []);
|
|
49
|
+
if (tokenString) {
|
|
50
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
51
|
+
}
|
|
38
52
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
|
|
54
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
55
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
56
|
+
const response = yield this.request({
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
}, initOverrides);
|
|
62
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BooleanResultDTOFromJSON)(jsonValue));
|
|
63
|
+
});
|
|
50
64
|
}
|
|
51
65
|
/**
|
|
52
66
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
53
67
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
54
68
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
watchlistAdd(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const response = yield this.watchlistAddRaw(requestParameters, initOverrides);
|
|
72
|
+
return yield response.value();
|
|
73
|
+
});
|
|
58
74
|
}
|
|
59
75
|
}
|
|
76
|
+
exports.WatchlistApi = WatchlistApi;
|
|
60
77
|
/**
|
|
61
78
|
* @export
|
|
62
79
|
*/
|
|
63
|
-
|
|
80
|
+
exports.WatchlistAddChainEnum = {
|
|
64
81
|
Sol: 'sol',
|
|
65
82
|
Base: 'base',
|
|
66
83
|
Bsc: 'bsc',
|