PageSourceSearch

https://opmarket.ai/assets/TransactionsPage-ChTyQqRm.js

js opmarket.ai collected 2026-10-05 13:42:05 UTC 9,057 bytes, 11 lines download raw bytes

1import{j as r,l as p}from"./index-CalqZXax.js";import{u as W,h as Y,r as c}from"./router-vendor-BMGipexe.js";import{u as U,a4 as B,s as J}from"./App-BnvYbDJp.js";import{T as G,a as H,b as V,c as Q,d as K}from"./TransactionsMints-DCD0KHeh.js";import{P as N}from"./PendingFeatureHandler-UM8FMQ5_.js";import{H as T,N as F}from"./NFTDetailModalRedesigned-BSlzZROh.js";import{A as tt}from"./arrow-left-DsyUL12o.js";import{a as et}from"./zap-Ce8OQGo2.js";import{A as rt}from"./arrow-left-right-CAsCVaWD.js";import{G as st}from"./gift-BGQ6sxdm.js";import"./wallet-vendor-9kXFB4J1.js";import"./xrpl-vendor-nOXNihUv.js";import"./supabase-vendor-CUBVRmCX.js";import"./refresh-cw-DXF5E9pA.js";import"./charts-vendor-Nzv12KU-.js";import"./lazyWithRetry-BEfkzXQn.js";import"./AcceptOfferModal-CNsfmDmn.js";import"./useXamanQR-BgFi_pqH.js";import"./currencyHelpers-D3cVW_Kd.js";import"./calendar-Ct1hYR0i.js";import"./CancelListingModal-C9Vfz486.js";import"./BumpListingModal-dL9kAsBe.js";import"./marketplaceService-dyuJJAuy.js";import"./bithompService-DoAeqPhB.js";import"./cacheService-CoOV3Dld.js";import"./databaseService-BGzVEYRB.js";import"./loader-D4IajoN8.js";import"./featuredListingsService-C1FnoMA-.js";import"./star-CYt8jUlP.js";import"./chevron-left-B4GHOsdD.js";import"./rocket-TQeKsnu-.js";import"./arrow-down-right-538e7wxd.js";import"./send-70HuzeQX.js";import"./rotate-ccw-BZbtkjJl.js";import"./flame-BbfLTCCV.js";import"./award-BmvIcdYb.js";import"./AddCollectionModal-D9XjHCT4.js";import"./plus-CZ4eyteE.js";import"./twitter-CwqlYK_m.js";import"./globe-D11JTZXb.js";import"./message-square-CbsnPUGk.js";import"./arrow-up-BkH7k-CW.js";import"./gem-ydTTBihP.js";import"./trophy-B5XC6TjT.js";import"./tokenTransactionService-CRr9POYM.js";import"./arrow-right-left-BKbYJK46.js";import"./play-D8JH7_6J.js";import"./cpu-NNsBhDs9.js";import"./database-BY2BcA7t.js";const te=()=>{const x=W(),{wallet:n,isInitialized:g}=U(),[M,z]=Y(),Z=()=>{const e=M.get("tab");return e&&{buy:"offers",received:"offers",incoming:"transfers",outgoing:"transfers",offers:"offers",listed:"listed",transfers:"transfers",mints:"mints",history:"history"}[e]||"offers"},[l,A]=c.useState(Z),[E,D]=c.useState(null),[P,b]=c.useState(!1),[ot,y]=c.useState(!1);c.useEffect(()=>{g&&!(n!=null&&n.address)&&x("/home")},[n,g,x]);const R=e=>{A(e),z({tab:e})},X=async e=>{var j,k,I,w,O,S,C;if(!e.nft_token_id)return;y(!0);let t=null,o="",i=0;try{const{data:s,error:f}=await J.from("cached_nfts").select(`
2          *,
3          collection_id(
4            name,
5            slug,
6            issuer,
7            taxon,
8            total_items,
9            image_url
10          )
11        `).eq("token_id",e.nft_token_id).maybeSingle();if(f?p.error("Error fetching cached NFT:",f):t=s,t)o=(t==null?void 0:t.issuer)||((j=t==null?void 0:t.collection_id)==null?void 0:j.issuer)||"",i=(t==null?void 0:t.taxon)||((k=t==null?void 0:t.collection_id)==null?void 0:k.taxon)||0;else{const m=await fetch("https://ftfxuqcublftahewmmkb.supabase.co/functions/v1/get-nft-data",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0Znh1cWN1YmxmdGFoZXdtbWtiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTMwMjc5NzksImV4cCI6MjA2ODYwMzk3OX0.lyq2yqJRyI_aSg92angFQZxDPfU3pW3hrNxnVeK6590"},body:JSON.stringify({tokenId:e.nft_token_id})});if(m.ok){const a=await m.json();a.success&&a.nft&&(t=a.nft,o=a.nft.issuer||"",i=a.nft.taxon||0)}}if(!o||!i)try{const m=`https://bithomp.com/api/v2/nft/${e.nft_token_id}`,a=await fetch(m,{headers:{Accept:"application/json","x-bithomp-token":"a39b388f-0bd4-46c3-8c9e-73d9b8c4ea98"}});if(a.ok){const d=await a.json();d&&(o=d.issuer||"",i=d.nftokenTaxon||d.taxon||0)}}catch(m){p.error("Error fetching from Bithomp:",m)}}catch(s){p.error("Error in handleNFTClick:",s)}finally{y(!1)}let h=[],v=[];try{const s=await fetch("https://ftfxuqcublftahewmmkb.supabase.co/functions/v1/fetch-nft-offers",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ0Znh1cWN1YmxmdGFoZXdtbWtiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTMwMjc5NzksImV4cCI6MjA2ODYwMzk3OX0.lyq2yqJRyI_aSg92angFQZxDPfU3pW3hrNxnVeK6590"},body:JSON.stringify({nftTokenId:e.nft_token_id})});if(s.ok){const f=await s.json();h=f.sellOffers||[],v=f.buyOffers||[]}}
11catch(s){p.error("Error fetching NFT offers:",s)}let u=((I=t==null?void 0:t.collection_id)==null?void 0:I.name)||e.collection_name||"",_=((w=t==null?void 0:t.collection_id)==null?void 0:w.slug)||"";if(!u&&o&&i)try{const{data:s}=await J.from("cached_collections").select("name, slug").eq("issuer",o).eq("taxon",i).maybeSingle();s&&(u=s.name,_=s.slug)}catch(s){p.error("Error fetching collection info:",s)}const $={id:e.nft_token_id,tokenId:e.nft_token_id,name:(t==null?void 0:t.name)||e.nft_name||"Unknown NFT",image:(t==null?void 0:t.image_url)||e.nft_image||"",collection:u,collectionSlug:_,issuer:o||((O=t==null?void 0:t.collection_id)==null?void 0:O.issuer)||(t==null?void 0:t.issuer)||"",taxon:i||((S=t==null?void 0:t.collection_id)==null?void 0:S.taxon)||(t==null?void 0:t.taxon)||0,price:t!=null&&t.current_price?t.current_price.toString():void 0,isListed:(t==null?void 0:t.is_listed)||!1,owner:(t==null?void 0:t.owner_address)||"",transferFee:t==null?void 0:t.transfer_fee,metadata:{name:(t==null?void 0:t.name)||e.nft_name||"Unknown NFT",image:(t==null?void 0:t.image_url)||e.nft_image||"",description:(t==null?void 0:t.description)||"",attributes:(t==null?void 0:t.attributes)||[]},attributes:(t==null?void 0:t.attributes)||[],sellOffers:h,buyOffers:v,rarityScore:t==null?void 0:t.rarity_score,rarityTier:t==null?void 0:t.rarity_tier,rarityRank:t==null?void 0:t.rarity_rank,collection_total_items:(C=t==null?void 0:t.collection_id)==null?void 0:C.total_items};D($),b(!0)},q=[{id:"offers",label:"Offers",icon:B,color:"green"},{id:"listed",label:"Listed Items",icon:et,color:"orange"},{id:"transfers",label:"Transfers",icon:rt,color:"blue"},{id:"mints",label:"Mints",icon:st,color:"amber"},{id:"history",label:"History",icon:T,color:"gray"}],L=(e,t)=>{const o={green:{active:"text-green-400 border-green-400",inactive:"text-gray-400",hover:"hover:text-green-300"},orange:{active:"text-orange-400 border-orange-400",inactive:"text-gray-400",hover:"hover:text-orange-300"},blue:{active:"text-blue-400 border-blue-400",inactive:"text-gray-400",hover:"hover:text-blue-300"},amber:{active:"text-amber-400 border-amber-400",inactive:"text-gray-400",hover:"hover:text-amber-300"},gray:{active:"text-gray-300 border-gray-300",inactive:"text-gray-400",hover:"hover:text-gray-200"}},i=o[e]||o.gray;return t?`${i.active} border-b-2`:`${i.inactive} ${i.hover}`};return g?n?r.jsxs("div",{className:"min-h-screen bg-black pt-16 sm:pt-20 pb-20 overflow-x-hidden",children:[r.jsx(N,{}),r.jsxs("div",{className:"max-w-7xl mx-auto px-3 sm:px-4 md:px-6 lg:px-8",children:[r.jsxs("div",{className:"mb-8",children:[r.jsxs("button",{onClick:()=>x("/home"),className:"flex items-center gap-2 text-gray-400 hover:text-white transition-colors mb-6 group",children:[r.jsx(tt,{className:"w-5 h-5 group-hover:-translate-x-1 transition-transform"}),r.jsx("span",{className:"font-space-grotesk",children:"Back"})]}),r.jsxs("div",{className:"bg-gradient-to-r from-gray-900/80 to-gray-800/40 rounded-none p-4 sm:p-6 md:p-8 border border-gray-700/40",children:[r.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-white mb-2 sm:mb-3 font-space-grotesk",children:"Transactions"}),r.jsx("p",{className:"text-gray-400 text-sm sm:text-base",children:"Manage your offers, listed NFTs, transfers, and full activity history"})]})]}),r.jsxs("div",{className:"bg-gray-900/50 backdrop-blur-xl border border-gray-700/50 rounded-none mb-6 overflow-hidden",children:[r.jsx("div",{className:"flex overflow-x-auto border-b border-gray-700/50",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:q.map(e=>{const t=e.icon,o=l===e.id;return r.jsxs("button",{onClick:()=>R(e.id),className:`flex-1 sm:flex-shrink-0 sm:min-w-[130px] flex items-center justify-center gap-1.5 sm:gap-2 px-2 sm:px-5 py-3 sm:py-4 text-xs sm:text-sm font-medium transition-all duration-200 font-space-grotesk whitespace-nowrap ${L(e.color,o)}`,children:[r.jsx(t,{size:15,className:"sm:w-[17px] sm:h-[17px] flex-shrink-0"}),r.jsx("span",{children:e.label})]},e.id)})}),r.jsxs("div",{className:"p-3 sm:p-4 md:p-6",children:[l==="offers"&&r.jsx(G,{}),l==="listed"&&r.jsx(H,{}),l==="transfers"&&r.jsx(V,{}),l==="mints"&&r.jsx(Q,{}),l==="history"&&r.jsx(K,{onNFTClick:X})]})]})]}),r.jsx(F,{isOpen:P,onClose:()=>b(!1),nft:E,userAddress:n==null?void 0:n.address})]}):null:r.jsx("div",{className:"min-h-screen bg-black pt-16 sm:pt-20 pb-20 flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"w-12 h-12 border-4 border-orange-500 border-t-transparent roun
11ded-full animate-spin mx-auto mb-4"}),r.jsx("p",{className:"text-gray-400",children:"Loading..."})]})})};export{te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.