Skip to content

Commit 60b6571

Browse files
committed
fix - return event kind param as an integer instead of a string when a NIP19 identifier is being decoded
1 parent 7ade363 commit 60b6571

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Nip19/Nip19Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function decode(string $bech32string): array
152152
foreach ($item['value'] as $byte) {
153153
$intValue = ($intValue << 8) | $byte;
154154
}
155-
$kind = (string) $intValue;
155+
$kind = $intValue;
156156
$tlvData['kind'] = $kind;
157157
}
158158
}
@@ -307,7 +307,7 @@ public function encodeAddr(Event $event, string $dTag, int $kind, string $author
307307
$dTag,
308308
$author !== '' ? $author : $event->getPublicKey(),
309309
$relays,
310-
$kind ?? $event->getKind(),
310+
$kind ?: $event->getKind(),
311311
);
312312
$bytes_array = $this->convertAddressableEventToBytes($event, $metadata);
313313
$checksum = new Checksum($prefix, Bits::encode($bytes_array));

0 commit comments

Comments
 (0)