@riocrypto/common-server 1.0.1804 → 1.0.1806
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.
- package/build/clients/fireblocks-client.d.ts +2 -0
- package/build/clients/fireblocks-client.js +12 -0
- package/build/helpers/get-network-fees.d.ts +2 -2
- package/build/helpers/get-network-fees.js +2 -11
- package/build/models/crypto-address.d.ts +2 -0
- package/build/models/crypto-address.js +3 -0
- package/package.json +2 -2
|
@@ -23,6 +23,8 @@ declare class FireblocksClient {
|
|
|
23
23
|
transferFromExchangeToExchange(rioId: string, crypto: Crypto, sourceExchangeId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
24
24
|
transferFromExchange(rioId: string, crypto: Crypto, sourceExchangeId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
25
25
|
sweep(rioId: string, vaultId: string, assetId: string, amount: number): Promise<void>;
|
|
26
|
+
createExternalWallet(name: string, userId: string): Promise<string>;
|
|
27
|
+
createWhitelistedWalletAsset(fireblocksWalletId: string, asset: Crypto, address: string): Promise<string>;
|
|
26
28
|
}
|
|
27
29
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
28
30
|
export {};
|
|
@@ -410,6 +410,18 @@ class FireblocksClient {
|
|
|
410
410
|
});
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
+
createExternalWallet(name, userId) {
|
|
414
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
415
|
+
const response = yield this.fireblocks.createExternalWallet(name, userId);
|
|
416
|
+
return response.id;
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
createWhitelistedWalletAsset(fireblocksWalletId, asset, address) {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
const response = yield this.fireblocks.createExternalWalletAsset(fireblocksWalletId, asset, address);
|
|
422
|
+
return response.id;
|
|
423
|
+
});
|
|
424
|
+
}
|
|
413
425
|
}
|
|
414
426
|
const buildFireblocksClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
415
427
|
const FIREBLOCKS_PRIVATE_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("FIREBLOCKS_PRIVATE_KEY");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Crypto } from "@riocrypto/common";
|
|
2
|
-
export declare const getNetworkFees: (crypto: Crypto, conversionRateToUSD: number) =>
|
|
2
|
+
export declare const getNetworkFees: (crypto: Crypto, conversionRateToUSD: number) => {
|
|
3
3
|
withdrawFeeInBaseFiat: number;
|
|
4
|
-
}
|
|
4
|
+
};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.getNetworkFees = void 0;
|
|
13
4
|
const common_1 = require("@riocrypto/common");
|
|
14
|
-
const getNetworkFees = (crypto, conversionRateToUSD) =>
|
|
5
|
+
const getNetworkFees = (crypto, conversionRateToUSD) => {
|
|
15
6
|
// const address =
|
|
16
7
|
// crypto === Crypto.USDCSolana
|
|
17
8
|
// ? "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH"
|
|
@@ -62,5 +53,5 @@ const getNetworkFees = (crypto, conversionRateToUSD) => __awaiter(void 0, void 0
|
|
|
62
53
|
return {
|
|
63
54
|
withdrawFeeInBaseFiat: withdrawFeeInUSD * (1 / conversionRateToUSD),
|
|
64
55
|
};
|
|
65
|
-
}
|
|
56
|
+
};
|
|
66
57
|
exports.getNetworkFees = getNetworkFees;
|
|
@@ -10,6 +10,7 @@ interface CryptoAddressAttrs {
|
|
|
10
10
|
lastChecked: Date;
|
|
11
11
|
label?: string;
|
|
12
12
|
advancedVerificationStatus?: AddressVerificationStatus;
|
|
13
|
+
fireblocksId?: string;
|
|
13
14
|
}
|
|
14
15
|
interface CryptoAddressDoc extends mongoose.Document {
|
|
15
16
|
createdAt: Date;
|
|
@@ -21,6 +22,7 @@ interface CryptoAddressDoc extends mongoose.Document {
|
|
|
21
22
|
lastChecked: Date;
|
|
22
23
|
label?: string;
|
|
23
24
|
advancedVerificationStatus?: AddressVerificationStatus;
|
|
25
|
+
fireblocksId?: string;
|
|
24
26
|
}
|
|
25
27
|
interface CryptoAddressModel extends mongoose.Model<CryptoAddressDoc> {
|
|
26
28
|
build(attrs: CryptoAddressAttrs): CryptoAddressDoc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1806",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
27
27
|
"@google-cloud/storage": "^6.9.5",
|
|
28
28
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.1606",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|