@riocrypto/common-server 1.0.1615 → 1.0.1616
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.
|
@@ -17,11 +17,11 @@ declare class FireblocksClient {
|
|
|
17
17
|
getDepositAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
18
18
|
createVault(userId: string, name: string, type: "transactional" | "managed"): Promise<string>;
|
|
19
19
|
createWallet(vaultId: string, crypto: Crypto): Promise<string>;
|
|
20
|
-
internalTransfer(crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
21
|
-
externalTransfer(crypto: Crypto, sourceVaultId: string, destinationAddress: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
22
|
-
transferToExchange(crypto: Crypto, sourceVaultId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
23
|
-
transferFromExchangeToExchange(crypto: Crypto, sourceExchangeId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
24
|
-
transferFromExchange(crypto: Crypto, sourceExchangeId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
20
|
+
internalTransfer(rioId: string, crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
21
|
+
externalTransfer(rioId: string, crypto: Crypto, sourceVaultId: string, destinationAddress: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
22
|
+
transferToExchange(rioId: string, crypto: Crypto, sourceVaultId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
23
|
+
transferFromExchangeToExchange(rioId: string, crypto: Crypto, sourceExchangeId: string, destinationExchangeId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
24
|
+
transferFromExchange(rioId: string, crypto: Crypto, sourceExchangeId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
25
25
|
sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
|
|
26
26
|
}
|
|
27
27
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
@@ -263,7 +263,7 @@ class FireblocksClient {
|
|
|
263
263
|
return wallet.address;
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
internalTransfer(crypto, sourceVaultId, destinationVaultId, amountCrypto, notes) {
|
|
266
|
+
internalTransfer(rioId, crypto, sourceVaultId, destinationVaultId, amountCrypto, notes) {
|
|
267
267
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
268
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
269
269
|
throw new Error("Internal transfers are disabled in sandbox mode.");
|
|
@@ -280,12 +280,13 @@ class FireblocksClient {
|
|
|
280
280
|
},
|
|
281
281
|
amount: amountCrypto,
|
|
282
282
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
283
|
+
externalTxId: rioId,
|
|
283
284
|
note: notes,
|
|
284
285
|
});
|
|
285
286
|
return response.id;
|
|
286
287
|
});
|
|
287
288
|
}
|
|
288
|
-
externalTransfer(crypto, sourceVaultId, destinationAddress, amountCrypto, notes) {
|
|
289
|
+
externalTransfer(rioId, crypto, sourceVaultId, destinationAddress, amountCrypto, notes) {
|
|
289
290
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
291
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
291
292
|
throw new Error("External transfers are disabled in sandbox mode.");
|
|
@@ -304,12 +305,13 @@ class FireblocksClient {
|
|
|
304
305
|
},
|
|
305
306
|
amount: amountCrypto,
|
|
306
307
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
308
|
+
externalTxId: rioId,
|
|
307
309
|
note: notes,
|
|
308
310
|
});
|
|
309
311
|
return response.id;
|
|
310
312
|
});
|
|
311
313
|
}
|
|
312
|
-
transferToExchange(crypto, sourceVaultId, destinationExchangeId, amountCrypto, notes) {
|
|
314
|
+
transferToExchange(rioId, crypto, sourceVaultId, destinationExchangeId, amountCrypto, notes) {
|
|
313
315
|
return __awaiter(this, void 0, void 0, function* () {
|
|
314
316
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
315
317
|
throw new Error("Transfers to exchanges are disabled in sandbox mode.");
|
|
@@ -327,11 +329,12 @@ class FireblocksClient {
|
|
|
327
329
|
amount: amountCrypto,
|
|
328
330
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
329
331
|
note: notes,
|
|
332
|
+
externalTxId: rioId,
|
|
330
333
|
});
|
|
331
334
|
return response.id;
|
|
332
335
|
});
|
|
333
336
|
}
|
|
334
|
-
transferFromExchangeToExchange(crypto, sourceExchangeId, destinationExchangeId, amountCrypto, notes) {
|
|
337
|
+
transferFromExchangeToExchange(rioId, crypto, sourceExchangeId, destinationExchangeId, amountCrypto, notes) {
|
|
335
338
|
return __awaiter(this, void 0, void 0, function* () {
|
|
336
339
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
337
340
|
throw new Error("Transfers from exchanges to exchanges are disabled in sandbox mode.");
|
|
@@ -348,17 +351,19 @@ class FireblocksClient {
|
|
|
348
351
|
},
|
|
349
352
|
amount: amountCrypto,
|
|
350
353
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
354
|
+
externalTxId: rioId,
|
|
351
355
|
note: notes,
|
|
352
356
|
});
|
|
353
357
|
return response.id;
|
|
354
358
|
});
|
|
355
359
|
}
|
|
356
|
-
transferFromExchange(crypto, sourceExchangeId, destinationVaultId, amountCrypto, notes) {
|
|
360
|
+
transferFromExchange(rioId, crypto, sourceExchangeId, destinationVaultId, amountCrypto, notes) {
|
|
357
361
|
return __awaiter(this, void 0, void 0, function* () {
|
|
358
362
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
359
363
|
throw new Error("Transfers from exchanges are disabled in sandbox mode.");
|
|
360
364
|
}
|
|
361
365
|
const response = yield this.fireblocks.createTransaction({
|
|
366
|
+
externalTxId: rioId,
|
|
362
367
|
assetId: crypto,
|
|
363
368
|
source: {
|
|
364
369
|
type: fireblocks_sdk_1.PeerType.EXCHANGE_ACCOUNT,
|