Hello, so I have created a marketplace and got its ID on testnet API. I have created collections and listed NFTs.
Now, I’m trying to test buy feature with a different wallet address.
How can I trigger NFT buy feature with JavaScript?
The biggest problem here is that type: TransactionType.Buy triggers Transfer instead of Buy and MarketBuy. It looks like there’s a bug? I’m using this to load KleverWeb:
import {
web,
TransactionType,
} from 'https://sdk.kleverscan.org/kleverchain-sdk-web-esm-1-0-x.js';
@Yuri thanks a lot! it worked! I was confused because documentation said it’s Buy, not BuyOrder. How can I get price of each NFT? it looks like the function throws invalid amount error when I enter wrong price.
Successful means that your transaction was broadcasted, but it does not guarantee that the transaction status is OK.
After the broadcast, your transaction goes to a pool (transactions pool) and then is selected and computed. This process can delay 4-12s (1 block or 3 blocks on epoch changes).
The error that you are receiving is AmountInvalid, checking the orderID, the listing amount was 3000000000000000 so the amount on the buy transaction is wrong
Also, I’m curious if there’s a klever.finance API endpoint that will show price of my NFT token. I can’t find price of my NFT token after I list it on marketplace. I want to be able to pass in price of NFT token dynamically from API endpoint.
@Yuri when I transfer an NFT asset directly on KleverScan, the transaction shows up well on Klever wallet extension as you can see on above image example. However, when I buy an NFT asset on marketplace through BuyOrder, NFT Receive transaction doesn’t show up on Klever extension. I can see that I have received an NFT on KleverScan but not on Klever wallet extension. Is there any way to show NFT ‘Receive’ transaction on Klever wallet too? Any advice would be appreciated. Thanks!
Since you’re on testnet, I suggest you check and confirm your transactions straight on KleverScan. It’s the best way to help and guide your development.
Don’t worry, on mainnet the transactions of all kinds of tokens will be on the kleverscan, extension, and wallet as well.