@riocrypto/common 1.0.498 → 1.0.500
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.
|
@@ -48,7 +48,6 @@ export declare class RioClient {
|
|
|
48
48
|
createBrokerCustomer(businessUser: BusinessUserInput): Promise<BusinessUser>;
|
|
49
49
|
sendPhoneAuthCode(phoneNumber: string): Promise<void>;
|
|
50
50
|
authExists(phoneNumber: string): Promise<boolean>;
|
|
51
|
-
addSecurityQuestion(question: SecurityQuestion, answer: string): Promise<void>;
|
|
52
51
|
uploadCOI(businessUserId: string, formData: FormData): Promise<BusinessUser>;
|
|
53
52
|
uploadKYCReport(businessUserId: string, formData: FormData): Promise<BusinessUser>;
|
|
54
53
|
getSecurityQuestion(): Promise<SecurityQuestion>;
|
|
@@ -142,14 +142,6 @@ class RioClient {
|
|
|
142
142
|
return response.data.exists;
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
addSecurityQuestion(question, answer) {
|
|
146
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
yield this.axios.post("/api/auth/security-question", {
|
|
148
|
-
question,
|
|
149
|
-
answer,
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
145
|
uploadCOI(businessUserId, formData) {
|
|
154
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
147
|
const { data } = yield this.axios.patch(`/api/business/users/${businessUserId}/coi`, formData);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getUserFromClientHelper = void 0;
|
|
13
|
+
const rio_client_1 = require("../clients/rio-client");
|
|
14
|
+
const getUserFromClientHelper = (client) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
let individualUser;
|
|
16
|
+
let businessUser;
|
|
17
|
+
try {
|
|
18
|
+
individualUser = yield new rio_client_1.RioClient(client).getUser();
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
individualUser = null;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
businessUser = yield new rio_client_1.RioClient(client).getBusinessUser();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
businessUser = null;
|
|
28
|
+
}
|
|
29
|
+
const user = individualUser || businessUser;
|
|
30
|
+
return user;
|
|
31
|
+
});
|
|
32
|
+
exports.getUserFromClientHelper = getUserFromClientHelper;
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -196,3 +196,4 @@ __exportStar(require("./clients/kapstar-client"), exports);
|
|
|
196
196
|
__exportStar(require("./clients/etherscan-client"), exports);
|
|
197
197
|
__exportStar(require("./clients/rio-client"), exports);
|
|
198
198
|
__exportStar(require("./helpers/get-user-helper"), exports);
|
|
199
|
+
__exportStar(require("./helpers/get-user-from-client-helper"), exports);
|