@riocrypto/common-server 1.0.2421 → 1.0.2423

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 } 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, PriceType } 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, price, ignoreLiquidityError, }: {
13
+ createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, price, ignoreLiquidityError, priceType, limitNetPrice, }: {
14
14
  userId: string;
15
15
  side: Side;
16
16
  country: Country;
@@ -25,6 +25,8 @@ declare class ClusterClient {
25
25
  netPrice?: number;
26
26
  price?: number;
27
27
  ignoreLiquidityError?: boolean;
28
+ priceType?: PriceType;
29
+ limitNetPrice?: number;
28
30
  }): Promise<Quote>;
29
31
  getNewChainedQuote(chainedOrderId: string, chainedQuote: ChainedQuote, newOriginAmount?: number): Promise<ChainedQuote>;
30
32
  getBidQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire", netPrice?: string): Promise<Quote>;
@@ -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, price, ignoreLiquidityError, }) {
77
+ createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, netPrice, price, ignoreLiquidityError, priceType, limitNetPrice, }) {
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,
@@ -1,7 +1,8 @@
1
- import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side, Crypto, OrderAttribute, DeferredPaymentType, TwoWaySettlementType } from "@riocrypto/common";
1
+ import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side, Crypto, OrderAttribute, DeferredPaymentType, TwoWaySettlementType, PriceType } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface OrderAttrs {
4
4
  quoteId: string;
5
+ priceType: PriceType;
5
6
  userId: string;
6
7
  crypto: Crypto;
7
8
  side: Side;
@@ -28,6 +29,7 @@ interface OrderAttrs {
28
29
  withdrawalTxId?: string;
29
30
  withdrawalTxIds?: string[];
30
31
  brokerId?: string;
32
+ limitNetPrice?: number;
31
33
  conversionRateUSD: number;
32
34
  conversionRateUSDWithMarkups: number;
33
35
  actualConversionRateUSD?: number;
@@ -127,6 +129,7 @@ interface OrderAttrs {
127
129
  }
128
130
  interface OrderDoc extends Document {
129
131
  quoteId: string;
132
+ priceType: PriceType;
130
133
  userId: string;
131
134
  status: OrderStatus;
132
135
  crypto: Crypto;
@@ -137,7 +140,7 @@ interface OrderDoc extends Document {
137
140
  createdAt: Date;
138
141
  twoWaySettlementDate: Date;
139
142
  country: Country;
140
- state?: string;
143
+ limitNetPrice?: number;
141
144
  cryptoAddress?: string;
142
145
  amountFiat: number;
143
146
  amountCrypto: number;
@@ -11,6 +11,10 @@ const buildOrder = (mongoose) => {
11
11
  quoteId: {
12
12
  type: String,
13
13
  },
14
+ priceType: {
15
+ type: String,
16
+ required: true,
17
+ },
14
18
  userId: {
15
19
  type: String,
16
20
  required: true,
@@ -68,8 +72,8 @@ const buildOrder = (mongoose) => {
68
72
  type: String,
69
73
  required: true,
70
74
  },
71
- state: {
72
- type: String,
75
+ limitNetPrice: {
76
+ type: Number,
73
77
  },
74
78
  amountFiat: {
75
79
  type: Number,
@@ -1,15 +1,16 @@
1
- import { Country, Fees, Fiat, LiquidityProvider, PaymentMethod, PayoutMethod, Processor, Side, USState, Crypto, DeferredPaymentType, TwoWaySettlementType } from "@riocrypto/common";
1
+ import { Country, Fees, Fiat, LiquidityProvider, PaymentMethod, PayoutMethod, Processor, Side, Crypto, DeferredPaymentType, TwoWaySettlementType, PriceType } from "@riocrypto/common";
2
2
  import { Mongoose, Model, Document } from "mongoose";
3
3
  interface QuoteAttrs {
4
4
  userId: string;
5
+ priceType: PriceType;
5
6
  crypto: Crypto;
6
7
  side: Side;
7
8
  fiat: Fiat;
9
+ limitNetPrice?: number;
8
10
  paymentMethod?: PaymentMethod;
9
11
  payoutMethod?: PayoutMethod;
10
12
  expiresAt?: Date;
11
13
  country: Country;
12
- state?: USState | string;
13
14
  amountFiat: number;
14
15
  amountCrypto: number;
15
16
  liquidityProvider: LiquidityProvider;
@@ -42,6 +43,7 @@ interface QuoteAttrs {
42
43
  }
43
44
  interface QuoteDoc extends Document {
44
45
  userId: string;
46
+ priceType: PriceType;
45
47
  crypto: Crypto;
46
48
  side: Side;
47
49
  fiat: Fiat;
@@ -49,7 +51,7 @@ interface QuoteDoc extends Document {
49
51
  payoutMethod?: PayoutMethod;
50
52
  expiresAt?: Date;
51
53
  country: Country;
52
- state?: USState | string;
54
+ limitNetPrice?: number;
53
55
  amountFiat: number;
54
56
  amountCrypto: number;
55
57
  liquidityProvider: LiquidityProvider;
@@ -11,6 +11,13 @@ const buildQuote = (mongoose) => {
11
11
  type: String,
12
12
  required: true,
13
13
  },
14
+ priceType: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ limitNetPrice: {
19
+ type: Number,
20
+ },
14
21
  crypto: {
15
22
  type: String,
16
23
  required: true,
@@ -36,9 +43,6 @@ const buildQuote = (mongoose) => {
36
43
  type: String,
37
44
  required: true,
38
45
  },
39
- state: {
40
- type: String,
41
- },
42
46
  amountFiat: {
43
47
  type: Number,
44
48
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2421",
3
+ "version": "1.0.2423",
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.2172",
31
+ "@riocrypto/common": "^1.0.2175",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",