@riocrypto/common-server 1.0.805 → 1.0.807
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 +20 -15
- package/build/models/order.js +33 -4
- package/package.json +2 -2
package/build/models/order.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side,
|
|
1
|
+
import { Country, Fees, Fiat, LiquidityProvider, OrderStatus, PaymentMethod, PayoutMethod, Processor, Side, Crypto } from "@riocrypto/common";
|
|
2
2
|
import { Mongoose, Model, Document } from "mongoose";
|
|
3
3
|
interface OrderAttrs {
|
|
4
|
+
quoteId: string;
|
|
4
5
|
userId: string;
|
|
5
6
|
crypto: Crypto;
|
|
6
7
|
side: Side;
|
|
@@ -11,27 +12,29 @@ interface OrderAttrs {
|
|
|
11
12
|
status: OrderStatus;
|
|
12
13
|
cryptoAddress: string;
|
|
13
14
|
country: Country;
|
|
14
|
-
state
|
|
15
|
+
state?: string;
|
|
15
16
|
amountFiat?: number;
|
|
16
17
|
amountCrypto?: number;
|
|
17
|
-
liquidityProvider
|
|
18
|
-
processor
|
|
19
|
-
fees
|
|
20
|
-
|
|
18
|
+
liquidityProvider: LiquidityProvider;
|
|
19
|
+
processor: Processor;
|
|
20
|
+
fees: Fees;
|
|
21
|
+
actualFees?: Fees;
|
|
22
|
+
price: number;
|
|
23
|
+
actualPrice?: number;
|
|
21
24
|
partnerId?: string;
|
|
22
25
|
depositAddress?: string;
|
|
23
26
|
depositTxId?: string;
|
|
24
27
|
withdrawalTxId?: string;
|
|
25
28
|
brokerId?: string;
|
|
26
|
-
conversionRateUSD
|
|
29
|
+
conversionRateUSD: number;
|
|
30
|
+
conversionRateUSDWithMarkups: number;
|
|
27
31
|
actualConversionRateUSD?: number;
|
|
28
32
|
notes?: string;
|
|
29
33
|
discount?: number;
|
|
30
34
|
markup?: number;
|
|
31
|
-
invoiceUrl?: string;
|
|
32
|
-
quoteId?: string;
|
|
33
35
|
}
|
|
34
36
|
interface OrderDoc extends Document {
|
|
37
|
+
quoteId: string;
|
|
35
38
|
userId: string;
|
|
36
39
|
status: OrderStatus;
|
|
37
40
|
crypto: Crypto;
|
|
@@ -41,25 +44,27 @@ interface OrderDoc extends Document {
|
|
|
41
44
|
payoutMethod?: PayoutMethod;
|
|
42
45
|
createdAt: Date;
|
|
43
46
|
country: Country;
|
|
44
|
-
state
|
|
47
|
+
state?: string;
|
|
45
48
|
cryptoAddress: string;
|
|
46
49
|
amountFiat?: number;
|
|
47
50
|
amountCrypto?: number;
|
|
48
|
-
liquidityProvider
|
|
49
|
-
processor
|
|
50
|
-
fees
|
|
51
|
+
liquidityProvider: LiquidityProvider;
|
|
52
|
+
processor: Processor;
|
|
53
|
+
fees: Fees;
|
|
54
|
+
actualFees?: Fees;
|
|
51
55
|
price?: number;
|
|
56
|
+
actualPrice: number;
|
|
52
57
|
partnerId?: string;
|
|
53
58
|
depositAddress?: string;
|
|
54
59
|
depositTxId?: string;
|
|
55
60
|
withdrawalTxId?: string;
|
|
56
61
|
brokerId?: string;
|
|
57
|
-
conversionRateUSD
|
|
62
|
+
conversionRateUSD: number;
|
|
63
|
+
conversionRateUSDWithMarkups: number;
|
|
58
64
|
actualConversionRateUSD?: number;
|
|
59
65
|
notes?: string;
|
|
60
66
|
discount?: number;
|
|
61
67
|
markup?: number;
|
|
62
|
-
quoteId?: string;
|
|
63
68
|
}
|
|
64
69
|
interface OrderModel extends Model<OrderDoc> {
|
|
65
70
|
build(attrs: OrderAttrs): OrderDoc;
|
package/build/models/order.js
CHANGED
|
@@ -7,6 +7,10 @@ const buildOrder = (mongoose) => {
|
|
|
7
7
|
return mongoose.model("Order");
|
|
8
8
|
}
|
|
9
9
|
const orderSchema = new mongoose.Schema({
|
|
10
|
+
quoteId: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
10
14
|
userId: {
|
|
11
15
|
type: String,
|
|
12
16
|
required: true,
|
|
@@ -47,7 +51,6 @@ const buildOrder = (mongoose) => {
|
|
|
47
51
|
},
|
|
48
52
|
state: {
|
|
49
53
|
type: String,
|
|
50
|
-
required: true,
|
|
51
54
|
},
|
|
52
55
|
amountFiat: {
|
|
53
56
|
type: Number,
|
|
@@ -57,9 +60,11 @@ const buildOrder = (mongoose) => {
|
|
|
57
60
|
},
|
|
58
61
|
processor: {
|
|
59
62
|
type: String,
|
|
63
|
+
required: true,
|
|
60
64
|
},
|
|
61
65
|
liquidityProvider: {
|
|
62
66
|
type: String,
|
|
67
|
+
required: true,
|
|
63
68
|
},
|
|
64
69
|
depositTxId: {
|
|
65
70
|
type: String,
|
|
@@ -87,8 +92,29 @@ const buildOrder = (mongoose) => {
|
|
|
87
92
|
type: Number,
|
|
88
93
|
},
|
|
89
94
|
},
|
|
95
|
+
actualFees: {
|
|
96
|
+
processingFeeFiat: {
|
|
97
|
+
type: Number,
|
|
98
|
+
},
|
|
99
|
+
transferFeeFiat: {
|
|
100
|
+
type: Number,
|
|
101
|
+
},
|
|
102
|
+
platformFeeFiat: {
|
|
103
|
+
type: Number,
|
|
104
|
+
},
|
|
105
|
+
partnerFeeFiat: {
|
|
106
|
+
type: Number,
|
|
107
|
+
},
|
|
108
|
+
platformFeeFiatTax: {
|
|
109
|
+
type: Number,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
90
112
|
price: {
|
|
91
113
|
type: Number,
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
actualPrice: {
|
|
117
|
+
type: Number,
|
|
92
118
|
},
|
|
93
119
|
partnerId: {
|
|
94
120
|
type: String,
|
|
@@ -98,9 +124,15 @@ const buildOrder = (mongoose) => {
|
|
|
98
124
|
},
|
|
99
125
|
conversionRateUSD: {
|
|
100
126
|
type: Number,
|
|
127
|
+
required: true,
|
|
128
|
+
},
|
|
129
|
+
conversionRateUSDWithMarkups: {
|
|
130
|
+
type: Number,
|
|
131
|
+
required: true,
|
|
101
132
|
},
|
|
102
133
|
actualConversionRateUSD: {
|
|
103
134
|
type: Number,
|
|
135
|
+
required: true,
|
|
104
136
|
},
|
|
105
137
|
notes: {
|
|
106
138
|
type: String,
|
|
@@ -111,9 +143,6 @@ const buildOrder = (mongoose) => {
|
|
|
111
143
|
markup: {
|
|
112
144
|
type: Number,
|
|
113
145
|
},
|
|
114
|
-
quoteId: {
|
|
115
|
-
type: Number,
|
|
116
|
-
},
|
|
117
146
|
}, {
|
|
118
147
|
toJSON: {
|
|
119
148
|
transform(doc, ret) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.807",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.699",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|