@riocrypto/common-server 1.0.2146 → 1.0.2148

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 } from "@riocrypto/common";
1
+ import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade } from "@riocrypto/common";
2
2
  declare class ClusterClient {
3
3
  private baseUrl;
4
4
  private clusterApiKey;
@@ -61,6 +61,8 @@ declare class ClusterClient {
61
61
  receiverCLABE: string;
62
62
  amount: number;
63
63
  }): Promise<string>;
64
+ placeEmarketsTrade(externalTradeId: string): Promise<void>;
65
+ getEmarketsTrade(id: string): Promise<EmarketsFXTrade>;
64
66
  }
65
67
  export declare const buildClusterClient: () => Promise<ClusterClient>;
66
68
  export {};
@@ -390,6 +390,25 @@ class ClusterClient {
390
390
  return (_a = response.data) === null || _a === void 0 ? void 0 : _a.url;
391
391
  });
392
392
  }
393
+ placeEmarketsTrade(externalTradeId) {
394
+ return __awaiter(this, void 0, void 0, function* () {
395
+ yield this.axios.post(`${this.baseUrl}/api/emarkets/trades`, { externalTradeId }, {
396
+ headers: {
397
+ "x-cluster-api-key": this.clusterApiKey,
398
+ },
399
+ });
400
+ });
401
+ }
402
+ getEmarketsTrade(id) {
403
+ return __awaiter(this, void 0, void 0, function* () {
404
+ const response = yield this.axios.get(`${this.baseUrl}/api/emarkets/trades/${id}`, {
405
+ headers: {
406
+ "x-cluster-api-key": this.clusterApiKey,
407
+ },
408
+ });
409
+ return response.data;
410
+ });
411
+ }
393
412
  }
394
413
  const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
395
414
  // Retrieve secrets asynchronously
@@ -5,6 +5,7 @@ interface EmarketsFXTradeAttrs {
5
5
  status: EmarketsFXTradeStatus;
6
6
  FXTradeId?: string;
7
7
  arbitrageTradeId?: string;
8
+ externalTradeId?: string;
8
9
  side: Side;
9
10
  fiat: Fiat;
10
11
  amountToTrade: number;
@@ -18,6 +19,7 @@ interface EmarketsFXTradeDoc extends Document {
18
19
  createdAt: Date;
19
20
  side: Side;
20
21
  status: EmarketsFXTradeStatus;
22
+ externalTradeId?: string;
21
23
  FXTradeId?: string;
22
24
  arbitrageTradeId?: string;
23
25
  fiat: Fiat;
@@ -49,6 +49,10 @@ const buildEmarketsFXTrade = (mongoose) => {
49
49
  type: String,
50
50
  required: true,
51
51
  },
52
+ externalTradeId: {
53
+ type: String,
54
+ required: true,
55
+ },
52
56
  }, {
53
57
  toJSON: {
54
58
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2146",
3
+ "version": "1.0.2148",
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.1910",
31
+ "@riocrypto/common": "^1.0.1911",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",