@riocrypto/common-server 1.0.1272 → 1.0.1274

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
@@ -38,6 +38,7 @@ export * from "./models/bitso-fx-order";
38
38
  export * from "./models/internal-swap";
39
39
  export * from "./models/bitso-mxn-withdrawal";
40
40
  export * from "./models/circle-address-book-recipient";
41
+ export * from "./models/circle-payout";
41
42
  export * from "./clients/bitstamp-client";
42
43
  export * from "./clients/ccxt-client";
43
44
  export * from "./clients/kushki-client";
package/build/index.js CHANGED
@@ -54,6 +54,7 @@ __exportStar(require("./models/bitso-fx-order"), exports);
54
54
  __exportStar(require("./models/internal-swap"), exports);
55
55
  __exportStar(require("./models/bitso-mxn-withdrawal"), exports);
56
56
  __exportStar(require("./models/circle-address-book-recipient"), exports);
57
+ __exportStar(require("./models/circle-payout"), exports);
57
58
  __exportStar(require("./clients/bitstamp-client"), exports);
58
59
  __exportStar(require("./clients/ccxt-client"), exports);
59
60
  __exportStar(require("./clients/kushki-client"), exports);
@@ -0,0 +1,18 @@
1
+ import mongoose from "mongoose";
2
+ interface CirclePayoutAttrs {
3
+ userId: string;
4
+ orderId: string;
5
+ circlePayoutId: string;
6
+ status: "pending" | "complete" | "failed";
7
+ }
8
+ interface CirclePayoutDoc extends mongoose.Document {
9
+ userId: string;
10
+ orderId: string;
11
+ circlePayoutId: string;
12
+ status: "pending" | "complete" | "failed";
13
+ }
14
+ interface CirclePayoutModel extends mongoose.Model<CirclePayoutDoc> {
15
+ build(attrs: CirclePayoutAttrs): CirclePayoutDoc;
16
+ }
17
+ declare const buildCirclePayout: (mongoose: typeof mongoose) => CirclePayoutModel;
18
+ export { buildCirclePayout, CirclePayoutDoc };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCirclePayout = void 0;
4
+ const buildCirclePayout = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.CirclePayout) {
7
+ return mongoose.model("CirclePayout");
8
+ }
9
+ const CirclePayoutSchema = new mongoose.Schema({
10
+ userId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ orderId: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ circlePayoutId: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ status: {
23
+ type: String,
24
+ required: true,
25
+ },
26
+ }, {
27
+ toJSON: {
28
+ transform(doc, ret) {
29
+ ret.id = ret._id;
30
+ delete ret._id;
31
+ delete ret.__v;
32
+ },
33
+ },
34
+ });
35
+ CirclePayoutSchema.statics.build = (attrs) => {
36
+ return new CirclePayout(attrs);
37
+ };
38
+ const CirclePayout = mongoose.model("CirclePayout", CirclePayoutSchema);
39
+ return CirclePayout;
40
+ };
41
+ exports.buildCirclePayout = buildCirclePayout;
@@ -19,9 +19,6 @@ const buildFireblocksTransfer = (mongoose) => {
19
19
  type: String,
20
20
  required: true,
21
21
  },
22
- depositAddresses: {
23
- type: Object,
24
- },
25
22
  }, {
26
23
  toJSON: {
27
24
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1272",
3
+ "version": "1.0.1274",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "@everapi/currencyapi-js": "^1.0.6",
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
- "@riocrypto/common": "^1.0.1146",
30
+ "@riocrypto/common": "^1.0.1148",
31
31
  "@types/express": "^4.17.13",
32
32
  "axios": "^0.27.2",
33
33
  "ccxt": "^3.0.30",