@riocrypto/common 1.0.1031 → 1.0.1033
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.
|
@@ -28,6 +28,10 @@ import { AdminTaskType } from "../types/admin-task-type";
|
|
|
28
28
|
import { ImportOrderInput } from "../types/import-order-input";
|
|
29
29
|
import { Invoice } from "../types/invoice";
|
|
30
30
|
import { CryptoAddressQuery } from "../types/crypto-address-query";
|
|
31
|
+
import { ChainedOrderQuery } from "../types/chained-order-query";
|
|
32
|
+
import { ChainedOrder } from "../types/chained-order";
|
|
33
|
+
import { ChainedQuoteInput } from "../types/chained-quote-input";
|
|
34
|
+
import { ChainedQuote } from "../types/chained-quote";
|
|
31
35
|
export declare class RioAdminClient {
|
|
32
36
|
private axios;
|
|
33
37
|
constructor(axios: AxiosStatic | AxiosInstance);
|
|
@@ -97,6 +101,9 @@ export declare class RioAdminClient {
|
|
|
97
101
|
}>;
|
|
98
102
|
refreshAdminToken(): Promise<void>;
|
|
99
103
|
createOrder(order: OrderInput): Promise<Order>;
|
|
104
|
+
getChainedOrders(page: number, limit?: number, query?: ChainedOrderQuery): Promise<ChainedOrder[]>;
|
|
105
|
+
getChainedQuote(id: string): Promise<ChainedQuote>;
|
|
106
|
+
getChainedOrder(id: string): Promise<ChainedOrder>;
|
|
100
107
|
importOrder(order: ImportOrderInput): Promise<Order>;
|
|
101
108
|
registerExchangeRate(orderId: string, amount: number, price: number, provider: string): Promise<void>;
|
|
102
109
|
cancelOrder(id?: string): Promise<Order>;
|
|
@@ -105,6 +112,7 @@ export declare class RioAdminClient {
|
|
|
105
112
|
getBankPayout(orderId: string): Promise<BankPayout>;
|
|
106
113
|
getCryptoAddresses(page: number, limit?: number, query?: CryptoAddressQuery): Promise<CryptoAddress[]>;
|
|
107
114
|
createCryptoAddress(address: string, crypto: Crypto, userId: string, label?: string): Promise<CryptoAddress>;
|
|
115
|
+
createChainedQuote(input: ChainedQuoteInput): Promise<ChainedQuote>;
|
|
108
116
|
createBankAccount(userId: string, country: Country, fiat: Fiat, bankName: string, accountHolderName: string, accountNumber: string, swiftCode?: string, CCI?: string, notes?: string): Promise<BankAccount>;
|
|
109
117
|
updateBankAccount(id: string, userId?: string, country?: Country, fiat?: Fiat, bankName?: string, accountHolderName?: string, accountNumber?: string, swiftCode?: string, notes?: string, approved?: boolean): Promise<BankAccount>;
|
|
110
118
|
deleteBankAccount(id: string): Promise<void>;
|
|
@@ -316,6 +316,27 @@ class RioAdminClient {
|
|
|
316
316
|
return response.data;
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
+
getChainedOrders(page, limit, query) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
321
|
+
const { data } = yield this.axios.get(`/api/orders/chained?`, {
|
|
322
|
+
params: Object.assign({ page,
|
|
323
|
+
limit }, query),
|
|
324
|
+
});
|
|
325
|
+
return data;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
getChainedQuote(id) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
const { data } = yield this.axios.get(`/api/quotes/chained/${id}`);
|
|
331
|
+
return data;
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
getChainedOrder(id) {
|
|
335
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
336
|
+
const response = yield this.axios.get(`/api/orders/chained/${id}`);
|
|
337
|
+
return response.data;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
319
340
|
importOrder(order) {
|
|
320
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
321
342
|
const response = yield this.axios.post("/api/orders/import", order);
|
|
@@ -379,6 +400,12 @@ class RioAdminClient {
|
|
|
379
400
|
return response.data;
|
|
380
401
|
});
|
|
381
402
|
}
|
|
403
|
+
createChainedQuote(input) {
|
|
404
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
+
const { data } = yield this.axios.post(`/api/quotes/chained`, input);
|
|
406
|
+
return data;
|
|
407
|
+
});
|
|
408
|
+
}
|
|
382
409
|
createBankAccount(userId, country, fiat, bankName, accountHolderName, accountNumber, swiftCode, CCI, notes) {
|
|
383
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
384
411
|
const response = yield this.axios.post(`/api/bank/accounts`, {
|
|
@@ -2,14 +2,14 @@ import { CustomError } from "./custom-error";
|
|
|
2
2
|
export declare class MissingUserDataError extends CustomError {
|
|
3
3
|
private customMessage;
|
|
4
4
|
private missingFields;
|
|
5
|
-
private
|
|
5
|
+
private userId;
|
|
6
6
|
statusCode: number;
|
|
7
7
|
internalCode: number;
|
|
8
|
-
constructor(customMessage: string, missingFields: string[],
|
|
8
|
+
constructor(customMessage: string, missingFields: string[], userId: string);
|
|
9
9
|
serializeErrors(): {
|
|
10
10
|
code: number;
|
|
11
11
|
fields: string[];
|
|
12
|
-
|
|
12
|
+
userId: string;
|
|
13
13
|
message: string;
|
|
14
14
|
}[];
|
|
15
15
|
}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MissingUserDataError = void 0;
|
|
4
4
|
const custom_error_1 = require("./custom-error");
|
|
5
5
|
class MissingUserDataError extends custom_error_1.CustomError {
|
|
6
|
-
constructor(customMessage, missingFields,
|
|
6
|
+
constructor(customMessage, missingFields, userId) {
|
|
7
7
|
super(customMessage);
|
|
8
8
|
this.customMessage = customMessage;
|
|
9
9
|
this.missingFields = missingFields;
|
|
10
|
-
this.
|
|
10
|
+
this.userId = userId;
|
|
11
11
|
this.statusCode = 400;
|
|
12
12
|
this.internalCode = 88;
|
|
13
13
|
Object.setPrototypeOf(this, MissingUserDataError.prototype);
|
|
@@ -17,7 +17,7 @@ class MissingUserDataError extends custom_error_1.CustomError {
|
|
|
17
17
|
{
|
|
18
18
|
code: this.internalCode,
|
|
19
19
|
fields: this.missingFields,
|
|
20
|
-
|
|
20
|
+
userId: this.userId,
|
|
21
21
|
message: this.customMessage,
|
|
22
22
|
},
|
|
23
23
|
];
|