Skip to content

Commit

Permalink
Merge pull request #62 from fireblocks/activateVaultAsset
Browse files Browse the repository at this point in the history
add functionality for activate vault asset
  • Loading branch information
yarinvak authored Dec 2, 2021
2 parents b92ff1f + 4286d7d commit 143d35e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
VaultAccountsFilter,
VaultBalancesFilter,
ValidateAddressResponse,
CreateVaultAssetResponse,
VaultAssetResponse,
RequestOptions,
AllocateFundsRequest,
DeallocateFundsRequest,
Expand Down Expand Up @@ -437,10 +437,19 @@ export class FireblocksSDK {
* @param vaultAccountId The vault account ID
* @param assetId The asset to add
*/
public async createVaultAsset(vaultAccountId: string, assetId: string): Promise<CreateVaultAssetResponse> {
public async createVaultAsset(vaultAccountId: string, assetId: string): Promise<VaultAssetResponse> {
return await this.apiClient.issuePostRequest(`/v1/vault/accounts/${vaultAccountId}/${assetId}`, {});
}

/**
* Retry to create a vault asset for a vault asset that failed
* @param vaultAccountId The vault account ID
* @param assetId The asset to add
*/
public async activateVaultAsset(vaultAccountId: string, assetId: string): Promise<VaultAssetResponse> {
return await this.apiClient.issuePostRequest(`/v1/vault/accounts/${vaultAccountId}/${assetId}/activate`, {});
}

/**
* Creates a new external wallet
* @param name A name for the new external wallet
Expand Down
10 changes: 9 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,21 @@ export interface UnfreezeTransactionResponse {
success: boolean;
}

export interface CreateVaultAssetResponse {
export interface VaultAssetResponse {
id: string;
address: string;
legacyAddress: string;
enterpriseAddress?: string;
tag: string;
eosAccountName: string;
status?: VaultAssetActivationStatus;
activationTxId?: string;
}

export enum VaultAssetActivationStatus {
PENDING_ACTIVATION = "PENDING_ACTIVATION",
ACTIVATION_FAILED = "ACTIVATION_FAILED",
READY = "READY"
}

export interface WalletContainerResponse<WalletAssetType> {
Expand Down

0 comments on commit 143d35e

Please sign in to comment.