@riocrypto/common-server 1.0.606 → 1.0.607
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.
|
@@ -3,8 +3,7 @@ import { Crypto } from "@riocrypto/common";
|
|
|
3
3
|
declare class FireblocksClient {
|
|
4
4
|
fireblocks: FireblocksSDK;
|
|
5
5
|
constructor(privateKey: string, apiKey: string);
|
|
6
|
-
|
|
7
|
-
estimateWithdrawFromVaultFee(crypto: Crypto, address: string, amountCrypto: number): Promise<string | undefined>;
|
|
6
|
+
estimateWithdrawFromFee(crypto: Crypto): Promise<string | undefined>;
|
|
8
7
|
withdrawFromExchange(crypto: Crypto, address: string, amountCrypto: number): Promise<void>;
|
|
9
8
|
withdrawFromVault(crypto: Crypto, address: string, amountCrypto: number): Promise<void>;
|
|
10
9
|
getVaultCryptoBalance(crypto: Crypto): Promise<number>;
|
|
@@ -16,43 +16,9 @@ class FireblocksClient {
|
|
|
16
16
|
constructor(privateKey, apiKey) {
|
|
17
17
|
this.fireblocks = new fireblocks_sdk_1.FireblocksSDK(privateKey, apiKey, "https://api.fireblocks.io");
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
estimateWithdrawFromFee(crypto) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
let estimate = yield this.fireblocks.
|
|
22
|
-
assetId: crypto,
|
|
23
|
-
source: {
|
|
24
|
-
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
25
|
-
id: "2",
|
|
26
|
-
},
|
|
27
|
-
destination: {
|
|
28
|
-
type: fireblocks_sdk_1.PeerType.ONE_TIME_ADDRESS,
|
|
29
|
-
oneTimeAddress: {
|
|
30
|
-
address,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
amount: amountCrypto,
|
|
34
|
-
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
35
|
-
});
|
|
36
|
-
return estimate.medium.networkFee;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
estimateWithdrawFromVaultFee(crypto, address, amountCrypto) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
let estimate = yield this.fireblocks.estimateFeeForTransaction({
|
|
42
|
-
assetId: crypto,
|
|
43
|
-
source: {
|
|
44
|
-
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
45
|
-
id: "2",
|
|
46
|
-
},
|
|
47
|
-
destination: {
|
|
48
|
-
type: fireblocks_sdk_1.PeerType.ONE_TIME_ADDRESS,
|
|
49
|
-
oneTimeAddress: {
|
|
50
|
-
address,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
amount: amountCrypto,
|
|
54
|
-
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
55
|
-
});
|
|
21
|
+
let estimate = yield this.fireblocks.getFeeForAsset(crypto);
|
|
56
22
|
return estimate.medium.networkFee;
|
|
57
23
|
});
|
|
58
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.607",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@google-cloud/storage": "^6.9.5",
|
|
26
|
-
"@riocrypto/common": "^1.0.
|
|
26
|
+
"@riocrypto/common": "^1.0.581",
|
|
27
27
|
"@types/express": "^4.17.13",
|
|
28
28
|
"axios": "^0.27.2",
|
|
29
29
|
"ccxt": "^3.0.30",
|