@chainstream-io/sdk 0.1.6 → 0.1.8
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 +74 -73
- package/dist/esm/openapi/apis/BlockchainApi.js +44 -61
- package/dist/esm/openapi/apis/DefiSolanaMoonshotApi.js +50 -67
- package/dist/esm/openapi/apis/DefiSolanaPumpfunApi.js +25 -38
- package/dist/esm/openapi/apis/DexApi.js +176 -205
- package/dist/esm/openapi/apis/DexPoolApi.js +28 -41
- package/dist/esm/openapi/apis/EndpointApi.js +175 -212
- package/dist/esm/openapi/apis/IpfsApi.js +25 -38
- package/dist/esm/openapi/apis/JobsApi.js +48 -65
- package/dist/esm/openapi/apis/RankingApi.js +249 -278
- package/dist/esm/openapi/apis/RedPacketApi.js +253 -294
- package/dist/esm/openapi/apis/TokenApi.js +1056 -1145
- package/dist/esm/openapi/apis/TradeApi.js +208 -233
- package/dist/esm/openapi/apis/TransactionApi.js +29 -42
- package/dist/esm/openapi/apis/WalletApi.js +123 -148
- package/dist/esm/openapi/apis/WatchlistApi.js +28 -41
- package/dist/esm/openapi/runtime.js +118 -119
- package/dist/esm/stream/stream.js +34 -36
- package/dist/index.js +96 -99
- package/dist/openapi/apis/BlockchainApi.js +48 -69
- package/dist/openapi/apis/DefiSolanaMoonshotApi.js +53 -74
- package/dist/openapi/apis/DefiSolanaPumpfunApi.js +28 -45
- package/dist/openapi/apis/DexApi.js +184 -217
- package/dist/openapi/apis/DexPoolApi.js +32 -49
- package/dist/openapi/apis/EndpointApi.js +179 -220
- package/dist/openapi/apis/IpfsApi.js +27 -44
- package/dist/openapi/apis/JobsApi.js +51 -72
- package/dist/openapi/apis/RankingApi.js +273 -306
- package/dist/openapi/apis/RedPacketApi.js +260 -305
- package/dist/openapi/apis/TokenApi.js +1089 -1182
- package/dist/openapi/apis/TradeApi.js +227 -256
- package/dist/openapi/apis/TransactionApi.js +32 -49
- package/dist/openapi/apis/WalletApi.js +130 -159
- package/dist/openapi/apis/WatchlistApi.js +32 -49
- package/dist/openapi/apis/index.js +15 -31
- package/dist/openapi/index.js +3 -19
- package/dist/openapi/models/BlockchainDTO.js +5 -12
- package/dist/openapi/models/BlockchainLatestBlockDTO.js +5 -12
- package/dist/openapi/models/BooleanResultDTO.js +5 -12
- package/dist/openapi/models/CalculatePnlInput.js +5 -12
- package/dist/openapi/models/Candle.js +8 -15
- package/dist/openapi/models/ClaimRedPacketInput.js +5 -12
- package/dist/openapi/models/CreateEndpointInput.js +5 -12
- package/dist/openapi/models/CreateRedPacketInput.js +5 -12
- package/dist/openapi/models/CreateRedPacketReply.js +5 -12
- package/dist/openapi/models/CreateTokenInput.js +6 -14
- package/dist/openapi/models/CreateTokenReply.js +5 -12
- package/dist/openapi/models/DexDTO.js +5 -12
- package/dist/openapi/models/DexPage.js +8 -15
- package/dist/openapi/models/DexPoolDTO.js +5 -12
- package/dist/openapi/models/EndpointListResponse.js +8 -15
- package/dist/openapi/models/EndpointOperationResponse.js +5 -12
- package/dist/openapi/models/EndpointResponse.js +5 -12
- package/dist/openapi/models/EndpointSecretResponse.js +5 -12
- package/dist/openapi/models/FilterCondition.js +6 -14
- package/dist/openapi/models/GainersAndLosersDTO.js +5 -12
- package/dist/openapi/models/GainersAndLosersPage.js +8 -15
- package/dist/openapi/models/JobDTO.js +5 -12
- package/dist/openapi/models/JobStreamingDTO.js +5 -12
- package/dist/openapi/models/Link.js +6 -14
- package/dist/openapi/models/MoonshotCreateTokenInput.js +10 -18
- package/dist/openapi/models/MoonshotCreateTokenReply.js +5 -12
- package/dist/openapi/models/MoonshotSubmitCreateToken200Response.js +5 -12
- package/dist/openapi/models/MoonshotSubmitCreateTokenInput.js +5 -12
- package/dist/openapi/models/PumpCreateTokenInput.js +7 -15
- package/dist/openapi/models/PumpCreateTokenReply.js +5 -12
- package/dist/openapi/models/QuoteResponse.js +5 -12
- package/dist/openapi/models/RedPacketClaimDTO.js +6 -14
- package/dist/openapi/models/RedPacketClaimsPage.js +8 -15
- package/dist/openapi/models/RedPacketDTO.js +6 -14
- package/dist/openapi/models/RedPacketReply.js +5 -12
- package/dist/openapi/models/RedPacketSendTxInput.js +5 -12
- package/dist/openapi/models/RedPacketSendTxResponse.js +5 -12
- package/dist/openapi/models/RedPacketsPage.js +8 -15
- package/dist/openapi/models/Resolution.js +9 -17
- package/dist/openapi/models/SendTxInput.js +6 -14
- package/dist/openapi/models/SendTxResponse.js +5 -12
- package/dist/openapi/models/SwapInput.js +7 -15
- package/dist/openapi/models/SwapReply.js +5 -12
- package/dist/openapi/models/SwapRouteInput.js +7 -15
- package/dist/openapi/models/SwapRouteResponse.js +8 -15
- package/dist/openapi/models/Token.js +23 -30
- package/dist/openapi/models/TokenCreationDTO.js +6 -14
- package/dist/openapi/models/TokenCreationPage.js +8 -15
- package/dist/openapi/models/TokenCreatorsDTO.js +5 -12
- package/dist/openapi/models/TokenExtraDTO.js +5 -12
- package/dist/openapi/models/TokenHolder.js +5 -12
- package/dist/openapi/models/TokenHolderPage.js +8 -15
- package/dist/openapi/models/TokenListPage.js +8 -15
- package/dist/openapi/models/TokenMarketData.js +5 -12
- package/dist/openapi/models/TokenMetadata.js +14 -21
- package/dist/openapi/models/TokenPage.js +8 -15
- package/dist/openapi/models/TokenPriceDTO.js +5 -12
- package/dist/openapi/models/TokenPricePage.js +8 -15
- package/dist/openapi/models/TokenSocialMediasDTO.js +5 -12
- package/dist/openapi/models/TokenStat.js +5 -12
- package/dist/openapi/models/TopTradersDTO.js +5 -12
- package/dist/openapi/models/TopTradersPage.js +8 -15
- package/dist/openapi/models/TradeDetailDTO.js +5 -12
- package/dist/openapi/models/TradeEvent.js +8 -15
- package/dist/openapi/models/TradePage.js +8 -15
- package/dist/openapi/models/TradeType.js +9 -17
- package/dist/openapi/models/UpdateEndpointInput.js +5 -12
- package/dist/openapi/models/WalletBalanceDetailDTO.js +5 -12
- package/dist/openapi/models/WalletBalancesDTO.js +8 -15
- package/dist/openapi/models/WalletPnlDTO.js +5 -12
- package/dist/openapi/models/index.js +70 -86
- package/dist/openapi/runtime.js +136 -153
- package/dist/stream/index.js +3 -19
- package/dist/stream/stream.fields.js +5 -11
- package/dist/stream/stream.js +39 -45
- package/dist/stream/stream.model.js +10 -13
- package/package.json +4 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* tslint:disable */
|
|
3
2
|
/* eslint-disable */
|
|
4
3
|
/**
|
|
@@ -12,66 +11,50 @@
|
|
|
12
11
|
* https://openapi-generator.tech
|
|
13
12
|
* Do not edit the class manually.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
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");
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { SendTxInputToJSON, SendTxResponseFromJSON, } from '../models/index';
|
|
28
16
|
/**
|
|
29
17
|
*
|
|
30
18
|
*/
|
|
31
|
-
class TransactionApi extends runtime.BaseAPI {
|
|
19
|
+
export class TransactionApi extends runtime.BaseAPI {
|
|
32
20
|
/**
|
|
33
21
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
34
22
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
35
23
|
*/
|
|
36
|
-
sendRaw(requestParameters, initOverrides) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
async sendRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['chain'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling send().');
|
|
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}`;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
});
|
|
40
|
+
}
|
|
41
|
+
let urlPath = `/v1/transaction/{chain}/send`;
|
|
42
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
43
|
+
const response = await this.request({
|
|
44
|
+
path: urlPath,
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: headerParameters,
|
|
47
|
+
query: queryParameters,
|
|
48
|
+
body: SendTxInputToJSON(requestParameters['sendTxInput']),
|
|
49
|
+
}, initOverrides);
|
|
50
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SendTxResponseFromJSON(jsonValue));
|
|
65
51
|
}
|
|
66
52
|
/**
|
|
67
53
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
68
54
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
69
55
|
*/
|
|
70
|
-
send(requestParameters, initOverrides) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return yield response.value();
|
|
74
|
-
});
|
|
56
|
+
async send(requestParameters, initOverrides) {
|
|
57
|
+
const response = await this.sendRaw(requestParameters, initOverrides);
|
|
58
|
+
return await response.value();
|
|
75
59
|
}
|
|
76
60
|
}
|
|
77
|
-
exports.TransactionApi = TransactionApi;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* tslint:disable */
|
|
3
2
|
/* eslint-disable */
|
|
4
3
|
/**
|
|
@@ -12,212 +11,184 @@
|
|
|
12
11
|
* https://openapi-generator.tech
|
|
13
12
|
* Do not edit the class manually.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
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");
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { BooleanResultDTOFromJSON, CalculatePnlInputToJSON, WalletBalancesDTOFromJSON, WalletPnlDTOFromJSON, } from '../models/index';
|
|
28
16
|
/**
|
|
29
17
|
*
|
|
30
18
|
*/
|
|
31
|
-
class WalletApi extends runtime.BaseAPI {
|
|
19
|
+
export class WalletApi extends runtime.BaseAPI {
|
|
32
20
|
/**
|
|
33
21
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
34
22
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
35
23
|
*/
|
|
36
|
-
calculatePnlRaw(requestParameters, initOverrides) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
async calculatePnlRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['chain'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling calculatePnl().');
|
|
27
|
+
}
|
|
28
|
+
if (requestParameters['walletAddress'] == null) {
|
|
29
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling calculatePnl().');
|
|
30
|
+
}
|
|
31
|
+
if (requestParameters['calculatePnlInput'] == null) {
|
|
32
|
+
throw new runtime.RequiredError('calculatePnlInput', 'Required parameter "calculatePnlInput" was null or undefined when calling calculatePnl().');
|
|
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}`;
|
|
46
42
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
});
|
|
43
|
+
}
|
|
44
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/calculate-pnl`;
|
|
45
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
46
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
47
|
+
const response = await this.request({
|
|
48
|
+
path: urlPath,
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: headerParameters,
|
|
51
|
+
query: queryParameters,
|
|
52
|
+
body: CalculatePnlInputToJSON(requestParameters['calculatePnlInput']),
|
|
53
|
+
}, initOverrides);
|
|
54
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
69
55
|
}
|
|
70
56
|
/**
|
|
71
57
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
72
58
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
73
59
|
*/
|
|
74
|
-
calculatePnl(requestParameters, initOverrides) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return yield response.value();
|
|
78
|
-
});
|
|
60
|
+
async calculatePnl(requestParameters, initOverrides) {
|
|
61
|
+
const response = await this.calculatePnlRaw(requestParameters, initOverrides);
|
|
62
|
+
return await response.value();
|
|
79
63
|
}
|
|
80
64
|
/**
|
|
81
65
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
82
66
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
83
67
|
*/
|
|
84
|
-
getBalanceRaw(requestParameters, initOverrides) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
68
|
+
async getBalanceRaw(requestParameters, initOverrides) {
|
|
69
|
+
if (requestParameters['chain'] == null) {
|
|
70
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getBalance().');
|
|
71
|
+
}
|
|
72
|
+
if (requestParameters['walletAddress'] == null) {
|
|
73
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getBalance().');
|
|
74
|
+
}
|
|
75
|
+
const queryParameters = {};
|
|
76
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
77
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
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}`;
|
|
95
85
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
});
|
|
86
|
+
}
|
|
87
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/balance`;
|
|
88
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
89
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
90
|
+
const response = await this.request({
|
|
91
|
+
path: urlPath,
|
|
92
|
+
method: 'GET',
|
|
93
|
+
headers: headerParameters,
|
|
94
|
+
query: queryParameters,
|
|
95
|
+
}, initOverrides);
|
|
96
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WalletBalancesDTOFromJSON(jsonValue));
|
|
115
97
|
}
|
|
116
98
|
/**
|
|
117
99
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
118
100
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
119
101
|
*/
|
|
120
|
-
getBalance(requestParameters, initOverrides) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return yield response.value();
|
|
124
|
-
});
|
|
102
|
+
async getBalance(requestParameters, initOverrides) {
|
|
103
|
+
const response = await this.getBalanceRaw(requestParameters, initOverrides);
|
|
104
|
+
return await response.value();
|
|
125
105
|
}
|
|
126
106
|
/**
|
|
127
107
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
128
108
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
129
109
|
*/
|
|
130
|
-
getPnlRaw(requestParameters, initOverrides) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
110
|
+
async getPnlRaw(requestParameters, initOverrides) {
|
|
111
|
+
if (requestParameters['chain'] == null) {
|
|
112
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnl().');
|
|
113
|
+
}
|
|
114
|
+
if (requestParameters['walletAddress'] == null) {
|
|
115
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnl().');
|
|
116
|
+
}
|
|
117
|
+
const queryParameters = {};
|
|
118
|
+
if (requestParameters['tokenAddress'] != null) {
|
|
119
|
+
queryParameters['tokenAddress'] = requestParameters['tokenAddress'];
|
|
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}`;
|
|
141
127
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
});
|
|
128
|
+
}
|
|
129
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}`;
|
|
130
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
131
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
132
|
+
const response = await this.request({
|
|
133
|
+
path: urlPath,
|
|
134
|
+
method: 'GET',
|
|
135
|
+
headers: headerParameters,
|
|
136
|
+
query: queryParameters,
|
|
137
|
+
}, initOverrides);
|
|
138
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
161
139
|
}
|
|
162
140
|
/**
|
|
163
141
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
164
142
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
165
143
|
*/
|
|
166
|
-
getPnl(requestParameters, initOverrides) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return yield response.value();
|
|
170
|
-
});
|
|
144
|
+
async getPnl(requestParameters, initOverrides) {
|
|
145
|
+
const response = await this.getPnlRaw(requestParameters, initOverrides);
|
|
146
|
+
return await response.value();
|
|
171
147
|
}
|
|
172
148
|
/**
|
|
173
149
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
174
150
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
175
151
|
*/
|
|
176
|
-
getPnlStatsRaw(requestParameters, initOverrides) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
191
|
-
}
|
|
152
|
+
async getPnlStatsRaw(requestParameters, initOverrides) {
|
|
153
|
+
if (requestParameters['chain'] == null) {
|
|
154
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling getPnlStats().');
|
|
155
|
+
}
|
|
156
|
+
if (requestParameters['walletAddress'] == null) {
|
|
157
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling getPnlStats().');
|
|
158
|
+
}
|
|
159
|
+
const queryParameters = {};
|
|
160
|
+
const headerParameters = {};
|
|
161
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
162
|
+
const token = this.configuration.accessToken;
|
|
163
|
+
const tokenString = await token("bearer", []);
|
|
164
|
+
if (tokenString) {
|
|
165
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
192
166
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
167
|
+
}
|
|
168
|
+
let urlPath = `/v1/wallet/{chain}/{walletAddress}/stats`;
|
|
169
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
170
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
171
|
+
const response = await this.request({
|
|
172
|
+
path: urlPath,
|
|
173
|
+
method: 'GET',
|
|
174
|
+
headers: headerParameters,
|
|
175
|
+
query: queryParameters,
|
|
176
|
+
}, initOverrides);
|
|
177
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WalletPnlDTOFromJSON));
|
|
204
178
|
}
|
|
205
179
|
/**
|
|
206
180
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
207
181
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
208
182
|
*/
|
|
209
|
-
getPnlStats(requestParameters, initOverrides) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return yield response.value();
|
|
213
|
-
});
|
|
183
|
+
async getPnlStats(requestParameters, initOverrides) {
|
|
184
|
+
const response = await this.getPnlStatsRaw(requestParameters, initOverrides);
|
|
185
|
+
return await response.value();
|
|
214
186
|
}
|
|
215
187
|
}
|
|
216
|
-
exports.WalletApi = WalletApi;
|
|
217
188
|
/**
|
|
218
189
|
* @export
|
|
219
190
|
*/
|
|
220
|
-
|
|
191
|
+
export const CalculatePnlChainEnum = {
|
|
221
192
|
Sol: 'sol',
|
|
222
193
|
Base: 'base',
|
|
223
194
|
Bsc: 'bsc',
|
|
@@ -232,7 +203,7 @@ exports.CalculatePnlChainEnum = {
|
|
|
232
203
|
/**
|
|
233
204
|
* @export
|
|
234
205
|
*/
|
|
235
|
-
|
|
206
|
+
export const GetBalanceChainEnum = {
|
|
236
207
|
Sol: 'sol',
|
|
237
208
|
Base: 'base',
|
|
238
209
|
Bsc: 'bsc',
|
|
@@ -247,7 +218,7 @@ exports.GetBalanceChainEnum = {
|
|
|
247
218
|
/**
|
|
248
219
|
* @export
|
|
249
220
|
*/
|
|
250
|
-
|
|
221
|
+
export const GetPnlChainEnum = {
|
|
251
222
|
Sol: 'sol',
|
|
252
223
|
Base: 'base',
|
|
253
224
|
Bsc: 'bsc',
|
|
@@ -262,7 +233,7 @@ exports.GetPnlChainEnum = {
|
|
|
262
233
|
/**
|
|
263
234
|
* @export
|
|
264
235
|
*/
|
|
265
|
-
|
|
236
|
+
export const GetPnlStatsChainEnum = {
|
|
266
237
|
Sol: 'sol',
|
|
267
238
|
Base: 'base',
|
|
268
239
|
Bsc: 'bsc',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* tslint:disable */
|
|
3
2
|
/* eslint-disable */
|
|
4
3
|
/**
|
|
@@ -12,72 +11,56 @@
|
|
|
12
11
|
* https://openapi-generator.tech
|
|
13
12
|
* Do not edit the class manually.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
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");
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { BooleanResultDTOFromJSON, } from '../models/index';
|
|
28
16
|
/**
|
|
29
17
|
*
|
|
30
18
|
*/
|
|
31
|
-
class WatchlistApi extends runtime.BaseAPI {
|
|
19
|
+
export class WatchlistApi extends runtime.BaseAPI {
|
|
32
20
|
/**
|
|
33
21
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
34
22
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
35
23
|
*/
|
|
36
|
-
watchlistAddRaw(requestParameters, initOverrides) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
51
|
-
}
|
|
24
|
+
async watchlistAddRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['chain'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('chain', 'Required parameter "chain" was null or undefined when calling watchlistAdd().');
|
|
27
|
+
}
|
|
28
|
+
if (requestParameters['walletAddress'] == null) {
|
|
29
|
+
throw new runtime.RequiredError('walletAddress', 'Required parameter "walletAddress" was null or undefined when calling watchlistAdd().');
|
|
30
|
+
}
|
|
31
|
+
const queryParameters = {};
|
|
32
|
+
const headerParameters = {};
|
|
33
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
34
|
+
const token = this.configuration.accessToken;
|
|
35
|
+
const tokenString = await token("bearer", []);
|
|
36
|
+
if (tokenString) {
|
|
37
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
52
38
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
}
|
|
40
|
+
let urlPath = `/v1/watchlist/{chain}/{walletAddress}`;
|
|
41
|
+
urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters['chain'])));
|
|
42
|
+
urlPath = urlPath.replace(`{${"walletAddress"}}`, encodeURIComponent(String(requestParameters['walletAddress'])));
|
|
43
|
+
const response = await this.request({
|
|
44
|
+
path: urlPath,
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: headerParameters,
|
|
47
|
+
query: queryParameters,
|
|
48
|
+
}, initOverrides);
|
|
49
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BooleanResultDTOFromJSON(jsonValue));
|
|
64
50
|
}
|
|
65
51
|
/**
|
|
66
52
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
67
53
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
68
54
|
*/
|
|
69
|
-
watchlistAdd(requestParameters, initOverrides) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return yield response.value();
|
|
73
|
-
});
|
|
55
|
+
async watchlistAdd(requestParameters, initOverrides) {
|
|
56
|
+
const response = await this.watchlistAddRaw(requestParameters, initOverrides);
|
|
57
|
+
return await response.value();
|
|
74
58
|
}
|
|
75
59
|
}
|
|
76
|
-
exports.WatchlistApi = WatchlistApi;
|
|
77
60
|
/**
|
|
78
61
|
* @export
|
|
79
62
|
*/
|
|
80
|
-
|
|
63
|
+
export const WatchlistAddChainEnum = {
|
|
81
64
|
Sol: 'sol',
|
|
82
65
|
Base: 'base',
|
|
83
66
|
Bsc: 'bsc',
|