@riocrypto/common-server 1.0.1580 → 1.0.1584
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.
|
@@ -8,6 +8,7 @@ declare class BitsoClient {
|
|
|
8
8
|
constructor(apiKey: string, apiSecret: string, env: "production" | "sandbox");
|
|
9
9
|
createClabe(): Promise<string>;
|
|
10
10
|
createReceivingAccount(user: User, bankAccount: BankAccount, bitsoBankAccountCode: string): Promise<string>;
|
|
11
|
+
deleteReceivingAccount(bitsoReceivingAccountId: string): Promise<string>;
|
|
11
12
|
createWithdraw(bitsoReceivingAccountId: string, amount: number, concept: string, rfc?: string): Promise<Object>;
|
|
12
13
|
getWithdrawal(withdrawalId: string): Promise<any>;
|
|
13
14
|
createLimitOrder(asset: string, amount: number, price: number, side: "buy" | "sell"): Promise<{
|
|
@@ -80,6 +80,23 @@ class BitsoClient {
|
|
|
80
80
|
return data.payload;
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
+
deleteReceivingAccount(bitsoReceivingAccountId) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
86
|
+
throw new Error("Bitso delete receiving account not allowed in sandbox");
|
|
87
|
+
}
|
|
88
|
+
const requestConfig = {
|
|
89
|
+
method: "DELETE",
|
|
90
|
+
url: `${this.baseUrl}/api/v3/consumer-contacts/${bitsoReceivingAccountId}`,
|
|
91
|
+
};
|
|
92
|
+
const signedRequestConfig = this.signRequest(requestConfig);
|
|
93
|
+
const { data } = yield (0, axios_1.default)(signedRequestConfig);
|
|
94
|
+
if (!data.success) {
|
|
95
|
+
throw new Error("Error deleting Bitso receiving account");
|
|
96
|
+
}
|
|
97
|
+
return data.payload;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
83
100
|
createWithdraw(bitsoReceivingAccountId, amount, concept, rfc) {
|
|
84
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
102
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
package/build/services/logger.js
CHANGED
|
@@ -40,7 +40,7 @@ class LoggerService {
|
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
this.logger = (0, winston_1.createLogger)({
|
|
43
|
-
level:
|
|
43
|
+
level: "error",
|
|
44
44
|
format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json(), winston_1.format.metadata(), winston_1.format.prettyPrint()),
|
|
45
45
|
transports: [new winston_1.transports.Console()],
|
|
46
46
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1584",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1412",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.6.0",
|
|
34
34
|
"ccxt": "^3.0.30",
|