@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
|
@@ -12,42 +12,18 @@
|
|
|
12
12
|
* https://openapi-generator.tech
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
-
var ownKeys = function(o) {
|
|
33
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
-
var ar = [];
|
|
35
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
-
return ar;
|
|
37
|
-
};
|
|
38
|
-
return ownKeys(o);
|
|
39
|
-
};
|
|
40
|
-
return function (mod) {
|
|
41
|
-
if (mod && mod.__esModule) return mod;
|
|
42
|
-
var result = {};
|
|
43
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
-
__setModuleDefault(result, mod);
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
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
|
+
};
|
|
48
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
25
|
exports.TransactionApi = void 0;
|
|
50
|
-
const runtime =
|
|
26
|
+
const runtime = require("../runtime");
|
|
51
27
|
const index_1 = require("../models/index");
|
|
52
28
|
/**
|
|
53
29
|
*
|
|
@@ -57,41 +33,45 @@ class TransactionApi extends runtime.BaseAPI {
|
|
|
57
33
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
58
34
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
59
35
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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().');
|
|
40
|
+
}
|
|
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
|
+
}
|
|
75
53
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
});
|
|
87
65
|
}
|
|
88
66
|
/**
|
|
89
67
|
* CONTROLLER.TRANSACTION.SEND.DESCRIPTION
|
|
90
68
|
* CONTROLLER.TRANSACTION.SEND.SUMMARY
|
|
91
69
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
+
});
|
|
95
75
|
}
|
|
96
76
|
}
|
|
97
77
|
exports.TransactionApi = TransactionApi;
|
|
@@ -12,42 +12,18 @@
|
|
|
12
12
|
* https://openapi-generator.tech
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
-
var ownKeys = function(o) {
|
|
33
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
-
var ar = [];
|
|
35
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
-
return ar;
|
|
37
|
-
};
|
|
38
|
-
return ownKeys(o);
|
|
39
|
-
};
|
|
40
|
-
return function (mod) {
|
|
41
|
-
if (mod && mod.__esModule) return mod;
|
|
42
|
-
var result = {};
|
|
43
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
-
__setModuleDefault(result, mod);
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
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
|
+
};
|
|
48
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
25
|
exports.GetPnlStatsChainEnum = exports.GetPnlChainEnum = exports.GetBalanceChainEnum = exports.CalculatePnlChainEnum = exports.WalletApi = void 0;
|
|
50
|
-
const runtime =
|
|
26
|
+
const runtime = require("../runtime");
|
|
51
27
|
const index_1 = require("../models/index");
|
|
52
28
|
/**
|
|
53
29
|
*
|
|
@@ -57,168 +33,184 @@ class WalletApi extends runtime.BaseAPI {
|
|
|
57
33
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
58
34
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
59
35
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const queryParameters = {};
|
|
71
|
-
const headerParameters = {};
|
|
72
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
73
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
74
|
-
const token = this.configuration.accessToken;
|
|
75
|
-
const tokenString = await token("bearer", []);
|
|
76
|
-
if (tokenString) {
|
|
77
|
-
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().');
|
|
78
46
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
+
});
|
|
91
69
|
}
|
|
92
70
|
/**
|
|
93
71
|
* CONTROLLER.WALLET.CALCULATE_PNL.DESCRIPTION
|
|
94
72
|
* CONTROLLER.WALLET.CALCULATE_PNL.SUMMARY
|
|
95
73
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
+
});
|
|
99
79
|
}
|
|
100
80
|
/**
|
|
101
81
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
102
82
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
103
83
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const headerParameters = {};
|
|
116
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
117
|
-
const token = this.configuration.accessToken;
|
|
118
|
-
const tokenString = await token("bearer", []);
|
|
119
|
-
if (tokenString) {
|
|
120
|
-
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'];
|
|
121
95
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
+
});
|
|
133
115
|
}
|
|
134
116
|
/**
|
|
135
117
|
* CONTROLLER.WALLET.GET_BALANCES.DESCRIPTION
|
|
136
118
|
* CONTROLLER.WALLET.GET_BALANCES.SUMMARY
|
|
137
119
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
+
});
|
|
141
125
|
}
|
|
142
126
|
/**
|
|
143
127
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
144
128
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
145
129
|
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const headerParameters = {};
|
|
158
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
159
|
-
const token = this.configuration.accessToken;
|
|
160
|
-
const tokenString = await token("bearer", []);
|
|
161
|
-
if (tokenString) {
|
|
162
|
-
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'];
|
|
163
141
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
+
});
|
|
175
161
|
}
|
|
176
162
|
/**
|
|
177
163
|
* CONTROLLER.WALLET.GET_PNL.DESCRIPTION
|
|
178
164
|
* CONTROLLER.WALLET.GET_PNL.SUMMARY
|
|
179
165
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
});
|
|
183
171
|
}
|
|
184
172
|
/**
|
|
185
173
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
186
174
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
187
175
|
*/
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
+
}
|
|
202
192
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
+
});
|
|
214
204
|
}
|
|
215
205
|
/**
|
|
216
206
|
* CONTROLLER.WALLET.GET_PNL_STATS.DESCRIPTION
|
|
217
207
|
* CONTROLLER.WALLET.GET_PNL_STATS.SUMMARY
|
|
218
208
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
+
});
|
|
222
214
|
}
|
|
223
215
|
}
|
|
224
216
|
exports.WalletApi = WalletApi;
|
|
@@ -12,42 +12,18 @@
|
|
|
12
12
|
* https://openapi-generator.tech
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
-
var ownKeys = function(o) {
|
|
33
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
-
var ar = [];
|
|
35
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
-
return ar;
|
|
37
|
-
};
|
|
38
|
-
return ownKeys(o);
|
|
39
|
-
};
|
|
40
|
-
return function (mod) {
|
|
41
|
-
if (mod && mod.__esModule) return mod;
|
|
42
|
-
var result = {};
|
|
43
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
-
__setModuleDefault(result, mod);
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
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
|
+
};
|
|
48
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
25
|
exports.WatchlistAddChainEnum = exports.WatchlistApi = void 0;
|
|
50
|
-
const runtime =
|
|
26
|
+
const runtime = require("../runtime");
|
|
51
27
|
const index_1 = require("../models/index");
|
|
52
28
|
/**
|
|
53
29
|
*
|
|
@@ -57,40 +33,44 @@ class WatchlistApi extends runtime.BaseAPI {
|
|
|
57
33
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
58
34
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
59
35
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
}
|
|
74
52
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
});
|
|
86
64
|
}
|
|
87
65
|
/**
|
|
88
66
|
* CONTROLLER.WATCHLIST.ADD.DESCRIPTION
|
|
89
67
|
* CONTROLLER.WATCHLIST.ADD.SUMMARY
|
|
90
68
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
+
});
|
|
94
74
|
}
|
|
95
75
|
}
|
|
96
76
|
exports.WatchlistApi = WatchlistApi;
|