@riocrypto/common-server 1.0.1645 → 1.0.1647

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
@@ -58,6 +58,7 @@ export * from "./models/address-verification";
58
58
  export * from "./models/bank-account-verification";
59
59
  export * from "./models/coincover-transaction";
60
60
  export * from "./models/coinbase-order";
61
+ export * from "./models/multi-part-liquidity-order";
61
62
  export * from "./clients/bitstamp-client";
62
63
  export * from "./clients/ccxt-client";
63
64
  export * from "./clients/slack-client";
package/build/index.js CHANGED
@@ -74,6 +74,7 @@ __exportStar(require("./models/address-verification"), exports);
74
74
  __exportStar(require("./models/bank-account-verification"), exports);
75
75
  __exportStar(require("./models/coincover-transaction"), exports);
76
76
  __exportStar(require("./models/coinbase-order"), exports);
77
+ __exportStar(require("./models/multi-part-liquidity-order"), exports);
77
78
  __exportStar(require("./clients/bitstamp-client"), exports);
78
79
  __exportStar(require("./clients/ccxt-client"), exports);
79
80
  __exportStar(require("./clients/slack-client"), exports);
@@ -0,0 +1,25 @@
1
+ import { Crypto, Fiat } from "@riocrypto/common";
2
+ import mongoose from "mongoose";
3
+ interface MultiPartLiquidityOrderAttrs {
4
+ createdAt: Date;
5
+ destinationCrypto: Crypto;
6
+ originFiat: Fiat;
7
+ amountFiat: number;
8
+ amountCrypto?: number;
9
+ status: "bbvaWithdrawn" | "brexDeposited" | "brexWithdrawn" | "coinbaseDeposited" | "coinbaseTrading" | "coinbaseTraded" | "coinbaseWithdrawn" | "done";
10
+ coinbaseOrderId?: string;
11
+ }
12
+ interface MultiPartLiquidityOrderDoc extends mongoose.Document {
13
+ createdAt: Date;
14
+ destinationCrypto: Crypto;
15
+ originFiat: Fiat;
16
+ amountFiat: number;
17
+ amountCrypto?: number;
18
+ status: "bbvaWithdrawn" | "brexDeposited" | "brexWithdrawn" | "coinbaseDeposited" | "coinbaseTrading" | "coinbaseTraded" | "coinbaseWithdrawn" | "done";
19
+ coinbaseOrderId?: string;
20
+ }
21
+ interface MultiPartLiquidityOrderModel extends mongoose.Model<MultiPartLiquidityOrderDoc> {
22
+ build(attrs: MultiPartLiquidityOrderAttrs): MultiPartLiquidityOrderDoc;
23
+ }
24
+ declare const buildMultiPartLiquidityOrder: (mongoose: typeof mongoose) => MultiPartLiquidityOrderModel;
25
+ export { buildMultiPartLiquidityOrder, MultiPartLiquidityOrderDoc, MultiPartLiquidityOrderAttrs, };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildMultiPartLiquidityOrder = void 0;
4
+ const buildMultiPartLiquidityOrder = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.MultiPartLiquidityOrder) {
7
+ return mongoose.model("MultiPartLiquidityOrder");
8
+ }
9
+ const MultiPartLiquidityOrderSchema = new mongoose.Schema({
10
+ createdAt: {
11
+ type: Date,
12
+ required: true,
13
+ },
14
+ destinationCrypto: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ originFiat: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ amountFiat: {
23
+ type: Number,
24
+ required: true,
25
+ },
26
+ amountCrypto: {
27
+ type: Number,
28
+ },
29
+ status: {
30
+ type: String,
31
+ required: true,
32
+ },
33
+ coinbaseOrderId: {
34
+ type: String,
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
+ MultiPartLiquidityOrderSchema.statics.build = (attrs) => {
46
+ return new MultiPartLiquidityOrder(attrs);
47
+ };
48
+ const MultiPartLiquidityOrder = mongoose.model("MultiPartLiquidityOrder", MultiPartLiquidityOrderSchema);
49
+ return MultiPartLiquidityOrder;
50
+ };
51
+ exports.buildMultiPartLiquidityOrder = buildMultiPartLiquidityOrder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1645",
3
+ "version": "1.0.1647",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",