fireblocks-sdk
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -5,2 +5,8 @@ ### Changelog | ||
#### [v2.2.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v2.1.0...v2.2.0) | ||
> 10 May 2022 | ||
- added convert exchange asset method [`#83`](https://github.com/fireblocks/fireblocks-sdk-js/pull/83) | ||
#### [v2.1.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v2.0.0...v2.1.0) | ||
@@ -11,2 +17,4 @@ | ||
- Bump minimist from 1.2.5 to 1.2.6 [`#91`](https://github.com/fireblocks/fireblocks-sdk-js/pull/91) | ||
- add fee payer endpoints [`#89`](https://github.com/fireblocks/fireblocks-sdk-js/pull/89) | ||
- Add gasPrice to response when it exists [`#86`](https://github.com/fireblocks/fireblocks-sdk-js/pull/86) | ||
@@ -13,0 +21,0 @@ ### [v2.0.0](https://github.com/fireblocks/fireblocks-sdk-js/compare/v1.14.0...v2.0.0) |
import { IAuthProvider } from "./iauth-provider"; | ||
import { VaultAccountResponse, CreateTransactionResponse, TransactionArguments, AssetResponse, ExchangeResponse, TransactionResponse, TransactionFilter, CancelTransactionResponse, WalletContainerResponse, DepositAddressResponse, GenerateAddressResponse, OperationSuccessResponse, NetworkConnectionResponse, FiatAccountResponse, CreateTransferTicketArgs, TransferTicketResponse, TermResponse, ExecuteTermArgs, CreateTransferTicketResponse, EstimateTransactionFeeResponse, EstimateFeeResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, GasStationInfo, MaxSpendableAmountResponse, VaultAccountsFilter, VaultBalancesFilter, ValidateAddressResponse, VaultAssetResponse, RequestOptions, AllocateFundsRequest, DeallocateFundsRequest, ResendWebhooksResponse, AssetTypeResponse, User, TransactionPageResponse, TransactionPageFilter, InternalWalletAsset, ExternalWalletAsset, OffExchangeEntityResponse, SetFeePayerConfiguration, FeePayerConfiguration, PagedVaultAccountsResponse, PagedVaultAccountsRequestFilters } from "./types"; | ||
import { AllocateFundsRequest, AssetResponse, AssetTypeResponse, CancelTransactionResponse, ConvertExchangeAssetResponse, CreateTransactionResponse, CreateTransferTicketArgs, CreateTransferTicketResponse, DeallocateFundsRequest, DepositAddressResponse, EstimateFeeResponse, EstimateTransactionFeeResponse, ExchangeResponse, ExecuteTermArgs, ExternalWalletAsset, FiatAccountResponse, GasStationInfo, GenerateAddressResponse, InternalWalletAsset, MaxSpendableAmountResponse, NetworkConnectionResponse, OffExchangeEntityResponse, OperationSuccessResponse, PagedVaultAccountsRequestFilters, PagedVaultAccountsResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, RequestOptions, ResendWebhooksResponse, TermResponse, TransactionArguments, TransactionFilter, TransactionPageFilter, TransactionPageResponse, TransactionResponse, TransferTicketResponse, User, ValidateAddressResponse, VaultAccountResponse, VaultAccountsFilter, VaultAssetResponse, VaultBalancesFilter, WalletContainerResponse, SetFeePayerConfiguration, FeePayerConfiguration } from "./types"; | ||
export * from "./types"; | ||
@@ -117,2 +117,10 @@ export interface SDKOptions { | ||
/** | ||
* Convert an asset at an Exchange Account | ||
* @param exchangeAccountId The exchange account ID | ||
* @param srcAsset The source asset to convert from | ||
* @param destAsset The destination asset to convert to | ||
* @param amount The amount to convert | ||
*/ | ||
convertExchangeAsset(exchangeAccountId: string, srcAsset: string, destAsset: string, amount: number, requestOptions?: RequestOptions): Promise<ConvertExchangeAssetResponse>; | ||
/** | ||
* Transfer from a main exchange account to a subaccount | ||
@@ -119,0 +127,0 @@ * @param exchangeAccountId The exchange ID in Fireblocks |
@@ -28,4 +28,4 @@ "use strict"; | ||
const api_token_provider_1 = require("./api-token-provider"); | ||
const query_string_1 = __importDefault(require("query-string")); | ||
__exportStar(require("./types"), exports); | ||
const query_string_1 = __importDefault(require("query-string")); | ||
class FireblocksSDK { | ||
@@ -220,2 +220,16 @@ /** | ||
/** | ||
* Convert an asset at an Exchange Account | ||
* @param exchangeAccountId The exchange account ID | ||
* @param srcAsset The source asset to convert from | ||
* @param destAsset The destination asset to convert to | ||
* @param amount The amount to convert | ||
*/ | ||
convertExchangeAsset(exchangeAccountId, srcAsset, destAsset, amount, requestOptions) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.apiClient.issuePostRequest(`/v1/exchange_accounts/${exchangeAccountId}/convert`, { | ||
srcAsset, destAsset, amount | ||
}, requestOptions); | ||
}); | ||
} | ||
/** | ||
* Transfer from a main exchange account to a subaccount | ||
@@ -222,0 +236,0 @@ * @param exchangeAccountId The exchange ID in Fireblocks |
@@ -206,2 +206,5 @@ export interface VaultAccountResponse { | ||
} | ||
export interface ConvertExchangeAssetResponse { | ||
status: boolean; | ||
} | ||
export interface FiatAccountResponse { | ||
@@ -208,0 +211,0 @@ id: string; |
{ | ||
"name": "fireblocks-sdk", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "dist/fireblocks-sdk.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/fireblocks-sdk.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
137289
2437