@@ -44,7 +44,8 @@ export class NamespaceMetadataTransaction extends Transaction {
4444 * @param scopedMetadataKey - Metadata key scoped to source, target and type.
4545 * @param targetNamespaceId - Target namespace identifier.
4646 * @param valueSizeDelta - Change in value size in bytes.
47- * @param value - Difference between the previous value and new value.
47+ * @param value - String value with UTF-8 encoding
48+ * Difference between the previous value and new value.
4849 * You can calculate value as xor(previous-value, new-value).
4950 * If there is no previous value, use directly the new value.
5051 * @param maxFee - (Optional) Max fee defined by the sender
@@ -55,7 +56,7 @@ export class NamespaceMetadataTransaction extends Transaction {
5556 scopedMetadataKey : UInt64 ,
5657 targetNamespaceId : NamespaceId ,
5758 valueSizeDelta : number ,
58- value : Uint8Array ,
59+ value : string ,
5960 networkType : NetworkType ,
6061 maxFee : UInt64 = new UInt64 ( [ 0 , 0 ] ) ) : NamespaceMetadataTransaction {
6162 return new NamespaceMetadataTransaction ( networkType ,
@@ -104,9 +105,10 @@ export class NamespaceMetadataTransaction extends Transaction {
104105 */
105106 public readonly valueSizeDelta : number ,
106107 /**
108+ * String value with UTF-8 encoding.
107109 * Difference between the previous value and new value.
108110 */
109- public readonly value : Uint8Array ,
111+ public readonly value : string ,
110112 signature ?: string ,
111113 signer ?: PublicAccount ,
112114 transactionInfo ?: TransactionInfo ) {
@@ -135,7 +137,7 @@ export class NamespaceMetadataTransaction extends Transaction {
135137 new UInt64 ( builder . getScopedMetadataKey ( ) ) ,
136138 new NamespaceId ( builder . getTargetNamespaceId ( ) . namespaceId ) ,
137139 builder . getValueSizeDelta ( ) ,
138- builder . getValue ( ) ,
140+ Convert . uint8ToUtf8 ( builder . getValue ( ) ) ,
139141 networkType ,
140142 isEmbedded ? new UInt64 ( [ 0 , 0 ] ) : new UInt64 ( ( builder as NamespaceMetadataTransactionBuilder ) . fee . amount ) ,
141143 ) ;
@@ -181,7 +183,7 @@ export class NamespaceMetadataTransaction extends Transaction {
181183 this . scopedMetadataKey . toDTO ( ) ,
182184 new NamespaceIdDto ( this . targetNamespaceId . id . toDTO ( ) ) ,
183185 this . valueSizeDelta ,
184- this . value ,
186+ Convert . utf8ToUint8 ( this . value ) ,
185187 ) ;
186188 return transactionBuilder . serialize ( ) ;
187189 }
@@ -199,7 +201,7 @@ export class NamespaceMetadataTransaction extends Transaction {
199201 this . scopedMetadataKey . toDTO ( ) ,
200202 new NamespaceIdDto ( this . targetNamespaceId . id . toDTO ( ) ) ,
201203 this . valueSizeDelta ,
202- this . value ,
204+ Convert . utf8ToUint8 ( this . value ) ,
203205 ) ;
204206 return transactionBuilder . serialize ( ) ;
205207 }
0 commit comments