Skip to content

Commit

Permalink
Support for hidden accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomer Vilensky committed Apr 18, 2020
1 parent e8c4b91 commit 71538c7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,33 @@ export class FireblocksSDK {
/**
* Creates a new vault account
* @param name A name for the new vault account
* @param hiddenOnUI If true, the created account and all related transactions will not be shown on Fireblocks console
*/
public async createVaultAccount(name: string): Promise<VaultAccountResponse> {
public async createVaultAccount(name: string, hiddenOnUI?: boolean): Promise<VaultAccountResponse> {
const body = {
name: name
name: name,
hiddenOnUI: hiddenOnUI || false
};

return await this.apiClient.issuePostRequest("/v1/vault/accounts", body);
}

/**
* Hides a vault account in Fireblocks console
* @param vaultAccountId The vault account ID
*/
public async hideVaultAccount(vaultAccountId: string): Promise<VaultAccountResponse> {
return await this.apiClient.issuePostRequest(`/v1/vault/accounts/${vaultAccountId}/hide`, {});
}

/**
* Reveals a hidden vault account in Fireblocks console
* @param vaultAccountId The vault account ID
*/
public async unhideVaultAccount(vaultAccountId: string): Promise<VaultAccountResponse> {
return await this.apiClient.issuePostRequest(`/v1/vault/accounts/${vaultAccountId}/unhide`, {});
}

/**
* Updates a vault account
* @param name A new name for the vault account
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface VaultAccountResponse {
id: string;
name: string;
hiddenOnUI: boolean;
assets: AssetResponse[];
}

Expand Down

0 comments on commit 71538c7

Please sign in to comment.