@riocrypto/common-server 1.0.1036 → 1.0.1038
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.
|
@@ -13,6 +13,7 @@ declare class FireblocksClient {
|
|
|
13
13
|
getDepositAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
14
14
|
createVault(userId: string, name: string): Promise<string>;
|
|
15
15
|
createWallet(vaultId: string, crypto: Crypto): Promise<string>;
|
|
16
|
+
sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
|
|
16
17
|
}
|
|
17
18
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
18
19
|
export {};
|
|
@@ -128,7 +128,7 @@ class FireblocksClient {
|
|
|
128
128
|
}
|
|
129
129
|
createVault(userId, name) {
|
|
130
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
const vault = yield this.fireblocks.createVaultAccount(`${name} - ${userId}
|
|
131
|
+
const vault = yield this.fireblocks.createVaultAccount(`${name} - ${userId}`, false, userId);
|
|
132
132
|
return vault.id;
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -138,6 +138,22 @@ class FireblocksClient {
|
|
|
138
138
|
return wallet.address;
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
+
sweep(vaultId, assetId, amount) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
yield this.fireblocks.createTransaction({
|
|
144
|
+
assetId: assetId,
|
|
145
|
+
source: {
|
|
146
|
+
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
147
|
+
id: vaultId,
|
|
148
|
+
},
|
|
149
|
+
destination: {
|
|
150
|
+
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
151
|
+
id: String(2),
|
|
152
|
+
},
|
|
153
|
+
amount: amount.toFixed(4),
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
const buildFireblocksClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
159
|
const FIREBLOCKS_PRIVATE_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("FIREBLOCKS_PRIVATE_KEY");
|
package/build/models/quote.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ interface QuoteAttrs {
|
|
|
18
18
|
price: number;
|
|
19
19
|
createdAt: Date;
|
|
20
20
|
noMarkups: boolean;
|
|
21
|
+
quoteInCrypto: boolean;
|
|
21
22
|
depositAddress?: string;
|
|
22
23
|
brokerId?: string;
|
|
23
24
|
conversionRateUSD: number;
|
|
@@ -42,6 +43,7 @@ interface QuoteDoc extends Document {
|
|
|
42
43
|
createdAt: Date;
|
|
43
44
|
fees: Fees;
|
|
44
45
|
price: number;
|
|
46
|
+
quoteInCrypto: boolean;
|
|
45
47
|
noMarkups: boolean;
|
|
46
48
|
depositAddress?: string;
|
|
47
49
|
brokerId?: string;
|
package/build/models/quote.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1038",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
25
25
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
26
26
|
"@google-cloud/storage": "^6.9.5",
|
|
27
|
-
"@riocrypto/common": "^1.0.
|
|
27
|
+
"@riocrypto/common": "^1.0.896",
|
|
28
28
|
"@types/express": "^4.17.13",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"ccxt": "^3.0.30",
|