@riocrypto/common-server 1.0.2156 → 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 } 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;
@@ -72,6 +72,17 @@ declare class ClusterClient {
72
72
  startExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
73
73
  stopExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
74
74
  getExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
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>;
75
86
  }
76
87
  export declare const buildClusterClient: () => Promise<ClusterClient>;
77
88
  export {};
@@ -460,6 +460,35 @@ class ClusterClient {
460
460
  return response.data;
461
461
  });
462
462
  }
463
+ getExternalTrade(id) {
464
+ return __awaiter(this, void 0, void 0, function* () {
465
+ const response = yield this.axios.get(`${this.baseUrl}/api/trading/external/trades/${id}`, {
466
+ headers: {
467
+ "x-cluster-api-key": this.clusterApiKey,
468
+ },
469
+ });
470
+ return response.data;
471
+ });
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
+ }
463
492
  }
464
493
  const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
465
494
  // Retrieve secrets asynchronously
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2156",
3
+ "version": "1.0.2158",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",