@riocrypto/common 1.0.443 → 1.0.445

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.
@@ -91,7 +91,9 @@ class CCXTClient {
91
91
  }
92
92
  getBuyQuote(amount, crypto, fiat) {
93
93
  return __awaiter(this, void 0, void 0, function* () {
94
+ console.log("getBuyQuote", amount, crypto, fiat);
94
95
  if (this.env === "production") {
96
+ console.log("its prod");
95
97
  const exchange = yield this.getOptimalExchange(crypto);
96
98
  if (!exchange)
97
99
  throw new Error("Unable to get optimal exchange");
@@ -108,6 +110,7 @@ class CCXTClient {
108
110
  };
109
111
  }
110
112
  else {
113
+ console.log("its dev");
111
114
  return {
112
115
  price: 0.5,
113
116
  amountCrypto: amount,
package/build/index.d.ts CHANGED
@@ -156,6 +156,7 @@ export * from "./models/order";
156
156
  export * from "./models/partner";
157
157
  export * from "./models/user";
158
158
  export * from "./models/ccxt-order";
159
+ export * from "./models/kushki-payment";
159
160
  export * from "./clients/bitstamp-client";
160
161
  export * from "./clients/ccxt-client";
161
162
  export * from "./clients/fixer-client";
package/build/index.js CHANGED
@@ -173,6 +173,7 @@ __exportStar(require("./models/order"), exports);
173
173
  __exportStar(require("./models/partner"), exports);
174
174
  __exportStar(require("./models/user"), exports);
175
175
  __exportStar(require("./models/ccxt-order"), exports);
176
+ __exportStar(require("./models/kushki-payment"), exports);
176
177
  __exportStar(require("./clients/bitstamp-client"), exports);
177
178
  __exportStar(require("./clients/ccxt-client"), exports);
178
179
  __exportStar(require("./clients/fixer-client"), exports);
@@ -0,0 +1,16 @@
1
+ import mongoose from "mongoose";
2
+ interface KushkiPaymentAttrs {
3
+ orderId: string;
4
+ kushkiTransactionReference: string;
5
+ status: string;
6
+ }
7
+ interface KushkiPaymentDoc extends mongoose.Document {
8
+ orderId: string;
9
+ status: string;
10
+ kushkiTransactionReference: string;
11
+ }
12
+ interface KushkiPaymentModel extends mongoose.Model<KushkiPaymentDoc> {
13
+ build(attrs: KushkiPaymentAttrs): KushkiPaymentDoc;
14
+ }
15
+ declare const buildKushkiPayment: (mongoose: typeof mongoose) => KushkiPaymentModel | undefined;
16
+ export { buildKushkiPayment, KushkiPaymentDoc };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildKushkiPayment = void 0;
4
+ const buildKushkiPayment = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.KushkiPayment) {
7
+ return mongoose.model("KushkiPayment");
8
+ }
9
+ const KushkiPaymentSchema = new mongoose.Schema({
10
+ orderId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ kushkiTransactionReference: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ status: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ }, {
23
+ toJSON: {
24
+ transform(doc, ret) {
25
+ ret.id = ret._id;
26
+ delete ret._id;
27
+ delete ret.__v;
28
+ },
29
+ },
30
+ });
31
+ KushkiPaymentSchema.statics.build = (attrs) => {
32
+ return new KushkiPayment(attrs);
33
+ };
34
+ const KushkiPayment = mongoose.model("KushkiPayment", KushkiPaymentSchema);
35
+ };
36
+ exports.buildKushkiPayment = buildKushkiPayment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.443",
3
+ "version": "1.0.445",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",