@riocrypto/common-server 1.0.2442 → 1.0.2445

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, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType, STPMXNWithdrawal, AuthPermission, DeferredPaymentType, TwoWaySettlementType, PriceType } 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, STPMXNWithdrawal, AuthPermission, DeferredPaymentType, TwoWaySettlementType, OrderType, EmarketsSettlementType, EmarketsOrderType } from "@riocrypto/common";
2
2
  declare class ClusterClient {
3
3
  private baseUrl;
4
4
  private clusterApiKey;
@@ -10,7 +10,7 @@ declare class ClusterClient {
10
10
  newAmountCrypto?: number;
11
11
  useSamePrice?: boolean;
12
12
  }): Promise<Quote>;
13
- createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, marketPrice, ignoreLiquidityError, priceType, limitNetPrice, timeInForceStartsAt, timeInForceEndsAt, }: {
13
+ createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, marketPrice, ignoreLiquidityError, orderType, limitNetPrice, timeInForceStartsAt, timeInForceEndsAt, }: {
14
14
  userId: string;
15
15
  side: Side;
16
16
  country: Country;
@@ -25,7 +25,7 @@ declare class ClusterClient {
25
25
  netPrice?: number;
26
26
  marketPrice?: number;
27
27
  ignoreLiquidityError?: boolean;
28
- priceType?: PriceType;
28
+ orderType?: OrderType;
29
29
  limitNetPrice?: number;
30
30
  timeInForceStartsAt?: Date;
31
31
  timeInForceEndsAt?: Date;
@@ -98,10 +98,11 @@ declare class ClusterClient {
98
98
  receiverCLABE: string;
99
99
  amount: number;
100
100
  }): Promise<string>;
101
- placeEmarketsTrade({ amountToTrade, limitPrice, orderType, side, isExternalTrade, }: {
101
+ placeEmarketsTrade({ amountToTrade, limitPrice, settlementType, orderType, side, isExternalTrade, }: {
102
102
  amountToTrade: number;
103
103
  limitPrice: number;
104
- orderType: "TOD" | "TOM" | "SPT";
104
+ settlementType: EmarketsSettlementType;
105
+ orderType: EmarketsOrderType;
105
106
  side: Side;
106
107
  isExternalTrade: boolean;
107
108
  }): Promise<EmarketsFXTrade>;
@@ -116,7 +117,7 @@ declare class ClusterClient {
116
117
  originAmount: number;
117
118
  destinationAmount: number;
118
119
  type: ExternalTradeType;
119
- emarketsOrderType?: "TOD" | "TOM" | "SPT";
120
+ emarketsSettlementType?: EmarketsSettlementType;
120
121
  arbitrageSessionId?: string;
121
122
  externalTradingAlgorithmId?: string;
122
123
  }): Promise<ExternalTrade>;
@@ -139,7 +140,7 @@ declare class ClusterClient {
139
140
  stopExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
140
141
  getExternalTradingAlgorithm(id: string): Promise<ExternalTradingAlgorithm>;
141
142
  getExternalTrade(id: string): Promise<ExternalTrade>;
142
- placeExternalTrade({ provider, type, originCurrency, destinationCurrency, requestedOriginAmount, requestedDestinationAmount, limitPrice, emarketsOrderType, arbitrageSessionId, }: {
143
+ placeExternalTrade({ provider, type, originCurrency, destinationCurrency, requestedOriginAmount, requestedDestinationAmount, limitPrice, emarketsSettlementType, arbitrageSessionId, }: {
143
144
  provider: ExternalTradingProvider;
144
145
  type: ExternalTradeType;
145
146
  originCurrency: Crypto | Fiat;
@@ -147,7 +148,7 @@ declare class ClusterClient {
147
148
  requestedOriginAmount?: number;
148
149
  requestedDestinationAmount?: number;
149
150
  limitPrice: number;
150
- emarketsOrderType?: "TOD" | "TOM" | "SPT";
151
+ emarketsSettlementType?: EmarketsSettlementType;
151
152
  arbitrageSessionId?: string;
152
153
  }): Promise<ExternalTrade>;
153
154
  generateSTPDepositCLABE(userId: string): Promise<{
@@ -74,7 +74,7 @@ class ClusterClient {
74
74
  return response.data.quote;
75
75
  });
76
76
  }
77
- createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, marketPrice, ignoreLiquidityError, priceType, limitNetPrice, timeInForceStartsAt, timeInForceEndsAt, }) {
77
+ createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, marketPrice, ignoreLiquidityError, orderType, limitNetPrice, timeInForceStartsAt, timeInForceEndsAt, }) {
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
79
  const response = yield this.axios.post(`${this.baseUrl}/api/quotes`, {
80
80
  userId,
@@ -91,7 +91,7 @@ class ClusterClient {
91
91
  netPrice,
92
92
  marketPrice,
93
93
  ignoreLiquidityError,
94
- priceType,
94
+ orderType,
95
95
  limitNetPrice,
96
96
  timeInForceStartsAt,
97
97
  timeInForceEndsAt,
@@ -441,9 +441,16 @@ class ClusterClient {
441
441
  return (_a = response.data) === null || _a === void 0 ? void 0 : _a.url;
442
442
  });
443
443
  }
444
- placeEmarketsTrade({ amountToTrade, limitPrice, orderType, side, isExternalTrade, }) {
444
+ placeEmarketsTrade({ amountToTrade, limitPrice, settlementType, orderType, side, isExternalTrade, }) {
445
445
  return __awaiter(this, void 0, void 0, function* () {
446
- const response = yield this.axios.post(`${this.baseUrl}/api/emarkets/bot/trades`, { amountToTrade, limitPrice, orderType, side, isExternalTrade }, {
446
+ const response = yield this.axios.post(`${this.baseUrl}/api/emarkets/bot/trades`, {
447
+ amountToTrade,
448
+ limitPrice,
449
+ orderType,
450
+ side,
451
+ isExternalTrade,
452
+ settlementType,
453
+ }, {
447
454
  headers: {
448
455
  "x-cluster-api-key": this.clusterApiKey,
449
456
  },
@@ -565,7 +572,7 @@ class ClusterClient {
565
572
  return response.data;
566
573
  });
567
574
  }
568
- placeExternalTrade({ provider, type, originCurrency, destinationCurrency, requestedOriginAmount, requestedDestinationAmount, limitPrice, emarketsOrderType, arbitrageSessionId, }) {
575
+ placeExternalTrade({ provider, type, originCurrency, destinationCurrency, requestedOriginAmount, requestedDestinationAmount, limitPrice, emarketsSettlementType, arbitrageSessionId, }) {
569
576
  return __awaiter(this, void 0, void 0, function* () {
570
577
  const response = yield this.axios.post(`${this.baseUrl}/api/trading/external/trades`, {
571
578
  provider,
@@ -575,7 +582,7 @@ class ClusterClient {
575
582
  requestedOriginAmount,
576
583
  requestedDestinationAmount,
577
584
  limitPrice,
578
- emarketsOrderType,
585
+ emarketsSettlementType,
579
586
  arbitrageSessionId,
580
587
  }, {
581
588
  headers: {
@@ -1,8 +1,8 @@
1
- import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side, Crypto, OrderAttribute, DeferredPaymentType, TwoWaySettlementType, PriceType } from "@riocrypto/common";
1
+ import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side, Crypto, OrderAttribute, DeferredPaymentType, TwoWaySettlementType, OrderType } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface OrderAttrs {
4
4
  quoteId: string;
5
- priceType: PriceType;
5
+ type: OrderType;
6
6
  userId: string;
7
7
  crypto: Crypto;
8
8
  side: Side;
@@ -134,7 +134,7 @@ interface OrderAttrs {
134
134
  }
135
135
  interface OrderDoc extends Document {
136
136
  quoteId: string;
137
- priceType: PriceType;
137
+ type: OrderType;
138
138
  userId: string;
139
139
  status: OrderStatus;
140
140
  crypto: Crypto;
@@ -11,9 +11,8 @@ const buildOrder = (mongoose) => {
11
11
  quoteId: {
12
12
  type: String,
13
13
  },
14
- priceType: {
14
+ type: {
15
15
  type: String,
16
- required: true,
17
16
  },
18
17
  userId: {
19
18
  type: String,
@@ -1,8 +1,8 @@
1
- import { Country, Fees, Fiat, LiquidityProvider, PaymentMethod, PayoutMethod, Processor, Side, Crypto, DeferredPaymentType, TwoWaySettlementType, PriceType } from "@riocrypto/common";
1
+ import { Country, Fees, Fiat, LiquidityProvider, PaymentMethod, PayoutMethod, Processor, Side, Crypto, DeferredPaymentType, TwoWaySettlementType, OrderType } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface QuoteAttrs {
4
4
  userId: string;
5
- priceType: PriceType;
5
+ orderType: OrderType;
6
6
  crypto: Crypto;
7
7
  side: Side;
8
8
  fiat: Fiat;
@@ -45,7 +45,7 @@ interface QuoteAttrs {
45
45
  }
46
46
  interface QuoteDoc extends Document {
47
47
  userId: string;
48
- priceType: PriceType;
48
+ orderType: OrderType;
49
49
  crypto: Crypto;
50
50
  side: Side;
51
51
  fiat: Fiat;
@@ -11,7 +11,7 @@ const buildQuote = (mongoose) => {
11
11
  type: String,
12
12
  required: true,
13
13
  },
14
- priceType: {
14
+ orderType: {
15
15
  type: String,
16
16
  required: true,
17
17
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2442",
3
+ "version": "1.0.2445",
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.2203",
31
+ "@riocrypto/common": "^1.0.2206",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",