fix optional rune divisibility bug

This commit is contained in:
Mononaut 2024-10-08 02:40:14 +00:00
parent 65f080d526
commit 15b3c88a1f
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -201,9 +201,9 @@ function messageToRunestone(message: Message): Runestone {
if (flags & Flag.ETCHING) {
const hasTerms = (flags & Flag.TERMS) > 0n;
const isTurbo = (flags & Flag.TURBO) > 0n;
const name = parseRuneName(message.fields[Tag.Rune][0]);
const name = parseRuneName(message.fields[Tag.Rune]?.[0] ?? 0n);
etching = {
divisibility: Number(message.fields[Tag.Divisibility][0]),
divisibility: Number(message.fields[Tag.Divisibility]?.[0] ?? 0n),
premine: message.fields[Tag.Premine]?.[0],
symbol: message.fields[Tag.Symbol]?.[0] ? String.fromCodePoint(Number(message.fields[Tag.Symbol][0])) : '¤',
terms: hasTerms ? {