@riocrypto/common-server 1.0.946 → 1.0.949
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.
|
@@ -9,9 +9,10 @@ declare class FireblocksClient {
|
|
|
9
9
|
getVaultCryptoBalance(crypto: Crypto): Promise<number>;
|
|
10
10
|
getExchangeCryptoBalance(crypto: Crypto): Promise<number>;
|
|
11
11
|
getExchangeFiatBalance(): Promise<number>;
|
|
12
|
-
getTransactions(crypto: Crypto, nextPage?: string): Promise<any>;
|
|
12
|
+
getTransactions(vaultId: string, crypto: Crypto, nextPage?: string): Promise<any>;
|
|
13
13
|
getDepositAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
14
14
|
createVault(userId: string): Promise<string>;
|
|
15
|
+
createWallet(vaultId: string, crypto: Crypto): Promise<string>;
|
|
15
16
|
}
|
|
16
17
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
17
18
|
export {};
|
|
@@ -108,12 +108,13 @@ class FireblocksClient {
|
|
|
108
108
|
return balance;
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
getTransactions(crypto, nextPage) {
|
|
111
|
+
getTransactions(vaultId, crypto, nextPage) {
|
|
112
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
113
|
let transactionData = nextPage
|
|
114
114
|
? yield this.fireblocks.getTransactionsWithPageInfo(undefined, nextPage)
|
|
115
115
|
: yield this.fireblocks.getTransactionsWithPageInfo({
|
|
116
116
|
assets: crypto,
|
|
117
|
+
destId: vaultId,
|
|
117
118
|
});
|
|
118
119
|
return transactionData;
|
|
119
120
|
});
|
|
@@ -130,6 +131,12 @@ class FireblocksClient {
|
|
|
130
131
|
return vault.id;
|
|
131
132
|
});
|
|
132
133
|
}
|
|
134
|
+
createWallet(vaultId, crypto) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const wallet = yield this.fireblocks.createVaultAsset(vaultId, crypto);
|
|
137
|
+
return wallet.address;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
133
140
|
}
|
|
134
141
|
const buildFireblocksClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
135
142
|
const FIREBLOCKS_PRIVATE_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("FIREBLOCKS_PRIVATE_KEY");
|
|
@@ -6,6 +6,9 @@ interface FireblocksVaultAttrs {
|
|
|
6
6
|
interface FireblocksVaultDoc extends mongoose.Document {
|
|
7
7
|
userId: string;
|
|
8
8
|
fireblocksVaultId: string;
|
|
9
|
+
depositAddresses: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
interface FireblocksVaultModel extends mongoose.Model<FireblocksVaultDoc> {
|
|
11
14
|
build(attrs: FireblocksVaultAttrs): FireblocksVaultDoc;
|