@riocrypto/common 1.0.455 → 1.0.456

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
@@ -159,6 +159,7 @@ export * from "./models/ccxt-order";
159
159
  export * from "./models/kushki-payment";
160
160
  export * from "./models/kyc";
161
161
  export * from "./models/checked-address";
162
+ export * from "./models/rio-settings";
162
163
  export * from "./clients/bitstamp-client";
163
164
  export * from "./clients/ccxt-client";
164
165
  export * from "./clients/fixer-client";
package/build/index.js CHANGED
@@ -176,6 +176,7 @@ __exportStar(require("./models/ccxt-order"), exports);
176
176
  __exportStar(require("./models/kushki-payment"), exports);
177
177
  __exportStar(require("./models/kyc"), exports);
178
178
  __exportStar(require("./models/checked-address"), exports);
179
+ __exportStar(require("./models/rio-settings"), exports);
179
180
  __exportStar(require("./clients/bitstamp-client"), exports);
180
181
  __exportStar(require("./clients/ccxt-client"), exports);
181
182
  __exportStar(require("./clients/fixer-client"), exports);
@@ -0,0 +1,12 @@
1
+ import mongoose from "mongoose";
2
+ interface RioSettingsAttrs {
3
+ platformFee: number;
4
+ }
5
+ interface RioSettingsDoc extends mongoose.Document {
6
+ platformFee: number;
7
+ }
8
+ interface RioSettingsModel extends mongoose.Model<RioSettingsDoc> {
9
+ build(attrs: RioSettingsAttrs): RioSettingsDoc;
10
+ }
11
+ declare const buildRioSettings: (mongoose: typeof mongoose) => RioSettingsModel;
12
+ export { buildRioSettings, RioSettingsModel };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildRioSettings = void 0;
4
+ const buildRioSettings = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.RioSettings) {
7
+ return mongoose.model("RioSettings");
8
+ }
9
+ const RioSettingsSchema = new mongoose.Schema({
10
+ platformFee: {
11
+ type: Number,
12
+ required: true,
13
+ },
14
+ }, {
15
+ toJSON: {
16
+ transform(doc, ret) {
17
+ ret.id = ret._id;
18
+ delete ret._id;
19
+ delete ret.__v;
20
+ },
21
+ },
22
+ });
23
+ RioSettingsSchema.statics.build = (attrs) => {
24
+ return new RioSettings(attrs);
25
+ };
26
+ const RioSettings = mongoose.model("RioSettings", RioSettingsSchema);
27
+ return RioSettings;
28
+ };
29
+ exports.buildRioSettings = buildRioSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.455",
3
+ "version": "1.0.456",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",