Content
Token & Market Metadata
Creates the initial metadata for a newly deployed token or prediction market. This must be called after the on-chain transaction is confirmed. The server reads the token name, symbol, creator, and options directly from the blockchain — you only supply the off-chain fields (description, socials, image).
POST
/api/metadata
Creates metadata JSON on IPFS for a new token or prediction market.
Auth: Session required + wallet must be the on-chain creator
Request Body (JSON)
Response
{
"address": "0x...", // Contract address (required)
"description": "string", // Optional
"website": "string", // Optional
"telegram": "string", // Optional
"twitterx": "string", // Optional
"image": "string" // IPFS URL from /api/images (optional)
}The server automatically detects whether the address is a regular token, public prediction market, or private prediction market by checking the on-chain contracts.
Response
Response
{ "url": "https://...pinata.cloud/ipfs/...", "cid": "bafy..." }200 Created400 Not an ecosystem token401 Not signed in403 Not the token creator409 Metadata already exists
Server-Side Verification
The server reads the following directly from the blockchain:
nameandsymbol— from the token contractdev— fromDEV()ormarketData[1]multiplier— fromhybridMultiplier()isPredictionandpredictionType— auto-detected by checking public and private prediction contractsoptions— fromgetAllOutcomes()(prediction markets only)eventType— frommarketData[11](prediction markets only)
Example Code
// Create metadata for a newly deployed token or prediction market
// The server auto-detects whether it's a token, public market, or private market
async function createMetadata(contractAddress, imageUrl, sessionCookie) {
const res = await fetch("https://launchonbasis.com/api/metadata", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Cookie": sessionCookie,
},
body: JSON.stringify({
address: contractAddress,
description: "My awesome project",
website: "https://example.com",
telegram: "https://t.me/myproject",
twitterx: "https://x.com/myproject",
image: imageUrl,
}),
});
const { url, cid } = await res.json();
return { url, cid };
};