@riocrypto/common-server 1.0.900 → 1.0.902

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
@@ -32,6 +32,7 @@ export * from "./models/quote";
32
32
  export * from "./models/bridge-customer";
33
33
  export * from "./models/bridge-transfer";
34
34
  export * from "./models/bridge-external-account";
35
+ export * from "./models/bridge-liquidation-address";
35
36
  export * from "./clients/bitstamp-client";
36
37
  export * from "./clients/ccxt-client";
37
38
  export * from "./clients/kushki-client";
package/build/index.js CHANGED
@@ -48,6 +48,7 @@ __exportStar(require("./models/quote"), exports);
48
48
  __exportStar(require("./models/bridge-customer"), exports);
49
49
  __exportStar(require("./models/bridge-transfer"), exports);
50
50
  __exportStar(require("./models/bridge-external-account"), exports);
51
+ __exportStar(require("./models/bridge-liquidation-address"), exports);
51
52
  __exportStar(require("./clients/bitstamp-client"), exports);
52
53
  __exportStar(require("./clients/ccxt-client"), exports);
53
54
  __exportStar(require("./clients/kushki-client"), exports);
@@ -0,0 +1,18 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ import { Crypto } from "@riocrypto/common";
3
+ interface BridgeLiquidationAddressAttrs {
4
+ userId: string;
5
+ crypto: Crypto;
6
+ bridgeLiquidationAddressId: string;
7
+ }
8
+ interface BridgeLiquidationAddressModel extends Model<BridgeLiquidationAddressDoc> {
9
+ build(attrs: BridgeLiquidationAddressAttrs): BridgeLiquidationAddressDoc;
10
+ }
11
+ interface BridgeLiquidationAddressDoc extends Document {
12
+ _id: string;
13
+ userId: string;
14
+ crypto: Crypto;
15
+ bridgeLiquidationAddressId: string;
16
+ }
17
+ declare const buildBridgeLiquidationAddress: (mongoose: Mongoose) => BridgeLiquidationAddressModel;
18
+ export { buildBridgeLiquidationAddress, BridgeLiquidationAddressDoc };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBridgeLiquidationAddress = void 0;
4
+ const buildBridgeLiquidationAddress = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.BridgeLiquidationAddress) {
7
+ return mongoose.model("BridgeLiquidationAddress");
8
+ }
9
+ const bridgeLiquidationAddressSchema = new mongoose.Schema({
10
+ userId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ crypto: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ bridgeLiquidationAddressId: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ }, {
23
+ toJSON: {
24
+ transform(doc, ret) {
25
+ ret.id = ret._id.valueOf();
26
+ delete ret._id;
27
+ delete ret.__v;
28
+ },
29
+ },
30
+ });
31
+ bridgeLiquidationAddressSchema.statics.build = (attrs) => {
32
+ return new BridgeLiquidationAddress(attrs);
33
+ };
34
+ const BridgeLiquidationAddress = mongoose.model("BridgeLiquidationAddress", bridgeLiquidationAddressSchema);
35
+ return BridgeLiquidationAddress;
36
+ };
37
+ exports.buildBridgeLiquidationAddress = buildBridgeLiquidationAddress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.900",
3
+ "version": "1.0.902",
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.770",
27
+ "@riocrypto/common": "^1.0.772",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",