zeekayandHanzo Dev aa14e5189d fix(market): real NFT read path — every data hook was a hard-coded empty stub
app.lux.market rendered "No NFT collections found on Lux yet" unconditionally:
src/hooks/useNFTData.ts and src/lib/explorer.ts returned {items:[]} literals, so
no request was ever made. The URLs they would have used were dead anyway.

Measured against live mainnet 96369 and fixed:

- lib/chains.ts: EXPLORER_API pointed at https://explore.lux.network/api/v2 —
  404 (that host serves the Next.js frontend, not an API). The live read API is
  the unified indexer at https://api-explore.lux.network/v1/indexer/<slug>,
  slugs from its own /v1/explorer/admin/chains. CORS is `*`.
- lib/chains.ts: all five rpcUrls 404'd (`/mainnet/ext/bc/...`). Public form is
  `/v1/bc/C/rpc`; the four reachable ones now verified via eth_chainId. SPC has
  no public RPC and is marked as such.
- lib/chains.ts: Pars was chainId 17471; it is 494949 (eth_chainId 0x78d65).
- lib/chains.ts: CHAIN_INFO gained `color`, read by three pages that had been
  typing it as a missing property.
- lib/explorer.ts: real typed fetchers, one data-access layer. The indexer
  ignores `?type=`, so the ERC-721/ERC-1155 filter is applied client-side.
- hooks/useNFTData.ts: thin react-query wrappers over those fetchers.
- app/activity: dropped its private copy of the fetch (used `tx_hash`; the API
  field is `transaction_hash`) in favour of the shared hook.
- ActivityRow: derives the explorer URL from the chain object instead of string
  surgery on the API base.
- contracts.ts: MARKET_ABI was `[]`. Filled from the real interface at
  standard/contracts/nft/Market.sol:37-48. ERC721_ABI gained the `approve` entry
  ListingForm calls.
- ListingForm/OfferForm addressed `contracts.markets`; the field is `market`.
- OfferForm sent paymentToken=address(0) plus native `value`. makeOffer is
  non-payable and reverts on address(0) (Market.sol:418) — every offer would
  have reverted. Now denominated in WLUX, verified on-chain (1730 bytes, 18dp).
- next.config.ts: ignoreBuildErrors was hiding all 40 of the above type errors.
  Turned off; `pnpm build` is green with checking on.

CONTRACTS stays empty: Market.sol is deployed on no Lux chain. The recorded
mainnet address (addresses.json markets/Markets 0xefba7dbf…) has no code — so
list/buy/offer remain unreachable by design until it is redeployed.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 12:06:20 -07:00
2022-11-29 18:04:37 -05:00
S
Description
Web3 marketplace for real-world assets (RWAs)
20 MiB
Languages
TypeScript 96.2%
CSS 2.5%
JavaScript 1.2%