I am trying to concatenate two strings and then convert to bytes using pack(). However this prepends some bytes to the front of the result.
var str1 : string = "TEST INDEX #";
var str2 = concat(str1, nat_to_string(index));
var str3 = pack(str2);
The result is 0x05010000000d5445535420494e444558202331. It appears 05010000000d is being prepended.
Is there a way to remove those bytes? Or another builtin function that I have missed?
I tried using slice to remove them (an idea from another post that had the same issue with smartpy).
var byt2 = slice(str3, 0, 6);
However, when adding the result from slice into a var of type map<string, bytes> I get the following error:
Archetype compiler: File "indexer.arl", line 62, characters 1154-1158: Incompatible types: found 'option' but expected 'bytes'
I'm unsure where my vars are getting converted to option.
From what i understand, the prepended bytes contain length information so the slice method might not be very scalable.
I would like to store the result in the token_metadata storage so the prepended bytes are not playing nicely with BCD or tzkt.
Thank you