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