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