-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository contains the code that powers the automatic XRPL image NFT metadata translation platform that you can use for free at api.universalnft.dev or host your own.
UniversalNFT.dev is a web platform that automatically translates pretty much any XRPL XLS-20 image NFT into one consistent response format.
You no longer have to deal with hundreds of different image NFT metadata schemas living on and off of the blochain.
Instead, metadata always comes back from api.universalnft.dev exactly like this
{
"nfTokenID": "000803E8CEC1EB1B331D8A55E39D451DE8E13F59CF5509D5FA17E45000000527",
"ownerAccount": "rPpMSFxzjqJ6AGgEZ8kgbQeeo6UJvUkVmb",
"imageUrl": "https://cloudflare-ipfs.com/ipfs/bafybeiewsupnlepoyqp7rgghjhkkfubdv45pli26phogyeisu5t3siav44/1670271940652.png",
"imageThumbnailCacheUrl": "https://api.universalnft.dev/v1.0/Image?file=000803E8CEC1EB1B331D8A55E39D451DE8E13F59CF5509D5FA17E45000000527.png",
"timestamp": "2024-02-10T17:08:04.6653210Z"
}
UniversalNFT.dev connects directly to the XRPL and loads the NFT data from the blockchain, then it follows any needed hops to off-chain (usually IPFS) metadata and parses that metadata file to find the actual NFT image URL (IFPS or anything else). You say "just give me the image url", we do that.
Let's load the metadata for this image NFT below
Go to api.universalnft.dev and perform the search by clicking "Try it out"
and then "Execute" without filling in any details, as this NFT is the default example on the web Swagger.
Or, simply click the a prepopulated link such as https://api.universalnft.dev/v1.0/NFT?NFTokenID=000803E8CEC1EB1B331D8A55E39D451DE8E13F59CF5509D5FA17E45000000527&OwnerWalletAddress=rPpMSFxzjqJ6AGgEZ8kgbQeeo6UJvUkVmb
You should now receive the converted link to this image directly, as well as a resized thumbnail.
You can use OpenAPI (Swagger) and Swagger Codegen to create a client in pretty much any programming language. See https://swagger.io/tools/swagger-codegen/ for details as there is already a lot of documentation available on how to do this.
You can also integrate manually using the REST API endpoints as shown in Swagger.
Our hosted OpenAPI spec can be found at https://api.universalnft.dev/swagger/v1/swagger.json
Please create a Github issue, or DM https://twitter.com/ohonesix with an example NFT and details.
The free infrastructure provided at api.universalnft.dev is meant for development and testing use only. If you want to use it in production it is highly recommended that you host your own by following the setup instructions as you will have much better performance.
The free hosted version has rate limits applied to incoming requests, as well as rate limits applied to outgoing XRPL cluster requests as to not overload the free XRPL cluster.
The free hosted version also has storage limits applied to the thumbnail image cache, so thumbnails will eventually be deleted automatically even if your application uses them. To recreate thumbnails you will have to call the /NFT endpoint again.
For maximum performance you should host your own Rippled node as well as your own UniversalNFT.dev server, then there are no limits!
We would love for the XRPL to have a strict and well defined metadata format for all NFTs. We believe it would massively help with adoption of XRPL NFTs as it makes development much easier. This is the sole reason we created the project. However, since XLS-24d has not been accepted and been declared as the "right way" to do XRPL NFTs, we need something to tide us over. Also with any new standard, existing issued tokens will have to be reminted which many people are weary of. Universalnft.dev removes the need for remints, and gets us closer to one format to rule them all.
To help support the case for XLS-24d, you can request our converted output in the art.v0
format by using the /v1.0/NFT/art.v0
endpoint, and you will receive back a response like this
{
"schema": "ipfs://QmNpi8rcXEkohca8iXu7zysKKSJYqCvBJn3xJwga8jXqWU",
"nftType": "art.v0",
"name": "000803E8CEC1EB1B331D8A55E39D451DE8E13F59CF5509D5FA17E45000000527",
"description": "Converted with https://api.universalnft.dev at 2024-03-18T19:58:29.1105979Z",
"image": "https://cloudflare-ipfs.com/ipfs/bafybeiewsupnlepoyqp7rgghjhkkfubdv45pli26phogyeisu5t3siav44/1670271940652.png"
}