@riocrypto/common-server 1.0.1108 → 1.0.1110
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.
|
@@ -14,6 +14,7 @@ declare class FireblocksClient {
|
|
|
14
14
|
createVault(userId: string, name: string, type: "transactional" | "managed"): Promise<string>;
|
|
15
15
|
createWallet(vaultId: string, crypto: Crypto): Promise<string>;
|
|
16
16
|
internalTransfer(crypto: Crypto, sourceVaultId: string, destinationVaultId: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
17
|
+
externalTransfer(crypto: Crypto, sourceVaultId: string, destinationAddress: string, amountCrypto: number, notes?: string): Promise<string>;
|
|
17
18
|
sweep(vaultId: string, assetId: string, amount: number): Promise<void>;
|
|
18
19
|
}
|
|
19
20
|
export declare const buildFireblocksClient: () => Promise<FireblocksClient>;
|
|
@@ -157,6 +157,27 @@ class FireblocksClient {
|
|
|
157
157
|
return response.id;
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
+
externalTransfer(crypto, sourceVaultId, destinationAddress, amountCrypto, notes) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const response = yield this.fireblocks.createTransaction({
|
|
163
|
+
assetId: crypto,
|
|
164
|
+
source: {
|
|
165
|
+
type: fireblocks_sdk_1.PeerType.VAULT_ACCOUNT,
|
|
166
|
+
id: sourceVaultId,
|
|
167
|
+
},
|
|
168
|
+
destination: {
|
|
169
|
+
type: fireblocks_sdk_1.PeerType.ONE_TIME_ADDRESS,
|
|
170
|
+
oneTimeAddress: {
|
|
171
|
+
address: destinationAddress,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
amount: amountCrypto,
|
|
175
|
+
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
176
|
+
note: notes,
|
|
177
|
+
});
|
|
178
|
+
return response.id;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
160
181
|
sweep(vaultId, assetId, amount) {
|
|
161
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
183
|
yield this.fireblocks.createTransaction({
|
|
@@ -6,7 +6,6 @@ interface FireblocksVaultAttrs {
|
|
|
6
6
|
depositAddresses?: {
|
|
7
7
|
[key: string]: string;
|
|
8
8
|
};
|
|
9
|
-
firstUSDCSolanaOrderId?: string;
|
|
10
9
|
}
|
|
11
10
|
interface FireblocksVaultDoc extends mongoose.Document {
|
|
12
11
|
userId: string;
|
|
@@ -15,7 +14,6 @@ interface FireblocksVaultDoc extends mongoose.Document {
|
|
|
15
14
|
depositAddresses?: {
|
|
16
15
|
[key: string]: string;
|
|
17
16
|
};
|
|
18
|
-
firstUSDCSolanaOrderId?: string;
|
|
19
17
|
}
|
|
20
18
|
interface FireblocksVaultModel extends mongoose.Model<FireblocksVaultDoc> {
|
|
21
19
|
build(attrs: FireblocksVaultAttrs): FireblocksVaultDoc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1110",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.951",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^0.27.2",
|
|
32
32
|
"ccxt": "^3.0.30",
|