@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
|
@@ -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 { BooleanResultDTOFromJSON, CalculatePnlInputToJSON, WalletBalancesDTOFromJSON, WalletPnlDTOFromJSON, } from '../models/index';
|
|
16
25
|
/**
|
|
@@ -21,168 +30,184 @@ export class WalletApi extends runtime.BaseAPI {
|
|
|
21
30
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
22
31
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
23
32
|
*/
|
|
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}`;
|
|
33
|
+
calculatePnlRaw(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 calculatePnl().');
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['walletAddress'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling calculatePnl().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['calculatePnlInput'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('calculatePnlInput', 'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().');
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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/wallet/{chain}/{walletAddress}/calculate-pnl`;
|
|
55
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
56
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
57
|
+
const response = yield this.request({
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
body: CalculatePnlInputToJSON(requestParameters['calculatePnlInput']),
|
|
63
|
+
}, initOverrides);
|
|
64
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
65
|
+
});
|
|
55
66
|
}
|
|
56
67
|
/**
|
|
57
68
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
58
69
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
59
70
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
calculatePnl(requestParameters, initOverrides) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const response = yield this.calculatePnlRaw(requestParameters, initOverrides);
|
|
74
|
+
return yield response.value();
|
|
75
|
+
});
|
|
63
76
|
}
|
|
64
77
|
/**
|
|
65
78
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
66
79
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
67
80
|
*/
|
|
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}`;
|
|
81
|
+
getBalanceRaw(requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
if (requestParameters['chain'] == null) {
|
|
84
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getBalance().');
|
|
85
|
+
}
|
|
86
|
+
if (requestParameters['walletAddress'] == null) {
|
|
87
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getBalance().');
|
|
88
|
+
}
|
|
89
|
+
const queryParameters = {};
|
|
90
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
91
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
85
92
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const headerParameters = {};
|
|
94
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
95
|
+
const token = this.configuration.accessToken;
|
|
96
|
+
const tokenString = yield token("bearer", []);
|
|
97
|
+
if (tokenString) {
|
|
98
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
|
|
102
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
103
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
104
|
+
const response = yield this.request({
|
|
105
|
+
path: urlPath,
|
|
106
|
+
method: 'GET',
|
|
107
|
+
headers: headerParameters,
|
|
108
|
+
query: queryParameters,
|
|
109
|
+
}, initOverrides);
|
|
110
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WalletBalancesDTOFromJSON(jsonValue));
|
|
111
|
+
});
|
|
97
112
|
}
|
|
98
113
|
/**
|
|
99
114
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
100
115
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
101
116
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
getBalance(requestParameters, initOverrides) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const response = yield this.getBalanceRaw(requestParameters, initOverrides);
|
|
120
|
+
return yield response.value();
|
|
121
|
+
});
|
|
105
122
|
}
|
|
106
123
|
/**
|
|
107
124
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
108
125
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
109
126
|
*/
|
|
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}`;
|
|
127
|
+
getPnlRaw(requestParameters, initOverrides) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
if (requestParameters['chain'] == null) {
|
|
130
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnl().');
|
|
131
|
+
}
|
|
132
|
+
if (requestParameters['walletAddress'] == null) {
|
|
133
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnl().');
|
|
134
|
+
}
|
|
135
|
+
const queryParameters = {};
|
|
136
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
137
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
127
138
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
const headerParameters = {};
|
|
140
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
141
|
+
const token = this.configuration.accessToken;
|
|
142
|
+
const tokenString = yield token("bearer", []);
|
|
143
|
+
if (tokenString) {
|
|
144
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
|
|
148
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
149
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
150
|
+
const response = yield this.request({
|
|
151
|
+
path: urlPath,
|
|
152
|
+
method: 'GET',
|
|
153
|
+
headers: headerParameters,
|
|
154
|
+
query: queryParameters,
|
|
155
|
+
}, initOverrides);
|
|
156
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
157
|
+
});
|
|
139
158
|
}
|
|
140
159
|
/**
|
|
141
160
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
142
161
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
143
162
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
163
|
+
getPnl(requestParameters, initOverrides) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const response = yield this.getPnlRaw(requestParameters, initOverrides);
|
|
166
|
+
return yield response.value();
|
|
167
|
+
});
|
|
147
168
|
}
|
|
148
169
|
/**
|
|
149
170
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
150
171
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
151
172
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
getPnlStatsRaw(requestParameters, initOverrides) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
if (requestParameters['chain'] == null) {
|
|
176
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnlStats().');
|
|
177
|
+
}
|
|
178
|
+
if (requestParameters['walletAddress'] == null) {
|
|
179
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnlStats().');
|
|
180
|
+
}
|
|
181
|
+
const queryParameters = {};
|
|
182
|
+
const headerParameters = {};
|
|
183
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
184
|
+
const token = this.configuration.accessToken;
|
|
185
|
+
const tokenString = yield token("bearer", []);
|
|
186
|
+
if (tokenString) {
|
|
187
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
188
|
+
}
|
|
166
189
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
190
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
|
|
191
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
192
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
193
|
+
const response = yield this.request({
|
|
194
|
+
path: urlPath,
|
|
195
|
+
method: 'GET',
|
|
196
|
+
headers: headerParameters,
|
|
197
|
+
query: queryParameters,
|
|
198
|
+
}, initOverrides);
|
|
199
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
200
|
+
});
|
|
178
201
|
}
|
|
179
202
|
/**
|
|
180
203
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
181
204
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
182
205
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
206
|
+
getPnlStats(requestParameters, initOverrides) {
|
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
const response = yield this.getPnlStatsRaw(requestParameters, initOverrides);
|
|
209
|
+
return yield response.value();
|
|
210
|
+
});
|
|
186
211
|
}
|
|
187
212
|
}
|
|
188
213
|
/**
|
|
@@ -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 { BooleanResultDTOFromJSON, } from '../models/index';
|
|
16
25
|
/**
|
|
@@ -21,40 +30,44 @@ export class WatchlistApi extends runtime.BaseAPI {
|
|
|
21
30
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
22
31
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
watchlistAddRaw(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 watchlistAdd().');
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['walletAddress'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().');
|
|
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
|
+
}
|
|
38
49
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
|
|
51
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
52
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
53
|
+
const response = yield this.request({
|
|
54
|
+
path: urlPath,
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: headerParameters,
|
|
57
|
+
query: queryParameters,
|
|
58
|
+
}, initOverrides);
|
|
59
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
60
|
+
});
|
|
50
61
|
}
|
|
51
62
|
/**
|
|
52
63
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
53
64
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
54
65
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
watchlistAdd(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const response = yield this.watchlistAddRaw(requestParameters, initOverrides);
|
|
69
|
+
return yield response.value();
|
|
70
|
+
});
|
|
58
71
|
}
|
|
59
72
|
}
|
|
60
73
|
/**
|