Hartii developer docs

Gallery

Hartii Gallery

Hartii Gallery is the production NFT marketplace/creator platform at hartiigallery.com — collection creation, five separate marketplace venues (fixed-price, bundles, auctions, gasless orders, ERC-1155), and a public read API backing the frontend.

Architecture

  • Frontend: Vite + React, deployed as static assets to Cloudflare Pages.
  • Chain library: quais — this repo does not use ethers.
  • Contracts: Hardhat project in contracts/; deployed to Quai mainnet (Cyprus-1, chain 9).
  • Edge/API: Cloudflare Pages Functions under functions/api/** — see api.
  • Data stores: Cloudflare KV (hot cache, floor prices, sales index) and D1 (durable collection index, sales history) behind the API — the browser never talks to KV/D1 directly.

There is also a testnet mirror, Orchard (hartiigallery.com/orchard, chain 15000), built from the same app and used for rehearsal before mainnet contract changes. It shares the same image/metadata proxy endpoints as production but has its own contract addresses and its own KV/D1 — it is not documented further here since it carries no real value.

Live URLs

Apphartiigallery.com
Public API basehttps://hartiigallery.com/api/
Orchard testnet mirrorhttps://hartiigallery.com/orchard (chain 15000 — rehearsal only)

Data flow

  1. Collection creation. A creator calls deployCollection(...) on the current factory (HartiiFactoryV7Clone), which deploys an EIP-1167 minimal-proxy clone of HartiiCollectionV7Clone, initialized atomically in the same transaction.
  2. Discovery. A scheduled worker scans the chain for CollectionDeployed events and known marketplace activity and writes a durable index into D1 (functions/api/collections.js reads from that index, merging in live on-chain floor-price/listing reads rather than trusting a stale cache for money-relevant fields).
  3. Browsing. GET /api/collections returns the whole catalogue in one response — factory collections plus externally-listed ones — for the Explore page. GET /api/floor-prices recomputes floors from live marketplace state.
  4. Trading. The frontend calls the marketplace contracts directly from the connected wallet (list, buy, offer, bundle, auction, gasless order fulfillment) — the API never custodies a trade; it only indexes what already happened on-chain (/api/sales) for fast history browsing.
  5. Media. NFT images/metadata live on IPFS. /api/img and /api/meta are caching proxies that hedge across several public IPFS gateways and cache the result at Cloudflare's edge (content-addressed, so the cache is effectively permanent).

Live contracts (Quai mainnet, Cyprus-1)

All addresses below were read from src/utils/appConfig.js NETWORK_CONFIGS.mainnet and independently confirmed live with quai_getCode against https://rpc.quai.network/cyprus1 (each returned non-empty deployed bytecode).

ContractAddressRole
HartiiFactoryV7Clone (current factory)0x007d00B9752d852658A03167b825d62b68c375FcDeploys new collections as EIP-1167 clones
HartiiFactory (legacy factory)0x00265a93d7Bf94147d88e27EA28A2AC9dAd9eF04Older full-bytecode factory; existing collections still resolve their provenance to it
HartiiMarketplaceV8 (current marketplace)0x006792f8913d99e2D9E72087D4C3CBAf2e77E867Fixed-price listings + offers — write target for all new activity
Legacy marketplace (v7)0x003fEB578c595563e8790Ef0240B248e4D2C1Ae5Old listings/offers stay readable, buyable and cancellable here — no new listings
HartiiBundleMarketplace0x0028E7a353cA07Ad754E8b1F144305e2E17b2eDAMulti-NFT bundle listings, one flat price
HartiiAuctionHouse0x0068d66A3FC1E65e89D00D801cADB095e6e4019cEnglish auctions with anti-snipe extension
HartiiGaslessMarketplace0x005f633a448B10e0aF8E170394F92A83955a410fEIP-712 signed orders, fulfilled by the buyer's tx
HartiiMarketplace11550x00137c1eD65B084319ee1420a243aa1dD35BfA04Quantity-aware ERC-1155 trading venue
HartiiCurationRegistry0x000404Cd0833465bCe3E345454B901b69B5ff51CEditorial allow-list for a specific launch surface (see contracts)
Launchpad demo collection0x004Ff0147ca6AB274E171D2A47d0aD34762bE154Seed collection so Explore isn't empty before real factory deploys land

Every collection a creator deploys through either factory is its own HartiiCollectionV7Clone (or legacy HartiiCollection/HartiiCollectionV2) instance — there is no single "the collection contract" address; see contracts for the template's interface.

See contracts for the full interface and trust model of each contract above, and api / integrate for the HTTP surface and code examples.

Quai Network mainnet · chain 9 · Cyprus-1. Figures marked "read on" a date were read from the chain that day; re-read before relying on them.