@riocrypto/common 1.0.1218 → 1.0.1220

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.
@@ -0,0 +1,7 @@
1
+ import { CountryOfOrigin } from "../types/country-of-origin";
2
+ export declare class KYCFieldAsset {
3
+ field: "personalId" | "taxId";
4
+ private country;
5
+ constructor(field: "personalId" | "taxId", country: CountryOfOrigin);
6
+ getName(): string | undefined;
7
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KYCFieldAsset = void 0;
4
+ const country_of_origin_1 = require("../types/country-of-origin");
5
+ const CountryAsset_1 = require("./CountryAsset");
6
+ class KYCFieldAsset {
7
+ constructor(field, country) {
8
+ this.field = field;
9
+ this.country = country;
10
+ }
11
+ getName() {
12
+ if (this.field === "personalId") {
13
+ if (this.country === country_of_origin_1.CountryOfOrigin.UnitedStates) {
14
+ return "Social Security Number";
15
+ }
16
+ else if (this.country === country_of_origin_1.CountryOfOrigin.Mexico) {
17
+ return "CURP";
18
+ }
19
+ else {
20
+ return `${new CountryAsset_1.CountryAsset(this.country).getName()} Personal Identification Number`;
21
+ }
22
+ }
23
+ }
24
+ }
25
+ exports.KYCFieldAsset = KYCFieldAsset;
@@ -35,6 +35,8 @@ import { ChainedQuote } from "../types/chained-quote";
35
35
  import { ChainedOrderInput } from "../types/chained-order-input";
36
36
  import { InternalSwap } from "../types/internal-swap";
37
37
  import { BridgeExternalAccountQuery } from "../types/bridge-external-account-query";
38
+ import { CountryOfOrigin } from "../types/country-of-origin";
39
+ import { KYCFileType } from "../types/KYCFileType";
38
40
  export declare class RioAdminClient {
39
41
  private axios;
40
42
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -51,6 +53,7 @@ export declare class RioAdminClient {
51
53
  signinAdmin(email: string, password: string, authenticatorCode: string): Promise<any>;
52
54
  updateUser(update: UserUpdate, userId?: string): Promise<User>;
53
55
  uploadCOI(id: string, formData: FormData): Promise<User>;
56
+ uploadFile(id: string, country: CountryOfOrigin, fileType: KYCFileType, formData: FormData): Promise<User>;
54
57
  uploadKYCReport(id: string, formData: FormData): Promise<User>;
55
58
  uploadCSF(id: string, formData: FormData): Promise<User>;
56
59
  uploadProofOfAddress(id: string, formData: FormData): Promise<User>;
@@ -91,6 +91,12 @@ class RioAdminClient {
91
91
  return data;
92
92
  });
93
93
  }
94
+ uploadFile(id, country, fileType, formData) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ const { data } = yield this.axios.post(`/api/users/${id}/files/${country}/${fileType}`, formData);
97
+ return data;
98
+ });
99
+ }
94
100
  uploadKYCReport(id, formData) {
95
101
  return __awaiter(this, void 0, void 0, function* () {
96
102
  const { data } = yield this.axios.post(`/api/users/${id}/kyc-report`, formData);
@@ -31,6 +31,8 @@ import { ChainedOrder } from "../types/chained-order";
31
31
  import { ChainedOrderQuery } from "../types/chained-order-query";
32
32
  import { BridgeExternalAccountQuery } from "../types/bridge-external-account-query";
33
33
  import { SecurityQuestion } from "../types/security-question";
34
+ import { KYCFileType } from "../types/KYCFileType";
35
+ import { CountryOfOrigin } from "../types/country-of-origin";
34
36
  export declare class RioClient {
35
37
  private axios;
36
38
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -42,6 +44,7 @@ export declare class RioClient {
42
44
  getUsers(page: number, limit?: number, query?: UserQuery): Promise<User[]>;
43
45
  updateUser(update: UserUpdate, userId?: string): Promise<User>;
44
46
  uploadCOI(id: string, formData: FormData): Promise<User>;
47
+ uploadFile(id: string, country: CountryOfOrigin, fileType: KYCFileType, formData: FormData): Promise<User>;
45
48
  uploadKYCReport(id: string, formData: FormData): Promise<User>;
46
49
  uploadCSF(id: string, formData: FormData): Promise<User>;
47
50
  getRioSettings(): Promise<RioSettings>;
@@ -82,6 +82,12 @@ class RioClient {
82
82
  return data;
83
83
  });
84
84
  }
85
+ uploadFile(id, country, fileType, formData) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const { data } = yield this.axios.post(`/api/users/${id}/files/${country}/${fileType}`, formData);
88
+ return data;
89
+ });
90
+ }
85
91
  uploadKYCReport(id, formData) {
86
92
  return __awaiter(this, void 0, void 0, function* () {
87
93
  const { data } = yield this.axios.post(`/api/users/${id}/kyc-report`, formData);
package/build/index.d.ts CHANGED
@@ -200,6 +200,7 @@ export * from "./types/risk-tier";
200
200
  export * from "./types/market-data";
201
201
  export * from "./types/KYCFileType";
202
202
  export * from "./classes/Asset";
203
+ export * from "./classes/KYCFieldClass";
203
204
  export * from "./classes/CountryAsset";
204
205
  export * from "./classes/CryptoAsset";
205
206
  export * from "./classes/FiatAsset";
package/build/index.js CHANGED
@@ -216,6 +216,7 @@ __exportStar(require("./types/risk-tier"), exports);
216
216
  __exportStar(require("./types/market-data"), exports);
217
217
  __exportStar(require("./types/KYCFileType"), exports);
218
218
  __exportStar(require("./classes/Asset"), exports);
219
+ __exportStar(require("./classes/KYCFieldClass"), exports);
219
220
  __exportStar(require("./classes/CountryAsset"), exports);
220
221
  __exportStar(require("./classes/CryptoAsset"), exports);
221
222
  __exportStar(require("./classes/FiatAsset"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1218",
3
+ "version": "1.0.1220",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",