@riocrypto/common-server 1.0.2265 → 1.0.2267

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.
@@ -87,6 +87,17 @@ declare class ClusterClient {
87
87
  }): Promise<EmarketsFXTrade>;
88
88
  retryEmarketsTrade(id: string): Promise<void>;
89
89
  retryExternalTrade(id: string): Promise<void>;
90
+ importExternalTrade(data: {
91
+ provider: ExternalTradingProvider;
92
+ originCurrency: Crypto | Fiat;
93
+ destinationCurrency: Crypto | Fiat;
94
+ originAmount: number;
95
+ destinationAmount: number;
96
+ type: ExternalTradeType;
97
+ emarketsOrderType?: "TOD" | "TOM" | "SPT";
98
+ arbitrageSessionId?: string;
99
+ }): Promise<ExternalTrade>;
100
+ deleteExternalTrade(id: string): Promise<void>;
90
101
  getEmarketsTrade(id: string): Promise<EmarketsFXTrade>;
91
102
  updateExternalTradingAlgorithmLimitPrice(id: string, limitPrice: number): Promise<void>;
92
103
  startExternalTradingAlgorithm({ type, provider, originCurrency, destinationCurrency, maxOriginAmount, maxDestinationAmount, limitPrice, replaceOrderDifferenceThreshold, isPostOnly, spread, clipSize, }: {
@@ -452,6 +452,21 @@ class ClusterClient {
452
452
  yield this.axios.post(`${this.baseUrl}/api/trading/external/trades/${id}/retry`, {}, { headers: { "x-cluster-api-key": this.clusterApiKey } });
453
453
  });
454
454
  }
455
+ importExternalTrade(data) {
456
+ return __awaiter(this, void 0, void 0, function* () {
457
+ const response = yield this.axios.post(`${this.baseUrl}/api/trading/external/trades/import`, Object.assign({}, data), {
458
+ headers: {
459
+ "x-cluster-api-key": this.clusterApiKey,
460
+ },
461
+ });
462
+ return response.data;
463
+ });
464
+ }
465
+ deleteExternalTrade(id) {
466
+ return __awaiter(this, void 0, void 0, function* () {
467
+ yield this.axios.delete(`${this.baseUrl}/api/trading/external/trades/${id}`, { headers: { "x-cluster-api-key": this.clusterApiKey } });
468
+ });
469
+ }
455
470
  getEmarketsTrade(id) {
456
471
  return __awaiter(this, void 0, void 0, function* () {
457
472
  const response = yield this.axios.get(`${this.baseUrl}/api/emarkets/bot/trades/${id}`, {
@@ -24,6 +24,7 @@ interface ExternalTradeAttrs {
24
24
  };
25
25
  externalTradingAlgorithmId?: string;
26
26
  arbitrageSessionId?: string;
27
+ isImported?: boolean;
27
28
  }
28
29
  interface ExternalTradeDoc extends Document {
29
30
  createdAt: Date;
@@ -50,6 +51,7 @@ interface ExternalTradeDoc extends Document {
50
51
  };
51
52
  externalTradingAlgorithmId?: string;
52
53
  arbitrageSessionId?: string;
54
+ isImported?: boolean;
53
55
  }
54
56
  interface ExternalTradeModel extends Model<ExternalTradeDoc> {
55
57
  build(attrs: ExternalTradeAttrs): ExternalTradeDoc;
@@ -74,6 +74,10 @@ const buildExternalTrade = (mongoose) => {
74
74
  arbitrageSessionId: {
75
75
  type: String,
76
76
  },
77
+ isImported: {
78
+ type: Boolean,
79
+ default: false,
80
+ },
77
81
  }, {
78
82
  toJSON: {
79
83
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2265",
3
+ "version": "1.0.2267",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/secret-manager": "^5.3.0",
29
29
  "@google-cloud/storage": "^6.9.5",
30
30
  "@hyperdx/node-opentelemetry": "^0.7.0",
31
- "@riocrypto/common": "^1.0.1984",
31
+ "@riocrypto/common": "^1.0.1990",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",