useNft() 0.10.0: on-chain punks and new NFT fields
On-chain Cryptopunks
The images of Cryptopunks are now fetched directly from the new image contract, as SVG files rather than PNG. The quality is improved, and it allows to not rely on Larvalabs hosting these files anymore.
Related pull request
- Cryptopunks: fetch images on chain (#155)
Ethers is now an optional peer dependency
By doing this change, injecting ethers
is now unnecessary, even though it will continue working to support advanced scenarios.
You might want to upgrade your code from this:
import ethers from 'ethers'
const provider = getDefaultProvider("homestead")
function App() {
return (
<NftProvider fetcher={["ethers", { ethers, provider }]} />
)
}
To this:
const provider = getDefaultProvider("homestead")
function App() {
return (
<NftProvider fetcher={["ethers", { provider }]} />
)
}
Related pull request
- Make Ethers an optional peer dependency (#153)
New fields: rawData
, imageType
Two new fields have been added on the nft
object:
rawData
contains the entire JSON data as being fetched from the source.imageType
can beimage
,video
orunknown
. useNft() tries to detect its type based on the URL extension, so it should only be used as an indicative information.