Events payload encoding

I’m trying to encode multiple numeric values into one event payload field. Is there any regular/accustomed way used through the community to encode such values?

3 Likes

It is a very generic question, is there a background story? What have you tried already? Why aren’t you happy with that solution?

If you only have a handful of values I’d probably do something simple like Int.to_str and then separate them with, say, a comma, or slightly more organized by putting them in a JSON array - if you instead have thousands of values you could try to do something more compressed.

3 Likes

I was trying to encode around 6 int non-indexed event fields.I used already, as you said, Int.to_str with ‘|’ separator. I was wondering though if people are used to view such event’s payload in a certain format, like: json, msgpack or something more specific to the blockchain. It seems isn’t the case. Thanks for answering.

3 Likes