@riocrypto/common-server 1.0.1170 → 1.0.1172
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.
|
@@ -89,7 +89,7 @@ class ClusterClient {
|
|
|
89
89
|
}
|
|
90
90
|
getBalance(asset) {
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
const rioResponse = yield this.axios.get(`${this.baseUrl}/api/
|
|
92
|
+
const rioResponse = yield this.axios.get(`${this.baseUrl}/api/liquidity/${asset}`, {
|
|
93
93
|
headers: {
|
|
94
94
|
"x-api-key": this.clusterApiKey,
|
|
95
95
|
},
|
|
@@ -16,6 +16,8 @@ declare class FireblocksClient {
|
|
|
16
16
|
createWallet(vaultId: string, crypto: Crypto): Promise<string>;
|
|
17
17
|
internalTransfer(crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
18
18
|
externalTransfer(crypto: Crypto, sourceVaultId: string, destinationAddress: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
19
|
+
transferToExchange(crypto: Crypto, sourceVaultId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
20
|
+
transferFromExchange(crypto: Crypto, sourceExchangeId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
19
21
|
sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
|
|
20
22
|
}
|
|
21
23
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
@@ -200,6 +200,44 @@ class FireblocksClient {
|
|
|
200
200
|
return response.id;
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
+
transferToExchange(crypto, sourceVaultId, destinationExchangeId, amountCrypto, notes) {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
const response = yield this.fireblocks.createTransaction({
|
|
206
|
+
assetId: crypto,
|
|
207
|
+
source: {
|
|
208
|
+
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
209
|
+
id: sourceVaultId,
|
|
210
|
+
},
|
|
211
|
+
destination: {
|
|
212
|
+
type: fireblocks_sdk_1.PeerType.EXCHANGE_ACCOUNT,
|
|
213
|
+
id: destinationExchangeId,
|
|
214
|
+
},
|
|
215
|
+
amount: amountCrypto,
|
|
216
|
+
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
217
|
+
note: notes,
|
|
218
|
+
});
|
|
219
|
+
return response.id;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
transferFromExchange(crypto, sourceExchangeId, destinationVaultId, amountCrypto, notes) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
const response = yield this.fireblocks.createTransaction({
|
|
225
|
+
assetId: crypto,
|
|
226
|
+
source: {
|
|
227
|
+
type: fireblocks_sdk_1.PeerType.EXCHANGE_ACCOUNT,
|
|
228
|
+
id: sourceExchangeId,
|
|
229
|
+
},
|
|
230
|
+
destination: {
|
|
231
|
+
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
232
|
+
id: destinationVaultId,
|
|
233
|
+
},
|
|
234
|
+
amount: amountCrypto,
|
|
235
|
+
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
236
|
+
note: notes,
|
|
237
|
+
});
|
|
238
|
+
return response.id;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
203
241
|
sweep(vaultId, assetId, amount) {
|
|
204
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
205
243
|
yield this.fireblocks.createTransaction({
|