Create Listing
How to list an NFT for sale on the Wayup Marketplace
Introduction
This guide demonstrates how to list an NFT for sale on the Wayup Marketplace using the API. Listing an NFT requires that you own the NFT and have it in your wallet UTXOs.
Requirements
A Cardano wallet containing the NFT you want to list.
UTXOs from your wallet containing the NFT. See Get UTXOs for more information.
Policy ID and asset name of your NFT.
API Request Structure
Configuration
// API endpoint for Wayup Marketplace
const NFT_BASE_URL = "https://prod.api.ada-anvil.app/marketplace/api";
// NFT to list for sale
const NFT_POLICY_ID = "6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01";
const NFT_ASSET_NAME_HEX = "4646506f776572436f72657331363630";
// Wallet address to receive change
const SELLER_CHANGE_ADDRESS = "addr1qx33ycd2ymg02dxh6vnnf8dsk54l8ranr9cfjk9qrlj3309c69jc4n8h3uvnczncaqu2sm03pl99h99n75uvtl3mhv0q3z8s8m";
// UTXOs from your wallet containing the NFT to list
const SELLER_UTXOS: string[] = [
"82825820fa7a8f907051db7783be036684481fdce2a5fbcf19f6e5ea5f9f09128288dd1f0382583901a31261aa26d0f534d7d327349db0b52bf38fb319709958a01fe518bcb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1e821a0092b832a1581c6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01a2504646506f776572436f7265733136363001504646506f776572436f7265733137323001",
"82825820fd43f693f0cd4c690ca3adde613262fc41530e62b3cacc906a0056603f5514ae0082583901a31261aa26d0f534d7d327349db0b52bf38fb319709958a01fe518bcb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1e821a0085b174a1581c6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01a34e4646506f776572436f7265733437014f4646506f776572436f72657336323901504646506f776572436f7265733132343801"
];
// Listing price in ADA (minimum 5 ADA)
const LISTING_PRICE_ADA = 25;
Type Definitions
interface ListingPayload {
changeAddress: string;
utxos: string[];
create: Array<{
assets: {
policyId: string;
assetName: string;
};
priceAda: number;
}>;
}
Implementation
Step 1: Identify Your NFT
First, identify the NFT you want to list by its policy ID and asset name:
// Step 1: Identify the NFT to list
console.log(`NFT to list: Policy ID ${NFT_POLICY_ID}, Asset Name ${NFT_ASSET_NAME_HEX}`);
Step 2: Create the Listing Payload
Next, create the payload for the listing transaction:
// Step 2: Create the listing payload
const listingPayload = {
changeAddress: SELLER_CHANGE_ADDRESS,
utxos: SELLER_UTXOS,
create: [
{
assets: {
policyId: NFT_POLICY_ID,
assetName: NFT_ASSET_NAME_HEX
},
priceAda: LISTING_PRICE_ADA,
},
],
};
console.log(`Creating listing for ${LISTING_PRICE_ADA} ADA`);
Step 3: Build the Transaction
Use the build-tx
endpoint to create the transaction:
// Step 3: Build the transaction
const response = await fetch(`${NFT_BASE_URL}/build-tx`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(listingPayload),
});
const result = await response.json();
console.log("Transaction:", result.transactions);
Running the Example
deno run --allow-net create-listing.ts
Example Output
NFT to list: Policy ID 6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01, Asset Name 4646506f776572436f72657331363630
Creating listing for 25 ADA
Transaction: [
"84a900d9010281825820fa7a8f907051db7783be036684481fdce2a5fbcf19f6e5ea5f9f09128288dd1f03018283583911a76f0fb801a29f591e9871576508d85b0b5f3c38774f65032f58fdadb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1e821a00146324a1581c6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01a1504646506f776572436f726573313636300158202aae2382a3cb6a2a215aa112f7b642f41fcc49028c033be8b848381974cbd7b482583901a31261aa26d0f534d7d327349db0b52bf38fb319709958a01fe518bcb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1e821a007a089da1581c6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01a1504646506f776572436f7265733137323001021a00044c71031a09744ed807582010d70a7bf1ff1ed57b4ac55c6ed323880724390905b3f69b92615166c3ac96990b5820846fd5d66b92548cd1e5f9eb7e33d830240d81c5a76930959f86013d150edbab0dd9010281825820fd43f693f0cd4c690ca3adde613262fc41530e62b3cacc906a0056603f5514ae001082583901a31261aa26d0f534d7d327349db0b52bf38fb319709958a01fe518bcb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1e821a007042aaa1581c6fb0ce0d80bce539333b0b16f4a29a0d40c786249f86850d3a36fa01a34e4646506f776572436f7265733437014f4646506f776572436f72657336323901504646506f776572436f7265733132343801111a00156ecaa104d901029fd8799f9fd8799fd8799fd8799f581ca31261aa26d0f534d7d327349db0b52bf38fb319709958a01fe518bcffd8799fd8799fd8799f581cb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1effffffff1a015b2330ffd8799fd8799fd8799f581c5288ee085dc108f6fdc262b9e0cdfa92663b302836830efc0c5b4fdfffd8799fd8799fd8799f581c41ff84ecc10aae4f3ba8526ba742c739de9d513ace95e17170b1f04cffffffff1a001312d0ffff581cb8d1658accf78f193c0a78e838a86df10fca5b94b3f538c5fe3bbb1efffff5a11902a2a1636d7367715761797570205472616e73616374696f6e"
]
The Complete File
See our examples repository for the complete file: create-listing.ts
Next Steps
After building the transaction:
Sign the transaction hex with your wallet
Submit the signed transaction using the
/submit
endpointWait for confirmation on the blockchain
Your NFT will be visible as listed on the Wayup Marketplace
Best Practices
Pricing Strategy: Research the collection's floor price before setting your listing price
Wallet Balance: Ensure your wallet has sufficient ADA for transaction fees
UTXO Verification: Make sure your UTXOs actually contain the NFT you're trying to list
Asset Verification: Double-check the policy ID and asset name before listing
End-to-End Flow
Confirm you own the NFT you want to sell
Build a listing transaction via
/build-tx
with thecreate
propertySign the transaction with your wallet. See Signing Transactions
Submit the transaction via
/submit
. See Submit TransactionsWait for confirmation; your NFT will be listed on the Wayup Marketplace
Last updated
Was this helpful?