@riocrypto/common-server 1.0.2157 → 1.0.2158
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade } 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 } from "@riocrypto/common";
|
|
2
2
|
declare class ClusterClient {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private clusterApiKey;
|
|
@@ -73,6 +73,16 @@ declare class ClusterClient {
|
|
|
73
73
|
stopExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
|
|
74
74
|
getExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
|
|
75
75
|
getExternalTrade(id: string): Promise<ExternalTrade>;
|
|
76
|
+
placeExternalTrade({ provider, type, originCurrency, destinationCurrency, originAmount, destinationAmount, limitPrice, emarketsOrderType, }: {
|
|
77
|
+
provider: ExternalTradingProvider;
|
|
78
|
+
type: ExternalTradeType;
|
|
79
|
+
originCurrency: Crypto | Fiat;
|
|
80
|
+
destinationCurrency: Crypto | Fiat;
|
|
81
|
+
originAmount: number;
|
|
82
|
+
destinationAmount: number;
|
|
83
|
+
limitPrice: number;
|
|
84
|
+
emarketsOrderType: "TOD" | "TOM" | "SPT";
|
|
85
|
+
}): Promise<ExternalTrade>;
|
|
76
86
|
}
|
|
77
87
|
export declare const buildClusterClient: () => Promise<ClusterClient>;
|
|
78
88
|
export {};
|
|
@@ -470,6 +470,25 @@ class ClusterClient {
|
|
|
470
470
|
return response.data;
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
|
+
placeExternalTrade({ provider, type, originCurrency, destinationCurrency, originAmount, destinationAmount, limitPrice, emarketsOrderType, }) {
|
|
474
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
475
|
+
const response = yield this.axios.post(`${this.baseUrl}/api/trading/external/trades`, {
|
|
476
|
+
provider,
|
|
477
|
+
type,
|
|
478
|
+
originCurrency,
|
|
479
|
+
destinationCurrency,
|
|
480
|
+
originAmount,
|
|
481
|
+
destinationAmount,
|
|
482
|
+
limitPrice,
|
|
483
|
+
emarketsOrderType,
|
|
484
|
+
}, {
|
|
485
|
+
headers: {
|
|
486
|
+
"x-cluster-api-key": this.clusterApiKey,
|
|
487
|
+
},
|
|
488
|
+
});
|
|
489
|
+
return response.data;
|
|
490
|
+
});
|
|
491
|
+
}
|
|
473
492
|
}
|
|
474
493
|
const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
475
494
|
// Retrieve secrets asynchronously
|