@riocrypto/common-server 1.0.2581 → 1.0.2583
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.
|
@@ -89,6 +89,7 @@ declare class BitsoClient {
|
|
|
89
89
|
usdc: number;
|
|
90
90
|
}>;
|
|
91
91
|
createCryptoWithdrawal(amount: number, crypto: Crypto, address: string): Promise<Object>;
|
|
92
|
+
getDepositByHash(hash: string): Promise<Object>;
|
|
92
93
|
signRequest(requestConfig: AxiosRequestConfig): AxiosRequestConfig;
|
|
93
94
|
}
|
|
94
95
|
export declare const buildBitsoClient: () => Promise<BitsoClient>;
|
|
@@ -448,6 +448,23 @@ class BitsoClient {
|
|
|
448
448
|
return data.payload;
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
|
+
getDepositByHash(hash) {
|
|
452
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
453
|
+
const requestConfig = {
|
|
454
|
+
method: "GET",
|
|
455
|
+
url: `${this.baseUrl}/api/v3/fundings`,
|
|
456
|
+
headers: {
|
|
457
|
+
"Content-Type": "application/json",
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
const signedRequestConfig = this.signRequest(requestConfig);
|
|
461
|
+
const { data } = yield this.axiosClient(signedRequestConfig);
|
|
462
|
+
if (!data.success) {
|
|
463
|
+
throw new Error("Error getting Bitso deposit");
|
|
464
|
+
}
|
|
465
|
+
return data.payload.find((deposit) => deposit.details.tx_hash === hash);
|
|
466
|
+
});
|
|
467
|
+
}
|
|
451
468
|
signRequest(requestConfig) {
|
|
452
469
|
var _a;
|
|
453
470
|
const url = new URL(requestConfig.url || "");
|
|
@@ -12,6 +12,7 @@ interface STPMXNWithdrawalAttrs {
|
|
|
12
12
|
id: number;
|
|
13
13
|
amount: number;
|
|
14
14
|
status: "processing" | "complete" | "failed";
|
|
15
|
+
reference: string;
|
|
15
16
|
}[];
|
|
16
17
|
orderVersion?: number;
|
|
17
18
|
}
|
|
@@ -29,6 +30,7 @@ interface STPMXNWithdrawalDoc extends Document {
|
|
|
29
30
|
id: number;
|
|
30
31
|
amount: number;
|
|
31
32
|
status: "processing" | "complete" | "failed";
|
|
33
|
+
reference: string;
|
|
32
34
|
}[];
|
|
33
35
|
}
|
|
34
36
|
interface STPMXNWithdrawalModel extends Model<STPMXNWithdrawalDoc> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2583",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2380",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|