@riocrypto/common-server 1.0.1127 → 1.0.1129

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.
@@ -10,8 +10,20 @@ declare class BitsoClient {
10
10
  createReceivingAccount(user: User, bankAccount: BankAccount, bitsoBankAccountCode: string): Promise<string>;
11
11
  createWithdraw(bitsoReceivingAccountId: string, amount: number, concept: string, rfc?: string): Promise<string>;
12
12
  createLimitOrder(asset: string, amount: number, price: number, side: "buy" | "sell"): Promise<{
13
- amountFilled: number;
14
- oid?: string;
13
+ oid: string;
14
+ }>;
15
+ getOrder(oid: string): Promise<{
16
+ book: string;
17
+ original_amount: string;
18
+ unfilled_amount: string;
19
+ original_value: string;
20
+ created_at: string;
21
+ updated_at: string;
22
+ price: string;
23
+ oid: string;
24
+ side: "buy" | "sell";
25
+ status: "partially filled" | "queued" | "open" | "closed";
26
+ type: "limit";
15
27
  }>;
16
28
  getOrderBook(crypto: Crypto): Promise<{
17
29
  asks: {
@@ -128,6 +128,23 @@ class BitsoClient {
128
128
  return data.payload;
129
129
  });
130
130
  }
131
+ getOrder(oid) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const requestConfig = {
134
+ method: "GET",
135
+ url: `${this.baseUrl}/api/v3/orders/${oid}`,
136
+ headers: {
137
+ "Content-Type": "application/json",
138
+ },
139
+ };
140
+ const signedRequestConfig = this.signRequest(requestConfig);
141
+ const { data } = yield (0, axios_1.default)(signedRequestConfig);
142
+ if (!data.success || !data.payload.length) {
143
+ throw new Error("Error getting Bitso order");
144
+ }
145
+ return data.payload[0];
146
+ });
147
+ }
131
148
  getOrderBook(crypto) {
132
149
  return __awaiter(this, void 0, void 0, function* () {
133
150
  const requestConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1127",
3
+ "version": "1.0.1129",
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.974",
29
+ "@riocrypto/common": "^1.0.975",
30
30
  "@types/express": "^4.17.13",
31
31
  "axios": "^0.27.2",
32
32
  "ccxt": "^3.0.30",