Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add functionality for activate vault asset #62

Merged
merged 2 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -431,10 +431,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