← Protocols
Stargaze
01Description

Stargaze is the Cosmos-native NFT chain and marketplace, with on-chain royalties, a CosmWasm-based launchpad (SG-721 collections), and Live Auctions. It exposes a public GraphQL API for collections, listings, sales, and asset metadata, plus the `stargaze-js` TypeScript library for tx construction.

02Best for
  • 01minting and launching NFT collections in CosmWasm
  • 02marketplace listings, bids, and live auctions
  • 03indexing Cosmos NFTs via GraphQL
  • 04on-chain royalty enforcement (cw2981)
  • 05ICS-721 cross-chain NFT transfers
03Install
  • pnpm add stargazejs @cosmjs/cosmwasm-stargate @cosmjs/proto-signing graphql-request
04Environment variables
VariableScopeDescription
STARGAZE_RPC_URLClientStargaze Tendermint RPC endpoint (e.g., `https://rpc.stargaze-apis.com`). Required for tx submission.
STARGAZE_GRAPHQL_URLClientStargaze public GraphQL endpoint (default `https://graphql.mainnet.stargaze-apis.com/graphql`). Used for collection, token, and sales queries.
05Prompt snippet
For reads, use the GraphQL API at `https://graphql.mainnet.stargaze-apis.com/graphql` with `graphql-request` — query `collection(collectionAddr)`, `tokens(collectionAddr, filterForSale)`, and `wallet(address)` for portfolios. For writes, use `stargazejs`: build a SigningCosmWasmClient via `SigningCosmWasmClient.connectWithSigner(rpcEndpoint, signer, { gasPrice: GasPrice.fromString('1ustars') })`. To list an NFT call the marketplace contract with `client.execute(seller, marketplaceAddr, { set_ask: { collection, token_id, price: { amount, denom: 'ustars' }, ... } }, fee)` after first `approve`-ing the marketplace via the SG-721 contract's `approve` message. Mint via the launchpad's minter contract: `client.execute(buyer, minterAddr, { mint: {} }, fee, '', mintPrice)`. Royalties (cw2981) are enforced at marketplace level — verify the collection's `royalty_info` before listing.
06Gotchas
  • The GraphQL schema is under active development and breaks across mainnet/testnet — pin queries to a generated schema (`graphql-codegen`) and re-run codegen after every chain or marketplace upgrade.
  • Marketplace and launchpad contract addresses change between chain upgrades. Always read current addresses from the official `stargaze-tools` config or `docs.stargaze.zone/guides/contracts` instead of hard-coding.
  • CosmWasm version compatibility: SG-721 and marketplace contracts target specific cosmwasm-std versions (cw 1.5 / 2.0 era). If you fork them, match the version Stargaze chain supports or instantiate will fail.
  • Chain upgrades: Stargaze coordinates governance upgrades roughly quarterly; check `docs.stargaze.zone/release-notes` and bump `stargazejs` accordingly. New auction types (Live Auctions, Dutch Auctions) are added in upgrades and won't decode on old client versions.
  • Slashing on STARS validators is real (typical Cosmos params) — if you stake to a validator that double-signs, you lose 5% and the validator is jailed. NFT custody is unaffected, but staking yield is.
  • Gas token is `ustars` (1 STARS = 1_000_000 ustars). Mint prices are usually denominated in `ustars` or IBC-routed `uatom` — surface the denom and the IBC path explicitly so users don't pay with the wrong token.
  • ICS-721 NFT transfers across chains generate a NEW contract on the destination — the same Stargaze NFT viewed on another chain is a wrapped representation, not the original; users often confuse this with a duplicate.
  • Royalty-free marketplaces in the broader Cosmos NFT space exist; Stargaze enforces royalties at protocol level via the marketplace contract, but if a buyer trades the NFT off Stargaze (e.g., direct cw721 transfer), royalties are NOT collected.
07Alternatives