@riocrypto/common 1.0.1002 → 1.0.1004

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.
@@ -26,6 +26,8 @@ import { Invoice } from "../types/invoice";
26
26
  import { CryptoAddressQuery } from "../types/crypto-address-query";
27
27
  import { ChainedQuoteInput } from "../types/chained-quote-input";
28
28
  import { ChainedQuote } from "../types/chained-quote";
29
+ import { ChainedOrderInput } from "../types/chained-order-input";
30
+ import { ChainedOrder } from "../types/chained-order";
29
31
  export declare class RioClient {
30
32
  private axios;
31
33
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -64,8 +66,10 @@ export declare class RioClient {
64
66
  }>;
65
67
  refreshToken(): Promise<void>;
66
68
  createOrder(order: OrderInput): Promise<Order>;
69
+ createChainedOrder(order: ChainedOrderInput): Promise<ChainedOrder>;
67
70
  cancelOrder(id?: string): Promise<Order>;
68
71
  getOrder(id: string): Promise<Order>;
72
+ getChainedOrder(id: string): Promise<ChainedOrder>;
69
73
  createBankPayout(oid: string, bankAccountId: string): Promise<BankPayout>;
70
74
  getBankPayout(orderId: string): Promise<BankPayout>;
71
75
  getBridgeOnboardingLinks(userId: string): Promise<{
@@ -93,6 +97,7 @@ export declare class RioClient {
93
97
  revenue: number;
94
98
  }>;
95
99
  getQuote(id: string): Promise<Quote>;
100
+ getChainedQuote(id: string): Promise<ChainedQuote>;
96
101
  createVerificationLink(userId: string, firstName: string, lastName: string): Promise<string>;
97
102
  getPaymentMethods(fiat: Fiat, country: Country): Promise<PaymentMethod[]>;
98
103
  getBankAccounts(page: number, limit: number, query?: BankAccountQuery): Promise<BankAccount[]>;
@@ -196,10 +196,12 @@ class RioClient {
196
196
  return response.data;
197
197
  });
198
198
  }
199
- // async createChainedOrder(order: ChainedOrder): Promise<Order> {
200
- // const response = await this.axios.post("/api/orders", order);
201
- // return response.data as Order;
202
- // }
199
+ createChainedOrder(order) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ const response = yield this.axios.post("/api/orders/chained", order);
202
+ return response.data;
203
+ });
204
+ }
203
205
  cancelOrder(id) {
204
206
  return __awaiter(this, void 0, void 0, function* () {
205
207
  const response = yield this.axios.post(`/api/orders${id ? `/${id}/cancel` : "/cancel"}`);
@@ -212,6 +214,12 @@ class RioClient {
212
214
  return response.data;
213
215
  });
214
216
  }
217
+ getChainedOrder(id) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ const response = yield this.axios.get(`/api/orders/chained/${id}`);
220
+ return response.data;
221
+ });
222
+ }
215
223
  createBankPayout(oid, bankAccountId) {
216
224
  return __awaiter(this, void 0, void 0, function* () {
217
225
  const response = yield this.axios.post(`/api/payouts/bank`, {
@@ -319,6 +327,12 @@ class RioClient {
319
327
  return data;
320
328
  });
321
329
  }
330
+ getChainedQuote(id) {
331
+ return __awaiter(this, void 0, void 0, function* () {
332
+ const { data } = yield this.axios.get(`/api/quotes/chained/${id}`);
333
+ return data;
334
+ });
335
+ }
322
336
  createVerificationLink(userId, firstName, lastName) {
323
337
  return __awaiter(this, void 0, void 0, function* () {
324
338
  const { data } = yield this.axios.post("/api/kyc/link", {
@@ -2,7 +2,7 @@ import { Country } from "./country";
2
2
  import { Fees } from "./fees";
3
3
  import { Fiat } from "./fiat";
4
4
  import { OrderStatus } from "./order-status";
5
- export interface ChainedQuote {
5
+ export interface ChainedOrder {
6
6
  id: string;
7
7
  userId: string;
8
8
  crypto: Crypto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1002",
3
+ "version": "1.0.1004",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",