Storage
Your gateway to decentralized storage.
Upload
Upload anything to decentralized storage. Call the API with file: anything as form-data.
Note: For IPFS, you will get the same id on uploading same content.
POST https://api.shyft.to/sol/v1/storage/upload
https://api.shyft.to/sol/v1/storage/upload
var myHeaders = new Headers();
myHeaders.append("x-api-key", "20CcwuFeQOIcfuHx");
var formdata = new FormData();
formdata.append("file", fileInput.files[0], "cb.jpeg");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.shyft.to/sol/v1/storage/upload", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Create Nft Metadata
This API endpoint lets you create an NFT metadata JSON file on decentralized storage (IPFS).
POST https://api.shyft.to/sol/v1/metadata/create
Body Params
name: NFT Name
symbol: NFT Symbol
description: NFT description
attributes: attributes associated to this NFT. (Stringify it)
share: NFT share
image: URI of the NFT image.
creator: public onchain address of the creator
royalty: (optional) 0 by default.
external_url: (optional) any url to associate with the NFT
files: (optional) additional files that are to be linked to the metadata of the NFT
var myHeaders = new Headers();
myHeaders.append("x-api-key", <YOUR-API-KEY>);
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"name": "SHYFT",
"symbol": "SHY",
"description": "A web3 development platform that gets you wings",
"image": "https://ipfs.io/ipfs/bafkreigx7c3s267vty55xutwjkdmllugvwu2mhoowlcvx2nnhjl6k5kjaq",
"attributes": [
{
"trait_type": "fast",
"value": "80"
},
{
"trait_type": "efficient",
"value": 100
}
],
"royalty": 5,
"creator": "BvzKvn6nUUAYtKu2pH3h5SbUkUNcRPQawg4bURBiojJx",
"share": 100,
"external_url": "https://www.example.com",
"files": [
{
"uri": "https://nftstorage.link/ipfs/bafybeia4ml3aaj3tqln5z6qxqvi2ygfouw4ppt7t3qp3wrsoiccslexomm",
"type": "image/png"
},
{
"uri": "https://nftstorage.link/ipfs/bafybeigvojjdy5ofaeu7semfvdjugnbutda37r35xjpsvmm5vzblill6k4",
"type": "image/png"
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.shyft.to/sol/v1/metadata/create", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Last updated
Was this helpful?