@riocrypto/common-server 1.0.1589 → 1.0.1591
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.
|
@@ -5,7 +5,7 @@ declare class FireblocksClient {
|
|
|
5
5
|
constructor(privateKey: string, apiKey: string);
|
|
6
6
|
estimateWithdrawFee(crypto: Crypto, address: string, amountCrypto: number): Promise<string | number | undefined>;
|
|
7
7
|
withdrawFromExchange(crypto: Crypto, address: string, amountCrypto: number): Promise<void>;
|
|
8
|
-
withdrawFromVault(crypto: Crypto, address: string, amountCrypto: number): Promise<string>;
|
|
8
|
+
withdrawFromVault(crypto: Crypto, address: string, amountCrypto: number, vaultId?: string): Promise<string>;
|
|
9
9
|
getVaultCryptoBalance(vaultId: string, crypto: Crypto): Promise<number>;
|
|
10
10
|
getVaultCryptoAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
11
11
|
getTotalVaultUSDBalance(vaultId: string): Promise<number>;
|
|
@@ -27,7 +27,6 @@ class FireblocksClient {
|
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
let fee;
|
|
29
29
|
const cachedResponse = cache2.get(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`);
|
|
30
|
-
console.log(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`, cachedResponse);
|
|
31
30
|
if (cachedResponse) {
|
|
32
31
|
fee = cachedResponse;
|
|
33
32
|
}
|
|
@@ -76,7 +75,7 @@ class FireblocksClient {
|
|
|
76
75
|
});
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
|
-
withdrawFromVault(crypto, address, amountCrypto) {
|
|
78
|
+
withdrawFromVault(crypto, address, amountCrypto, vaultId) {
|
|
80
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
80
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
82
81
|
throw new Error("Withdrawals are disabled in sandbox mode.");
|
|
@@ -85,7 +84,7 @@ class FireblocksClient {
|
|
|
85
84
|
assetId: crypto,
|
|
86
85
|
source: {
|
|
87
86
|
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
88
|
-
id: "2",
|
|
87
|
+
id: vaultId ? vaultId : "2",
|
|
89
88
|
},
|
|
90
89
|
destination: {
|
|
91
90
|
type: fireblocks_sdk_1.PeerType.ONE_TIME_ADDRESS,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
interface FireblocksTransferAttrs {
|
|
3
3
|
userId: string;
|
|
4
|
-
|
|
4
|
+
type: "transaction" | "addressVerification";
|
|
5
5
|
orderId?: string;
|
|
6
6
|
addressId?: string;
|
|
7
7
|
fireblocksTransferId: string;
|
|
8
8
|
}
|
|
9
9
|
interface FireblocksTransferDoc extends mongoose.Document {
|
|
10
10
|
userId: string;
|
|
11
|
-
|
|
11
|
+
type: "transaction" | "addressVerification";
|
|
12
12
|
orderId?: string;
|
|
13
13
|
addressId?: string;
|
|
14
14
|
fireblocksTransferId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1591",
|
|
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.1420",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.6.0",
|
|
34
34
|
"ccxt": "^3.0.30",
|