@riocrypto/common-server 1.0.1057 → 1.0.1059

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
+ internalTransfer(crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number): Promise<string>;
16
17
  sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
17
18
  }
18
19
  export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
@@ -138,6 +138,24 @@ class FireblocksClient {
138
138
  return wallet.address;
139
139
  });
140
140
  }
141
+ internalTransfer(crypto, sourceVaultId, destinationVaultId, amountCrypto) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const response = yield this.fireblocks.createTransaction({
144
+ assetId: crypto,
145
+ source: {
146
+ type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
147
+ id: sourceVaultId,
148
+ },
149
+ destination: {
150
+ type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
151
+ id: destinationVaultId,
152
+ },
153
+ amount: amountCrypto,
154
+ operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
155
+ });
156
+ return response.id;
157
+ });
158
+ }
141
159
  sweep(vaultId, assetId, amount) {
142
160
  return __awaiter(this, void 0, void 0, function* () {
143
161
  yield this.fireblocks.createTransaction({
@@ -5,6 +5,7 @@ interface FireblocksVaultAttrs {
5
5
  depositAddresses?: {
6
6
  [key: string]: string;
7
7
  };
8
+ firstUSDCSolanaOrderId?: string;
8
9
  }
9
10
  interface FireblocksVaultDoc extends mongoose.Document {
10
11
  userId: string;
@@ -12,6 +13,7 @@ interface FireblocksVaultDoc extends mongoose.Document {
12
13
  depositAddresses?: {
13
14
  [key: string]: string;
14
15
  };
16
+ firstUSDCSolanaOrderId?: string;
15
17
  }
16
18
  interface FireblocksVaultModel extends mongoose.Model<FireblocksVaultDoc> {
17
19
  build(attrs: FireblocksVaultAttrs): FireblocksVaultDoc;
@@ -18,6 +18,9 @@ const buildFireblocksVault = (mongoose) => {
18
18
  depositAddresses: {
19
19
  type: Object,
20
20
  },
21
+ firstUSDCSolanaOrderId: {
22
+ type: Object,
23
+ },
21
24
  }, {
22
25
  toJSON: {
23
26
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1057",
3
+ "version": "1.0.1059",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",