@riocrypto/common 1.0.594 → 1.0.596
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.
|
@@ -65,6 +65,7 @@ export declare class RioClient {
|
|
|
65
65
|
}>;
|
|
66
66
|
refreshToken(): Promise<void>;
|
|
67
67
|
createOrder(order: OrderInput): Promise<Order>;
|
|
68
|
+
cancelOrder(id: string): Promise<Order>;
|
|
68
69
|
getOrder(id: string): Promise<Order>;
|
|
69
70
|
createBankPayout(oid: string, accountNumber: string, swiftCode?: string): Promise<BankPayout>;
|
|
70
71
|
getBankPayout(orderId: string): Promise<BankPayout>;
|
|
@@ -202,6 +202,12 @@ class RioClient {
|
|
|
202
202
|
return response.data;
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
+
cancelOrder(id) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
const response = yield this.axios.post(`/api/orders/${id}/cancel`);
|
|
208
|
+
return response.data;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
205
211
|
getOrder(id) {
|
|
206
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
213
|
const response = yield this.axios.get(`/api/orders/${id}`);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { CustomError } from "./custom-error";
|
|
2
2
|
export declare class ActiveSellOrderError extends CustomError {
|
|
3
|
+
private activeOrderId;
|
|
3
4
|
statusCode: number;
|
|
4
|
-
constructor();
|
|
5
|
+
constructor(activeOrderId: string);
|
|
5
6
|
serializeErrors(): {
|
|
6
7
|
message: string;
|
|
8
|
+
activeOrderId: string;
|
|
7
9
|
}[];
|
|
8
10
|
}
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ActiveSellOrderError = void 0;
|
|
4
4
|
const custom_error_1 = require("./custom-error");
|
|
5
5
|
class ActiveSellOrderError extends custom_error_1.CustomError {
|
|
6
|
-
constructor() {
|
|
6
|
+
constructor(activeOrderId) {
|
|
7
7
|
super("There is an active sell order for this user. Cannot create another one");
|
|
8
|
+
this.activeOrderId = activeOrderId;
|
|
8
9
|
this.statusCode = 409;
|
|
9
10
|
Object.setPrototypeOf(this, ActiveSellOrderError.prototype);
|
|
10
11
|
}
|
|
@@ -12,6 +13,7 @@ class ActiveSellOrderError extends custom_error_1.CustomError {
|
|
|
12
13
|
return [
|
|
13
14
|
{
|
|
14
15
|
message: "There is an active sell order for this user. Cannot create another one",
|
|
16
|
+
activeOrderId: this.activeOrderId,
|
|
15
17
|
},
|
|
16
18
|
];
|
|
17
19
|
}
|