@riocrypto/common-server 1.0.945 → 1.0.947

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,8 +9,9 @@ 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>;
13
- getDepositAddress(crypto: Crypto): Promise<string>;
12
+ getTransactions(vaultId: string, crypto: Crypto, nextPage?: string): Promise<any>;
13
+ getDepositAddress(vaultId: string, crypto: Crypto): Promise<string>;
14
+ createVault(userId: string): Promise<string>;
14
15
  }
15
16
  export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
16
17
  export {};
@@ -108,22 +108,29 @@ 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
  });
120
121
  }
121
- getDepositAddress(crypto) {
122
+ getDepositAddress(vaultId, crypto) {
122
123
  return __awaiter(this, void 0, void 0, function* () {
123
- let addresses = yield this.fireblocks.getDepositAddresses("2", crypto);
124
+ let addresses = yield this.fireblocks.getDepositAddresses(vaultId, crypto);
124
125
  return addresses[0].address;
125
126
  });
126
127
  }
128
+ createVault(userId) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ const vault = yield this.fireblocks.createVaultAccount(`Rio user ${userId}`);
131
+ return vault.id;
132
+ });
133
+ }
127
134
  }
128
135
  const buildFireblocksClient = () => __awaiter(void 0, void 0, void 0, function* () {
129
136
  const FIREBLOCKS_PRIVATE_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("FIREBLOCKS_PRIVATE_KEY");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.945",
3
+ "version": "1.0.947",
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.813",
27
+ "@riocrypto/common": "^1.0.814",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",