@riocrypto/common-server 1.0.1060 → 1.0.1062

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.
@@ -4,7 +4,7 @@ declare class GoogleSheetsAPIClient {
4
4
  googleAuth: any;
5
5
  constructor(env: RioEnv);
6
6
  getNextAvailableRow(sheetId: string): Promise<number>;
7
- appendRowToNextAvailableRow(sheetId: string, rowData: string[]): Promise<void>;
7
+ appendRowToNextAvailableRow(sheetId: string, rowData: any[]): Promise<void>;
8
8
  }
9
9
  export declare const googleSheetsAPIClient: GoogleSheetsAPIClient;
10
10
  export {};
package/build/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export * from "./models/master-order-record";
39
39
  export * from "./models/invoice";
40
40
  export * from "./models/bank-transfer";
41
41
  export * from "./models/webhook-registration";
42
+ export * from "./models/chained-quote";
42
43
  export * from "./clients/bitstamp-client";
43
44
  export * from "./clients/ccxt-client";
44
45
  export * from "./clients/kushki-client";
package/build/index.js CHANGED
@@ -55,6 +55,7 @@ __exportStar(require("./models/master-order-record"), exports);
55
55
  __exportStar(require("./models/invoice"), exports);
56
56
  __exportStar(require("./models/bank-transfer"), exports);
57
57
  __exportStar(require("./models/webhook-registration"), exports);
58
+ __exportStar(require("./models/chained-quote"), exports);
58
59
  __exportStar(require("./clients/bitstamp-client"), exports);
59
60
  __exportStar(require("./clients/ccxt-client"), exports);
60
61
  __exportStar(require("./clients/kushki-client"), exports);
@@ -0,0 +1,37 @@
1
+ import { Country, Fees, Fiat, Crypto } from "@riocrypto/common";
2
+ import { Mongoose, Model, Document } from "mongoose";
3
+ interface ChainedQuoteAttrs {
4
+ userId: string;
5
+ crypto: Crypto;
6
+ startFiat: Fiat;
7
+ endFiat: Fiat;
8
+ expiresAt: Date;
9
+ startCountry: Country;
10
+ endCountry: Country;
11
+ startAmountFiat: number;
12
+ endAmountFiat: number;
13
+ fees: Fees;
14
+ price: number;
15
+ createdAt: Date;
16
+ brokerId?: string;
17
+ }
18
+ interface ChainedQuoteDoc extends Document {
19
+ userId: string;
20
+ crypto: Crypto;
21
+ startFiat: Fiat;
22
+ endFiat: Fiat;
23
+ expiresAt: Date;
24
+ startCountry: Country;
25
+ endCountry: Country;
26
+ startAmountFiat: number;
27
+ endAmountFiat: number;
28
+ fees: Fees;
29
+ price: number;
30
+ createdAt: Date;
31
+ brokerId?: string;
32
+ }
33
+ interface ChainedQuoteModel extends Model<ChainedQuoteDoc> {
34
+ build(attrs: ChainedQuoteAttrs): ChainedQuoteDoc;
35
+ }
36
+ declare const buildChainedQuote: (mongoose: Mongoose) => ChainedQuoteModel;
37
+ export { buildChainedQuote, ChainedQuoteDoc };
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildChainedQuote = void 0;
4
+ const buildChainedQuote = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.ChainedQuote) {
7
+ return mongoose.model("ChainedQuote");
8
+ }
9
+ const ChainedQuoteSchema = new mongoose.Schema({
10
+ userId: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ crypto: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ startFiat: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ endFiat: {
23
+ type: String,
24
+ required: true,
25
+ },
26
+ expiresAt: {
27
+ type: mongoose.Schema.Types.Date,
28
+ required: true,
29
+ },
30
+ startCountry: {
31
+ type: String,
32
+ required: true,
33
+ },
34
+ endCountry: {
35
+ type: String,
36
+ required: true,
37
+ },
38
+ startAmountFiat: {
39
+ type: Number,
40
+ required: true,
41
+ },
42
+ endAmountFiat: {
43
+ type: Number,
44
+ required: true,
45
+ },
46
+ amountCrypto: {
47
+ type: Number,
48
+ required: true,
49
+ },
50
+ fees: {
51
+ processingFeeFiat: {
52
+ type: Number,
53
+ },
54
+ transferFeeFiat: {
55
+ type: Number,
56
+ },
57
+ platformFeeFiat: {
58
+ type: Number,
59
+ },
60
+ platformFeeFiatTax: {
61
+ type: Number,
62
+ },
63
+ },
64
+ price: {
65
+ type: Number,
66
+ },
67
+ brokerId: {
68
+ type: String,
69
+ },
70
+ createdAt: {
71
+ type: mongoose.Schema.Types.Date,
72
+ required: true,
73
+ },
74
+ }, {
75
+ toJSON: {
76
+ transform(doc, ret) {
77
+ ret.id = ret._id.valueOf();
78
+ delete ret._id;
79
+ delete ret.__v;
80
+ },
81
+ },
82
+ });
83
+ ChainedQuoteSchema.statics.build = (attrs) => {
84
+ return new ChainedQuote(attrs);
85
+ };
86
+ const ChainedQuote = mongoose.model("ChainedQuote", ChainedQuoteSchema);
87
+ return ChainedQuote;
88
+ };
89
+ exports.buildChainedQuote = buildChainedQuote;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1060",
3
+ "version": "1.0.1062",
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.909",
27
+ "@riocrypto/common": "^1.0.913",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",