diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index d5964266..63489049 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -23,7 +23,7 @@ import { ExecuteTermArgs, CreateTransferTicketResponse, EstimateTransactionFeeResponse, - EstimateFeeResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, GasStationInfo + EstimateFeeResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, GasStationInfo, MaxSpendableAmountResponse } from "./types"; export * from "./types"; @@ -672,4 +672,17 @@ export class FireblocksSDK { return await this.apiClient.issuePostRequest(url, body); } + + /** + * Get max spendable amount per asset and vault. + */ + public async getMaxSpendableAmount(vaultAccountId: string, assetId: string, manualSigning?: Boolean): Promise { + let url = `/v1/vault/accounts/${vaultAccountId}/${assetId}/max_spendable_amount`; + + if (manualSigning) { + url += `?manualSigning=${manualSigning}`; + } + + return await this.apiClient.issueGetRequest(url); + } } diff --git a/src/types.ts b/src/types.ts index fdcc9750..bb255101 100644 --- a/src/types.ts +++ b/src/types.ts @@ -412,3 +412,7 @@ export interface PublicKeyResonse { derivationPath: number[]; publicKey: string; } + +export interface MaxSpendableAmountResponse { + maxSpendableAmount: string; +} \ No newline at end of file