@riocrypto/common-server 1.0.1478 → 1.0.1481

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.
@@ -6,6 +6,7 @@ declare class ClusterClient {
6
6
  constructor(baseUrl: string, clusterApiKey: string);
7
7
  getNewQuote(orderId: string, quote: Quote, newAmountFiat?: number, newAmountCrypto?: number): Promise<Quote>;
8
8
  getQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire"): Promise<Quote>;
9
+ getBidQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire", netPrice?: string): Promise<Quote>;
9
10
  getCryptoAddresses(userId: string, crypto: Crypto): Promise<CryptoAddress[]>;
10
11
  createOrder(quoteId: string, cryptoAddress?: string, notes?: string, externalAccountId?: string): Promise<Order>;
11
12
  confirmPayment(orderId: string): Promise<void>;
@@ -94,6 +94,26 @@ class ClusterClient {
94
94
  return response.data;
95
95
  });
96
96
  }
97
+ getBidQuote(userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, netPrice) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ const response = yield this.axios.post(`${this.baseUrl}/api/quotes`, {
100
+ userId,
101
+ side,
102
+ crypto,
103
+ fiat,
104
+ amountFiat,
105
+ amountCrypto,
106
+ country,
107
+ USBankTransferMethod,
108
+ netPrice,
109
+ }, {
110
+ headers: {
111
+ "x-cluster-api-key": this.clusterApiKey,
112
+ },
113
+ });
114
+ return response.data;
115
+ });
116
+ }
97
117
  getCryptoAddresses(userId, crypto) {
98
118
  return __awaiter(this, void 0, void 0, function* () {
99
119
  const response = yield this.axios.get(`${this.baseUrl}/api/addresses?userId=${userId}&crypto=${crypto}`, {
@@ -1,13 +1,16 @@
1
+ import { BidStatus } from "@riocrypto/common";
1
2
  import { Mongoose, Model, Document } from "mongoose";
2
3
  interface BidAttrs {
3
4
  createdAt: Date;
4
5
  userId: string;
5
6
  quoteId: string;
7
+ status: BidStatus;
6
8
  }
7
9
  interface BidDoc extends Document {
8
10
  createdAt: Date;
9
11
  userId: string;
10
12
  quoteId: string;
13
+ status: BidStatus;
11
14
  }
12
15
  interface BidModel extends Model<BidDoc> {
13
16
  build(attrs: BidAttrs): BidDoc;
@@ -19,6 +19,10 @@ const buildBid = (mongoose) => {
19
19
  type: String,
20
20
  required: true,
21
21
  },
22
+ status: {
23
+ type: String,
24
+ required: true,
25
+ },
22
26
  }, {
23
27
  toJSON: {
24
28
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1478",
3
+ "version": "1.0.1481",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
30
  "@hyperdx/node-opentelemetry": "^0.4.2",
31
- "@riocrypto/common": "^1.0.1313",
31
+ "@riocrypto/common": "^1.0.1315",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^0.27.2",
34
34
  "ccxt": "^3.0.30",