@riocrypto/common-server 1.0.858 → 1.0.860
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,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserType } from "@riocrypto/common";
|
|
2
2
|
declare class BridgeClient {
|
|
3
3
|
private apiKey;
|
|
4
4
|
private baseUrl;
|
|
5
5
|
constructor(apiKey: string);
|
|
6
|
-
|
|
7
|
-
createCustomer(userInput: BridgeCustomerInput): Promise<{
|
|
6
|
+
createKYCLink(fullName: string, email: string, userType: UserType): Promise<{
|
|
8
7
|
id: string;
|
|
8
|
+
email: string;
|
|
9
|
+
type: "individual" | "business";
|
|
10
|
+
kyc_link: string;
|
|
11
|
+
tos_link: string;
|
|
12
|
+
kyc_status: string;
|
|
13
|
+
tos_status: string;
|
|
14
|
+
created_at: string;
|
|
9
15
|
}>;
|
|
10
16
|
}
|
|
11
17
|
export declare const buildBridgeClient: () => Promise<BridgeClient>;
|
|
@@ -27,26 +27,19 @@ class BridgeClient {
|
|
|
27
27
|
this.baseUrl = "https://api.sandbox.bridge.xyz";
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
createKYCLink(fullName, email, userType) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const { data } = yield axios_1.default.post(`${this.baseUrl}/v0/customers/
|
|
32
|
+
const { data } = yield axios_1.default.post(`${this.baseUrl}/v0/customers/kyc_links`, {
|
|
33
|
+
full_name: fullName,
|
|
34
|
+
email,
|
|
35
|
+
type: userType,
|
|
36
|
+
}, {
|
|
33
37
|
headers: {
|
|
34
38
|
"Api-Key": this.apiKey,
|
|
35
39
|
"Idempotency-Key": (0, uuid_1.v4)(),
|
|
36
40
|
},
|
|
37
41
|
});
|
|
38
|
-
return data
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
createCustomer(userInput) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const { data } = yield axios_1.default.post(`${this.baseUrl}/v0/customers`, userInput, {
|
|
44
|
-
headers: {
|
|
45
|
-
"Api-Key": this.apiKey,
|
|
46
|
-
"Idempotency-Key": (0, uuid_1.v4)(),
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
return data.url;
|
|
42
|
+
return data;
|
|
50
43
|
});
|
|
51
44
|
}
|
|
52
45
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Mongoose, Model, Document } from "mongoose";
|
|
2
2
|
interface BridgeCustomerAttrs {
|
|
3
3
|
userId: string;
|
|
4
|
-
|
|
4
|
+
kycLinkId: string;
|
|
5
|
+
bridgeCustomerId?: string;
|
|
5
6
|
}
|
|
6
7
|
interface BridgeCustomerModel extends Model<BridgeCustomerDoc> {
|
|
7
8
|
build(attrs: BridgeCustomerAttrs): BridgeCustomerDoc;
|
|
8
9
|
}
|
|
9
10
|
interface BridgeCustomerDoc extends Document {
|
|
10
11
|
_id: string;
|
|
11
|
-
bridgeId: string;
|
|
12
12
|
userId: string;
|
|
13
|
+
kycLinkId: string;
|
|
14
|
+
bridgeCustomerId?: string;
|
|
13
15
|
}
|
|
14
16
|
declare const buildBridgeCustomer: (mongoose: Mongoose) => BridgeCustomerModel;
|
|
15
17
|
export { buildBridgeCustomer, BridgeCustomerDoc };
|
|
@@ -7,14 +7,17 @@ const buildBridgeCustomer = (mongoose) => {
|
|
|
7
7
|
return mongoose.model("BridgeCustomer");
|
|
8
8
|
}
|
|
9
9
|
const bridgeCustomerSchema = new mongoose.Schema({
|
|
10
|
-
|
|
10
|
+
userId: {
|
|
11
11
|
type: String,
|
|
12
12
|
required: true,
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
kycLinkId: {
|
|
15
15
|
type: String,
|
|
16
16
|
required: true,
|
|
17
17
|
},
|
|
18
|
+
bridgeCustomerId: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
18
21
|
}, {
|
|
19
22
|
toJSON: {
|
|
20
23
|
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.860",
|
|
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.743",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|