How to Create Sale Transactions for NFTs on NEAR Protocol Marketplace

I built two smart contracts based on the NEAR NFT tutorial. One handles token creation and the other manages marketplace operations.

my-nft-contract.testnet - Handles NFT minting
my-market-contract.testnet - Manages NFT sales

I already got the minting part working through my frontend. I can create NFTs using the sign_url API and they show up in my testnet wallet properly.

Now I need help with the selling part. I want to create transaction links that let users list their NFTs for sale. I saw how other platforms do it but I’m not sure what parameters to send in the API request.

What should I include in the request payload to generate these listing transactions? I need to know the correct structure for the sign_url API call.

Any help with integrating the sales functionality would be great. Thanks!

To get your NFT sales working, you need to structure the cross-contract calls correctly. When I built my marketplace, I had to set the sign_url payload with receiver_id as my-market-contract.testnet. Use nft_on_approve with the key arguments: token_id, price (in yoctoNEAR), and the NFT contract address. Don’t forget to call nft_approve first - this lets the marketplace transfer your tokens. Set higher gas limits too, because these operations eat more gas than minting and will fail silently if you’re too low.

handle approval flow separately from minting. when users hit ‘sell’, call the market contract with proper storage deposit first. i kept running into failed transactions because i forgot storage costs for new listings. also verify the user owns the nft before listing - saves gas when things break.