@riocrypto/common-server 1.0.1364 → 1.0.1366

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.
@@ -1,11 +1,11 @@
1
- import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress } from "@riocrypto/common";
1
+ import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount } from "@riocrypto/common";
2
2
  declare class ClusterClient {
3
3
  private baseUrl;
4
4
  private clusterApiKey;
5
5
  private axios;
6
6
  constructor(baseUrl: string, clusterApiKey: string);
7
7
  getNewQuote(orderId: string, quote: Quote, newAmountFiat?: number, newAmountCrypto?: number): Promise<Quote>;
8
- getQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number): Promise<Quote>;
8
+ getQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire"): Promise<Quote>;
9
9
  getCryptoAddresses(userId: string, crypto: Crypto): Promise<CryptoAddress[]>;
10
10
  createOrder(quoteId: string, cryptoAddress?: string, notes?: string, externalAccountId?: string): Promise<Order>;
11
11
  confirmPayment(orderId: string): Promise<void>;
@@ -17,6 +17,7 @@ declare class ClusterClient {
17
17
  account_owner_name: string;
18
18
  last_4: string;
19
19
  }[]>;
20
+ getBankAccounts(userId: string): Promise<BankAccount[]>;
20
21
  getTransactionLimits(userId: string): Promise<{
21
22
  limit: number;
22
23
  used: number;
@@ -75,7 +75,7 @@ class ClusterClient {
75
75
  return response.data;
76
76
  });
77
77
  }
78
- getQuote(userId, side, country, fiat, crypto, amountFiat, amountCrypto) {
78
+ getQuote(userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod) {
79
79
  return __awaiter(this, void 0, void 0, function* () {
80
80
  const response = yield this.axios.post(`${this.baseUrl}/api/quotes`, {
81
81
  userId,
@@ -85,6 +85,7 @@ class ClusterClient {
85
85
  amountFiat,
86
86
  amountCrypto,
87
87
  country,
88
+ USBankTransferMethod,
88
89
  }, {
89
90
  headers: {
90
91
  "x-cluster-api-key": this.clusterApiKey,
@@ -161,6 +162,16 @@ class ClusterClient {
161
162
  return rioResponse.data;
162
163
  });
163
164
  }
165
+ getBankAccounts(userId) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const rioResponse = yield this.axios.get(`${this.baseUrl}/api/bank/accounts?userId=${userId}`, {
168
+ headers: {
169
+ "x-cluster-api-key": this.clusterApiKey,
170
+ },
171
+ });
172
+ return rioResponse.data;
173
+ });
174
+ }
164
175
  getTransactionLimits(userId) {
165
176
  return __awaiter(this, void 0, void 0, function* () {
166
177
  const response = yield this.axios.get(`${this.baseUrl}/api/users/${userId}/limits`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1364",
3
+ "version": "1.0.1366",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",