@riocrypto/common-server 1.0.1037 → 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 {};
@@ -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");
@@ -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;
@@ -100,6 +100,9 @@ const buildQuote = (mongoose) => {
100
100
  markup: {
101
101
  type: Number,
102
102
  },
103
+ quoteInCrypto: {
104
+ type: Boolean,
105
+ },
103
106
  }, {
104
107
  toJSON: {
105
108
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1037",
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.891",
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",