1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { hexToUtf8 } from "https://esm.town/v/ryanwaits/hexToUtf8";
export function snsFromInscription(inscription: any) {
if (inscription.inscription_number < 0)
return;
if (
inscription.content_type.includes("text/plain") ||
inscription.content_type.includes("application/json")
)
return;
const decodedContent = hexToUtf8(
inscription.content_bytes,
);
return JSON.parse(decodedContent);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023