@riocrypto/common-server 1.0.1139 → 1.0.1140

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,7 @@ declare class BitsoClient {
25
25
  status: "partially filled" | "queued" | "open" | "closed";
26
26
  type: "limit";
27
27
  }>;
28
+ cancelOrder(oid: string): Promise<void>;
28
29
  getOrderBook(crypto: Crypto): Promise<{
29
30
  asks: {
30
31
  book: string;
@@ -146,6 +146,22 @@ class BitsoClient {
146
146
  return data.payload[0];
147
147
  });
148
148
  }
149
+ cancelOrder(oid) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ const requestConfig = {
152
+ method: "DELETE",
153
+ url: `${this.baseUrl}/api/v3/orders/${oid}`,
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) {
161
+ throw new Error("Error deleting Bitso order");
162
+ }
163
+ });
164
+ }
149
165
  getOrderBook(crypto) {
150
166
  return __awaiter(this, void 0, void 0, function* () {
151
167
  const requestConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1139",
3
+ "version": "1.0.1140",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",