@riocrypto/common-server 1.0.742 → 1.0.744

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
+ declare class AiPriseClient {
2
+ private apiKey;
3
+ constructor(apiKey: string);
4
+ createVerificationLink(userId: string, firstName: string, lastName: string): Promise<string>;
5
+ }
6
+ export declare const buildAiPriseClient: () => Promise<AiPriseClient>;
7
+ export {};
@@ -0,0 +1,48 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.buildAiPriseClient = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const secret_manager_client_1 = require("./secret-manager-client");
18
+ class AiPriseClient {
19
+ constructor(apiKey) {
20
+ this.apiKey = apiKey;
21
+ }
22
+ createVerificationLink(userId, firstName, lastName) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const response = yield axios_1.default.post("https://api.aiprise.com/api/v1/verify/get_user_verification_url", {
25
+ template_id: "15cd1203-5c60-470b-8cbc-4d806433c7b7",
26
+ "client-reference-id": userId,
27
+ "user-data": {
28
+ first_name: firstName,
29
+ last_name: lastName,
30
+ },
31
+ }, {
32
+ headers: {
33
+ "x-api-key": this.apiKey,
34
+ },
35
+ });
36
+ return response.data.verification_url;
37
+ });
38
+ }
39
+ }
40
+ const buildAiPriseClient = () => __awaiter(void 0, void 0, void 0, function* () {
41
+ const AIPRISE_API_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("AIPRISE_API_KEY");
42
+ if (!AIPRISE_API_KEY) {
43
+ throw new Error("Unable to get AIPRISE_API_KEY");
44
+ }
45
+ // Create FixerClient instance and return
46
+ return new AiPriseClient(AIPRISE_API_KEY);
47
+ });
48
+ exports.buildAiPriseClient = buildAiPriseClient;
package/build/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export * from "./clients/rio-client";
40
40
  export * from "./clients/secret-manager-client";
41
41
  export * from "./clients/gcloud-storage-client";
42
42
  export * from "./clients/currency-api-client";
43
+ export * from "./clients/aiprise-client";
43
44
  export * from "./helpers/get-user-helper";
44
45
  export * from "./helpers/get-platform-and-partner-fees";
45
46
  export * from "./helpers/get-network-fees";
package/build/index.js CHANGED
@@ -56,6 +56,7 @@ __exportStar(require("./clients/rio-client"), exports);
56
56
  __exportStar(require("./clients/secret-manager-client"), exports);
57
57
  __exportStar(require("./clients/gcloud-storage-client"), exports);
58
58
  __exportStar(require("./clients/currency-api-client"), exports);
59
+ __exportStar(require("./clients/aiprise-client"), exports);
59
60
  __exportStar(require("./helpers/get-user-helper"), exports);
60
61
  __exportStar(require("./helpers/get-platform-and-partner-fees"), exports);
61
62
  __exportStar(require("./helpers/get-network-fees"), exports);
@@ -25,6 +25,7 @@ interface OrderAttrs {
25
25
  brokerId?: string;
26
26
  conversionRateToUSD?: number;
27
27
  notes?: string;
28
+ discountBPS?: number;
28
29
  }
29
30
  interface OrderDoc extends Document {
30
31
  userId: string;
@@ -51,6 +52,7 @@ interface OrderDoc extends Document {
51
52
  brokerId?: string;
52
53
  conversionRateToUSD?: number;
53
54
  notes?: string;
55
+ discountBPS?: number;
54
56
  }
55
57
  interface OrderModel extends Model<OrderDoc> {
56
58
  build(attrs: OrderAttrs): OrderDoc;
@@ -102,6 +102,9 @@ const buildOrder = (mongoose) => {
102
102
  notes: {
103
103
  type: String,
104
104
  },
105
+ discountBPS: {
106
+ type: Number,
107
+ },
105
108
  }, {
106
109
  toJSON: {
107
110
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.742",
3
+ "version": "1.0.744",
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.659",
27
+ "@riocrypto/common": "^1.0.661",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",