Generate
idle
Use from Workbench
import { decodeBolt11Invoice, mintMacaroon } from "@boltwall/l402";function hexToBytes(hex: string): Uint8Array {const bytes = new Uint8Array(hex.length / 2);for (let i = 0; i < bytes.length; i++) {bytes[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);}return bytes;}const rootKey = hexToBytes("<64-char hex key>");const invoice = "";const paymentHash = invoice? decodeBolt11Invoice(invoice).paymentHash: crypto.getRandomValues(new Uint8Array(32));const identifier = {version: 0 as const,paymentHash,tokenId: crypto.getRandomValues(new Uint8Array(32)),};const macaroon = mintMacaroon({ rootKey, identifier });