@riocrypto/common-server 1.0.1239 → 1.0.1241
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.
|
@@ -9,6 +9,7 @@ declare class BitsoClient {
|
|
|
9
9
|
createClabe(): Promise<string>;
|
|
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
|
+
getWithdrawal(withdrawalId: string): Promise<any>;
|
|
12
13
|
createLimitOrder(asset: string, amount: number, price: number, side: "buy" | "sell"): Promise<{
|
|
13
14
|
oid: string;
|
|
14
15
|
}>;
|
|
@@ -104,6 +104,23 @@ class BitsoClient {
|
|
|
104
104
|
return data.payload;
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
+
getWithdrawal(withdrawalId) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const requestConfig = {
|
|
110
|
+
method: "GET",
|
|
111
|
+
url: `${this.baseUrl}/api/v3/withdrawals/${withdrawalId}`,
|
|
112
|
+
headers: {
|
|
113
|
+
"Content-Type": "application/json",
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
const signedRequestConfig = this.signRequest(requestConfig);
|
|
117
|
+
const { data } = yield (0, axios_1.default)(signedRequestConfig);
|
|
118
|
+
if (!data.success || !data.payload.length) {
|
|
119
|
+
throw new Error("Error getting Bitso order");
|
|
120
|
+
}
|
|
121
|
+
return data.payload[0];
|
|
122
|
+
});
|
|
123
|
+
}
|
|
107
124
|
createLimitOrder(asset, amount, price, side) {
|
|
108
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
126
|
const major = amount / price;
|
|
@@ -4,13 +4,21 @@ interface BankPayoutAttrs {
|
|
|
4
4
|
orderId: string;
|
|
5
5
|
bankAccountId: string;
|
|
6
6
|
originBank: Processor;
|
|
7
|
-
status:
|
|
7
|
+
status: "initialized" | "processing" | "complete" | "failed" | "cancelled";
|
|
8
|
+
transferDetails?: {
|
|
9
|
+
speiTrackingNumber?: string;
|
|
10
|
+
reference?: string;
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
13
|
interface BankPayoutDoc extends Document {
|
|
10
14
|
orderId: string;
|
|
11
15
|
bankAccountId: string;
|
|
12
16
|
originBank: Processor;
|
|
13
|
-
status:
|
|
17
|
+
status: "initialized" | "processing" | "complete" | "failed" | "cancelled";
|
|
18
|
+
transferDetails?: {
|
|
19
|
+
speiTrackingNumber?: string;
|
|
20
|
+
reference?: string;
|
|
21
|
+
};
|
|
14
22
|
}
|
|
15
23
|
interface BankPayoutModel extends Model<BankPayoutDoc> {
|
|
16
24
|
build(attrs: BankPayoutAttrs): BankPayoutDoc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1241",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1126",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|