Transaction

d013cd6885f9c26e3f1957bce165f5b57f233ccf43607ddf8ee4aa00a0aa5e7c
Timestamp (utc)
2026-02-14 00:27:46
Fee Paid
0.00003079 BSV
(
0.00003079 BSV
-
0.00000000 BSV
)
Fee Rate
100.1 sat/KB
Version
1
Confirmations
2,924
Size Stats
30,753 B

1 Output

Total Output:
0.00000000 BSV
  • j"19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAutM3w"use strict";(self.webpackChunkfrithchain_client=self.webpackChunkfrithchain_client||[]).push([[595],{595(e,t,r){r.r(t),r.d(t,{default:()=>w});var n=r(379),a=r(43),s=r(216),i=r(475),o=r(722),c=r(614),l=r(272),d=r(778),m=r(911);async function h(){var e;const t=await m.$q();return{isInstalled:"none"!==t.provider,isConnected:t.isConnected,address:t.address,pubKey:t.pubKey,balance:(null===(e=t.balance)||void 0===e?void 0:e.satoshis)||null}}async function y(){if((await m.$q()).isConnected)return!0;const e=await m.We();if(e.yours)return await m.EK(),!0;if(e.native)throw new Error("Native wallet is locked. Please unlock it in Settings.");throw new Error("No wallet available. Please install Yours Wallet or set up the Native Wallet in Settings.")}async function p(){var e,t;const r=await m.$q();return{satoshis:(null===(e=r.balance)||void 0===e?void 0:e.satoshis)||0,bsv:(null===(t=r.balance)||void 0===t?void 0:t.bsv)||0}}async function x(e){try{await y();const{satoshis:t}=await p(),r=e.amount+200;if(t<r)return{success:!1,error:"Insufficient balance. Need ".concat(r," sats, have ").concat(t," sats")};console.log("\ud83d\udcb8 Sending ".concat(e.amount," satoshis to ").concat(e.address)),console.log(" Provider: ".concat(m._s()));const n=await m.Fd(e.address,e.amount,e.label);return n.success?(console.log("\u2705 Payment sent! TxId: ".concat(n.txId)),{success:!0,txId:n.txId,amount:e.amount}):(console.error("Payment failed:",n.error),{success:!1,error:n.error||"Payment failed"})}catch(t){return console.error("Payment error:",t),{success:!1,error:t.message||"Payment failed"}}}const u="https://api.whatsonchain.com/v1/bsv/".concat("mainnet"===({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_JUNGLEBUS_SUBSCRIPTION_ID:"f65cc0300e471db03641cc2b1e82bb7cb5cdc280e3681b83c0cfaa305ce1ba01"}.REACT_APP_NETWORK||"mainnet")?"main":"test");async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e3;const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{return await fetch(e,{signal:r.signal,headers:{"User-Agent":"FrithChain-Client/1.0"}})}finally{clearTimeout(n)}}async function f(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a={paymentReceived:!1,paymentAmount:0,paymentTxId:null,paymentConfirmations:0,contractDeployed:!1,contractTxId:null,contractBalance:0,contractSpent:!1,contractSpentByTxId:null,isEscrowActive:!1,isReleased:!1,isRefunded:!1,verifiedAt:(new Date).toISOString(),blockchainSource:"whatsonchain"};try{const r=await g("".concat(u,"/address/").concat(e,"/unspent"));if(r.ok){const e=await r.json();var s;if(Array.isArray(e)&&e.length>0)if(a.paymentAmount=e.reduce((e,t)=>e+t.value,0),a.paymentReceived=a.paymentAmount>=t,a.paymentTxId=(null===(s=e[0])||void 0===s?void 0:s.tx_hash)||null,a.paymentTxId)try{const e=await g("".concat(u,"/tx/").concat(a.paymentTxId));if(e.ok){const t=await e.json();a.paymentConfirmations=t.confirmations||0}}catch(o){}}if(!a.paymentReceived){const t=await g("".concat(u,"/address/").concat(e,"/history"));if(t.ok){const e=await t.json();var i;if(Array.isArray(e)&&e.length>0)a.paymentReceived=!0,a.paymentTxId=(null===(i=e[0])||void 0===i?void 0:i.tx_hash)||null}}}catch(c){console.error("[OnChainState] Error checking payment address:",c)}if(r){a.contractTxId=r,a.contractDeployed=!0;try{const e=await g("".concat(u,"/tx/").concat(r,"/").concat(n,"/spent"));if(e.ok){const t=await e.json();a.contractSpent=!0,a.contractSpentByTxId=(null===t||void 0===t?void 0:t.txid)||null,a.contractBalance=0,a.isReleased=!0,a.isEscrowActive=!1}else if(404===e.status){a.contractSpent=!1,a.isEscrowActive=!0;try{const e=await g("".concat(u,"/tx/").concat(r));if(e.ok){const t=await e.json();t.vout&&t.vout[n]&&(a.contractBalance=Math.round(1e8*t.vout[n].value))}}catch(l){}}}catch(c){console.error("[OnChainState] Error checking contract state:",c)}}return a}async function v(e){const t=[];try{const r=await f(e.paymentAddress,e.amount,e.contractTxId,e.contractOutputIndex||0);"awaiting_payment"===e.status&&r.paymentReceived&&t.push({field:"paymentReceived",serverValue:!1,chainValue:!0,severity:"critical",message:"Server shows awaiting payment, but blockchain shows payment received!"}),"awaiting_payment"===e.status||r.paymentReceived||r.contractDeployed||t.push({field:"paymentReceived",serverValue:!0,chainValue:!1,severity:"warning",message:"Server shows payment received, but blockchain shows no payment"}),e.contractTxId&&!r.contractDeployed&&t.push({field:"contractDeployed",serverValue:!0,chainValue:!1,severity:"critical",message:"Server shows contract deployed, but transaction not found on blockchain"}),"funds_released"===e.status&&r.contractDeployed&&!r.isReleased&&t.push({field:"isReleased",serverValue:!0,chainValue:!1,severity:"critical",message:"Server shows funds released, but contract UTXO is still unspent!"}),"funds_released"!==e.status&&r.isReleased&&t.push({field:"isReleased",serverValue:!1,chainValue:!0,severity:"warning",message:"Blockchain shows funds released, but server status not updated"});let n="verified";return t.some(e=>"critical"===e.severity)?n="mismatch":t.some(e=>"warning"===e.severity)&&(n="partial"),{chainState:r,discrepancies:t,trustLevel:n}}catch(r){return console.error("[OnChainState] Error reconciling state:",r),{chainState:{paymentReceived:!1,paymentAmount:0,paymentTxId:null,paymentConfirmations:0,contractDeployed:!1,contractTxId:null,contractBalance:0,contractSpent:!1,contractSpentByTxId:null,isEscrowActive:!1,isReleased:!1,isRefunded:!1,verifiedAt:(new Date).toISOString(),blockchainSource:"whatsonchain"},discrepancies:[{field:"verification",serverValue:"unknown",chainValue:"error",severity:"critical",message:"Failed to verify on-chain state: ".concat(r)}],trustLevel:"error"}}}var b=r(579);const j=e=>{if(!e.startsWith("b://"))return{txId:e,outputIndex:0,dataIndex:3};const t=e.replace("b://",""),r=t.match(/^([a-f0-9]+)\.out\.(\d+)\.(\d+)$/i);return r?{txId:r[1],outputIndex:parseInt(r[2]),dataIndex:parseInt(r[3])}:{txId:t,outputIndex:0,dataIndex:3}},S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.startsWith("b://"))return e;const{txId:r,outputIndex:n,dataIndex:a}=j(e),s=["https://bico.media/".concat(r),"https://www.bitcoinfiles.org/t/".concat(r),"https://x.bitfs.network/".concat(r,".out.").concat(n,".").concat(a)];return s[t%s.length]},w=()=>{var e,t;const{id:r}=(0,s.g)(),{getAuthHeaders:m}=(0,l.A)(),[y,p]=(0,a.useState)(null),[u,g]=(0,a.useState)(null),[f,w]=(0,a.useState)(null),[k,T]=(0,a.useState)(!1),[I,C]=(0,a.useState)(!0),[A,B]=(0,a.useState)(null),[R,E]=(0,a.useState)(!1),[z,N]=(0,a.useState)(null),[W,D]=(0,a.useState)(!1),[_,P]=(0,a.useState)(null),[V,L]=(0,a.useState)(null),[O,F]=(0,a.useState)([]),[U,H]=(0,a.useState)("verified"),[M,K]=(0,a.useState)(!1),X=(0,a.useCallback)(async()=>{try{const e=await o.A.get("/api/listings/".concat(r),{headers:m()});p(e.data.listing),B(null)}catch(n){var e,t;B((null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Failed to load listing")}finally{C(!1)}},[r,m]),q=(0,a.useCallback)(async()=>{if(null!==y&&void 0!==y&&y.paymentAddress)try{const e=await(0,d.jK)(y.paymentAddress);g(e),P(new Date)}catch(e){console.error("Failed to fetch balance:",e)}},[null===y||void 0===y?void 0:y.paymentAddress]),Y=(0,a.useCallback)(async()=>{if(null!==y&&void 0!==y&&y.contractTxId){T(!0);try{const e=await(0,d.sg)(y.contractTxId,y.contractOutputIndex||0);w(e)}catch(e){console.error("Failed to fetch contract state:",e)}finally{T(!1)}}},[null===y||void 0===y?void 0:y.contractTxId,null===y||void 0===y?void 0:y.contractOutputIndex]),$=async()=>{if(y){D(!0);try{const e=await o.A.post("/api/listings/".concat(r,"/check-payment"),{},{headers:m()});"paid"===e.data.status&&p(t=>t?(0,n.A)((0,n.A)({},t),{},{status:"paid",paymentTxId:e.data.txId}):null),await q()}catch(e){console.error("Error checking payment:",e)}finally{D(!1)}}};(0,a.useEffect)(()=>{X()},[X]),(0,a.useEffect)(()=>{if(null!==y&&void 0!==y&&y.paymentAddress){q();const e=setInterval(q,3e4);return()=>clearInterval(e)}},[null===y||void 0===y?void 0:y.paymentAddress,q]),(0,a.useEffect)(()=>{if(null!==y&&void 0!==y&&y.contractTxId){Y();const e=setInterval(Y,6e4);return()=>clearInterval(e)}},[null===y||void 0===y?void 0:y.contractTxId,Y]);const Q=(0,a.useCallback)(async()=>{if(y){K(!0);try{const e=await v({status:y.status,paymentAddress:y.paymentAddress,amount:y.amount,paymentTxId:y.paymentTxId,contractTxId:y.contractTxId,contractOutputIndex:y.contractOutputIndex});L(e.chainState),F(e.discrepancies),H(e.trustLevel)}catch(e){console.error("On-chain verification failed:",e),H("error")}finally{K(!1)}}},[y]);if((0,a.useEffect)(()=>{y&&Q()},[y,Q]),I)return(0,b.jsx)("div",{className:"listing-detail-page fade-in",children:(0,b.jsx)("div",{className:"loading",children:"Loading listing details..."})});if(A||!y)return(0,b.jsx)("div",{className:"listing-detail-page fade-in",children:(0,b.jsxs)("div",{className:"card",children:[(0,b.jsx)("div",{className:"alert alert-danger",children:A||"Listing not found"}),(0,b.jsx)(i.N_,{to:"/dashboard",className:"btn btn-secondary",children:"Back to Dashboard"})]})});const G=(y.amount/1e8).toFixed(8),J=y.paymentAddress,Z=(e=>{switch(e){case"awaiting_payment":return{text:"Awaiting Payment",color:"#856404",bg:"#fff3cd"};case"payment_detected":return{text:"Payment Detected - Deploying Contract",color:"#0c5460",bg:"#d1ecf1"};case"contract_deployed":return{text:"Contract Deployed - Awaiting Delivery",color:"#155724",bg:"#d4edda"};case"paid":return{text:"Paid - Awaiting Delivery",color:"#0c5460",bg:"#d1ecf1"};case"delivered":return{text:"Delivered",color:"#155724",bg:"#d4edda"};case"funds_released":case"released":return{text:"Funds Released",color:"#155724",bg:"#d4edda"};case"expired":return{text:"Expired",color:"#721c24",bg:"#f8d7da"};case"cancelled":return{text:"Cancelled",color:"#721c24",bg:"#f8d7da"};default:return{text:e,color:"#6c757d",bg:"#e9ecef"}}})(y.status);return(0,b.jsxs)("div",{className:"listing-detail-page fade-in",children:[(0,b.jsxs)("div",{className:"page-header",style:{marginBottom:"2rem"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"page-title",children:"Listing Details"}),(0,b.jsx)("p",{style:{color:"var(--text-secondary)",margin:0},children:y.description||"Listing ".concat(y.id)})]}),(0,b.jsx)(i.N_,{to:"/dashboard",className:"btn btn-secondary",children:"Back to Dashboard"})]}),(0,b.jsx)("div",{className:"card",style:{background:Z.bg,borderColor:Z.color,marginBottom:"1.5rem"},children:(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{style:{color:Z.color,margin:0},children:Z.text}),(0,b.jsxs)("p",{style:{margin:"0.5rem 0 0",color:Z.color},children:["Listing ID: ",y.id]})]}),(0,b.jsxs)("span",{style:{fontSize:"2rem",fontWeight:"bold",color:Z.color},children:[G," BSV"]})]})}),(0,b.jsxs)("div",{className:"card",style:{marginBottom:"1.5rem",border:"2px solid ".concat("verified"===U?"#4caf50":"partial"===U?"#ff9800":"mismatch"===U?"#f44336":"#9e9e9e"),background:"mismatch"===U?"#ffebee":"white"},children:[(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,b.jsx)("span",{style:{width:"12px",height:"12px",borderRadius:"50%",background:"verified"===U?"#4caf50":"partial"===U?"#ff9800":"mismatch"===U?"#f44336":"#9e9e9e",display:"inline-block"}}),(0,b.jsxs)("h3",{style:{margin:0},children:["Blockchain Verification","verified"===U&&" (Verified)","partial"===U&&" (Partial Match)","mismatch"===U&&" (MISMATCH!)","error"===U&&" (Error)"]})]}),(0,b.jsx)("button",{className:"btn btn-secondary",onClick:Q,disabled:M,style:{padding:"0.25rem 0.75rem",fontSize:"0.85rem"},children:M?"Verifying...":"Re-verify"})]}),M?(0,b.jsx)("div",{style:{padding:"1rem",textAlign:"center",color:"#666"},children:"Querying blockchain for authoritative state..."}):V&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"1rem",marginBottom:O.length>0?"1rem":0},children:[(0,b.jsxs)("div",{style:{padding:"0.75rem",background:"#f5f5f5",borderRadius:"8px"},children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666",marginBottom:"0.25rem"},children:"Payment Status (On-Chain)"}),(0,b.jsx)("div",{style:{fontSize:"1rem",fontWeight:"bold",color:V.paymentReceived?"#2e7d32":"#f57c00"},children:V.paymentReceived?"RECEIVED":"NOT RECEIVED"}),V.paymentReceived&&(0,b.jsxs)("div",{style:{fontSize:"0.85rem",color:"#666"},children:[(V.paymentAmount/1e8).toFixed(8)," BSV"]})]}),(0,b.jsxs)("div",{style:{padding:"0.75rem",background:"#f5f5f5",borderRadius:"8px"},children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666",marginBottom:"0.25rem"},children:"Contract Status (On-Chain)"}),(0,b.jsx)("div",{style:{fontSize:"1rem",fontWeight:"bold",color:V.contractDeployed?V.isEscrowActive?"#1565c0":"#2e7d32":"#757575"},children:V.contractDeployed?V.isEscrowActive?"ESCROW ACTIVE":"RELEASED":"NOT DEPLOYED"}),V.contractDeployed&&V.isEscrowActive&&(0,b.jsxs)("div",{style:{fontSize:"0.85rem",color:"#666"},children:[(V.contractBalance/1e8).toFixed(8)," BSV locked"]})]}),(0,b.jsxs)("div",{style:{padding:"0.75rem",background:"#f5f5f5",borderRadius:"8px"},children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666",marginBottom:"0.25rem"},children:"Server Status"}),(0,b.jsx)("div",{style:{fontSize:"1rem",fontWeight:"bold",color:Z.color},children:Z.text.toUpperCase()})]})]}),O.length>0&&(0,b.jsxs)("div",{style:{padding:"1rem",background:O.some(e=>"critical"===e.severity)?"#ffcdd2":"#fff3e0",borderRadius:"8px",marginTop:"1rem"},children:[(0,b.jsx)("h4",{style:{margin:"0 0 0.5rem",color:O.some(e=>"critical"===e.severity)?"#c62828":"#e65100"},children:O.some(e=>"critical"===e.severity)?"CRITICAL: State Mismatch Detected!":"Warning: State Discrepancies Found"}),(0,b.jsx)("ul",{style:{margin:0,paddingLeft:"1.5rem"},children:O.map((e,t)=>(0,b.jsx)("li",{style:{color:"critical"===e.severity?"#c62828":"#e65100",marginBottom:"0.25rem"},children:e.message},t))}),(0,b.jsx)("p",{style:{margin:"0.75rem 0 0",fontSize:"0.85rem",fontWeight:"bold",color:"#424242"},children:"THE BLOCKCHAIN IS THE SOURCE OF TRUTH. Server state may be out of sync."})]}),(0,b.jsxs)("div",{style:{marginTop:"0.75rem",fontSize:"0.75rem",color:"#999",textAlign:"right"},children:["Verified: ",new Date(V.verifiedAt).toLocaleString()," via WhatsOnChain"]})]})]}),(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(350px, 1fr))",gap:"1.5rem"},children:[(0,b.jsxs)("div",{className:"card",children:[(0,b.jsx)("h3",{className:"card-title",children:"Payment QR Code"}),(0,b.jsxs)("div",{style:{textAlign:"center",padding:"1rem"},children:[(0,b.jsx)(c.h,{value:J,size:200,level:"M",includeMargin:!0,style:{border:"4px solid var(--primary)",borderRadius:"8px"}}),(0,b.jsx)("p",{style:{marginTop:"1rem",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Scan with BSV wallet to pay"})]}),(0,b.jsxs)("div",{style:{marginTop:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",marginBottom:"0.5rem"},children:"Payment Address:"}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,b.jsx)("code",{style:{background:"var(--bg-secondary)",padding:"0.5rem",borderRadius:"4px",flex:1,wordBreak:"break-all",fontSize:"0.8rem"},children:y.paymentAddress}),(0,b.jsx)("button",{className:"btn btn-secondary",onClick:()=>{return e=y.paymentAddress,void navigator.clipboard.writeText(e);var e},style:{whiteSpace:"nowrap"},children:"Copy"})]})]}),(0,b.jsxs)("div",{style:{marginTop:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",marginBottom:"0.5rem"},children:"Required Amount:"}),(0,b.jsxs)("div",{style:{background:"var(--bg-secondary)",padding:"0.75rem 1rem",borderRadius:"8px",fontSize:"1.25rem",fontWeight:"bold",color:"var(--primary)",textAlign:"center"},children:[G," BSV"]}),(0,b.jsx)("p",{style:{margin:"0.5rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)",textAlign:"center"},children:"Customer must send this exact amount"})]}),"awaiting_payment"===y.status&&(0,b.jsxs)("div",{style:{marginTop:"1.5rem"},children:[(0,b.jsx)("button",{className:"btn btn-primary",onClick:async()=>{if(y){E(!0),N(null);try{if(!(await h()).isInstalled)return void N({success:!1,error:"Yours Wallet not installed. Please install from https://yours.org"});const e=await x({address:y.paymentAddress,amount:y.amount,label:"FrithChain Escrow - ".concat(y.trackingNumber)});N(e),e.success&&(await q(),setTimeout(()=>$(),3e3))}catch(e){console.error("Wallet payment error:",e),N({success:!1,error:e.message||"Payment failed"})}finally{E(!1)}}},disabled:R,style:{width:"100%",padding:"1rem",fontSize:"1.1rem"},children:R?"Processing Payment...":"Pay Now from Wallet"}),z&&(0,b.jsx)("div",{style:{marginTop:"0.75rem",padding:"0.75rem",borderRadius:"8px",background:z.success?"#d4edda":"#f8d7da",color:z.success?"#155724":"#721c24",fontSize:"0.9rem"},children:z.success?(0,b.jsxs)(b.Fragment,{children:["Payment sent successfully!",z.txId&&(0,b.jsx)("div",{style:{marginTop:"0.5rem"},children:(0,b.jsx)("a",{href:"https://whatsonchain.com/tx/".concat(z.txId),target:"_blank",rel:"noopener noreferrer",style:{color:"#155724"},children:"View Transaction \u2192"})})]}):(0,b.jsxs)(b.Fragment,{children:["Error: ",z.error]})}),(0,b.jsx)("p",{style:{margin:"0.5rem 0 0",fontSize:"0.8rem",color:"var(--text-tertiary)",textAlign:"center"},children:"Pay directly from your Yours Wallet - no copy/paste needed"})]})]}),(0,b.jsxs)("div",{className:"card",children:[(0,b.jsx)("h3",{className:"card-title",children:"Payment Monitoring"}),u&&(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1rem",padding:"1rem",background:"var(--bg-secondary)",borderRadius:"8px"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Confirmed"}),(0,b.jsxs)("span",{style:{fontSize:"1.25rem",color:"var(--success)"},children:[(u.confirmed/1e8).toFixed(8)," BSV"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Unconfirmed"}),(0,b.jsxs)("span",{style:{fontSize:"1.25rem",color:"var(--warning)"},children:[(u.unconfirmed/1e8).toFixed(8)," BSV"]})]})]}),_&&(0,b.jsxs)("p",{style:{margin:"0.5rem 0 0",color:"var(--text-tertiary)",fontSize:"0.8rem"},children:["Last checked: ",_.toLocaleTimeString()]})]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:[(0,b.jsx)("button",{className:"btn btn-primary",onClick:$,disabled:W,children:W?"Checking...":"Check for Payment"}),(0,b.jsx)("a",{href:"https://whatsonchain.com/address/".concat(y.paymentAddress),target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",children:"View on WhatsonChain"})]}),y.paymentTxId&&(0,b.jsxs)("div",{style:{marginTop:"1rem",padding:"1rem",background:"var(--success-bg)",borderRadius:"8px"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",marginBottom:"0.5rem",color:"var(--success)"},children:"Payment Transaction:"}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,b.jsx)("code",{style:{background:"white",padding:"0.5rem",borderRadius:"4px",flex:1,wordBreak:"break-all",fontSize:"0.75rem"},children:y.paymentTxId}),(0,b.jsx)("a",{href:"https://whatsonchain.com/tx/".concat(y.paymentTxId),target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",style:{whiteSpace:"nowrap"},children:"View TX"})]})]}),y.contractTxId&&(0,b.jsxs)("div",{style:{marginTop:"1rem",padding:"1rem",background:"#e8f5e9",border:"2px solid #4caf50",borderRadius:"8px"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",marginBottom:"0.5rem",color:"#2e7d32"},children:"Smart Contract (On-Chain Escrow):"}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",marginBottom:"0.5rem"},children:[(0,b.jsx)("code",{style:{background:"white",padding:"0.5rem",borderRadius:"4px",flex:1,wordBreak:"break-all",fontSize:"0.75rem"},children:y.contractTxId}),(0,b.jsx)("a",{href:"https://whatsonchain.com/tx/".concat(y.contractTxId),target:"_blank",rel:"noopener noreferrer",className:"btn btn-primary",style:{whiteSpace:"nowrap"},children:"View Contract"})]}),(0,b.jsx)("p",{style:{margin:"0.5rem 0 0",fontSize:"0.85rem",color:"#2e7d32"},children:"Funds are now locked in a smart contract on the BSV blockchain. They will be released automatically when delivery is confirmed."}),y.contractDeployedAt&&(0,b.jsxs)("p",{style:{margin:"0.25rem 0 0",fontSize:"0.75rem",color:"#666"},children:["Deployed: ",new Date(y.contractDeployedAt).toLocaleString()]}),k?(0,b.jsx)("div",{style:{marginTop:"1rem",padding:"0.5rem",background:"#fff",borderRadius:"4px"},children:(0,b.jsx)("span",{style:{color:"#666"},children:"Loading on-chain state..."})}):f&&(0,b.jsxs)("div",{style:{marginTop:"1rem",padding:"1rem",background:f.isEscrowActive?"#e3f2fd":"#fff3e0",borderRadius:"8px",border:"2px solid ".concat(f.isEscrowActive?"#2196f3":"#ff9800")},children:[(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"},children:[(0,b.jsx)("strong",{style:{color:f.isEscrowActive?"#1565c0":"#e65100"},children:"On-Chain Status"}),(0,b.jsx)("button",{onClick:Y,className:"btn btn-secondary",style:{padding:"0.25rem 0.5rem",fontSize:"0.75rem"},children:"Refresh"})]}),(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"0.75rem"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666"},children:"UTXO Status"}),(0,b.jsx)("div",{style:{fontSize:"1rem",fontWeight:"bold",color:f.isEscrowActive?"#2e7d32":"#f57c00"},children:f.utxoStatus.toUpperCase()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666"},children:"Escrow Balance"}),(0,b.jsxs)("div",{style:{fontSize:"1rem",fontWeight:"bold"},children:[f.balanceBSV," BSV"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666"},children:"Confirmations"}),(0,b.jsx)("div",{style:{fontSize:"1rem",fontWeight:"bold"},children:null!==(e=f.confirmations)&&void 0!==e?e:"Pending"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666"},children:"Block Height"}),(0,b.jsx)("div",{style:{fontSize:"1rem"},children:null!==(t=f.blockHeight)&&void 0!==t?t:"Unconfirmed"})]})]}),f.isReleased&&f.spentByTxId&&(0,b.jsxs)("div",{style:{marginTop:"0.75rem",paddingTop:"0.75rem",borderTop:"1px solid #ddd"},children:[(0,b.jsx)("div",{style:{fontSize:"0.75rem",color:"#666"},children:"Released in TX:"}),(0,b.jsx)("a",{href:"https://whatsonchain.com/tx/".concat(f.spentByTxId),target:"_blank",rel:"noopener noreferrer",style:{fontSize:"0.8rem",color:"#1565c0",wordBreak:"break-all"},children:f.spentByTxId})]}),(0,b.jsx)("div",{style:{marginTop:"0.5rem",fontSize:"0.7rem",color:"#999"},children:"Real-time data from WhatsOnChain"})]})]})]}),(0,b.jsxs)("div",{className:"card",children:[(0,b.jsx)("h3",{className:"card-title",children:"Listing Information"}),(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Amount"}),(0,b.jsxs)("span",{style:{fontSize:"1.5rem",color:"var(--primary)"},children:[G," BSV"]}),(0,b.jsxs)("span",{style:{color:"var(--text-secondary)",marginLeft:"0.5rem"},children:["(",y.amount.toLocaleString()," satoshis)"]})]}),(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Tracking Number"}),(0,b.jsx)("code",{style:{fontSize:"1rem"},children:y.trackingNumber}),y.trackingCarrier&&(0,b.jsx)("span",{style:{marginLeft:"0.5rem",padding:"2px 8px",background:"var(--info-bg)",borderRadius:"4px",fontSize:"0.8rem"},children:y.trackingCarrier})]}),y.trackingUrl&&(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Tracking Link"}),(0,b.jsx)("a",{href:y.trackingUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:"Track Package"}),(0,b.jsx)("p",{style:{margin:"0.25rem 0 0",fontSize:"0.75rem",color:"var(--text-tertiary)",wordBreak:"break-all"},children:y.trackingUrl})]}),(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Vendor Address"}),(0,b.jsx)("code",{style:{fontSize:"0.85rem",wordBreak:"break-all"},children:y.vendorAddress})]}),(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Created"}),(0,b.jsx)("span",{children:new Date(y.createdAt).toLocaleString()})]}),(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Expires"}),(0,b.jsx)("span",{children:new Date(y.expiresAt).toLocaleString()})]}),y.description&&(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Description"}),(0,b.jsx)("span",{children:y.description})]}),y.productLink&&(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Product Link"}),(0,b.jsx)("a",{href:y.productLink,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primary)",wordBreak:"break-all"},children:y.productLink})]}),y.destinationAddress&&(0,b.jsxs)("div",{style:{marginBottom:"1rem"},children:[(0,b.jsx)("label",{style:{fontWeight:"bold",display:"block",color:"var(--text-secondary)",fontSize:"0.85rem"},children:"Shipping Address"}),(0,b.jsx)("div",{style:{padding:"0.5rem",background:"var(--bg-secondary)",borderRadius:"4px",whiteSpace:"pre-wrap"},children:y.destinationAddress})]})]}),y.photos&&y.photos.length>0&&(0,b.jsxs)("div",{className:"card",children:[(0,b.jsxs)("h3",{className:"card-title",children:["Evidence Photos (",y.photos.length,")"]}),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:"1rem"},children:y.photos.map((e,t)=>{const r=e.startsWith("b://"),n=r?(e=>{if(e.startsWith("b://")){const{txId:t}=j(e);return t}return null})(e):null;return(0,b.jsxs)("div",{style:{border:"2px solid var(--border)",borderRadius:"8px",overflow:"hidden",background:"var(--bg-secondary)"},children:[(0,b.jsx)("img",{src:S(e),alt:"Evidence ".concat(t+1),style:{width:"100%",height:"150px",objectFit:"cover",cursor:"pointer",display:"block"},onClick:()=>window.open(S(e),"_blank"),onError:t=>{const r=t.target,n=r.src,a=S(e,1);if(n!==a)r.src=a;else{r.style.display="none";const e=r.parentElement;if(e&&!e.querySelector(".photo-fallback")){const t=document.createElement("div");t.className="photo-fallback",t.style.cssText="height: 150px; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 0.8rem; text-align: center; padding: 1rem;",t.innerHTML="Image loading...<br/>Click View TX to see on blockchain",e.insertBefore(t,r)}}}}),(0,b.jsxs)("div",{style:{padding:"0.5rem",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"0.75rem"},children:[(0,b.jsx)("span",{style:{background:r?"var(--success)":"var(--info)",color:"white",padding:"2px 6px",borderRadius:"4px"},children:r?"On-Chain":"Local"}),r&&n&&(0,b.jsx)("a",{href:"https://whatsonchain.com/tx/".concat(n),target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primary)",textDecoration:"none"},children:"View TX"})]})]},t)})}),(0,b.jsx)("p",{style:{margin:"1rem 0 0",fontSize:"0.8rem",color:"var(--text-secondary)"},children:y.photos.some(e=>e.startsWith("b://"))?"Photos stored permanently on BSV blockchain. May take a few minutes to appear on gateways after upload.":"Photos uploaded as evidence for this listing."})]}),(0,b.jsxs)("div",{className:"card",children:[(0,b.jsx)("h3",{className:"card-title",children:"How It Works"}),(0,b.jsxs)("ol",{style:{paddingLeft:"1.25rem",margin:0,lineHeight:"2"},children:[(0,b.jsxs)("li",{style:{color:"awaiting_payment"===y.status?"var(--primary)":"var(--text-tertiary)"},children:[(0,b.jsx)("strong",{children:"Customer pays"})," to the payment address"]}),(0,b.jsxs)("li",{style:{color:["payment_detected","paid"].includes(y.status)?"var(--primary)":"var(--text-tertiary)"},children:[(0,b.jsx)("strong",{children:"Payment detected"})," and smart contract deployed"]}),(0,b.jsxs)("li",{style:{color:"contract_deployed"===y.status?"var(--primary)":"var(--text-tertiary)"},children:[(0,b.jsx)("strong",{children:"Funds locked"})," in on-chain escrow contract"]}),(0,b.jsxs)("li",{style:{color:"delivered"===y.status?"var(--primary)":"var(--text-tertiary)"},children:[(0,b.jsx)("strong",{children:"Delivery confirmed"})," via tracking API"]}),(0,b.jsxs)("li",{style:{color:["released","funds_released"].includes(y.status)?"var(--primary)":"var(--text-tertiary)"},children:[(0,b.jsx)("strong",{children:"Funds released"})," automatically to vendor"]})]}),(0,b.jsxs)("div",{style:{marginTop:"1.5rem",padding:"1rem",background:"var(--bg-secondary)",borderRadius:"8px"},children:[(0,b.jsx)("h4",{style:{margin:"0 0 0.5rem"},children:"Need Help?"}),(0,b.jsx)("p",{style:{margin:0,fontSize:"0.9rem",color:"var(--text-secondary)"},children:"Share the payment address or QR code with your customer. The system automatically monitors for payment and deploys a smart contract to secure the funds on-chain."})]})]})]})]})}}}]); //# sourceMappingURL=595.7b142324.chunk.js.mapapplication/javascriptbinary
    https://whatsonchain.com/tx/d013cd6885f9c26e3f1957bce165f5b57f233ccf43607ddf8ee4aa00a0aa5e7c