@riocrypto/common-server 1.0.1931 → 1.0.1934

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 CHANGED
@@ -24,7 +24,6 @@ export * from "./models/order";
24
24
  export * from "./models/user";
25
25
  export * from "./models/ccxt-order";
26
26
  export * from "./models/kushki-payment";
27
- export * from "./models/kyc";
28
27
  export * from "./models/crypto-address";
29
28
  export * from "./models/fireblocks-vault";
30
29
  export * from "./models/fireblocks-transfer";
@@ -70,6 +69,7 @@ export * from "./models/email-receipt";
70
69
  export * from "./models/dashboard-settings";
71
70
  export * from "./models/async-fx-trade";
72
71
  export * from "./models/internal-transfer";
72
+ export * from "./models/internal-balances";
73
73
  export * from "./clients/axios-with-logging";
74
74
  export * from "./clients/slack-client";
75
75
  export * from "./clients/fireblocks-client";
package/build/index.js CHANGED
@@ -40,7 +40,6 @@ __exportStar(require("./models/order"), exports);
40
40
  __exportStar(require("./models/user"), exports);
41
41
  __exportStar(require("./models/ccxt-order"), exports);
42
42
  __exportStar(require("./models/kushki-payment"), exports);
43
- __exportStar(require("./models/kyc"), exports);
44
43
  __exportStar(require("./models/crypto-address"), exports);
45
44
  __exportStar(require("./models/fireblocks-vault"), exports);
46
45
  __exportStar(require("./models/fireblocks-transfer"), exports);
@@ -86,6 +85,7 @@ __exportStar(require("./models/email-receipt"), exports);
86
85
  __exportStar(require("./models/dashboard-settings"), exports);
87
86
  __exportStar(require("./models/async-fx-trade"), exports);
88
87
  __exportStar(require("./models/internal-transfer"), exports);
88
+ __exportStar(require("./models/internal-balances"), exports);
89
89
  __exportStar(require("./clients/axios-with-logging"), exports);
90
90
  __exportStar(require("./clients/slack-client"), exports);
91
91
  __exportStar(require("./clients/fireblocks-client"), exports);
@@ -0,0 +1,48 @@
1
+ import mongoose from "mongoose";
2
+ import { Fiat } from "@riocrypto/common";
3
+ interface InternalBalancesAttrs {
4
+ [provider: string]: {
5
+ [key in keyof (Fiat & Crypto)]: number;
6
+ };
7
+ }
8
+ interface InternalBalancesDoc extends mongoose.Document {
9
+ id: string;
10
+ fireblocksVault: {
11
+ [key in keyof (Fiat & Crypto)]: number;
12
+ };
13
+ bitso: {
14
+ [key in keyof (Fiat & Crypto)]: number;
15
+ };
16
+ binance: {
17
+ [key in keyof (Fiat & Crypto)]: number;
18
+ };
19
+ brex: {
20
+ [key in keyof (Fiat & Crypto)]: number;
21
+ };
22
+ fondeadora: {
23
+ [key in keyof (Fiat & Crypto)]: number;
24
+ };
25
+ bbva: {
26
+ [key in keyof (Fiat & Crypto)]: number;
27
+ };
28
+ bancrea: {
29
+ [key in keyof (Fiat & Crypto)]: number;
30
+ };
31
+ interbank: {
32
+ [key in keyof (Fiat & Crypto)]: number;
33
+ };
34
+ jpmorgan: {
35
+ [key in keyof (Fiat & Crypto)]: number;
36
+ };
37
+ circle: {
38
+ [key in keyof (Fiat & Crypto)]: number;
39
+ };
40
+ coinbase: {
41
+ [key in keyof (Fiat & Crypto)]: number;
42
+ };
43
+ }
44
+ interface InternalBalancesModel extends mongoose.Model<InternalBalancesDoc> {
45
+ build(attrs: InternalBalancesAttrs): InternalBalancesDoc;
46
+ }
47
+ declare const buildInternalBalances: (mongoose: typeof mongoose) => InternalBalancesModel;
48
+ export { buildInternalBalances, InternalBalancesDoc, InternalBalancesAttrs };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildInternalBalances = void 0;
4
+ const common_1 = require("@riocrypto/common");
5
+ const buildInternalBalances = (mongoose) => {
6
+ // if model is already defined, return it
7
+ if (mongoose.models.InternalBalances) {
8
+ return mongoose.model("InternalBalances");
9
+ }
10
+ const InternalBalancesSchema = new mongoose.Schema({
11
+ [common_1.TreasuryProvider.FireblocksVault]: {
12
+ type: Object,
13
+ },
14
+ [common_1.TreasuryProvider.Bitso]: {
15
+ type: Object,
16
+ },
17
+ [common_1.TreasuryProvider.Binance]: {
18
+ type: Object,
19
+ },
20
+ [common_1.TreasuryProvider.Brex]: {
21
+ type: Object,
22
+ },
23
+ [common_1.TreasuryProvider.Fondeadora]: {
24
+ type: Object,
25
+ },
26
+ [common_1.TreasuryProvider.BBVA]: {
27
+ type: Object,
28
+ },
29
+ [common_1.TreasuryProvider.Bancrea]: {
30
+ type: Object,
31
+ },
32
+ [common_1.TreasuryProvider.Interbank]: {
33
+ type: Object,
34
+ },
35
+ [common_1.TreasuryProvider.JPMorgan]: {
36
+ type: Object,
37
+ },
38
+ [common_1.TreasuryProvider.Circle]: {
39
+ type: Object,
40
+ },
41
+ [common_1.TreasuryProvider.Coinbase]: {
42
+ type: Object,
43
+ },
44
+ }, {
45
+ toJSON: {
46
+ transform(doc, ret) {
47
+ ret.id = ret._id;
48
+ delete ret._id;
49
+ delete ret.__v;
50
+ },
51
+ },
52
+ });
53
+ InternalBalancesSchema.statics.build = (attrs) => {
54
+ return new InternalBalances(attrs);
55
+ };
56
+ const InternalBalances = mongoose.model("InternalBalances", InternalBalancesSchema);
57
+ return InternalBalances;
58
+ };
59
+ exports.buildInternalBalances = buildInternalBalances;
@@ -22,7 +22,10 @@ interface RioSettingsAttrs {
22
22
  sellOrderGeneralExchangeRateMarkup: {
23
23
  [key in Fiat]: number;
24
24
  };
25
- automaticFXTradeLimit: {
25
+ buyOrderAutomaticFXTradeLimit: {
26
+ [key in Fiat]: number;
27
+ };
28
+ sellOrderAutomaticFXTradeLimit: {
26
29
  [key in Fiat]: number;
27
30
  };
28
31
  additionalBuyOrderLiquidityUSD?: number;
@@ -51,6 +54,12 @@ interface RioSettingsDoc extends mongoose.Document {
51
54
  sellOrderAfterHoursExchangeRateMarkup: {
52
55
  [key in Fiat]: number;
53
56
  };
57
+ buyOrderAutomaticFXTradeLimit: {
58
+ [key in Fiat]: number;
59
+ };
60
+ sellOrderAutomaticFXTradeLimit: {
61
+ [key in Fiat]: number;
62
+ };
54
63
  additionalBuyOrderLiquidityUSD?: number;
55
64
  additionalSellOrderLiquidityUSD?: number;
56
65
  previousDayUSDMXNConversionRate?: number;
@@ -17,6 +17,12 @@ const buildRioSettings = (mongoose) => {
17
17
  sellOrderNextDaySettlementFee: {
18
18
  type: Number,
19
19
  },
20
+ buyOrderAutomaticFXTradeLimit: {
21
+ type: Object,
22
+ },
23
+ sellOrderAutomaticFXTradeLimit: {
24
+ type: Object,
25
+ },
20
26
  isAfterHours: {
21
27
  type: Object,
22
28
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1931",
3
+ "version": "1.0.1934",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/secret-manager": "^5.3.0",
29
29
  "@google-cloud/storage": "^6.9.5",
30
30
  "@hyperdx/node-opentelemetry": "^0.7.0",
31
- "@riocrypto/common": "^1.0.1706",
31
+ "@riocrypto/common": "^1.0.1711",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",
@@ -1,25 +0,0 @@
1
- import { IdentityVerificationType } from "@riocrypto/common";
2
- import mongoose from "mongoose";
3
- interface KYCAttrs {
4
- type: IdentityVerificationType;
5
- userId?: string;
6
- uboId?: string;
7
- provider: string;
8
- providerId: string;
9
- result: string;
10
- lastChecked: Date;
11
- }
12
- interface KYCDoc extends mongoose.Document {
13
- type: IdentityVerificationType;
14
- userId?: string;
15
- uboId?: string;
16
- provider: string;
17
- providerId: string;
18
- result: string;
19
- lastChecked: Date;
20
- }
21
- interface KYCModel extends mongoose.Model<KYCDoc> {
22
- build(attrs: KYCAttrs): KYCDoc;
23
- }
24
- declare const buildKYC: (mongoose: typeof mongoose) => KYCModel;
25
- export { buildKYC, KYCDoc, KYCAttrs };
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildKYC = void 0;
4
- const buildKYC = (mongoose) => {
5
- // if model is already defined, return it
6
- if (mongoose.models.KYC) {
7
- return mongoose.model("KYC");
8
- }
9
- const KYCSchema = new mongoose.Schema({
10
- type: {
11
- type: String,
12
- required: true,
13
- },
14
- userId: {
15
- type: String,
16
- },
17
- uboId: {
18
- type: String,
19
- },
20
- provider: {
21
- type: String,
22
- required: true,
23
- },
24
- providerId: {
25
- type: String,
26
- required: true,
27
- },
28
- result: {
29
- type: String,
30
- required: true,
31
- },
32
- lastChecked: {
33
- type: mongoose.Schema.Types.Date,
34
- required: true,
35
- },
36
- }, {
37
- toJSON: {
38
- transform(doc, ret) {
39
- ret.id = ret._id;
40
- delete ret._id;
41
- delete ret.__v;
42
- },
43
- },
44
- });
45
- KYCSchema.statics.build = (attrs) => {
46
- return new KYC(attrs);
47
- };
48
- const KYC = mongoose.model("KYC", KYCSchema);
49
- return KYC;
50
- };
51
- exports.buildKYC = buildKYC;