@riocrypto/common-server 1.0.2158 → 1.0.2160
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/build/clients/cluster-client.d.ts +10 -2
- package/build/clients/cluster-client.js +10 -2
- package/build/models/arbitrage-session.d.ts +4 -0
- package/build/models/external-trade.d.ts +2 -0
- package/build/models/external-trade.js +3 -0
- package/build/models/external-trading-algorithm.d.ts +2 -0
- package/build/models/external-trading-algorithm.js +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider } from "@riocrypto/common";
|
|
1
|
+
import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType } from "@riocrypto/common";
|
|
2
2
|
declare class ClusterClient {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private clusterApiKey;
|
|
@@ -69,7 +69,15 @@ declare class ClusterClient {
|
|
|
69
69
|
}): Promise<EmarketsFXTrade>;
|
|
70
70
|
getEmarketsTrade(id: string): Promise<EmarketsFXTrade>;
|
|
71
71
|
updateExternalTradingAlgorithmLimitPrice(id: string, limitPrice: number): Promise<void>;
|
|
72
|
-
startExternalTradingAlgorithm(
|
|
72
|
+
startExternalTradingAlgorithm({ type, provider, originCurrency, destinationCurrency, maxOriginAmount, maxDestinationAmount, limitPrice, }: {
|
|
73
|
+
type: ExternalTradingAlgorithmType;
|
|
74
|
+
provider: ExternalTradingProvider;
|
|
75
|
+
originCurrency: Crypto | Fiat;
|
|
76
|
+
destinationCurrency: Crypto | Fiat;
|
|
77
|
+
maxOriginAmount?: number;
|
|
78
|
+
maxDestinationAmount?: number;
|
|
79
|
+
limitPrice?: number;
|
|
80
|
+
}): Promise<ExternalTradingAlgorithm>;
|
|
73
81
|
stopExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
|
|
74
82
|
getExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
|
|
75
83
|
getExternalTrade(id: string): Promise<ExternalTrade>;
|
|
@@ -430,9 +430,17 @@ class ClusterClient {
|
|
|
430
430
|
});
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
startExternalTradingAlgorithm(
|
|
433
|
+
startExternalTradingAlgorithm({ type, provider, originCurrency, destinationCurrency, maxOriginAmount, maxDestinationAmount, limitPrice, }) {
|
|
434
434
|
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
-
const response = yield this.axios.post(`${this.baseUrl}/api/trading/external/algorithms
|
|
435
|
+
const response = yield this.axios.post(`${this.baseUrl}/api/trading/external/algorithms/start`, {
|
|
436
|
+
type,
|
|
437
|
+
provider,
|
|
438
|
+
originCurrency,
|
|
439
|
+
destinationCurrency,
|
|
440
|
+
maxOriginAmount,
|
|
441
|
+
maxDestinationAmount,
|
|
442
|
+
limitPrice,
|
|
443
|
+
}, {
|
|
436
444
|
headers: {
|
|
437
445
|
"x-cluster-api-key": this.clusterApiKey,
|
|
438
446
|
},
|
|
@@ -21,6 +21,7 @@ interface ArbitrageSessionAttrs {
|
|
|
21
21
|
amountWithdrawn: number;
|
|
22
22
|
avgPrice?: number;
|
|
23
23
|
externalTradeIds: string[];
|
|
24
|
+
runningExternalTradeIds: string[];
|
|
24
25
|
externalTradingAlgorithmId?: string;
|
|
25
26
|
providerOptions?: {
|
|
26
27
|
emarkets?: {
|
|
@@ -40,6 +41,7 @@ interface ArbitrageSessionAttrs {
|
|
|
40
41
|
amountWithdrawn: number;
|
|
41
42
|
avgPrice?: number;
|
|
42
43
|
externalTradeIds: string[];
|
|
44
|
+
runningExternalTradeIds: string[];
|
|
43
45
|
externalTradingAlgorithmId?: string;
|
|
44
46
|
providerOptions?: {
|
|
45
47
|
emarkets?: {
|
|
@@ -75,6 +77,7 @@ interface ArbitrageSessionDoc extends Document {
|
|
|
75
77
|
amountWithdrawn: number;
|
|
76
78
|
avgPrice?: number;
|
|
77
79
|
externalTradeIds: string[];
|
|
80
|
+
runningExternalTradeIds: string[];
|
|
78
81
|
externalTradingAlgorithmId?: string;
|
|
79
82
|
providerOptions?: {
|
|
80
83
|
emarkets?: {
|
|
@@ -95,6 +98,7 @@ interface ArbitrageSessionDoc extends Document {
|
|
|
95
98
|
amountWithdrawn: number;
|
|
96
99
|
avgPrice?: number;
|
|
97
100
|
externalTradeIds: string[];
|
|
101
|
+
runningExternalTradeIds: string[];
|
|
98
102
|
externalTradingAlgorithmId?: string;
|
|
99
103
|
providerOptions?: {
|
|
100
104
|
emarkets?: {
|
|
@@ -21,6 +21,7 @@ interface ExternalTradeAttrs {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
externalTradingAlgorithmId?: string;
|
|
24
|
+
arbitrageSessionId?: string;
|
|
24
25
|
}
|
|
25
26
|
interface ExternalTradeDoc extends Document {
|
|
26
27
|
createdAt: Date;
|
|
@@ -43,6 +44,7 @@ interface ExternalTradeDoc extends Document {
|
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
externalTradingAlgorithmId?: string;
|
|
47
|
+
arbitrageSessionId?: string;
|
|
46
48
|
}
|
|
47
49
|
interface ExternalTradeModel extends Model<ExternalTradeDoc> {
|
|
48
50
|
build(attrs: ExternalTradeAttrs): ExternalTradeDoc;
|
|
@@ -22,6 +22,7 @@ interface ExternalTradingAlgorithmAttrs {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
externalTradeIds: string[];
|
|
25
|
+
arbitrageSessionId?: string;
|
|
25
26
|
}
|
|
26
27
|
interface ExternalTradingAlgorithmDoc extends Document {
|
|
27
28
|
createdAt: Date;
|
|
@@ -45,6 +46,7 @@ interface ExternalTradingAlgorithmDoc extends Document {
|
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
externalTradeIds: string[];
|
|
49
|
+
arbitrageSessionId?: string;
|
|
48
50
|
}
|
|
49
51
|
interface ExternalTradingAlgorithmModel extends Model<ExternalTradingAlgorithmDoc> {
|
|
50
52
|
build(attrs: ExternalTradingAlgorithmAttrs): ExternalTradingAlgorithmDoc;
|