@riocrypto/common-server 1.0.2419 → 1.0.2420

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,38 +1,36 @@
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
- import { OrderExecutionType } from "@riocrypto/common/build/types/order-execution-type";
4
3
  interface OrderAttrs {
5
- quoteId?: string;
4
+ quoteId: string;
5
+ priceType: PriceType;
6
6
  userId: string;
7
7
  crypto: Crypto;
8
8
  side: Side;
9
9
  fiat: Fiat;
10
- executionType: OrderExecutionType;
11
- amountFiat: number;
12
- amountCrypto: number;
13
10
  paymentMethod?: PaymentMethod;
14
11
  payoutMethod?: PayoutMethod;
15
12
  createdAt: Date;
16
- twoWaySettlementDate?: Date;
13
+ twoWaySettlementDate: Date;
17
14
  status: OrderStatus;
18
15
  cryptoAddress?: string;
19
16
  country: Country;
20
- limitPrice?: number;
17
+ amountFiat: number;
21
18
  amountFiatReceived?: number;
19
+ amountCrypto: number;
22
20
  amountCryptoReceived?: number;
23
- liquidityProvider?: LiquidityProvider;
24
- processor?: Processor;
25
- fees?: Fees;
21
+ liquidityProvider: LiquidityProvider;
22
+ processor: Processor;
23
+ fees: Fees;
26
24
  actualFees?: Fees;
27
25
  wireMessage?: string;
28
- price?: number;
26
+ price: number;
29
27
  depositAddress?: string;
30
28
  depositTxId?: string;
31
29
  withdrawalTxId?: string;
32
30
  withdrawalTxIds?: string[];
33
31
  brokerId?: string;
34
- conversionRateUSD?: number;
35
- conversionRateUSDWithMarkups?: number;
32
+ conversionRateUSD: number;
33
+ conversionRateUSDWithMarkups: number;
36
34
  actualConversionRateUSD?: number;
37
35
  notes?: string;
38
36
  discount?: number;
@@ -44,7 +42,7 @@ interface OrderAttrs {
44
42
  isAfterHours?: boolean;
45
43
  isSurgePricing?: boolean;
46
44
  chainedOrderId?: string;
47
- netPrice?: number;
45
+ netPrice: number;
48
46
  requestedNetPrice?: number;
49
47
  payoutAddressId?: string;
50
48
  payoutBankAccountId?: string;
@@ -60,8 +58,8 @@ interface OrderAttrs {
60
58
  amount: number;
61
59
  };
62
60
  attributes?: OrderAttribute[];
63
- deferredPaymentType?: DeferredPaymentType;
64
- twoWaySettlementType?: TwoWaySettlementType;
61
+ deferredPaymentType: DeferredPaymentType;
62
+ twoWaySettlementType: TwoWaySettlementType;
65
63
  twoWaySettlementDateOffset?: number;
66
64
  effectiveTwoWaySettlementDateOffset?: number;
67
65
  destinationOfFunds?: {
@@ -129,36 +127,36 @@ interface OrderAttrs {
129
127
  };
130
128
  }
131
129
  interface OrderDoc extends Document {
132
- quoteId?: string;
130
+ quoteId: string;
131
+ priceType: PriceType;
133
132
  userId: string;
134
133
  status: OrderStatus;
135
134
  crypto: Crypto;
136
135
  side: Side;
137
136
  fiat: Fiat;
138
- executionType: OrderExecutionType;
139
- limitPrice?: number;
140
137
  paymentMethod?: PaymentMethod;
141
138
  payoutMethod?: PayoutMethod;
142
139
  createdAt: Date;
143
- twoWaySettlementDate?: Date;
140
+ twoWaySettlementDate: Date;
144
141
  country: Country;
142
+ state?: string;
145
143
  cryptoAddress?: string;
146
144
  amountFiat: number;
147
145
  amountCrypto: number;
148
146
  amountFiatReceived?: number;
149
147
  amountCryptoReceived?: number;
150
- liquidityProvider?: LiquidityProvider;
151
- processor?: Processor;
152
- fees?: Fees;
148
+ liquidityProvider: LiquidityProvider;
149
+ processor: Processor;
150
+ fees: Fees;
153
151
  actualFees?: Fees;
154
- price?: number;
152
+ price: number;
155
153
  depositAddress?: string;
156
154
  depositTxId?: string;
157
155
  withdrawalTxId?: string;
158
156
  withdrawalTxIds?: string[];
159
157
  brokerId?: string;
160
- conversionRateUSD?: number;
161
- conversionRateUSDWithMarkups?: number;
158
+ conversionRateUSD: number;
159
+ conversionRateUSDWithMarkups: number;
162
160
  actualConversionRateUSD?: number;
163
161
  notes?: string;
164
162
  discount?: number;
@@ -11,13 +11,10 @@ const buildOrder = (mongoose) => {
11
11
  quoteId: {
12
12
  type: String,
13
13
  },
14
- executionType: {
14
+ priceType: {
15
15
  type: String,
16
16
  required: true,
17
17
  },
18
- limitPrice: {
19
- type: Number,
20
- },
21
18
  userId: {
22
19
  type: String,
23
20
  required: true,
@@ -75,6 +72,9 @@ const buildOrder = (mongoose) => {
75
72
  type: String,
76
73
  required: true,
77
74
  },
75
+ state: {
76
+ type: String,
77
+ },
78
78
  amountFiat: {
79
79
  type: Number,
80
80
  required: true,
@@ -91,9 +91,11 @@ const buildOrder = (mongoose) => {
91
91
  },
92
92
  processor: {
93
93
  type: String,
94
+ required: true,
94
95
  },
95
96
  liquidityProvider: {
96
97
  type: String,
98
+ required: true,
97
99
  },
98
100
  depositTxId: {
99
101
  type: String,
@@ -151,15 +153,18 @@ const buildOrder = (mongoose) => {
151
153
  },
152
154
  price: {
153
155
  type: Number,
156
+ required: true,
154
157
  },
155
158
  brokerId: {
156
159
  type: String,
157
160
  },
158
161
  conversionRateUSD: {
159
162
  type: Number,
163
+ required: true,
160
164
  },
161
165
  conversionRateUSDWithMarkups: {
162
166
  type: Number,
167
+ required: true,
163
168
  },
164
169
  actualConversionRateUSD: {
165
170
  type: Number,
@@ -1,7 +1,8 @@
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, USState, 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;
@@ -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;
@@ -11,6 +11,10 @@ const buildQuote = (mongoose) => {
11
11
  type: String,
12
12
  required: true,
13
13
  },
14
+ priceType: {
15
+ type: String,
16
+ required: true,
17
+ },
14
18
  crypto: {
15
19
  type: String,
16
20
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2419",
3
+ "version": "1.0.2420",
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.2167",
31
+ "@riocrypto/common": "^1.0.2171",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",