Skip to content

Commit

Permalink
Merge pull request #16 from fireblocks/max-spendable-amount
Browse files Browse the repository at this point in the history
Add max spendable amount operation
  • Loading branch information
tomervil authored Jan 4, 2021
2 parents b08cd60 + 47809f9 commit a510d69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ExecuteTermArgs,
CreateTransferTicketResponse,
EstimateTransactionFeeResponse,
EstimateFeeResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, GasStationInfo
EstimateFeeResponse, PublicKeyInfoArgs, PublicKeyInfoForVaultAccountArgs, GasStationInfo, MaxSpendableAmountResponse
} from "./types";

export * from "./types";
Expand Down Expand Up @@ -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<MaxSpendableAmountResponse> {
let url = `/v1/vault/accounts/${vaultAccountId}/${assetId}/max_spendable_amount`;

if (manualSigning) {
url += `?manualSigning=${manualSigning}`;
}

return await this.apiClient.issueGetRequest(url);
}
}
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,7 @@ export interface PublicKeyResonse {
derivationPath: number[];
publicKey: string;
}

export interface MaxSpendableAmountResponse {
maxSpendableAmount: string;
}

0 comments on commit a510d69

Please sign in to comment.