@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.
45 lines (40 loc) • 2.09 kB
JavaScript
import { p as public_env } from './shared-server-i79vVjEm.js';
const load = async ({ params }) => {
const INDEXER_BASE_URL = public_env.PUBLIC_INDEXER_BASE_URL;
const txApiUrl = `${INDEXER_BASE_URL}/txs/${params.id}`;
const scriptApiUrl = `${INDEXER_BASE_URL}/txs/${params.id}/scripts`;
const metadataApiUrl = `${INDEXER_BASE_URL}/txs/${params.id}/metadata`;
const res = await fetch(txApiUrl);
const scriptRes = await fetch(scriptApiUrl);
const metadataRes = await fetch(metadataApiUrl);
const tx = await res.json();
const scripts = await scriptRes.json();
const metadata = await metadataRes.json();
console.log(tx);
console.log(scripts);
console.log(metadata);
if (res.ok) {
return {
"tx": tx,
"contracts": scripts,
"metadata": metadata
};
}
return {
status: 404,
body: { error: "Can not fetch transaction." }
};
};
var _page_server_ts = /*#__PURE__*/Object.freeze({
__proto__: null,
load: load
});
const index = 18;
let component_cache;
const component = async () => component_cache ??= (await import('./_page.svelte-CaoYKKyU.js')).default;
const server_id = "src/routes/transactions/[id]/+page.server.ts";
const imports = ["_app/immutable/nodes/18.8Ryenz77.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/if.DkuB8BPo.js","_app/immutable/chunks/each.e-7RQQYD.js","_app/immutable/chunks/attributes.CqauuZ_8.js","_app/immutable/chunks/class.DCW6ehBg.js","_app/immutable/chunks/lifecycle.BF-zkLgr.js","_app/immutable/chunks/props.Btle0pBM.js","_app/immutable/chunks/store.EL_7F1Fq.js","_app/immutable/chunks/ada_util.zWFYliEg.js","_app/immutable/chunks/index-client.TDQqURXd.js","_app/immutable/chunks/JsonContent.ClmH9GuZ.js","_app/immutable/chunks/XIcon.j6LjJLAc.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
//# sourceMappingURL=18-1Q-gWmnz.js.map