@riocrypto/common-server 1.0.1480 → 1.0.1482

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}`, {
@@ -27,6 +27,7 @@ interface QuoteAttrs {
27
27
  discount?: number;
28
28
  markup?: number;
29
29
  USBankTransferMethod?: "wire" | "ach_push";
30
+ isBid?: boolean;
30
31
  }
31
32
  interface QuoteDoc extends Document {
32
33
  userId: string;
@@ -55,6 +56,7 @@ interface QuoteDoc extends Document {
55
56
  discount?: number;
56
57
  markup?: number;
57
58
  USBankTransferMethod?: "wire" | "ach_push";
59
+ isBid?: boolean;
58
60
  }
59
61
  interface QuoteModel extends Model<QuoteDoc> {
60
62
  build(attrs: QuoteAttrs): QuoteDoc;
@@ -105,6 +105,9 @@ const buildQuote = (mongoose) => {
105
105
  markup: {
106
106
  type: Number,
107
107
  },
108
+ isBid: {
109
+ type: Boolean,
110
+ },
108
111
  quoteInCrypto: {
109
112
  type: Boolean,
110
113
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1480",
3
+ "version": "1.0.1482",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",