// deno-fmt-ignore-file // deno-lint-ignore-file // This code was bundled using `deno bundle` and it's not recommended to edit it manually async function fetchOffchain(url) { if (!url) { return null; } try { const response = await fetch(url); const body = await response.json(); return { status: response.status, url, body }; } catch (err) { return { url, error: err.toString() }; } } async function mapEvent(record) { if (!record.pool_registration) { return; } const offchain = await fetchOffchain(record.pool_registration.pool_metadata); return { tx: record.context.tx_hash, onchain: record.pool_registration, offchain }; } export { mapEvent as mapEvent };