From 3beed06848610c82ddd0c22efc9762cbba8380d7 Mon Sep 17 00:00:00 2001 From: Tomer Vilensky Date: Thu, 14 May 2020 15:14:05 +0300 Subject: [PATCH] Fix address description editing --- src/fireblocks-sdk.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index 83baa245..dded072e 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -96,7 +96,14 @@ export class FireblocksSDK { * @param description The description to set */ public async setAddressDescription(vaultAccountId: string, assetId: string, address: string, tag?: string, description?: string): Promise { - return await this.apiClient.issuePutRequest(`/v1/vault/accounts/${vaultAccountId}/${assetId}/addresses/${address}:${tag || ""}`, { description: description || "" }); + let addressId = address; + if (tag && tag.length > 0) { + addressId = `${address}:${tag}`; + } + + return await this.apiClient.issuePutRequest( + `/v1/vault/accounts/${vaultAccountId}/${assetId}/addresses/${addressId}`, + { description: description || "" }); } /**