UNPKG

@bloxbean/yaci-viewer

Version:

A Cardano blockchain data viewer for developers. It works with the Yaci-Store backend, supporting both a local devnet and public networks.

44 lines (39 loc) 1.86 kB
import { p as public_env } from './shared-server-i79vVjEm.js'; const load = async ({ params }) => { let splits = params.actionid.split("_"); let index = parseInt(splits[1]); const INDEXER_BASE_URL = public_env.PUBLIC_INDEXER_BASE_URL; const blockApiUrl = `${INDEXER_BASE_URL}/governance/proposals/${splits[0]}`; const res = await fetch(blockApiUrl); const govActions = await res.json(); if (res.ok) { let filterActionArr = govActions.filter((govAction) => govAction.index === index); if (filterActionArr.length === 0) { return { status: 404, body: { error: "Can not fetch Gov Action Proposal." } }; } else { return { govAction: filterActionArr[0] }; } } return { status: 404, body: { error: "Can not fetch block." } }; }; var _page_server_ts = /*#__PURE__*/Object.freeze({ __proto__: null, load: load }); const index = 15; let component_cache; const component = async () => component_cache ??= (await import('./_page.svelte-CK1Uo9rb.js')).default; const server_id = "src/routes/governance/govactions/[actionid]/+page.server.ts"; const imports = ["_app/immutable/nodes/15.BFTPDoLz.js","_app/immutable/chunks/disclose-version.BTC8Bk4r.js","_app/immutable/chunks/runtime.NVyxXVLy.js","_app/immutable/chunks/legacy.DKpsC3nd.js","_app/immutable/chunks/render.Dr_6zaa7.js","_app/immutable/chunks/attributes.CqauuZ_8.js","_app/immutable/chunks/lifecycle.BF-zkLgr.js","_app/immutable/chunks/props.Btle0pBM.js","_app/immutable/chunks/store.EL_7F1Fq.js","_app/immutable/chunks/moment.C5S46NFB.js","_app/immutable/chunks/JsonContent.ClmH9GuZ.js","_app/immutable/chunks/ada_util.zWFYliEg.js"]; const stylesheets = []; const fonts = []; export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets }; //# sourceMappingURL=15-BVH_afIM.js.map