Beitrag
Teile dein Wissen.
How to Use toGatewayURL to Save NFT Image URL for Image Component?
I am trying to utilize toGatewayURL
to save the URL from an NFT image for use in an Image Component. However, I am unsure of what to specify as the gateway parameter in the function call. I have attempted to use hanlo.mypinata.cloud
as the gateway, but it does not work. Additionally, I have a token available for use with the gateway. How can I correctly configure toGatewayURL
with the appropriate gateway and token to save the NFT image URL?
- IPFS
- JavaScript
- NFT.Storage
Antworten
1The library that provides the toGatewayURL
function is NFT.storage. However, Pinata also offers extensive gateway information on their documentation page at https://docs.pinata.cloud/docs/gateways-page.
It appears that the toGatewayURL
function requires a gateway URL and an IPFS CID to generate a functional URL. While using a generic gateway like "https://dweb.link/" should suffice, leveraging Pinata's dedicated gateways may offer better performance if you are already utilizing their services.
Weißt du die Antwort?
Bitte melde dich an und teile sie.
The InterPlanetary File System (IPFS) is a protocol, hypermedia and file sharing peer-to-peer network for storing and sharing data in a distributed file system.
Verdiene deinen Anteil an 1000 Sui
Sammle Reputationspunkte und erhalte Belohnungen für deine Hilfe beim Wachstum der Sui-Community.