Build an NFT provenance timeline on Astar
Fetch the token and its transfer history together. The token response gives the current owner and artwork; transfers provide the ordered mint, transfer, and burn events.
COLLECTION=0x0000000000000000000000000000000000000001TOKEN_ID=1curl -sS -H "Authorization: Bearer $ARADIA_API_TOKEN" \ "https://api.aradia.app/v1/nfts/$COLLECTION/$TOKEN_ID"curl -sS -H "Authorization: Bearer $ARADIA_API_TOKEN" \ "https://api.aradia.app/v1/nfts/$COLLECTION/$TOKEN_ID/transfers?limit=100"async function provenance(collection, tokenId, token) { const base = `https://api.aradia.app/v1/nfts/${collection}/${tokenId}`; const headers = { Authorization: `Bearer ${token}` }; const [nftResponse, transfersResponse] = await Promise.all([ fetch(base, { headers }), fetch(`${base}/transfers?limit=100`, { headers }), ]); if (!nftResponse.ok || !transfersResponse.ok) throw new Error("Provenance request failed"); const nft = (await nftResponse.json()).data; const transfers = (await transfersResponse.json()).data; return { nft: { ...nft, artwork: nft.media_url ?? nft.image_url }, timeline: transfers.slice().reverse(), };}import requests
def provenance(collection, token_id, token): base = f"https://api.aradia.app/v1/nfts/{collection}/{token_id}" headers = {"Authorization": f"Bearer {token}"} nft = requests.get(base, headers=headers, timeout=30) transfers = requests.get(f"{base}/transfers", params={"limit": 100}, headers=headers, timeout=30) nft.raise_for_status() transfers.raise_for_status() token_data = nft.json()["data"] token_data["artwork"] = token_data.get("media_url") or token_data.get("image_url") return {"nft": token_data, "timeline": list(reversed(transfers.json()["data"]))}Explain confirmation depth honestly
Section titled “Explain confirmation depth honestly”confirmations is the number of blocks mined on top of an event. It can be null for historical rows whose block number is unknown. Do not turn null into zero, because unknown depth is not the same as an unconfirmed transfer.
The endpoint excludes rows explicitly invalidated by a chain reorganisation. Apply the confirmation threshold appropriate for your product before calling an event settled.
