itrm-tools 1.3.0 → 1.3.1
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/dist/api/request/crud/common/ApplicationManager.d.ts +39 -0
- package/dist/api/request/crud/{cetus/ContributorManager.js → common/ApplicationManager.js} +22 -25
- package/dist/api/request/crud/common/ApplicationManager.js.map +1 -0
- package/dist/api/request/crud/common/AvailablePlatformManager.d.ts +5 -3
- package/dist/api/request/crud/common/AvailablePlatformManager.js +7 -5
- package/dist/api/request/crud/common/AvailablePlatformManager.js.map +1 -1
- package/dist/api/request/crud/common/ComponentManager.d.ts +10 -7
- package/dist/api/request/crud/common/ComponentManager.js +7 -4
- package/dist/api/request/crud/common/ComponentManager.js.map +1 -1
- package/dist/api/request/crud/common/PlatformManager.d.ts +9 -10
- package/dist/api/request/crud/common/PlatformManager.js +9 -13
- package/dist/api/request/crud/common/PlatformManager.js.map +1 -1
- package/dist/api/request/crud/common/RoleManager.d.ts +6 -2
- package/dist/api/request/crud/common/RoleManager.js +6 -3
- package/dist/api/request/crud/common/RoleManager.js.map +1 -1
- package/dist/index.d.ts +0 -24
- package/dist/index.js +2 -47
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/api/bitso/BitsoApiConnection.d.ts +0 -26
- package/dist/api/bitso/BitsoApiConnection.js +0 -121
- package/dist/api/bitso/BitsoApiConnection.js.map +0 -1
- package/dist/api/bitso/tools/BitsoBalance.d.ts +0 -17
- package/dist/api/bitso/tools/BitsoBalance.js +0 -29
- package/dist/api/bitso/tools/BitsoBalance.js.map +0 -1
- package/dist/api/bitso/tools/BitsoBook.d.ts +0 -38
- package/dist/api/bitso/tools/BitsoBook.js +0 -60
- package/dist/api/bitso/tools/BitsoBook.js.map +0 -1
- package/dist/api/bitso/tools/BitsoOrder.d.ts +0 -42
- package/dist/api/bitso/tools/BitsoOrder.js +0 -30
- package/dist/api/bitso/tools/BitsoOrder.js.map +0 -1
- package/dist/api/bitso/tools/BitsoOrderBook.d.ts +0 -14
- package/dist/api/bitso/tools/BitsoOrderBook.js +0 -24
- package/dist/api/bitso/tools/BitsoOrderBook.js.map +0 -1
- package/dist/api/bitso/tools/BitsoTrade.d.ts +0 -41
- package/dist/api/bitso/tools/BitsoTrade.js +0 -46
- package/dist/api/bitso/tools/BitsoTrade.js.map +0 -1
- package/dist/api/external/kyc/KycApiManager.d.ts +0 -84
- package/dist/api/external/kyc/KycApiManager.js +0 -148
- package/dist/api/external/kyc/KycApiManager.js.map +0 -1
- package/dist/api/request/crud/cetus/AccountManager.d.ts +0 -36
- package/dist/api/request/crud/cetus/AccountManager.js +0 -82
- package/dist/api/request/crud/cetus/AccountManager.js.map +0 -1
- package/dist/api/request/crud/cetus/AssetsManager.d.ts +0 -38
- package/dist/api/request/crud/cetus/AssetsManager.js +0 -82
- package/dist/api/request/crud/cetus/AssetsManager.js.map +0 -1
- package/dist/api/request/crud/cetus/BalanceChangeLogs.d.ts +0 -38
- package/dist/api/request/crud/cetus/BalanceChangeLogs.js +0 -90
- package/dist/api/request/crud/cetus/BalanceChangeLogs.js.map +0 -1
- package/dist/api/request/crud/cetus/CandleManager.d.ts +0 -32
- package/dist/api/request/crud/cetus/CandleManager.js +0 -17
- package/dist/api/request/crud/cetus/CandleManager.js.map +0 -1
- package/dist/api/request/crud/cetus/ContributorActionManager.d.ts +0 -59
- package/dist/api/request/crud/cetus/ContributorActionManager.js +0 -103
- package/dist/api/request/crud/cetus/ContributorActionManager.js.map +0 -1
- package/dist/api/request/crud/cetus/ContributorManager.d.ts +0 -33
- package/dist/api/request/crud/cetus/ContributorManager.js.map +0 -1
- package/dist/api/request/crud/cetus/CounterpartyBalances.d.ts +0 -44
- package/dist/api/request/crud/cetus/CounterpartyBalances.js +0 -96
- package/dist/api/request/crud/cetus/CounterpartyBalances.js.map +0 -1
- package/dist/api/request/crud/cetus/ExpenseManager.d.ts +0 -45
- package/dist/api/request/crud/cetus/ExpenseManager.js +0 -88
- package/dist/api/request/crud/cetus/ExpenseManager.js.map +0 -1
- package/dist/api/request/crud/cetus/IntermediaryManager.d.ts +0 -38
- package/dist/api/request/crud/cetus/IntermediaryManager.js +0 -82
- package/dist/api/request/crud/cetus/IntermediaryManager.js.map +0 -1
- package/dist/api/request/crud/cetus/ModificationManager.d.ts +0 -44
- package/dist/api/request/crud/cetus/ModificationManager.js +0 -102
- package/dist/api/request/crud/cetus/ModificationManager.js.map +0 -1
- package/dist/api/request/crud/cetus/NavManager.d.ts +0 -45
- package/dist/api/request/crud/cetus/NavManager.js +0 -88
- package/dist/api/request/crud/cetus/NavManager.js.map +0 -1
- package/dist/api/request/crud/cetus/OperationsManager.d.ts +0 -58
- package/dist/api/request/crud/cetus/OperationsManager.js +0 -98
- package/dist/api/request/crud/cetus/OperationsManager.js.map +0 -1
- package/dist/api/request/crud/cetus/PairsManager.d.ts +0 -40
- package/dist/api/request/crud/cetus/PairsManager.js +0 -84
- package/dist/api/request/crud/cetus/PairsManager.js.map +0 -1
- package/dist/api/request/crud/cetus/PnlManager.d.ts +0 -45
- package/dist/api/request/crud/cetus/PnlManager.js +0 -86
- package/dist/api/request/crud/cetus/PnlManager.js.map +0 -1
- package/dist/api/request/crud/cetus/RatesManager.d.ts +0 -41
- package/dist/api/request/crud/cetus/RatesManager.js +0 -94
- package/dist/api/request/crud/cetus/RatesManager.js.map +0 -1
- package/dist/api/request/crud/cetus/SourceManager.d.ts +0 -35
- package/dist/api/request/crud/cetus/SourceManager.js +0 -84
- package/dist/api/request/crud/cetus/SourceManager.js.map +0 -1
- package/dist/api/request/crud/cetus/StrategyManager.d.ts +0 -42
- package/dist/api/request/crud/cetus/StrategyManager.js +0 -88
- package/dist/api/request/crud/cetus/StrategyManager.js.map +0 -1
- package/dist/api/request/crud/cetus/StrategyOrderManager.d.ts +0 -46
- package/dist/api/request/crud/cetus/StrategyOrderManager.js +0 -92
- package/dist/api/request/crud/cetus/StrategyOrderManager.js.map +0 -1
- package/dist/api/request/crud/cetus/TransactionsManager.d.ts +0 -52
- package/dist/api/request/crud/cetus/TransactionsManager.js +0 -96
- package/dist/api/request/crud/cetus/TransactionsManager.js.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PairsManager = void 0;
|
|
13
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
-
class PairsManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
-
constructor(url) {
|
|
16
|
-
super();
|
|
17
|
-
this.url = url;
|
|
18
|
-
}
|
|
19
|
-
find(details) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
return this.sendFinding(`${this.url}/pairs?ticker=${details.ticker}`, details.config);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
count(details) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
let url = this.buildRequestUrl(`${this.url}/pairs`, details);
|
|
28
|
-
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
findAll(details) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
var _a;
|
|
34
|
-
let pairs = [];
|
|
35
|
-
let url = this.buildRequestUrl(`${this.url}/pairs`, details);
|
|
36
|
-
if (details.limit) {
|
|
37
|
-
pairs = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
41
|
-
do {
|
|
42
|
-
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
43
|
-
if (values)
|
|
44
|
-
pairs = pairs.concat(values);
|
|
45
|
-
isEmpty = values == undefined || values.length == 0;
|
|
46
|
-
offset += limit;
|
|
47
|
-
} while (!isEmpty);
|
|
48
|
-
}
|
|
49
|
-
return pairs;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
buildRequestUrl(url, details) {
|
|
53
|
-
let suffix = `${details.mainAssetId ? `&mainAssetId=${details.mainAssetId}` : ""}${details.quoteAssetId ? `"eAssetId=${details.quoteAssetId}` : ""}${details.intermediaryId ? `&intermediaryId=${details.intermediaryId}` : ""}${details.ticker ? `&ticker=${details.ticker}` : ""}`;
|
|
54
|
-
return `${url}?${suffix.substring(1)}`;
|
|
55
|
-
}
|
|
56
|
-
findById(id) {
|
|
57
|
-
return this.sendFinding(`${this.url}/pairs?id=${id.id}`, id.config);
|
|
58
|
-
}
|
|
59
|
-
create(details) {
|
|
60
|
-
return this.sendCreation(`${this.url}/pairs`, {
|
|
61
|
-
intermediaryId: details.intermediaryId,
|
|
62
|
-
mainAssetId: details.mainAssetId,
|
|
63
|
-
quoteAssetId: details.quoteAssetId,
|
|
64
|
-
ticker: details.ticker
|
|
65
|
-
}, details.config);
|
|
66
|
-
}
|
|
67
|
-
createMany(details) {
|
|
68
|
-
var _a;
|
|
69
|
-
return this.sendCreationMany(`${this.url}/pairs`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
70
|
-
}
|
|
71
|
-
modify(pair) {
|
|
72
|
-
return this.sendModification(`${this.url}/pairs/${pair.pairId}`, {
|
|
73
|
-
ticker: pair.ticker,
|
|
74
|
-
mainAssetId: pair.mainAssetId,
|
|
75
|
-
quoteAssetId: pair.quoteAssetId,
|
|
76
|
-
intermediaryId: pair.intermediaryId
|
|
77
|
-
}, pair.config);
|
|
78
|
-
}
|
|
79
|
-
destroy(pair) {
|
|
80
|
-
return this.sendDestruction(`${this.url}/pairs/${pair.pairId}`, pair.config);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.PairsManager = PairsManager;
|
|
84
|
-
//# sourceMappingURL=PairsManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PairsManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/PairsManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAwF;AA4BxF,MAAa,YAAa,SAAQ,uCAAyC;IAGvE,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEY,IAAI,CAAC,OAAsB;;YACpC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,iBAAiB,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1F,CAAC;KAAA;IAEY,KAAK,CAAC,OAAsB;;;YACrC,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7D,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC3E,CAAC;KAAA;IAEY,OAAO,CAAC,OAAsB;;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AC7D,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAEM,OAAO,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC;CACJ;AArED,oCAqEC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
-
export interface IPnl {
|
|
4
|
-
pnlId?: number;
|
|
5
|
-
sourceId?: number;
|
|
6
|
-
assetId?: number;
|
|
7
|
-
date?: number;
|
|
8
|
-
rawValue?: number;
|
|
9
|
-
netValue?: number;
|
|
10
|
-
details?: any;
|
|
11
|
-
fromDate?: number;
|
|
12
|
-
toDate?: number;
|
|
13
|
-
updatedAt?: string;
|
|
14
|
-
createdAt?: string;
|
|
15
|
-
config?: AxiosRequestConfig;
|
|
16
|
-
}
|
|
17
|
-
export interface IPnlDetails {
|
|
18
|
-
sourceId?: number;
|
|
19
|
-
assetId?: number;
|
|
20
|
-
date?: number;
|
|
21
|
-
rawValue?: number;
|
|
22
|
-
netValue?: number;
|
|
23
|
-
details?: any;
|
|
24
|
-
values?: IPnl[];
|
|
25
|
-
fromDate?: number;
|
|
26
|
-
toDate?: number;
|
|
27
|
-
limit?: number;
|
|
28
|
-
offset?: number;
|
|
29
|
-
config?: AxiosRequestConfig;
|
|
30
|
-
}
|
|
31
|
-
export declare class PnlManager extends CrudServiceManager<IPnlDetails, IPnl> {
|
|
32
|
-
private url;
|
|
33
|
-
constructor(url: string);
|
|
34
|
-
find(details: IPnlDetails): Promise<IPnl | undefined>;
|
|
35
|
-
count(details: IPnl): Promise<{
|
|
36
|
-
result: number;
|
|
37
|
-
}>;
|
|
38
|
-
findAll(details: IPnlDetails): Promise<IPnl[] | undefined>;
|
|
39
|
-
private buildRequestUrl;
|
|
40
|
-
findById(id: StandardIdRequestDefinition): Promise<IPnl | undefined>;
|
|
41
|
-
create(details: IPnlDetails): Promise<IPnl | undefined>;
|
|
42
|
-
createMany(details: IPnlDetails): Promise<IPnl[] | undefined>;
|
|
43
|
-
modify(pnl: IPnl): Promise<any>;
|
|
44
|
-
destroy(contributor: IPnl): Promise<any>;
|
|
45
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PnlManager = void 0;
|
|
13
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
-
class PnlManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
-
constructor(url) {
|
|
16
|
-
super();
|
|
17
|
-
this.url = url;
|
|
18
|
-
}
|
|
19
|
-
find(details) {
|
|
20
|
-
return this.sendFinding(`${this.url}/pnls?sourceId=${details.sourceId}${details.assetId ? `&assetId=${details.assetId}` : ""}${details.date ? `&date=${details.date}` : ""}`, details.config);
|
|
21
|
-
}
|
|
22
|
-
count(details) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
var _a;
|
|
25
|
-
let url = this.buildRequestUrl(`${this.url}/pnls`, details);
|
|
26
|
-
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
findAll(details) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a;
|
|
32
|
-
let pnl = [];
|
|
33
|
-
let url = this.buildRequestUrl(`${this.url}/pnls`, details);
|
|
34
|
-
if (details.limit) {
|
|
35
|
-
pnl = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
39
|
-
do {
|
|
40
|
-
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
41
|
-
if (values)
|
|
42
|
-
pnl = pnl.concat(values);
|
|
43
|
-
isEmpty = values == undefined || values.length == 0;
|
|
44
|
-
offset += limit;
|
|
45
|
-
} while (!isEmpty);
|
|
46
|
-
}
|
|
47
|
-
return pnl;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
buildRequestUrl(url, details) {
|
|
51
|
-
let suffix = `${details.sourceId ? `&sourceId=${details.sourceId}` : ""}${details.assetId ? `&assetId=${details.assetId}` : ""}${details.date ? `&date=${details.date}` : ""}${details.fromDate ? `&fromDate=${details.fromDate}` : ""}${details.toDate ? `&toDate=${details.toDate}` : ""}`;
|
|
52
|
-
return `${url}?${suffix.substring(1)}`;
|
|
53
|
-
}
|
|
54
|
-
findById(id) {
|
|
55
|
-
return this.sendFinding(`${this.url}/pnls?id=${id.id}`, id.config);
|
|
56
|
-
}
|
|
57
|
-
create(details) {
|
|
58
|
-
return this.sendCreation(`${this.url}/pnls`, {
|
|
59
|
-
sourceId: details.sourceId,
|
|
60
|
-
assetId: details.assetId,
|
|
61
|
-
date: details.date,
|
|
62
|
-
rawValue: details.rawValue,
|
|
63
|
-
netValue: details.netValue,
|
|
64
|
-
details: details.details
|
|
65
|
-
}, details.config);
|
|
66
|
-
}
|
|
67
|
-
createMany(details) {
|
|
68
|
-
var _a;
|
|
69
|
-
return this.sendCreationMany(`${this.url}/pnls`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
70
|
-
}
|
|
71
|
-
modify(pnl) {
|
|
72
|
-
return this.sendModification(`${this.url}/pnls/${pnl.pnlId}`, {
|
|
73
|
-
sourceId: pnl.sourceId,
|
|
74
|
-
assetId: pnl.assetId,
|
|
75
|
-
date: pnl.date,
|
|
76
|
-
rawValue: pnl.rawValue,
|
|
77
|
-
netValue: pnl.netValue,
|
|
78
|
-
details: pnl.details
|
|
79
|
-
}, pnl.config);
|
|
80
|
-
}
|
|
81
|
-
destroy(contributor) {
|
|
82
|
-
return this.sendDestruction(`${this.url}/pnls/${contributor.pnlId}`, contributor.config);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.PnlManager = PnlManager;
|
|
86
|
-
//# sourceMappingURL=PnlManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PnlManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/PnlManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8DAAwF;AAgCxF,MAAa,UAAW,SAAQ,uCAAqC;IAGjE,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEM,IAAI,CAAC,OAAoB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,kBAAkB,OAAO,CAAC,QAAQ,GAAG,OAA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
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
-
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
export interface IRates {
|
|
4
|
-
rateId?: number;
|
|
5
|
-
pairId?: number;
|
|
6
|
-
timestamp?: number;
|
|
7
|
-
rate?: number;
|
|
8
|
-
updatedAt?: string;
|
|
9
|
-
createdAt?: string;
|
|
10
|
-
config?: AxiosRequestConfig;
|
|
11
|
-
}
|
|
12
|
-
export interface IRatesDetails {
|
|
13
|
-
rateId?: number;
|
|
14
|
-
pairId?: number | string;
|
|
15
|
-
timestamp?: number;
|
|
16
|
-
rate?: number;
|
|
17
|
-
updatedAt?: string;
|
|
18
|
-
createdAt?: string;
|
|
19
|
-
values?: IRates[];
|
|
20
|
-
columns?: string;
|
|
21
|
-
limit?: number;
|
|
22
|
-
offset?: number;
|
|
23
|
-
config?: AxiosRequestConfig;
|
|
24
|
-
}
|
|
25
|
-
export declare class RatesManager extends CrudServiceManager<IRatesDetails, IRates> {
|
|
26
|
-
private url;
|
|
27
|
-
constructor(url: string);
|
|
28
|
-
find(details: IRatesDetails): Promise<IRates | undefined>;
|
|
29
|
-
count(details: IRatesDetails): Promise<{
|
|
30
|
-
result: number;
|
|
31
|
-
}>;
|
|
32
|
-
unique(details: IRatesDetails): Promise<IRates[] | undefined>;
|
|
33
|
-
findAll(details: IRatesDetails): Promise<IRates[] | undefined>;
|
|
34
|
-
private buildRequestUrl;
|
|
35
|
-
findById(id: StandardIdRequestDefinition): Promise<IRates | undefined>;
|
|
36
|
-
create(details: IRatesDetails): Promise<IRates | undefined>;
|
|
37
|
-
createMany(details: IRatesDetails): Promise<IRates[] | undefined>;
|
|
38
|
-
multipleCreation(details: IRatesDetails): Promise<IRates | undefined>;
|
|
39
|
-
modify(rate: IRates): Promise<any>;
|
|
40
|
-
destroy(rate: IRates): Promise<any>;
|
|
41
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RatesManager = void 0;
|
|
13
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
-
class RatesManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
-
constructor(url) {
|
|
16
|
-
super();
|
|
17
|
-
this.url = url;
|
|
18
|
-
}
|
|
19
|
-
find(details) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
return this.sendFinding(`${this.url}/rates?pairId=${details.pairId}${details.timestamp ? "×tamp=" + details.timestamp : ""}`, details.config);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
count(details) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
let url = this.buildRequestUrl(`${this.url}/rates`, details);
|
|
28
|
-
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
unique(details) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
let url = `${this.url}/rates/distinct?columns=${details.columns}`;
|
|
34
|
-
const rates = yield this.sendAllFinding(url, details.config);
|
|
35
|
-
return rates;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
findAll(details) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
var _a;
|
|
41
|
-
let rates = [];
|
|
42
|
-
let url = this.buildRequestUrl(`${this.url}/rates`, details);
|
|
43
|
-
if (details.limit) {
|
|
44
|
-
rates = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
48
|
-
do {
|
|
49
|
-
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
50
|
-
if (values)
|
|
51
|
-
rates = rates.concat(values);
|
|
52
|
-
isEmpty = values == undefined || values.length == 0;
|
|
53
|
-
offset += limit;
|
|
54
|
-
} while (!isEmpty);
|
|
55
|
-
}
|
|
56
|
-
return rates;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
buildRequestUrl(url, details) {
|
|
60
|
-
let suffix = `${details.pairId ? `&pairId=${details.pairId}` : ""}${details.timestamp ? `×tamp=${details.timestamp}` : ""}`;
|
|
61
|
-
return `${url}?${suffix.substring(1)}`;
|
|
62
|
-
}
|
|
63
|
-
findById(id) {
|
|
64
|
-
return this.sendFinding(`${this.url}/rates?id=${id.id}`, id.config);
|
|
65
|
-
}
|
|
66
|
-
create(details) {
|
|
67
|
-
return this.sendCreation(`${this.url}/rates`, {
|
|
68
|
-
pairId: details.pairId,
|
|
69
|
-
timestamp: details.timestamp,
|
|
70
|
-
rate: details.rate
|
|
71
|
-
}, details.config);
|
|
72
|
-
}
|
|
73
|
-
createMany(details) {
|
|
74
|
-
var _a;
|
|
75
|
-
return this.sendCreationMany(`${this.url}/rates`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
76
|
-
}
|
|
77
|
-
multipleCreation(details) {
|
|
78
|
-
return this.sendCreation(`${this.url}/rates`, {
|
|
79
|
-
values: details.values
|
|
80
|
-
}, details.config);
|
|
81
|
-
}
|
|
82
|
-
modify(rate) {
|
|
83
|
-
return this.sendModification(`${this.url}/rates/${rate.pairId}`, {
|
|
84
|
-
pairId: rate.pairId,
|
|
85
|
-
timestamp: rate.timestamp,
|
|
86
|
-
rate: rate.rate
|
|
87
|
-
}, rate.config);
|
|
88
|
-
}
|
|
89
|
-
destroy(rate) {
|
|
90
|
-
return this.sendDestruction(`${this.url}/rates/${rate.pairId}`, rate.config);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.RatesManager = RatesManager;
|
|
94
|
-
//# sourceMappingURL=RatesManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RatesManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/RatesManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAwF;AA2BxF,MAAa,YAAa,SAAQ,uCAAyC;IAGvE,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEY,IAAI,CAAC,OAAsB;;YACpC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,iBAAiB,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACvJ,CAAC;KAAA;IAEY,KAAK,CAAC,OAAsB;;;YACrC,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7D,OAAO,MAAA,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,MA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C,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,GAAG,QAAQ,EAAE;YAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE;YAC7D,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAEM,OAAO,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC;CACJ;AA/ED,oCA+EC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from "axios";
|
|
2
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
3
|
-
export interface ISource {
|
|
4
|
-
sourceId?: number;
|
|
5
|
-
typeId?: number;
|
|
6
|
-
name: string;
|
|
7
|
-
updatedAt?: string;
|
|
8
|
-
createdAt?: string;
|
|
9
|
-
config?: AxiosRequestConfig;
|
|
10
|
-
}
|
|
11
|
-
export interface ISourceDetails {
|
|
12
|
-
name?: string;
|
|
13
|
-
typeId?: number;
|
|
14
|
-
type?: string;
|
|
15
|
-
values?: ISource[];
|
|
16
|
-
limit?: number;
|
|
17
|
-
offset?: number;
|
|
18
|
-
config?: AxiosRequestConfig;
|
|
19
|
-
}
|
|
20
|
-
export declare class SourceManager extends CrudServiceManager<ISourceDetails, ISource> {
|
|
21
|
-
private url;
|
|
22
|
-
private typeManager;
|
|
23
|
-
constructor(url: string);
|
|
24
|
-
find(details: ISourceDetails): Promise<ISource | undefined>;
|
|
25
|
-
count(details: ISource): Promise<{
|
|
26
|
-
result: number;
|
|
27
|
-
}>;
|
|
28
|
-
findAll(details: ISourceDetails): Promise<ISource[] | undefined>;
|
|
29
|
-
private buildRequestUrl;
|
|
30
|
-
findById(id: StandardIdRequestDefinition): Promise<ISource | undefined>;
|
|
31
|
-
create(details: ISourceDetails): Promise<ISource | undefined>;
|
|
32
|
-
createMany(details: ISourceDetails): Promise<ISource[] | undefined>;
|
|
33
|
-
modify(source: ISource): Promise<any>;
|
|
34
|
-
destroy(source: ISource): Promise<any>;
|
|
35
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SourceManager = void 0;
|
|
13
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
-
const TypeManager_1 = require("../common/TypeManager");
|
|
15
|
-
class SourceManager extends CrudServiceManager_1.CrudServiceManager {
|
|
16
|
-
constructor(url) {
|
|
17
|
-
super();
|
|
18
|
-
this.url = url;
|
|
19
|
-
this.typeManager = new TypeManager_1.TypeManager(url);
|
|
20
|
-
}
|
|
21
|
-
find(details) {
|
|
22
|
-
return this.sendFinding(`${this.url}/sources?name=${details.name}`, details.config);
|
|
23
|
-
}
|
|
24
|
-
count(details) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
let url = this.buildRequestUrl(`${this.url}/sources`, details);
|
|
28
|
-
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
findAll(details) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
var _a;
|
|
34
|
-
let sources = [];
|
|
35
|
-
let url = this.buildRequestUrl(`${this.url}/sources`, details);
|
|
36
|
-
if (details.limit) {
|
|
37
|
-
sources = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
41
|
-
do {
|
|
42
|
-
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
43
|
-
if (values)
|
|
44
|
-
sources = sources.concat(values);
|
|
45
|
-
isEmpty = values == undefined || values.length == 0;
|
|
46
|
-
offset += limit;
|
|
47
|
-
} while (!isEmpty);
|
|
48
|
-
}
|
|
49
|
-
return sources;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
buildRequestUrl(url, details) {
|
|
53
|
-
let suffix = `${details.typeId ? `&typeId=${details.typeId}` : ""}`;
|
|
54
|
-
return `${url}?${suffix.substring(1)}`;
|
|
55
|
-
}
|
|
56
|
-
findById(id) {
|
|
57
|
-
return this.sendFinding(`${this.url}/sources?id=${id.id}`, id.config);
|
|
58
|
-
}
|
|
59
|
-
create(details) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
if (details.type) {
|
|
62
|
-
let sourceType = yield this.typeManager.findOrCreate({ type: details.type, config: details.config });
|
|
63
|
-
if (sourceType)
|
|
64
|
-
return this.sendCreation(`${this.url}/sources`, {
|
|
65
|
-
typeId: sourceType.typeId,
|
|
66
|
-
name: details.name
|
|
67
|
-
}, details.config);
|
|
68
|
-
}
|
|
69
|
-
return undefined;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
createMany(details) {
|
|
73
|
-
var _a;
|
|
74
|
-
return this.sendCreationMany(`${this.url}/sources`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
75
|
-
}
|
|
76
|
-
modify(source) {
|
|
77
|
-
return this.sendModification(`${this.url}/sources/${source.sourceId}`, { name: source.name, typeId: source.typeId }, source.config);
|
|
78
|
-
}
|
|
79
|
-
destroy(source) {
|
|
80
|
-
return this.sendDestruction(`${this.url}/sources/${source.sourceId}`, source.config);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.SourceManager = SourceManager;
|
|
84
|
-
//# sourceMappingURL=SourceManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SourceManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/SourceManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8DAAwF;AACxF,uDAAoD;AAqBpD,MAAa,aAAc,SAAQ,uCAA2C;IAI1E,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAEM,IAAI,CAAC,OAAuB;QAC/B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,iBAAiB,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxF,CAAC;IAEY,KAAK,CAAC,OAAgB;;;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,eAAe,C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AC;IAC9F,CAAC;IAEM,MAAM,CAAC,MAAe;QACzB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACxI,CAAC;IAEM,OAAO,CAAC,MAAe;QAC1B,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzF,CAAC;CACJ;AArED,sCAqEC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { CrudServiceManager, StandardIdRequestDefinition } from "../CrudServiceManager";
|
|
2
|
-
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
export interface IStrategy {
|
|
4
|
-
strategyId?: number;
|
|
5
|
-
accountId?: number;
|
|
6
|
-
statusId?: number;
|
|
7
|
-
name?: string;
|
|
8
|
-
pairId?: number;
|
|
9
|
-
settings?: any;
|
|
10
|
-
memory?: any;
|
|
11
|
-
updatedAt?: string;
|
|
12
|
-
createdAt?: string;
|
|
13
|
-
config?: AxiosRequestConfig;
|
|
14
|
-
}
|
|
15
|
-
export interface IStrategySearchDetails {
|
|
16
|
-
strategyId?: number;
|
|
17
|
-
accountId?: number;
|
|
18
|
-
statusId?: number;
|
|
19
|
-
name?: string;
|
|
20
|
-
pairId?: number;
|
|
21
|
-
settings?: any;
|
|
22
|
-
memory?: any;
|
|
23
|
-
values?: IStrategy[];
|
|
24
|
-
limit?: number;
|
|
25
|
-
offset?: number;
|
|
26
|
-
config?: AxiosRequestConfig;
|
|
27
|
-
}
|
|
28
|
-
export declare class StrategyManager extends CrudServiceManager<IStrategySearchDetails, IStrategy> {
|
|
29
|
-
private url;
|
|
30
|
-
constructor(url: string);
|
|
31
|
-
find(details: IStrategySearchDetails): Promise<IStrategy | undefined>;
|
|
32
|
-
count(details: IStrategySearchDetails): Promise<{
|
|
33
|
-
result: number;
|
|
34
|
-
}>;
|
|
35
|
-
findAll(details: IStrategySearchDetails): Promise<IStrategy[] | undefined>;
|
|
36
|
-
private buildRequestUrl;
|
|
37
|
-
findById(id: StandardIdRequestDefinition): Promise<IStrategy | undefined>;
|
|
38
|
-
create(details: IStrategySearchDetails): Promise<IStrategy | undefined>;
|
|
39
|
-
createMany(details: IStrategySearchDetails): Promise<IStrategy[] | undefined>;
|
|
40
|
-
modify(strategy: IStrategy): Promise<any>;
|
|
41
|
-
destroy(strategy: IStrategy): Promise<any>;
|
|
42
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StrategyManager = void 0;
|
|
13
|
-
const CrudServiceManager_1 = require("../CrudServiceManager");
|
|
14
|
-
class StrategyManager extends CrudServiceManager_1.CrudServiceManager {
|
|
15
|
-
constructor(url) {
|
|
16
|
-
super();
|
|
17
|
-
this.url = url;
|
|
18
|
-
}
|
|
19
|
-
find(details) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
return this.sendFinding(`${this.url}/strategies?name=${details.name}&pairId=${details.pairId}`, details.config);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
count(details) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
let url = this.buildRequestUrl(`${this.url}/strategies`, details);
|
|
28
|
-
return (_a = (yield this.sendCounting(url, details.config))) !== null && _a !== void 0 ? _a : { result: 0 };
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
findAll(details) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
var _a;
|
|
34
|
-
let strategies = [];
|
|
35
|
-
let url = this.buildRequestUrl(`${this.url}/strategies`, details);
|
|
36
|
-
if (details.limit) {
|
|
37
|
-
strategies = (_a = (yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${details.limit}&offset=${details.offset}`, details.config))) !== null && _a !== void 0 ? _a : [];
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
let limit = 5000, offset = 0, isEmpty = false;
|
|
41
|
-
do {
|
|
42
|
-
let values = yield this.sendAllFinding(`${url}${url.indexOf('?') !== -1 ? '&' : '?'}limit=${limit}&offset=${offset}`, details.config);
|
|
43
|
-
if (values)
|
|
44
|
-
strategies = strategies.concat(values);
|
|
45
|
-
isEmpty = values == undefined || values.length == 0;
|
|
46
|
-
offset += limit;
|
|
47
|
-
} while (!isEmpty);
|
|
48
|
-
}
|
|
49
|
-
return strategies;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
buildRequestUrl(url, details) {
|
|
53
|
-
let suffix = `${details.name ? `&name=${details.name}` : ""}${details.pairId ? `&pairId=${details.pairId}` : ""}${details.accountId ? `&accountId=${details.accountId}` : ""}${details.statusId ? `&statusId=${details.statusId}` : ""}`;
|
|
54
|
-
return `${url}?${suffix.substring(1)}`;
|
|
55
|
-
}
|
|
56
|
-
findById(id) {
|
|
57
|
-
return this.sendFinding(`${this.url}/strategies?id=${id.id}`, id.config);
|
|
58
|
-
}
|
|
59
|
-
create(details) {
|
|
60
|
-
return this.sendCreation(`${this.url}/strategies`, {
|
|
61
|
-
accountId: details.accountId,
|
|
62
|
-
statusId: details.statusId,
|
|
63
|
-
name: details.name,
|
|
64
|
-
pairId: details.pairId,
|
|
65
|
-
settings: details.settings,
|
|
66
|
-
memory: details.memory
|
|
67
|
-
}, details.config);
|
|
68
|
-
}
|
|
69
|
-
createMany(details) {
|
|
70
|
-
var _a;
|
|
71
|
-
return this.sendCreationMany(`${this.url}/strategies`, (_a = details.values) !== null && _a !== void 0 ? _a : [], details.config);
|
|
72
|
-
}
|
|
73
|
-
modify(strategy) {
|
|
74
|
-
return this.sendModification(`${this.url}/strategies/${strategy.strategyId}`, {
|
|
75
|
-
accountId: strategy.accountId,
|
|
76
|
-
statusId: strategy.statusId,
|
|
77
|
-
name: strategy.name,
|
|
78
|
-
pairId: strategy.pairId,
|
|
79
|
-
settings: strategy.settings,
|
|
80
|
-
memory: strategy.memory
|
|
81
|
-
}, strategy.config);
|
|
82
|
-
}
|
|
83
|
-
destroy(strategy) {
|
|
84
|
-
return this.sendDestruction(`${this.url}/strategies/${strategy.strategyId}`, strategy.config);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.StrategyManager = StrategyManager;
|
|
88
|
-
//# sourceMappingURL=StrategyManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StrategyManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/cetus/StrategyManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAAwF;AA8BxF,MAAa,eAAgB,SAAQ,uCAAqD;IAGtF,YAAY,GAAW;QACnB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAEY,IAAI,CAAC,OAA+B;;YAC7C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,oBAAoB,OAAO,CAAC,IAAI,WA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