@riocrypto/common-server 1.0.1612 → 1.0.1614

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.
@@ -20,6 +20,7 @@ declare class FireblocksClient {
20
20
  internalTransfer(crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
21
21
  externalTransfer(crypto: Crypto, sourceVaultId: string, destinationAddress: string, amountCrypto: number, notes?: string): Promise<string>;
22
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>;
23
24
  transferFromExchange(crypto: Crypto, sourceExchangeId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
24
25
  sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
25
26
  }
@@ -317,6 +317,28 @@ class FireblocksClient {
317
317
  return response.id;
318
318
  });
319
319
  }
320
+ transferFromExchangeToExchange(crypto, sourceExchangeId, destinationExchangeId, amountCrypto, notes) {
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
323
+ throw new Error("Transfers from exchanges to exchanges are disabled in sandbox mode.");
324
+ }
325
+ const response = yield this.fireblocks.createTransaction({
326
+ assetId: crypto,
327
+ source: {
328
+ type: fireblocks_sdk_1.PeerType.EXCHANGE_ACCOUNT,
329
+ id: sourceExchangeId,
330
+ },
331
+ destination: {
332
+ type: fireblocks_sdk_1.PeerType.EXCHANGE_ACCOUNT,
333
+ id: destinationExchangeId,
334
+ },
335
+ amount: amountCrypto,
336
+ operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
337
+ note: notes,
338
+ });
339
+ return response.id;
340
+ });
341
+ }
320
342
  transferFromExchange(crypto, sourceExchangeId, destinationVaultId, amountCrypto, notes) {
321
343
  return __awaiter(this, void 0, void 0, function* () {
322
344
  if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
@@ -6,7 +6,8 @@ interface InternalSwapAttrs {
6
6
  originCrypto: Crypto;
7
7
  destinationCrypto: Crypto;
8
8
  amount: number;
9
- fee: number;
9
+ originFee: number;
10
+ providerFee: number;
10
11
  provider: SwapProvider;
11
12
  origin: SwapOrigin;
12
13
  status: "created" | "processing" | "firstLegComplete" | "complete" | "failed";
@@ -17,7 +18,8 @@ interface InternalSwapDoc extends Document {
17
18
  originCrypto: Crypto;
18
19
  destinationCrypto: Crypto;
19
20
  amount: number;
20
- fee: number;
21
+ originFee: number;
22
+ providerFee: number;
21
23
  provider: SwapProvider;
22
24
  origin: SwapOrigin;
23
25
  status: "created" | "processing" | "firstLegComplete" | "complete" | "failed";
@@ -27,7 +27,10 @@ const buildInternalSwap = (mongoose) => {
27
27
  type: Number,
28
28
  required: true,
29
29
  },
30
- fee: {
30
+ originFee: {
31
+ type: Number,
32
+ },
33
+ providerFee: {
31
34
  type: Number,
32
35
  },
33
36
  provider: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1612",
3
+ "version": "1.0.1614",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
30
  "@hyperdx/node-opentelemetry": "^0.4.2",
31
- "@riocrypto/common": "^1.0.1451",
31
+ "@riocrypto/common": "^1.0.1452",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.6.0",
34
34
  "ccxt": "^3.0.30",