@riocrypto/common-server 1.0.656 → 1.0.658
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/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/models/bank-account.d.ts +23 -0
- package/build/models/bank-account.js +48 -0
- package/build/models/business-user.d.ts +1 -3
- package/build/models/business-user.js +0 -19
- package/build/models/user.d.ts +1 -3
- package/build/models/user.js +0 -19
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./models/kyc";
|
|
|
28
28
|
export * from "./models/checked-address";
|
|
29
29
|
export * from "./models/rio-settings";
|
|
30
30
|
export * from "./models/partner-auth";
|
|
31
|
+
export * from "./models/bank-account";
|
|
31
32
|
export * from "./clients/bitstamp-client";
|
|
32
33
|
export * from "./clients/ccxt-client";
|
|
33
34
|
export * from "./clients/kushki-client";
|
package/build/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __exportStar(require("./models/kyc"), exports);
|
|
|
44
44
|
__exportStar(require("./models/checked-address"), exports);
|
|
45
45
|
__exportStar(require("./models/rio-settings"), exports);
|
|
46
46
|
__exportStar(require("./models/partner-auth"), exports);
|
|
47
|
+
__exportStar(require("./models/bank-account"), exports);
|
|
47
48
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
48
49
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
49
50
|
__exportStar(require("./clients/kushki-client"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Country, Fiat } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface BankAccountAttrs {
|
|
4
|
+
userId: string;
|
|
5
|
+
country: Country;
|
|
6
|
+
fiat: Fiat;
|
|
7
|
+
accountNumber: string;
|
|
8
|
+
approved: boolean;
|
|
9
|
+
swiftCode?: string;
|
|
10
|
+
}
|
|
11
|
+
interface BankAccountDoc extends Document {
|
|
12
|
+
userId: string;
|
|
13
|
+
country: Country;
|
|
14
|
+
fiat: Fiat;
|
|
15
|
+
accountNumber: string;
|
|
16
|
+
approved: boolean;
|
|
17
|
+
swiftCode?: string;
|
|
18
|
+
}
|
|
19
|
+
interface BankPayoutModel extends Model<BankAccountDoc> {
|
|
20
|
+
build(attrs: BankAccountAttrs): BankAccountDoc;
|
|
21
|
+
}
|
|
22
|
+
declare const buildBankAccount: (mongoose: Mongoose) => BankPayoutModel;
|
|
23
|
+
export { buildBankAccount, BankAccountDoc };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBankAccount = void 0;
|
|
4
|
+
const buildBankAccount = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.BankPayout) {
|
|
7
|
+
return mongoose.model("BankPayout");
|
|
8
|
+
}
|
|
9
|
+
const BankAccountSchema = new mongoose.Schema({
|
|
10
|
+
userId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
country: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
fiat: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
accountNumber: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
swiftCode: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
approved: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
toJSON: {
|
|
35
|
+
transform(doc, ret) {
|
|
36
|
+
ret.id = ret._id.valueOf();
|
|
37
|
+
delete ret._id;
|
|
38
|
+
delete ret.__v;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
BankAccountSchema.statics.build = (attrs) => {
|
|
43
|
+
return new BankPayout(attrs);
|
|
44
|
+
};
|
|
45
|
+
const BankPayout = mongoose.model("BankAccount", BankAccountSchema);
|
|
46
|
+
return BankPayout;
|
|
47
|
+
};
|
|
48
|
+
exports.buildBankAccount = buildBankAccount;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Country, KYCStatus, Language, PlatformFeeRange, USState, UserAttribute, UserType } from "@riocrypto/common";
|
|
2
2
|
import { Mongoose, Model, Document } from "mongoose";
|
|
3
3
|
interface BusinessUserAttrs {
|
|
4
4
|
authIds?: string[];
|
|
@@ -22,7 +22,6 @@ interface BusinessUserAttrs {
|
|
|
22
22
|
brokerId?: string;
|
|
23
23
|
platformFeeRanges?: PlatformFeeRange[];
|
|
24
24
|
partnerId?: string;
|
|
25
|
-
bankAccounts?: BankAccount[];
|
|
26
25
|
}
|
|
27
26
|
interface BusinessUserModel extends Model<BusinessUserDoc> {
|
|
28
27
|
build(attrs: BusinessUserAttrs): BusinessUserDoc;
|
|
@@ -49,7 +48,6 @@ interface BusinessUserDoc extends Document {
|
|
|
49
48
|
brokerId?: string;
|
|
50
49
|
platformFeeRanges?: PlatformFeeRange[];
|
|
51
50
|
partnerId?: string;
|
|
52
|
-
bankAccounts?: BankAccount[];
|
|
53
51
|
}
|
|
54
52
|
declare const buildBusinessUser: (mongoose: Mongoose) => BusinessUserModel;
|
|
55
53
|
export { buildBusinessUser, BusinessUserDoc };
|
|
@@ -98,25 +98,6 @@ const buildBusinessUser = (mongoose) => {
|
|
|
98
98
|
},
|
|
99
99
|
},
|
|
100
100
|
],
|
|
101
|
-
bankAccounts: [
|
|
102
|
-
{
|
|
103
|
-
country: {
|
|
104
|
-
type: String,
|
|
105
|
-
required: true,
|
|
106
|
-
},
|
|
107
|
-
fiat: {
|
|
108
|
-
type: String,
|
|
109
|
-
required: true,
|
|
110
|
-
},
|
|
111
|
-
accountNumber: {
|
|
112
|
-
type: String,
|
|
113
|
-
required: true,
|
|
114
|
-
},
|
|
115
|
-
swiftCode: {
|
|
116
|
-
type: String,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
101
|
}, {
|
|
121
102
|
toJSON: {
|
|
122
103
|
transform(doc, ret) {
|
package/build/models/user.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Country, KYCStatus, Language, USState, UserAttribute, UserType } from "@riocrypto/common";
|
|
2
2
|
import { Mongoose, Model, Document } from "mongoose";
|
|
3
3
|
interface UserAttrs {
|
|
4
4
|
authId: string;
|
|
@@ -19,7 +19,6 @@ interface UserAttrs {
|
|
|
19
19
|
language?: Language;
|
|
20
20
|
attributes?: UserAttribute[];
|
|
21
21
|
partnerId?: string;
|
|
22
|
-
bankAccounts?: BankAccount[];
|
|
23
22
|
}
|
|
24
23
|
interface UserModel extends Model<UserDoc> {
|
|
25
24
|
build(attrs: UserAttrs): UserDoc;
|
|
@@ -44,7 +43,6 @@ interface UserDoc extends Document {
|
|
|
44
43
|
language?: Language;
|
|
45
44
|
attributes?: UserAttribute[];
|
|
46
45
|
partnerId?: string;
|
|
47
|
-
bankAccounts?: BankAccount[];
|
|
48
46
|
}
|
|
49
47
|
declare const buildUser: (mongoose: Mongoose) => UserModel;
|
|
50
48
|
export { buildUser, UserDoc };
|
package/build/models/user.js
CHANGED
|
@@ -76,25 +76,6 @@ const buildUser = (mongoose) => {
|
|
|
76
76
|
partnerId: {
|
|
77
77
|
type: String,
|
|
78
78
|
},
|
|
79
|
-
bankAccounts: [
|
|
80
|
-
{
|
|
81
|
-
country: {
|
|
82
|
-
type: String,
|
|
83
|
-
required: true,
|
|
84
|
-
},
|
|
85
|
-
fiat: {
|
|
86
|
-
type: String,
|
|
87
|
-
required: true,
|
|
88
|
-
},
|
|
89
|
-
accountNumber: {
|
|
90
|
-
type: String,
|
|
91
|
-
required: true,
|
|
92
|
-
},
|
|
93
|
-
swiftCode: {
|
|
94
|
-
type: String,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
79
|
}, {
|
|
99
80
|
toJSON: {
|
|
100
81
|
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.658",
|
|
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.600",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|