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.

2 lines (1 loc) 3.53 kB
import{e as p,a as V,t as H}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as O,l as q,a as Q,b as W,s as l,d as a,r as e,t as _,c as A,g as r,m as B}from"../chunks/runtime.NVyxXVLy.js";import{s as g}from"../chunks/render.Dr_6zaa7.js";import{e as X,i as Y}from"../chunks/each.e-7RQQYD.js";import{s as D}from"../chunks/attributes.CqauuZ_8.js";import{s as Z}from"../chunks/class.DCW6ehBg.js";import{i as tt}from"../chunks/lifecycle.BF-zkLgr.js";import{p as et}from"../chunks/props.Btle0pBM.js";import{s as at,a as rt}from"../chunks/store.EL_7F1Fq.js";import{g as E}from"../chunks/entry.CYtqVooA.js";import{p as st}from"../chunks/stores.DmQQ1jkb.js";import{g as ot,t as lt}from"../chunks/util.8sVtkjoC.js";var nt=H('<tr><td class="py-2 px-4"> </td><td class="py-2 px-4 text-center"><a class="text-blue-500"> </a></td><td class="py-2 px-4 text-center"> </td><td class="py-2 px-4"><a class="text-blue-500"><span class="ml-2"> </span></a></td></tr>'),ct=H('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">Stake Key Registrations</h2> <div class="flex flex-wrap justify-between mb-2"><button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors">&lt; Previous</button> <button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors">Next &gt;</button></div> <div class="overflow-x-auto"><table class="w-full bg-white border border-gray-300"><thead><tr><th class="py-2 px-4 bg-gray-100 font-bold text-center">Address</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Block</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Time</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Transaction Hash</th></tr></thead><tbody></tbody></table></div> <div class="flex flex-wrap justify-between mt-2 mb-4"><button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors">&lt; Previous</button> <button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors">Next &gt;</button></div></section>');function kt(K,k){O(k,!1);const L=at(),P=()=>rt(st,"$page",L),b=B();let s=et(k,"data",12),c=B([]);const w=()=>{let t=parseInt(s().page)-1;t<=0&&(t=1),E(`/certificates/stakekey-registrations?page=${t}&count=${s().count}`)},$=()=>{let o=parseInt(s().page),t=o+1;s().registrations.length==0&&(t=o),E(`/certificates/stakekey-registrations?page=${t}&count=${s().count}`)};console.log(s()),s().registrations||s(s().registrations=[],!0),q(()=>P(),()=>{A(b,P().url.searchParams.get("page"))}),q(()=>(r(c),r(b)),()=>{r(c).forEach(o=>{let f=o.href.split("?").slice(1).join("?");new URLSearchParams(f).get("page")===r(b)?o.active=!0:o.active=!1}),A(c,r(c))}),Q(),tt();var d=ct(),u=l(a(d),2),U=a(u),z=l(U,2);e(u);var m=l(u,2),j=a(m),S=l(a(j));X(S,5,()=>s().registrations,Y,(o,t,f)=>{var n=nt();Z(n,f%2===0?"bg-gray-50":"bg-white");var i=a(n),F=a(i,!0);e(i);var x=l(i),v=a(x),G=a(v,!0);e(v),e(x);var y=l(x),J=a(y,!0);_(()=>g(J,ot(r(t).block_time))),e(y);var R=l(y),h=a(R),T=a(h),M=a(T,!0);_(()=>g(M,lt(r(t).tx_hash,30,"..."))),e(T),e(h),e(R),e(n),_(()=>{g(F,r(t).address),D(v,"href",`/blocks/${r(t).block_number??""}`),g(G,r(t).block_number),D(h,"href",`/transactions/${r(t).tx_hash??""}`)}),V(o,n)}),e(S),e(j),e(m);var I=l(m,2),N=a(I),C=l(N,2);e(I),e(d),p("click",U,w),p("click",z,$),p("click",N,w),p("click",C,$),V(K,d),W()}export{kt as component};