Creating Sale Listings for NFTs on NEAR Protocol Marketplace

I built two smart contracts based on the NEAR NFT tutorial:

my-nft-contract.testnet - Main NFT Contract (enables public minting)
my-sales-contract.testnet - Marketplace Contract for trading

I already have a working frontend that can mint NFTs using the /sign_url API endpoint. The minting process works perfectly and I can see all my created NFTs in my testnet wallet.

Now I need help with the marketplace integration. I want to create listing transactions similar to what I see on other NEAR marketplaces. I need to figure out what parameters to send in the API request to generate proper listing URLs.

What should I include in the request payload when calling /sign_url to create NFT sale listings? I want users to be able to put their minted tokens up for sale on the testnet.

Any guidance on the required transaction structure would be really helpful for completing my marketplace frontend.

The biggest thing that got me was the msg parameter structure in nft_approve calls. You need token_id, receiver_id (your sales contract), and the msg field with sale conditions as a JSON string. For /sign_url: receiverId = your NFT contract, methodName = “nft_approve”, args = token_id + account_id (sales contract) + msg with price in yoctoNEAR and sale duration. Watch out - msg needs to be stringified JSON, not a regular object. Also make sure your sales contract has the approval callback implemented. Without it, approval works but no listing gets created. Start with small amounts since gas estimation gets weird with cross-contract calls.

yo, make sure to call nft_approve on ur main contract b4 anything else, then do a storage_deposit and offer_for_sale on ur sales contract. ur payload needs receiver_id (marketplace contract), token_id, and msg with price + sale conds. don’t skip storage deposit - it’ll fail silently!

Hey! This sounds like a cool project :rocket: What’s your setup like - using the standard NEAR marketplace contract or something custom?

For /sign_url listings, you’ll typically need token_id, price (in yoctoNEAR), and approval parameters. Have you set up the approval flow between your NFT and sales contracts yet? That’s where most people get stuck.

What kind of NFTs are you minting? Following NEP-171 completely? Marketplace calls can be picky if your metadata structure doesn’t match what they expect.

When you say “listing transactions” - do you mean creating the sale listing in one go, or the two-step process (approve marketplace contract first, then create listing)? The payload structure’s pretty different depending on which route you take.

Try checking the network calls from testnet marketplaces like Paras or Mintbase. You can see their transaction structures and get a feel for what parameters they expect.