@riocrypto/common-server 1.0.1146 → 1.0.1148
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.
|
@@ -25,6 +25,19 @@ declare class BitsoClient {
|
|
|
25
25
|
status: "partially filled" | "queued" | "open" | "closed";
|
|
26
26
|
type: "limit";
|
|
27
27
|
}>;
|
|
28
|
+
getOpenOrders(oid: string): Promise<{
|
|
29
|
+
book: string;
|
|
30
|
+
original_amount: string;
|
|
31
|
+
unfilled_amount: string;
|
|
32
|
+
original_value: string;
|
|
33
|
+
created_at: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
price: string;
|
|
36
|
+
oid: string;
|
|
37
|
+
side: "buy" | "sell";
|
|
38
|
+
status: "partially filled" | "queued" | "open" | "closed";
|
|
39
|
+
type: "limit";
|
|
40
|
+
}[]>;
|
|
28
41
|
getOrderTrades(oid: string): Promise<{
|
|
29
42
|
book: string;
|
|
30
43
|
major: string;
|
|
@@ -146,6 +146,23 @@ class BitsoClient {
|
|
|
146
146
|
return data.payload[0];
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
+
getOpenOrders(oid) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const requestConfig = {
|
|
152
|
+
method: "GET",
|
|
153
|
+
url: `${this.baseUrl}/api/v3/open_orders/`,
|
|
154
|
+
headers: {
|
|
155
|
+
"Content-Type": "application/json",
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
const signedRequestConfig = this.signRequest(requestConfig);
|
|
159
|
+
const { data } = yield (0, axios_1.default)(signedRequestConfig);
|
|
160
|
+
if (!data.success || !data.payload.length) {
|
|
161
|
+
throw new Error("Error getting Bitso order");
|
|
162
|
+
}
|
|
163
|
+
return data.payload;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
149
166
|
getOrderTrades(oid) {
|
|
150
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
168
|
const requestConfig = {
|
|
@@ -213,7 +230,9 @@ class BitsoClient {
|
|
|
213
230
|
throw new Error("Error getting Bitso fees");
|
|
214
231
|
}
|
|
215
232
|
const fees = data.payload.fees;
|
|
233
|
+
console.log("fees", fees);
|
|
216
234
|
const book = fees.find((obj) => obj.book === `${crypto.toLocaleLowerCase()}_mxn`);
|
|
235
|
+
console.log("book", book);
|
|
217
236
|
if (!book) {
|
|
218
237
|
throw new Error("Unable to get fees");
|
|
219
238
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1148",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.997",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^0.27.2",
|
|
32
32
|
"ccxt": "^3.0.30",
|